|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.kth.pdc.grid.utility.CertManager
public class CertManager
| Constructor Summary | |
|---|---|
CertManager()
Constructor of certificate manager |
|
| Method Summary | |
|---|---|
byte[] |
createCertificateRequest(org.bouncycastle.asn1.x509.X509Name subjectDN,
String sigAlgName,
KeyPair keyPair)
Creates a certificate request from the specified subject name, signing algorithm, and a key pair. |
void |
createCertRequest()
|
void |
createCertRequest(InputStream inCert,
InputStream inKey,
String pwd)
create a user certificate request from a given certificate |
byte[] |
createCertRequest(String subject,
KeyPair keyPair)
Creating a certificate request from a given subject DN and a key pair. |
void |
createCertRequest(X509Certificate inUserCert,
KeyPair kp)
create a user certificate request from existing certificate and keypair |
org.bouncycastle.jce.PKCS10CertificationRequest |
createCertRequestBC()
Create a certificate request from CN, OU |
void |
generateX509Certificate(byte[] req)
|
String |
getCertRequestinPEM(org.bouncycastle.jce.PKCS10CertificationRequest certReq)
|
PrivateKey |
getPrivateKey()
Getting user private key |
PublicKey |
getPublicKey()
Getting user public key |
X509Certificate |
getSignedCert()
Getting generated signed certificate |
X509Certificate |
getUserCert()
Getting user certificate in X509 format |
String |
getUserCertRequest()
Getting user certificate |
String |
getUserPemCert()
Getting generated user certificate in PEM |
String |
getUserPemKey()
Getting User private key in PEM |
void |
saveSignedCert(String fileName)
Save a signed certificate (PEM encoded) |
void |
setDNname(String uDN)
Set user DN |
void |
setDNname(String org,
String orgUnit,
String cn,
String country,
String email)
Set user DN |
void |
signCert(InputStream inRq,
InputStream inCACert,
InputStream inCAKey,
String caPwd)
Signs a Cert request |
void |
UserCertFromFile(String FileName)
Reads the user certificate and public key from a file |
void |
UserCertFromString(String certString)
Reads the user certificate and public key from a string |
void |
UserPrivateKeyFromFile(String FileName,
String pwd)
Reads the user private key from a file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CertManager()
throws Exception
Exception| Method Detail |
|---|
public void UserCertFromFile(String FileName)
throws Exception
FileName -
Exception
public void UserCertFromString(String certString)
throws Exception
certString -
Exception
public void UserPrivateKeyFromFile(String FileName,
String pwd)
throws Exception
FileName - pwd -
Exceptionpublic void setDNname(String uDN)
uDN -
public void setDNname(String org,
String orgUnit,
String cn,
String country,
String email)
org - Organization NameorgUnit - Organizatio Unitcn - Common Namecountry - Countryemail - Email Address
public byte[] createCertRequest(String subject,
KeyPair keyPair)
throws GeneralSecurityException
subject - the subject of the certificate requestkeyPair - the key pair of the certificate request
GeneralSecurityException - if security error
occurs.
public void createCertRequest(InputStream inCert,
InputStream inKey,
String pwd)
inCert - Existing user certificateinKey - Private keypwd - Password to encrypt the key
public void createCertRequest(X509Certificate inUserCert,
KeyPair kp)
inUserCert - Existing user certificatekp - keypair
public org.bouncycastle.jce.PKCS10CertificationRequest createCertRequestBC()
throws IOException,
NoSuchProviderException,
NoSuchAlgorithmException
IOException
NoSuchProviderException
NoSuchAlgorithmException
public String getCertRequestinPEM(org.bouncycastle.jce.PKCS10CertificationRequest certReq)
throws IOException
IOException
public void createCertRequest()
throws IOException,
NoSuchProviderException,
NoSuchAlgorithmException
IOException
NoSuchProviderException
NoSuchAlgorithmException
public byte[] createCertificateRequest(org.bouncycastle.asn1.x509.X509Name subjectDN,
String sigAlgName,
KeyPair keyPair)
throws GeneralSecurityException
subjectDN - the subject name of the certificate
request.sigAlgName - the signing algorithm name.keyPair - the key pair of the certificate request
GeneralSecurityException - if security error
occurs.
public void signCert(InputStream inRq,
InputStream inCACert,
InputStream inCAKey,
String caPwd)
throws IOException,
NoSuchAlgorithmException,
NoSuchProviderException,
InvalidKeyException,
GeneralSecurityException
inRq - Input stream of certificateinCACert - Cert stream of issuer certificateinCAKey - key stream of issuer keycaPwd - password of issuer key
IOException
NoSuchAlgorithmException
NoSuchProviderException
InvalidKeyException
GeneralSecurityException
public void saveSignedCert(String fileName)
throws IOException,
CertificateEncodingException
fileName - Location of certificate
IOException - if a save error occurs
CertificateEncodingException - if a PEM encoding error occurspublic X509Certificate getSignedCert()
public String getUserPemCert()
public String getUserPemKey()
public PrivateKey getPrivateKey()
public PublicKey getPublicKey()
public X509Certificate getUserCert()
public String getUserCertRequest()
public void generateX509Certificate(byte[] req)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||