|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eparapher.core.crypto.cert.CertificateManager
public class CertificateManager
| Constructor Summary | |
|---|---|
CertificateManager()
|
|
| Method Summary | |
|---|---|
static X509Certificate[] |
buildChain(X509Certificate[] certs)
|
static String |
createSigningRequest(NewCertParams params,
KeyPair keypair)
Create a PKSC10 certification signing request using the Bouncycastle provider. |
static String |
createSigningRequest(X509Certificate cert,
PrivateKey privKey)
Creates and returns the content of a new singing request for the specified certificate. |
static X509Certificate |
createX509V3Certificate(KeyPair kp,
int months,
String issuerDN,
String subjectDN,
String domain,
String signAlgoritm)
Creates an X509 version3 certificate. |
static List<X509Certificate> |
establishCertChain(X509Certificate certificate,
boolean trustCACerts)
|
static KeyPair |
generateECKeyPair(String ecspecs)
|
static KeyPair |
generateKeyPair(NewCertParams params)
|
static KeyPair |
generateKeyPair(String algorithm,
int keysize)
|
static KeyPair |
generateKeyPair(String algorithm,
int keysize,
String provider)
Returns a new public & private key with the specified algorithm (e.g. |
static X509Certificate[] |
generateNewCertificate(NewCertParams params,
KeyPair keypair)
|
static X509CRL |
getCRLFromCertCDP(X509Certificate certificate)
|
static List<String> |
getPeerIdentities(X509Certificate x509Certificate)
Returns the identities of the remote server as defined in the specified certificate. |
static boolean |
isDSACertificate(KeyStore ksKeys,
String domain)
Returns true if an DSA certificate was found in the specified keystore for the specified domain. |
static boolean |
isDSACertificate(X509Certificate certificate)
Returns true if the specified certificate is using the DSA algorithm. |
static boolean |
isECCertificate(X509Certificate certificate)
Returns true if the specified certificate is using the Elliptic Curve (EC) algorithm. |
static boolean |
isRSACertificate(KeyStore ksKeys,
String domain)
Returns true if an RSA certificate was found in the specified keystore for the specified domain. |
static boolean |
isValidKeyUsageForEncryption(X509Certificate cert)
|
static boolean |
isValidKeyUsageForNonRepudiation(X509Certificate cert)
|
static boolean |
isValidKeyUsageForSignature(X509Certificate cert)
|
static boolean |
validateCertChain(X509Certificate[] certificate,
boolean trustCACerts)
|
static boolean |
verify(X509Certificate certificate,
Collection<X509Certificate[]> caCertPath)
Check the certificate with CA certificate. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CertificateManager()
| Method Detail |
|---|
public static List<String> getPeerIdentities(X509Certificate x509Certificate)
x509Certificate - the certificate the holds the identities of the remote server.
public static boolean isValidKeyUsageForEncryption(X509Certificate cert)
public static boolean isValidKeyUsageForNonRepudiation(X509Certificate cert)
public static boolean isValidKeyUsageForSignature(X509Certificate cert)
public static boolean isRSACertificate(KeyStore ksKeys,
String domain)
throws KeyStoreException
ksKeys - the keystore that contains the certificates.domain - domain of the server signed by the certificate.
KeyStoreException
public static boolean isDSACertificate(KeyStore ksKeys,
String domain)
throws KeyStoreException
ksKeys - the keystore that contains the certificates.domain - domain of the server signed by the certificate.
KeyStoreException
public static boolean isDSACertificate(X509Certificate certificate)
throws KeyStoreException
certificate - the certificate to analyze.
KeyStoreException
public static boolean isECCertificate(X509Certificate certificate)
throws KeyStoreException
certificate - the certificate to analyze.
KeyStoreException
public static String createSigningRequest(X509Certificate cert,
PrivateKey privKey)
throws Exception
#installReply(java.security.KeyStore, java.security.KeyStore, String, String, java.io.InputStream, boolean, boolean)
to import the CA reply.
cert - the certificate to create a signing request.privKey - the private key of the certificate.
Exception
public static String createSigningRequest(NewCertParams params,
KeyPair keypair)
throws InvalidKeyException,
NoSuchAlgorithmException,
NoSuchProviderException,
SignatureException,
IOException
params -
SignatureException
NoSuchProviderException
NoSuchAlgorithmException
InvalidKeyException
IOException
public static X509Certificate[] generateNewCertificate(NewCertParams params,
KeyPair keypair)
throws CertificateEncodingException,
InvalidKeyException,
IllegalStateException,
NoSuchAlgorithmException,
SignatureException,
IOException,
NoSuchProviderException
CertificateEncodingException
InvalidKeyException
IllegalStateException
NoSuchAlgorithmException
SignatureException
IOException
NoSuchProviderException
public static boolean validateCertChain(X509Certificate[] certificate,
boolean trustCACerts)
throws Exception
Exception
public static List<X509Certificate> establishCertChain(X509Certificate certificate,
boolean trustCACerts)
throws Exception
Exception
public static X509Certificate createX509V3Certificate(KeyPair kp,
int months,
String issuerDN,
String subjectDN,
String domain,
String signAlgoritm)
throws GeneralSecurityException,
IOException
kp - KeyPair that keeps the public and private keys for the new certificate.months - time to liveissuerDN - Issuer string e.g "O=Grid,OU=OGSA,CN=ACME"subjectDN - Subject string e.g "O=Grid,OU=OGSA,CN=John Doe"domain - Domain of the server.signAlgoritm - Signature algorithm. This can be either a name or an OID.
GeneralSecurityException
IOException
public static X509CRL getCRLFromCertCDP(X509Certificate certificate)
throws CertificateParsingException
CertificateParsingException
public static KeyPair generateKeyPair(NewCertParams params)
throws NoSuchAlgorithmException,
NoSuchProviderException,
InvalidAlgorithmParameterException
NoSuchAlgorithmException
NoSuchProviderException
InvalidAlgorithmParameterException
public static KeyPair generateKeyPair(String algorithm,
int keysize,
String provider)
throws NoSuchAlgorithmException,
NoSuchProviderException
algorithm - DSA, RSA, etc.keysize - the keysize. This is an algorithm-specific metric, such as modulus
length, specified in number of bits.
NoSuchAlgorithmException
NoSuchProviderException
GeneralSecurityException
public static KeyPair generateKeyPair(String algorithm,
int keysize)
throws NoSuchAlgorithmException,
NoSuchProviderException
NoSuchAlgorithmException
NoSuchProviderException
public static KeyPair generateECKeyPair(String ecspecs)
throws NoSuchAlgorithmException,
NoSuchProviderException,
InvalidAlgorithmParameterException
NoSuchAlgorithmException
NoSuchProviderException
InvalidAlgorithmParameterException
public static boolean verify(X509Certificate certificate,
Collection<X509Certificate[]> caCertPath)
throws Exception
certificate - cert to verifycaCertPath - collection of X509Certificate
Exceptionpublic static X509Certificate[] buildChain(X509Certificate[] certs)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||