public class SmimeKey extends Object
PrivateKey and a chain of X509Certificates used to sign or decrypt a MIME message.| Constructor and Description |
|---|
SmimeKey(PrivateKey privateKey,
X509Certificate... certificateChain)
Create a new
SmimeKey with the given private key and certificate
chain. |
SmimeKey(X509Certificate... certificateChain)
Create a new
SmimeKey with the given private key and certificate
chain. |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getAssociatedAddresses()
Compiles and returns the list of email address associated with the
certificate of this SmimeKey by
inspecting the subjects distinguished name. |
X509Certificate |
getCertificate()
Returns the certificate that holds the public key that corresponds to the
private key of this
SmimeKey. |
X509Certificate[] |
getCertificateChain()
Returns the chain of certificates of this
SmimeKey starting with
the certificate that holds the public key that corresponds to the private
key of this SmimeKey and ending with the trust anchor. |
PrivateKey |
getPrivateKey()
Returns the private key of this
SmimeKey. |
static SmimeKey |
loadCertificate(InputStream stream)
Load a new
SmimeKey with the given certificate from string -----CERTIFICATE----- |
static SmimeKey |
loadCertificate(String crtPath)
Load a new
SmimeKey with the given private key and certificate from string -----CERTIFICATE----- |
static SmimeKey |
loadPFX(InputStream stream,
char[] password)
Load a new
SmimeKey with the given private key and certificate from PFX store |
static SmimeKey |
loadPFX(InputStream stream,
String alias,
char[] password)
Load a new
SmimeKey with the given private key and certificate from PFX store |
static SmimeKey |
loadPFX(String pfxPath,
char[] password)
Load a new
SmimeKey with the given private key and certificate from PFX store |
static SmimeKey |
loadPFX(String pfxPath,
String alias,
char[] password)
Load a new
SmimeKey with the given private key and certificate from PFX store |
static SmimeKey |
loadPrivateKey(InputStream stream)
Load a new
SmimeKey with the given private key from string ---RSA PRIVATE KEY---. |
static SmimeKey |
loadPrivateKey(String keyPath)
Load a new
SmimeKey with the given private key from string -----RSA PRIVATE KEY----- |
public SmimeKey(PrivateKey privateKey, X509Certificate... certificateChain)
SmimeKey with the given private key and certificate
chain.privateKey - The PrivateKey of this SmimeKeycertificateChain - The chain of X509Certificates of this
SmimeKey starting with the certificate that holds the
public key that corresponds to the given private key and
ending with the trust anchor.public SmimeKey(X509Certificate... certificateChain)
SmimeKey with the given private key and certificate
chain.certificateChain - The chain of X509Certificates of this
SmimeKey starting with the certificate that holds the
public key that corresponds to the given private key and
ending with the trust anchor.public static SmimeKey loadPrivateKey(InputStream stream)
SmimeKey with the given private key from string ---RSA PRIVATE KEY---.stream - The InputStream to read the private key from.public static SmimeKey loadPrivateKey(String keyPath)
SmimeKey with the given private key from string -----RSA PRIVATE KEY-----keyPath - The path to the file containing the private key.public static SmimeKey loadCertificate(InputStream stream)
SmimeKey with the given certificate from string -----CERTIFICATE-----stream - The InputStream to read the certificate from.public static SmimeKey loadCertificate(String crtPath)
SmimeKey with the given private key and certificate from string -----CERTIFICATE-----crtPath - The path to the file containing certificate.public static SmimeKey loadPFX(String pfxPath, char[] password)
SmimeKey with the given private key and certificate from PFX storepfxPath - The path to the PFX filepassword - The password to unlock the PFX store with.public static SmimeKey loadPFX(String pfxPath, String alias, char[] password)
SmimeKey with the given private key and certificate from PFX storepfxPath - The path to the PFX filealias - The alias of the key entry in the PFX store.password - The password to unlock the PFX store with.public static SmimeKey loadPFX(InputStream stream, char[] password)
SmimeKey with the given private key and certificate from PFX storestream - The InputStream to read the PFX store from.password - The password to unlock the PFX store with.public static SmimeKey loadPFX(InputStream stream, String alias, char[] password)
SmimeKey with the given private key and certificate from PFX storestream - The InputStream to read the PFX store from.alias - The alias of the key entry in the PFX store.password - The password to unlock the PFX store with.public PrivateKey getPrivateKey()
SmimeKey.PrivateKey.public X509Certificate getCertificate()
SmimeKey.X509Certificate.public X509Certificate[] getCertificateChain()
SmimeKey starting with
the certificate that holds the public key that corresponds to the private
key of this SmimeKey and ending with the trust anchor.X509Certificates.public List<String> getAssociatedAddresses()
certificate of this SmimeKey by
inspecting the subjects distinguished name.unmodifiable list of
email addresses.Copyright (c) 2008-2024 Aspose Pty Ltd. All Rights Reserved.