public class SMIMEUtil
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
SMIMEUtil.SafeCreator
Interface to obfuscate the repetitive constructors so that we could have only one createSafe
|
| Constructor and Description |
|---|
SMIMEUtil() |
| Modifier and Type | Method and Description |
|---|---|
static org.bouncycastle.asn1.cms.IssuerAndSerialNumber |
createIssuerAndSerialNumberFor(java.security.cert.X509Certificate cert)
Return a CMS IssuerAndSerialNumber structure for the passed in X.509 certificate.
|
static java.lang.Object |
createSafe(java.io.InputStream sigStream,
SMIMEUtil.SafeCreator creator)
If getInputStreamNoMultipartSigned returns PipedInputStream it will lead to
resource leak as it will not be closed if not handled safely.
|
static boolean |
isMultipartContent(javax.mail.Part part) |
static javax.mail.internet.MimeBodyPart |
toMimeBodyPart(byte[] content)
return the MimeBodyPart described in the raw bytes provided in content
|
static FileBackedMimeBodyPart |
toMimeBodyPart(org.bouncycastle.cms.CMSTypedStream content)
return a file backed MimeBodyPart described in
CMSTypedStream content. |
static FileBackedMimeBodyPart |
toMimeBodyPart(org.bouncycastle.cms.CMSTypedStream content,
java.io.File file)
Return a file based MimeBodyPart represented by content and backed
by the file represented by file.
|
static javax.mail.internet.MimeBodyPart |
toMimeBodyPart(java.io.InputStream content)
return the MimeBodyPart described in the input stream content
|
public static boolean isMultipartContent(javax.mail.Part part)
throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic static javax.mail.internet.MimeBodyPart toMimeBodyPart(byte[] content)
throws SMIMEException
SMIMEExceptionpublic static javax.mail.internet.MimeBodyPart toMimeBodyPart(java.io.InputStream content)
throws SMIMEException
SMIMEExceptionpublic static FileBackedMimeBodyPart toMimeBodyPart(org.bouncycastle.cms.CMSTypedStream content) throws SMIMEException
CMSTypedStream content.SMIMEExceptionpublic static FileBackedMimeBodyPart toMimeBodyPart(org.bouncycastle.cms.CMSTypedStream content, java.io.File file) throws SMIMEException
content - content stream containing body part.file - file to store the decoded body part in.SMIMEExceptionpublic static org.bouncycastle.asn1.cms.IssuerAndSerialNumber createIssuerAndSerialNumberFor(java.security.cert.X509Certificate cert)
throws java.security.cert.CertificateParsingException
cert - the X.509 certificate to get the issuer and serial number for.java.security.cert.CertificateParsingExceptionpublic static java.lang.Object createSafe(java.io.InputStream sigStream,
SMIMEUtil.SafeCreator creator)
throws javax.mail.MessagingException,
org.bouncycastle.cms.CMSException
javax.mail.MessagingException - an error extracting the signature or
otherwise processing the message.org.bouncycastle.cms.CMSException - if some other problem occurs.