public class SMIMECryptographerImpl extends Object implements Cryptographer
| Modifier and Type | Field and Description |
|---|---|
static SMIMECryptographerImpl |
Default |
static org.bouncycastle.asn1.ASN1ObjectIdentifier |
x509CertificateObjectsIdent |
| Constructor and Description |
|---|
SMIMECryptographerImpl()
Constructs a Cryptographer with a default EncryptionAlgorithm and DigestAlgorithm.
|
SMIMECryptographerImpl(EncryptionAlgorithm encryptionAlgorithm,
DigestAlgorithm digestAlgorithm)
Constructs a Cryptographer with an EncryptionAlgorithm and DigestAlgorithm.
|
SMIMECryptographerImpl(EncryptionAlgorithm encryptionAlgorithm,
DigestAlgorithm digestAlgorithm,
EncryptionAlgorithm keyEncryptionAlgorithm) |
SMIMECryptographerImpl(EncryptionAlgorithm encryptionAlgorithm,
DigestAlgorithm digestAlgorithm,
EncryptionAlgorithm keyEncryptionAlgorithm,
DigestAlgorithm keyEncryptionDigestAlgorithm) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkSignature(SignedEntity signedEntity,
X509Certificate signerCertificate,
Collection<X509Certificate> anchors)
Validates that a signed entity has a valid message and signature.
|
static org.bouncycastle.asn1.cms.AttributeTable |
createAttributeTable(org.bouncycastle.asn1.ASN1EncodableVector signedAttrs) |
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.
|
EncryptionAlgorithm |
getKeyEncryptionAlgorithm()
Gets the KeyEncryptionAlgorithm.
|
DigestAlgorithm |
getKeyEncryptionDigestAlgorithm()
Gets the KeyEncryptionDigestAlgorithm.
|
static String |
getMaskFunctionGeneratorFromOID(String mfgOID) |
boolean |
isIncludeMultipartEpilogueInSignature()
Indicates if the the Epilogue part of a multipart entity should be used to generate the message signature.
|
boolean |
isLogDigests()
Indicates if message digests will be logged when verifying messages.
|
boolean |
isStrongDigestEnforced()
Indicate if strong message digests are enforced
|
boolean |
isStrongEncryptionEnforced()
Indicate if strong message encryption is enforced
|
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.
|
void |
setKeyEncryptionAlgorithm(EncryptionAlgorithm value)
Sets the KeyEncryptionAlgorithm
|
void |
setKeyEncryptionDigestAlgorithm(DigestAlgorithm value)
Sets the KeyEncryptionDigestAlgorithm
|
void |
setLogDigests(boolean m_logDigest)
Sets if message digests will be looged.
|
void |
setStrongDigestEnforced(Boolean value)
Sets the option to enforce strong message digests.
|
void |
setStrongEncryptionEnforced(Boolean value)
Sets the option to enforce strong message encryption
|
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.
|
public static final org.bouncycastle.asn1.ASN1ObjectIdentifier x509CertificateObjectsIdent
public static final SMIMECryptographerImpl Default
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.public SMIMECryptographerImpl(EncryptionAlgorithm encryptionAlgorithm, DigestAlgorithm digestAlgorithm, EncryptionAlgorithm keyEncryptionAlgorithm)
public SMIMECryptographerImpl(EncryptionAlgorithm encryptionAlgorithm, DigestAlgorithm digestAlgorithm, EncryptionAlgorithm keyEncryptionAlgorithm, DigestAlgorithm keyEncryptionDigestAlgorithm)
public EncryptionAlgorithm getEncryptionAlgorithm()
public EncryptionAlgorithm getKeyEncryptionAlgorithm()
public DigestAlgorithm getKeyEncryptionDigestAlgorithm()
public void setEncryptionAlgorithm(EncryptionAlgorithm value)
value - The EncryptionAlgorithm used to encrypt messages.public void setKeyEncryptionAlgorithm(EncryptionAlgorithm value)
value - The KeyEncryptionAlgorithm used to encrypt message key.public void setKeyEncryptionDigestAlgorithm(DigestAlgorithm value)
value - The KeyEncryptionAlgorithm used to encrypt message key.public DigestAlgorithm getDigestAlgorithm()
public void setDigestAlgorithm(DigestAlgorithm value)
value - The DigestAlgorithm used generate the message digest stored in the message signature.public boolean isLogDigests()
public void setStrongDigestEnforced(Boolean value)
value - True if strong message digests are enforced. False otherwise.public boolean isStrongDigestEnforced()
public void setLogDigests(boolean m_logDigest)
m_logDigest - True if the digests will be logged. False otherwise.public void setStrongEncryptionEnforced(Boolean value)
value - True if strong encryption is enforced. False otherwise.public boolean isStrongEncryptionEnforced()
public boolean isIncludeMultipartEpilogueInSignature()
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 Cryptographerpublic 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 static org.bouncycastle.asn1.cms.AttributeTable createAttributeTable(org.bouncycastle.asn1.ASN1EncodableVector signedAttrs)
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 CryptographerCopyright © 2010–2025 NHIN Direct. All rights reserved.