|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glite.security.util.CertUtil
public class CertUtil
Certificate utilities.
Constructor Summary | |
---|---|
CertUtil()
|
Method Summary | |
---|---|
static int |
findClientCert(java.security.cert.X509Certificate[] chain)
Finds out the index of the client cert in a certificate chain. |
static byte[] |
getExtensionBytes(java.security.cert.X509Certificate cert,
java.lang.String oid)
Gets the certificate extension identified by the oid and returns the value bytes unwrapped by the ASN1OctetString. |
static java.lang.String |
getPEM(java.security.cert.X509Certificate cert)
Outputs the certificate in PEM encoded form. |
static java.lang.String |
getPEM(java.security.cert.X509Certificate[] certs)
Outputs the certificates in PEM encoded form. |
static java.lang.String |
getPEM(java.security.cert.X509Certificate[] certs,
int from,
int to)
Outputs the certificates in PEM encoded form. |
static boolean |
keysMatch(java.security.PrivateKey key,
java.security.PublicKey pubKey)
Compares whether the given private key and the public key belong together. |
static boolean |
keysMatch(java.security.PrivateKey key,
java.security.cert.X509Certificate certificate)
Compares whether the given private key and the public key in the certificate belong together. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CertUtil()
Method Detail |
---|
public static java.lang.String getPEM(java.security.cert.X509Certificate cert) throws java.io.IOException
cert
- the Certificate to encode.
java.io.IOException
- in case the certificate is invalid.public static java.lang.String getPEM(java.security.cert.X509Certificate[] certs, int from, int to) throws java.io.IOException
certs
- the Certificate to encode.from
- the index of the first cert to encode (0 means first, max certs.length - 1).to
- the index of the last cert to encode (0 means first, max certs.length - 1).
java.io.IOException
- in case the certificate is invalid.public static java.lang.String getPEM(java.security.cert.X509Certificate[] certs) throws java.io.IOException
certs
- the Certificate to encode.
java.io.IOException
- in case the certificate is invalid.public static int findClientCert(java.security.cert.X509Certificate[] chain)
chain
- the cert chain
public static boolean keysMatch(java.security.PrivateKey key, java.security.cert.X509Certificate certificate)
key
- The private key.certificate
- The certificate holding the public key.
public static boolean keysMatch(java.security.PrivateKey key, java.security.PublicKey pubKey)
key
- The private key.pubKey
- The public key.
public static byte[] getExtensionBytes(java.security.cert.X509Certificate cert, java.lang.String oid) throws java.io.IOException
cert
- The certificate to inspect.oid
- The extension OID to fetch.
java.io.IOException
- thrown in case the certificate parsing fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |