|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glite.slcs.pki.CertificateKeys
public class CertificateKeys
CertificateKeys is a wrapper class for a KeyPair. Adds functionalities to store the PrivateKey encrypted in PEM format.
Constructor Summary | |
---|---|
CertificateKeys()
Constructor. |
|
CertificateKeys(char[] password)
Constructor. |
|
CertificateKeys(int keySize)
Contructor. |
|
CertificateKeys(int keySize,
char[] password)
Creates a new key pair (private and public) for the given key size. |
Method Summary | |
---|---|
char[] |
getPassword()
|
java.lang.String |
getPEMPrivate()
Gets the private key PEM encoded. |
java.security.PrivateKey |
getPrivate()
|
java.security.PublicKey |
getPublic()
|
void |
setPassword(char[] password)
Sets the private key encryption password. |
void |
setPassword(java.lang.String password)
Sets the private key encryption password. |
void |
storePEMPrivate(java.io.File file)
Stores the private key in PEM format in the given file. |
void |
storePEMPrivate(java.lang.String filename)
Stores the private key in PEM format in the given filename. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CertificateKeys(int keySize, char[] password) throws java.security.GeneralSecurityException
keySize
- The keys size.password
- The password to store the private key crypted.
java.security.GeneralSecurityException
- If an error occurs.public CertificateKeys(char[] password) throws java.security.GeneralSecurityException
password
- The encryption password.
java.security.GeneralSecurityException
public CertificateKeys(int keySize) throws java.security.GeneralSecurityException
keySize
- 512, 1024 or 2048, The key length.
java.security.GeneralSecurityException
public CertificateKeys() throws java.security.GeneralSecurityException
1024
.
java.security.GeneralSecurityException
Method Detail |
---|
public java.security.PrivateKey getPrivate()
null
if the key pair doesn't
existpublic java.security.PublicKey getPublic()
null
if the key pair doesn't
existpublic void setPassword(java.lang.String password)
password
- The private key password.public void setPassword(char[] password)
password
- The private key password.public void storePEMPrivate(java.lang.String filename) throws java.io.IOException
filename
- The filename of the PEM file.
java.io.IOException
- If an IO error occurs.public void storePEMPrivate(java.io.File file) throws java.io.IOException
file
- The PEM file.
java.io.IOException
- If an IO error occurs.public java.lang.String getPEMPrivate() throws java.io.IOException
java.io.IOException
public char[] getPassword()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |