|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nhindirect.stagent.cryptography.SMIMECryptographerImpl
public class SMIMECryptographerImpl
Executes the cryptography operations. This include encryption, decryption, and signature generation.
| Field Summary | |
|---|---|
static SMIMECryptographerImpl |
Default
|
| Constructor Summary | |
|---|---|
SMIMECryptographerImpl()
Constructs a Cryptographer with a default EncryptionAlgorithm and DigestAlgorithm. |
|
SMIMECryptographerImpl(EncryptionAlgorithm encryptionAlgorithm,
DigestAlgorithm digestAlgorithm)
Constructs a Cryptographer with an EncryptionAlgorithm and DigestAlgorithm. |
|
| Method Summary | |
|---|---|
void |
checkSignature(SignedEntity signedEntity,
X509Certificate signerCertificate,
Collection<X509Certificate> anchors)
Validates that a signed entity has a valid message and signature. |
MimeEntity |
decrypt(Message message,
X509CertificateEx decryptingCertificate)
Decrypts a message with the provided certificates private key. |
MimeEntity |
decrypt(MimeEntity encryptedEntity,
Collection<X509CertificateEx> decryptingCertificates)
Decrypts an entity with the provided certificates' private key. |
MimeEntity |
decrypt(MimeEntity encryptedEntity,
X509CertificateEx decryptingCertificate)
Decrypts an entity with the provided certificate's private key. |
org.bouncycastle.cms.CMSSignedData |
deserializeEnvelopedSignature(byte[] messageBytes)
|
org.bouncycastle.cms.CMSSignedData |
deserializeEnvelopedSignature(MimeEntity envelopeEntity)
|
org.bouncycastle.cms.CMSSignedData |
deserializeSignatureEnvelope(SignedEntity entity)
Extracts the ASN1 encoded signature data from the signed entity. |
MimeEntity |
encrypt(MimeEntity entity,
Collection<X509Certificate> encryptingCertificates)
Encrypts an entity using the provided certificates. |
MimeEntity |
encrypt(MimeEntity entity,
X509Certificate encryptingCertificate)
Encrypts an entity using the provided certificate. |
MimeEntity |
encrypt(javax.mail.internet.MimeMultipart mmEntity,
Collection<X509Certificate> encryptingCertificates)
Encrypts a mulit part MIME entity using the provided certificates. |
MimeEntity |
encrypt(javax.mail.internet.MimeMultipart entity,
X509Certificate encryptingCertificate)
Encrypts a mulit part MIME entity using the provided certificate. |
DigestAlgorithm |
getDigestAlgorithm()
Gets the DigestAlgorithm. |
EncryptionAlgorithm |
getEncryptionAlgorithm()
Gets the EncryptionAlgorithm. |
boolean |
isIncludeMultipartEpilogueInSignature()
Indicates if the the Epilogue part of a multipart entity should be used to generate the message signature. |
void |
setDigestAlgorithm(DigestAlgorithm value)
Sets the DigestAlgorithm. |
void |
setEncryptionAlgorithm(EncryptionAlgorithm value)
Sets the EncryptionAlgorithm |
void |
setIncludeMultipartEpilogueInSignature(boolean value)
Sets if the the Epilogue part of a multipart entity should be used to generate the message signature. |
SignedEntity |
sign(Message message,
Collection<X509Certificate> signingCertificates)
|
SignedEntity |
sign(Message message,
X509Certificate signingCertificate)
Signs a message with the provided certificate. |
SignedEntity |
sign(MimeEntity entity,
Collection<X509Certificate> signingCertificates)
Signs an entity with the provided certificates. |
SignedEntity |
sign(MimeEntity entity,
X509Certificate signingCertificate)
Signs an entity with the provided certificate. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final SMIMECryptographerImpl Default
| Constructor Detail |
|---|
public SMIMECryptographerImpl()
public SMIMECryptographerImpl(EncryptionAlgorithm encryptionAlgorithm,
DigestAlgorithm digestAlgorithm)
encryptionAlgorithm - The encryption algorithm used to encrypt the message.digestAlgorithm - The digest algorithm used to generate the message digest stored in the message signature.| Method Detail |
|---|
public EncryptionAlgorithm getEncryptionAlgorithm()
@Inject(optional=true) public void setEncryptionAlgorithm(EncryptionAlgorithm value)
value - The EncryptionAlgorithm used to encrypt messages.public DigestAlgorithm getDigestAlgorithm()
@Inject(optional=true) public void setDigestAlgorithm(DigestAlgorithm value)
value - The DigestAlgorithm used generate the message digest stored in the message signature.public boolean isIncludeMultipartEpilogueInSignature()
@Inject(optional=true) public void setIncludeMultipartEpilogueInSignature(boolean value)
value - True if the the Epilogue part of a multipart entity should be used to generate the message signature. False otherwise.
public MimeEntity encrypt(javax.mail.internet.MimeMultipart entity,
X509Certificate encryptingCertificate)
encrypt in interface Cryptographerentity - The entity that will be encrypted.encryptingCertificate - The public certificates that will be used to encrypt the message.
public MimeEntity encrypt(javax.mail.internet.MimeMultipart mmEntity,
Collection<X509Certificate> encryptingCertificates)
encrypt in interface Cryptographerentity - The entity that will be encrypted.encryptingCertificates - The public certificates that will be used to encrypt the message.
public MimeEntity encrypt(MimeEntity entity,
X509Certificate encryptingCertificate)
encrypt in interface Cryptographerentity - The entity that will be encrypted.encryptingCertificate - The public certificates that will be used to encrypt the message.
public MimeEntity encrypt(MimeEntity entity,
Collection<X509Certificate> encryptingCertificates)
encrypt in interface Cryptographerentity - The entity that will be encrypted.encryptingCertificate - The public certificates that will be used to encrypt the message.
public MimeEntity decrypt(Message message,
X509CertificateEx decryptingCertificate)
decrypt in interface Cryptographermessage - The message that will be decrypted.decryptingCertificate - The certificate whose private key will be used to decrypt the message.
public MimeEntity decrypt(MimeEntity encryptedEntity,
X509CertificateEx decryptingCertificate)
decrypt in interface CryptographerencryptedEntity - The entity that will be decrypted.decryptingCertificate - The certificate whose private key will be used to decrypt the message.
public MimeEntity decrypt(MimeEntity encryptedEntity,
Collection<X509CertificateEx> decryptingCertificates)
decrypt in interface CryptographerencryptedEntity - The entity that will be decrypted.decryptingCertificate - The certificates whose private keys will be used to decrypt the message.
public SignedEntity sign(Message message,
X509Certificate signingCertificate)
sign in interface Cryptographermessage - The message that will be signed.signingCertificate - The certificate used to sign the message.
public SignedEntity sign(Message message,
Collection<X509Certificate> signingCertificates)
sign in interface Cryptographer
public SignedEntity sign(MimeEntity entity,
X509Certificate signingCertificate)
sign in interface Cryptographermessage - The entity that will be signed.signingCertificate - The certificate used to sign the message.
public SignedEntity sign(MimeEntity entity,
Collection<X509Certificate> signingCertificates)
sign in interface Cryptographermessage - The entity that will be signed.signingCertificates - The certificates used to sign the message.
public void checkSignature(SignedEntity signedEntity,
X509Certificate signerCertificate,
Collection<X509Certificate> anchors)
throws SignatureValidationException
checkSignature in interface CryptographersignedEntity - The entity containing the original signed part and the message signature.signerCertificate - The certificate used to sign the message.anchors - A collection of certificate anchors used to determine if the certificates used in the signature can be validated as trusted certificates.
SignatureValidationExceptionpublic org.bouncycastle.cms.CMSSignedData deserializeSignatureEnvelope(SignedEntity entity)
deserializeSignatureEnvelope in interface Cryptographerentity - The entity containing the original signed part and the message signature.
public org.bouncycastle.cms.CMSSignedData deserializeEnvelopedSignature(MimeEntity envelopeEntity)
deserializeEnvelopedSignature in interface Cryptographerpublic org.bouncycastle.cms.CMSSignedData deserializeEnvelopedSignature(byte[] messageBytes)
deserializeEnvelopedSignature in interface Cryptographer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||