|
IP*Works! S/MIME V9 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectipworkssmime.Certificate
public class Certificate
The digital certificate being used.
This type describes the current digital certificate. The certificate may be a public or private key. The fields are used to identify or select certificates.
EffectiveDate: The date which this certificate becomes valid. Prior to this it is not valid. The following is an example of an encoded date illustrating the format:
23-Jan-2000 15:00:00.
Encoded:
The certificate (PEM/base64 encoded). This field
is used to assign a specific certificate for client
authentication (server authentication in the case
of Daemon beans).
The Store
and Subject
fields may also be used
to specify a certificate.
When Encoded
is set, a search is initiated in the
current Store
for the private key of the certificate.
If the key is found, Subject
is updated to reflect
the full subject of the selected certificate, otherwise Subject
is set to empty string.
ExpirationDate: The date the certificate expires. Dates following this date, the certificate will no longer be valid. The following is an example of an encoded date illustrating the format:
23-Jan-2001 15:00:00.
ExtendedKeyUsage: A comma-delimited list of extended key usage identifiers. These are the same as ASN.1 Object-Identifiers (OIDs).
Fingerprint: The Hex encoded 16-byte MD5 fingerprint of the certificate.
This is in the form:
bc:2a:72:af:fe:58:17:43:7a:5f:ba:5a:7c:90:f7:02
Issuer: The issuer of the certificate. This field contains a string representation of the name of the issuing authority for the certificate.
KeyPassword: The password for the certificate's private key (if any).
Some certificate stores may individually protect certificates' private keys, separate from the standard protection offered by the StorePassword
. KeyPassword
. This can be used to read such password-protected private keys.
Note: this property defaults to the value of StorePassword
. To clear it, you must set the property to the empty string (""). It can be set at any time, but must be set before calling PrivateKey
when the private key's password is different from the store's.
PrivateKey: The private key of the certificate (if available). The key is provided as PEM/Base64-encoded data.
Note: The PrivateKey
may be available, but not exportable.
In this case, PrivateKey
returns an empty string.
PrivateKeyAvailable:
Shows whether a PrivateKey
is available for the
selected certificate. If PrivateKeyAvailable
is True, the certificate may be used for authentication
purposes (e.g. server authentication).
PrivateKeyContainer:
The name of the PrivateKey
container for the
certificate (if available). This functionality
is available only on Windows platforms.
PublicKey: The public key of the certificate. The key is provided as PEM/Base64-encoded data.
PublicKeyAlgorithm: Textual description of the public key algorithm of the certificate. The property contains either the name of the algorithm (such as "RSA" or "RSA_DH"), or an object identifier (OID) string representing the algorithm.
PublicKeyLength: The length of the certificate public key (in bits). Common values are 512, 1024, and 2048.
SerialNumber: The serial number of the certificate encoded as a string. The number is encoded as a series of hexadecimal digits, each two of them representing a byte of the serial number.
SignatureAlgorithm: Textual description of the signature algorithm of the certificate. The property contains either the name of the algorithm (such as "RSA" or "RSA_MD5RSA"), or an object identifier (OID) string representing the algorithm.
Store: The name of the certificate store for the client certificate.
The StoreType
field specifies the type of the
certificate store specified by Store
. If the store
is password protected, specify the password in StorePassword
.
Store
is used in conjunction with the Subject
field in order to specify client certificates. If Store
has a value, and Subject
or Encoded
is set, a search for a certificate is initiated. Please
refer to the Subject
field for details.
Designations of certificate stores are platform-dependent.
The following are designations of the most common User and Machine certificate stores in Windows:
In Java, the certificate store normally is a file containing certificates and optional private keys.
When the certificate store type is PFXFile, this property must be set to the name of the file. When the type is PFXBlob, the property must be set to the binary contents of a PFX file (i.e. PKCS12 certificate store).
If the provider is OpenSSL, the certificate store is a file containing a certificate and a private key. This property must be set to the name of the file.
StorePassword: If the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
StoreType: The type of certificate store for this certificate.
This property can take one of the following values:
Subject: The subject of the certificate used for client authentication.
This field will be populated with the full subject of the loaded certificate. When loading a certificate the subject is used to locate the certificate in the store.
If an exact match is not found, the store is searched for subjects containing the value of the property.
If a match is still not found, the property is set to an empty string, and no certificate is selected.
The special value "*" picks a random certificate in the certificate store.
SubjectAltNames: A comma-separated lists of alternative subject names of the certificate.
ThumbprintMD5: MD5 hash of the certificate. If the hash does not already exist, it is computed.
ThumbprintSHA1: SHA1 hash of the certificate. If the hash does not already exist, it is computed.
Usage:
Textual description of UsageFlags
.
The value will be of one or more of the following strings, separated by commas:
If the provider is OpenSSL, the value is a comma separated list of X509 certificate extension names.
UsageFlags:
Flags that show intended use for the certificate. The value
of UsageFlags
is a combination of the following flags:
Please refer to the Usage
field for a text representation
of UsageFlags
.
This functionality is currently not available when the provider is OpenSSL.
Version: The certificate's version number. The possible values are the strings "V1", "V2", and "V3".
Certmgr
,
Certmgr.Certificate
Field Summary | |
---|---|
static int |
cstJKSBlob
|
static int |
cstJKSFile
|
static int |
cstMachine
|
static int |
cstP7BBlob
|
static int |
cstP7BFile
|
static int |
cstPEMKeyBlob
|
static int |
cstPEMKeyFile
|
static int |
cstPFXBlob
|
static int |
cstPFXFile
|
static int |
cstPublicKeyBlob
|
static int |
cstPublicKeyFile
|
static int |
cstSSHPublicKeyBlob
|
static int |
cstSSHPublicKeyFile
|
static int |
cstUser
|
Constructor Summary | |
---|---|
Certificate()
|
|
Certificate(byte[] certificateData)
|
|
Certificate(int certStoreType,
byte[] storeBlob,
java.lang.String storePassword,
byte[] encoded)
|
|
Certificate(int certStoreType,
byte[] storeBlob,
java.lang.String storePassword,
java.lang.String subject)
|
|
Certificate(int certStoreType,
java.lang.String store,
java.lang.String storePassword,
byte[] encoded)
|
|
Certificate(int certStoreType,
java.lang.String store,
java.lang.String storePassword,
java.lang.String subject)
|
|
Certificate(java.lang.String certificateFile)
|
Method Summary | |
---|---|
java.lang.String |
getEffectiveDate()
|
byte[] |
getEncoded()
|
java.lang.String |
getExpirationDate()
|
java.lang.String |
getExtendedKeyUsage()
|
java.lang.String |
getFingerprint()
|
java.lang.String |
getIssuer()
|
java.lang.String |
getKeyPassword()
|
java.lang.String |
getPrivateKey()
|
boolean |
getPrivateKeyAvailable()
|
java.lang.String |
getPrivateKeyContainer()
|
java.lang.String |
getPublicKey()
|
java.lang.String |
getPublicKeyAlgorithm()
|
int |
getPublicKeyLength()
|
java.lang.String |
getSerialNumber()
|
java.lang.String |
getSignatureAlgorithm()
|
byte[] |
getStore()
|
java.lang.String |
getStorePassword()
|
int |
getStoreType()
|
java.lang.String |
getSubject()
|
java.lang.String |
getSubjectAltNames()
|
java.lang.String |
getThumbprintMD5()
|
java.lang.String |
getThumbprintSHA1()
|
java.lang.String |
getUsage()
|
int |
getUsageFlags()
|
java.lang.String |
getVersion()
|
void |
setEncoded(byte[] value)
|
void |
setExtendedKeyUsage(java.lang.String value)
|
void |
setKeyPassword(java.lang.String value)
|
void |
setPublicKeyAlgorithm(java.lang.String value)
|
void |
setStore(byte[] value)
|
void |
setStorePassword(java.lang.String value)
|
void |
setStoreType(int value)
|
void |
setSubject(java.lang.String value)
|
void |
setUsage(java.lang.String value)
|
void |
setUsageFlags(int value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int cstUser
public static final int cstMachine
public static final int cstPFXFile
public static final int cstPFXBlob
public static final int cstJKSFile
public static final int cstJKSBlob
public static final int cstPEMKeyFile
public static final int cstPEMKeyBlob
public static final int cstPublicKeyFile
public static final int cstPublicKeyBlob
public static final int cstSSHPublicKeyBlob
public static final int cstP7BFile
public static final int cstP7BBlob
public static final int cstSSHPublicKeyFile
Constructor Detail |
---|
public Certificate()
public Certificate(java.lang.String certificateFile) throws IPWorksSMIMEException
IPWorksSMIMEException
public Certificate(byte[] certificateData) throws IPWorksSMIMEException
IPWorksSMIMEException
public Certificate(int certStoreType, java.lang.String store, java.lang.String storePassword, java.lang.String subject) throws IPWorksSMIMEException
IPWorksSMIMEException
public Certificate(int certStoreType, java.lang.String store, java.lang.String storePassword, byte[] encoded) throws IPWorksSMIMEException
IPWorksSMIMEException
public Certificate(int certStoreType, byte[] storeBlob, java.lang.String storePassword, java.lang.String subject) throws IPWorksSMIMEException
IPWorksSMIMEException
public Certificate(int certStoreType, byte[] storeBlob, java.lang.String storePassword, byte[] encoded) throws IPWorksSMIMEException
IPWorksSMIMEException
Method Detail |
---|
public java.lang.String getEffectiveDate()
public byte[] getEncoded()
public void setEncoded(byte[] value)
public java.lang.String getExpirationDate()
public java.lang.String getExtendedKeyUsage()
public void setExtendedKeyUsage(java.lang.String value)
public java.lang.String getFingerprint()
public java.lang.String getIssuer()
public java.lang.String getKeyPassword()
public void setKeyPassword(java.lang.String value)
public java.lang.String getPrivateKey()
public boolean getPrivateKeyAvailable()
public java.lang.String getPrivateKeyContainer()
public java.lang.String getPublicKey()
public java.lang.String getPublicKeyAlgorithm()
public void setPublicKeyAlgorithm(java.lang.String value)
public int getPublicKeyLength()
public java.lang.String getSerialNumber()
public java.lang.String getSignatureAlgorithm()
public byte[] getStore()
public void setStore(byte[] value)
public java.lang.String getStorePassword()
public void setStorePassword(java.lang.String value)
public int getStoreType()
public void setStoreType(int value)
public java.lang.String getSubject()
public void setSubject(java.lang.String value)
public java.lang.String getSubjectAltNames()
public java.lang.String getThumbprintMD5()
public java.lang.String getThumbprintSHA1()
public java.lang.String getUsage()
public void setUsage(java.lang.String value)
public int getUsageFlags()
public void setUsageFlags(int value)
public java.lang.String getVersion()
|
IP*Works! S/MIME V9 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |