public class KeyPairDetails
extends java.lang.Object
SSLUtils#generateKeyPair(popjava.util.ssl.KeyPairDetails) | Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
alias |
protected int |
privateKeySize |
protected java.util.Map<org.bouncycastle.asn1.ASN1ObjectIdentifier,java.lang.String> |
rdn |
protected java.util.Date |
validUntil |
| Constructor and Description |
|---|
KeyPairDetails()
Empty constructor
|
KeyPairDetails(KeyPairDetails other)
Copy constructor
|
KeyPairDetails(java.lang.String alias)
Parameters to create a KeyStore with sane defaults.
|
KeyPairDetails(java.lang.String alias,
java.util.Date validUntil,
int privateKeySize)
Full constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRDN(org.bouncycastle.asn1.ASN1ObjectIdentifier name,
java.lang.String value)
Specify the certificate Relative Distinguished Name (RDN).
|
java.lang.String |
getAlias()
The alias of the certificate
|
int |
getPrivateKeySize()
Size in bits when creating a private key
|
java.util.Map<org.bouncycastle.asn1.ASN1ObjectIdentifier,java.lang.String> |
getRDN()
Get the whole certificate name as a unmodifiable map
|
java.util.Date |
getValidUntil()
Until when is the certificate valid, only used for the key store creation
|
void |
removeRDN(org.bouncycastle.asn1.ASN1ObjectIdentifier name)
Remove element from the certificate name
|
void |
setAlias(java.lang.String alias)
Set the alias of the certificate
|
void |
setPrivateKeySize(int keySize)
The complexity of the RSA key, must be greater than 1024 bits
|
void |
setValidFor(int days)
For how many day from now should the certificate be valid
|
void |
setValidUntil(java.util.Date validUntil)
Until when the certificate should be valid
|
void |
validate()
Check that the parameters are valid
|
protected java.lang.String alias
protected java.util.Date validUntil
protected int privateKeySize
protected final java.util.Map<org.bouncycastle.asn1.ASN1ObjectIdentifier,java.lang.String> rdn
public KeyPairDetails()
public KeyPairDetails(KeyPairDetails other)
other - the other KeyPairpublic KeyPairDetails(java.lang.String alias,
java.util.Date validUntil,
int privateKeySize)
alias - The alias of this node, used to find its own public certificatevalidUntil - Until when the certificate should be validprivateKeySize - The complexity of the RSA key, must be greater than 1024 bitspublic KeyPairDetails(java.lang.String alias)
setValidFor(int) Defaults are: validity := 365 days keySize := 2048
bitsalias - The alias of this node, used to find its own public certificatepublic java.lang.String getAlias()
public void setAlias(java.lang.String alias)
alias - the new alias of the keypublic java.util.Date getValidUntil()
public void setValidUntil(java.util.Date validUntil)
validUntil - the new validity datepublic void setValidFor(int days)
days - the number of days the certificate will be valid from today (now)public int getPrivateKeySize()
public void setPrivateKeySize(int keySize)
keySize - the new key sizepublic void addRDN(org.bouncycastle.asn1.ASN1ObjectIdentifier name,
java.lang.String value)
name - What we want to specify, like BCStyle.CNvalue - the value for the RDN keyBCStylepublic void removeRDN(org.bouncycastle.asn1.ASN1ObjectIdentifier name)
name - the RDN (key,value) pair to removepublic java.util.Map<org.bouncycastle.asn1.ASN1ObjectIdentifier,java.lang.String> getRDN()
public void validate()