public class SMIMEToolkit
extends java.lang.Object
| Constructor and Description |
|---|
SMIMEToolkit(org.bouncycastle.operator.DigestCalculatorProvider digestCalculatorProvider)
Base constructor.
|
| Modifier and Type | Method and Description |
|---|---|
jakarta.mail.internet.MimeBodyPart |
decrypt(jakarta.mail.internet.MimeBodyPart mimePart,
org.bouncycastle.cms.RecipientId recipientId,
org.bouncycastle.cms.Recipient recipient)
Decrypt the passed in MIME part returning a part representing the decrypted content.
|
jakarta.mail.internet.MimeBodyPart |
decrypt(jakarta.mail.internet.MimeMessage message,
org.bouncycastle.cms.RecipientId recipientId,
org.bouncycastle.cms.Recipient recipient)
Decrypt the passed in MIME message returning a part representing the decrypted content.
|
jakarta.mail.internet.MimeBodyPart |
encrypt(jakarta.mail.internet.MimeBodyPart mimePart,
org.bouncycastle.operator.OutputEncryptor contentEncryptor,
org.bouncycastle.cms.RecipientInfoGenerator recipientGenerator)
Encrypt the passed in MIME part returning a new encrypted MIME part.
|
jakarta.mail.internet.MimeBodyPart |
encrypt(jakarta.mail.internet.MimeMessage message,
org.bouncycastle.operator.OutputEncryptor contentEncryptor,
org.bouncycastle.cms.RecipientInfoGenerator recipientGenerator)
Encrypt the passed in MIME message returning a new encrypted MIME part.
|
jakarta.mail.internet.MimeBodyPart |
encrypt(jakarta.mail.internet.MimeMultipart multiPart,
org.bouncycastle.operator.OutputEncryptor contentEncryptor,
org.bouncycastle.cms.RecipientInfoGenerator recipientGenerator)
Encrypt the passed in MIME multi-part returning a new encrypted MIME part.
|
org.bouncycastle.cert.X509CertificateHolder |
extractCertificate(jakarta.mail.internet.MimeMultipart message,
org.bouncycastle.cms.SignerInformation signerInformation)
Extract the signer's signing certificate from Multipart message content.
|
org.bouncycastle.cert.X509CertificateHolder |
extractCertificate(jakarta.mail.Part message,
org.bouncycastle.cms.SignerInformation signerInformation)
Extract the signer's signing certificate from the message.
|
boolean |
isEncrypted(jakarta.mail.Part message)
Return true if the passed in message (MimeBodyPart or MimeMessage) is encrypted.
|
boolean |
isSigned(jakarta.mail.internet.MimeMultipart message)
Return true if the passed in MimeMultipart is a signed one.
|
boolean |
isSigned(jakarta.mail.Part message)
Return true if the passed in message (MimeBodyPart or MimeMessage) is a signed one.
|
boolean |
isValidSignature(jakarta.mail.internet.MimeMultipart message,
org.bouncycastle.cms.SignerInformationVerifier verifier)
Return true if there is a signature on the message that can be verified by verifier..
|
boolean |
isValidSignature(jakarta.mail.Part message,
org.bouncycastle.cms.SignerInformationVerifier verifier)
Return true if there is a signature on the message that can be verified by the verifier.
|
jakarta.mail.internet.MimeMultipart |
sign(jakarta.mail.internet.MimeBodyPart message,
org.bouncycastle.cms.SignerInfoGenerator signerInfoGenerator)
Produce a signed message in multi-part format with the second part containing a detached signature for the first.
|
jakarta.mail.internet.MimeBodyPart |
signEncapsulated(jakarta.mail.internet.MimeBodyPart message,
org.bouncycastle.cms.SignerInfoGenerator signerInfoGenerator)
Produce a signed message in encapsulated format where the message is encoded in the signature..
|
public SMIMEToolkit(org.bouncycastle.operator.DigestCalculatorProvider digestCalculatorProvider)
digestCalculatorProvider - provider for any digest calculations required.public boolean isEncrypted(jakarta.mail.Part message)
throws jakarta.mail.MessagingException
message - message of interestjakarta.mail.MessagingException - on a message processing issue.public boolean isSigned(jakarta.mail.Part message)
throws jakarta.mail.MessagingException
message - message of interestjakarta.mail.MessagingException - on a message processing issue.public boolean isSigned(jakarta.mail.internet.MimeMultipart message)
throws jakarta.mail.MessagingException
message - message of interestjakarta.mail.MessagingException - on a message processing issue.public boolean isValidSignature(jakarta.mail.Part message,
org.bouncycastle.cms.SignerInformationVerifier verifier)
throws SMIMEException,
jakarta.mail.MessagingException
message - a MIME part representing a signed message.verifier - the verifier we want to find a signer for.SMIMEException - on a SMIME handling issue.jakarta.mail.MessagingException - on a basic message processing exceptionpublic boolean isValidSignature(jakarta.mail.internet.MimeMultipart message,
org.bouncycastle.cms.SignerInformationVerifier verifier)
throws SMIMEException,
jakarta.mail.MessagingException
message - a MIME part representing a signed message.verifier - the verifier we want to find a signer for.SMIMEException - on a SMIME handling issue.jakarta.mail.MessagingException - on a basic message processing exceptionpublic org.bouncycastle.cert.X509CertificateHolder extractCertificate(jakarta.mail.Part message,
org.bouncycastle.cms.SignerInformation signerInformation)
throws SMIMEException,
jakarta.mail.MessagingException
message - a MIME part/MIME message representing a signed message.signerInformation - the signer information identifying the signer of interest.SMIMEExceptionjakarta.mail.MessagingExceptionpublic org.bouncycastle.cert.X509CertificateHolder extractCertificate(jakarta.mail.internet.MimeMultipart message,
org.bouncycastle.cms.SignerInformation signerInformation)
throws SMIMEException,
jakarta.mail.MessagingException
message - a MIME Multipart part representing a signed message.signerInformation - the signer information identifying the signer of interest.SMIMEExceptionjakarta.mail.MessagingExceptionpublic jakarta.mail.internet.MimeMultipart sign(jakarta.mail.internet.MimeBodyPart message,
org.bouncycastle.cms.SignerInfoGenerator signerInfoGenerator)
throws SMIMEException
message - the message to be signed.signerInfoGenerator - the generator to be used to generate the signature.SMIMEException - on an exception calculating or creating the signed data.public jakarta.mail.internet.MimeBodyPart signEncapsulated(jakarta.mail.internet.MimeBodyPart message,
org.bouncycastle.cms.SignerInfoGenerator signerInfoGenerator)
throws SMIMEException
message - the message to be signed.signerInfoGenerator - the generator to be used to generate the signature.SMIMEException - on an exception calculating or creating the signed data.public jakarta.mail.internet.MimeBodyPart encrypt(jakarta.mail.internet.MimeBodyPart mimePart,
org.bouncycastle.operator.OutputEncryptor contentEncryptor,
org.bouncycastle.cms.RecipientInfoGenerator recipientGenerator)
throws SMIMEException
mimePart - the part to be encrypted.contentEncryptor - the encryptor to use for the actual message content.recipientGenerator - the generator for the target recipient.SMIMEException - in the event of an exception creating the encrypted part.public jakarta.mail.internet.MimeBodyPart encrypt(jakarta.mail.internet.MimeMultipart multiPart,
org.bouncycastle.operator.OutputEncryptor contentEncryptor,
org.bouncycastle.cms.RecipientInfoGenerator recipientGenerator)
throws SMIMEException,
jakarta.mail.MessagingException
multiPart - the multi-part to be encrypted.contentEncryptor - the encryptor to use for the actual message content.recipientGenerator - the generator for the target recipient.SMIMEException - in the event of an exception creating the encrypted part.jakarta.mail.MessagingExceptionpublic jakarta.mail.internet.MimeBodyPart encrypt(jakarta.mail.internet.MimeMessage message,
org.bouncycastle.operator.OutputEncryptor contentEncryptor,
org.bouncycastle.cms.RecipientInfoGenerator recipientGenerator)
throws SMIMEException
message - the multi-part to be encrypted.contentEncryptor - the encryptor to use for the actual message content.recipientGenerator - the generator for the target recipient.SMIMEException - in the event of an exception creating the encrypted part.public jakarta.mail.internet.MimeBodyPart decrypt(jakarta.mail.internet.MimeBodyPart mimePart,
org.bouncycastle.cms.RecipientId recipientId,
org.bouncycastle.cms.Recipient recipient)
throws SMIMEException,
jakarta.mail.MessagingException
mimePart - the part containing the encrypted data.recipientId - the recipient id in the date to be matched.recipient - the recipient to be used if a match is found.SMIMEException - on an exception doing the decryption.jakarta.mail.MessagingException - on an exception parsing the message,public jakarta.mail.internet.MimeBodyPart decrypt(jakarta.mail.internet.MimeMessage message,
org.bouncycastle.cms.RecipientId recipientId,
org.bouncycastle.cms.Recipient recipient)
throws SMIMEException,
jakarta.mail.MessagingException
message - the message containing the encrypted data.recipientId - the recipient id in the date to be matched.recipient - the recipient to be used if a match is found.SMIMEException - on an exception doing the decryption.jakarta.mail.MessagingException - on an exception parsing the message,