public class BouncyCastleUtil
extends java.lang.Object
| Constructor and Description |
|---|
BouncyCastleUtil() |
| Modifier and Type | Method and Description |
|---|---|
static org.bouncycastle.asn1.ASN1Primitive |
duplicate(org.bouncycastle.asn1.ASN1Primitive obj)
Replicates a given
DERObject. |
static GSIConstants.CertificateType |
getCertificateType(org.bouncycastle.asn1.x509.TBSCertificateStructure crt,
TrustedCertificates trustedCerts) |
static GSIConstants.CertificateType |
getCertificateType(java.security.cert.X509Certificate cert)
Returns certificate type of the given certificate.
|
static GSIConstants.CertificateType |
getCertificateType(java.security.cert.X509Certificate cert,
java.security.cert.CertStore trustedCerts)
Returns the certificate type of the given certificate.
|
static GSIConstants.CertificateType |
getCertificateType(java.security.cert.X509Certificate cert,
TrustedCertificates trustedCerts)
Deprecated.
|
static org.bouncycastle.asn1.ASN1Primitive |
getExtensionObject(org.bouncycastle.asn1.x509.X509Extension ext)
Extracts the value of a certificate extension.
|
static byte[] |
getExtensionValue(byte[] certExtValue)
Retrieves the actual value of the X.509 extension.
|
static byte[] |
getExtensionValue(java.security.cert.X509Certificate cert,
java.lang.String oid)
Returns the actual value of the extension.
|
static java.lang.String |
getIdentity(java.security.cert.X509Certificate cert)
Returns the subject DN of the given certificate in the Globus format.
|
static java.lang.String |
getIdentity(java.security.cert.X509Certificate[] chain)
Finds the identity certificate in the given chain and
returns the subject DN of that certificate in the Globus format.
|
static java.security.cert.X509Certificate |
getIdentityCertificate(java.security.cert.X509Certificate[] chain)
Finds the identity certificate in the given chain.
|
static java.lang.String |
getIdentityPrefix(java.security.cert.X509Certificate cert) |
static boolean[] |
getKeyUsage(org.bouncycastle.asn1.x509.X509Extension ext)
Gets a boolean array representing bits of the KeyUsage extension.
|
static ProxyCertInfo |
getProxyCertInfo(org.bouncycastle.asn1.x509.TBSCertificateStructure crt) |
static ProxyCertInfo |
getProxyCertInfo(org.bouncycastle.asn1.x509.X509Extension ext)
Creates a
ProxyCertInfo object from given
extension. |
static int |
getProxyPathConstraint(org.bouncycastle.asn1.x509.TBSCertificateStructure crt) |
static int |
getProxyPathConstraint(java.security.cert.X509Certificate cert) |
static org.bouncycastle.asn1.x509.TBSCertificateStructure |
getTBSCertificateStructure(java.security.cert.X509Certificate cert)
Extracts the TBS certificate from the given certificate.
|
static org.bouncycastle.asn1.ASN1Primitive |
toASN1Primitive(byte[] data)
Converts the DER-encoded byte array into a
DERObject. |
static byte[] |
toByteArray(org.bouncycastle.asn1.ASN1Primitive obj)
Converts given
DERObject into
a DER-encoded byte array. |
public static byte[] toByteArray(org.bouncycastle.asn1.ASN1Primitive obj)
throws java.io.IOException
DERObject into
a DER-encoded byte array.obj - DERObject to convert.java.io.IOException - if conversion failspublic static org.bouncycastle.asn1.ASN1Primitive toASN1Primitive(byte[] data)
throws java.io.IOException
DERObject.data - the DER-encoded byte array to convert.java.io.IOException - if conversion failspublic static org.bouncycastle.asn1.ASN1Primitive duplicate(org.bouncycastle.asn1.ASN1Primitive obj)
throws java.io.IOException
DERObject.obj - the DERObject to replicate.java.io.IOException - if replication failspublic static org.bouncycastle.asn1.x509.TBSCertificateStructure getTBSCertificateStructure(java.security.cert.X509Certificate cert)
throws java.security.cert.CertificateEncodingException,
java.io.IOException
cert - the X.509 certificate to extract the TBS certificate from.java.io.IOException - if extraction fails.java.security.cert.CertificateEncodingException - if extraction fails.public static org.bouncycastle.asn1.ASN1Primitive getExtensionObject(org.bouncycastle.asn1.x509.X509Extension ext)
throws java.io.IOException
ext - the certificate extension to extract the value from.java.io.IOException - if extraction fails.public static GSIConstants.CertificateType getCertificateType(java.security.cert.X509Certificate cert, TrustedCertificates trustedCerts) throws java.security.cert.CertificateException
getCertificateType for details for
determining the certificate type.cert - the certificate to get the type of.trustedCerts - the trusted certificates to double check the
GSIConstants.EEC
certificate against.getCertificateType.java.security.cert.CertificateException - if something goes wrong.public static GSIConstants.CertificateType getCertificateType(java.security.cert.X509Certificate cert, java.security.cert.CertStore trustedCerts) throws java.security.cert.CertificateException
getCertificateType for details for
determining the certificate type.cert - the certificate to get the type of.trustedCerts - the trusted certificates to double check the
GSIConstants.EEC
certificate against.getCertificateType.java.security.cert.CertificateException - if something goes wrong.public static GSIConstants.CertificateType getCertificateType(java.security.cert.X509Certificate cert) throws java.security.cert.CertificateException
getCertificateType for details for determining the certificate type.cert - the certificate to get the type of.getCertificateType.java.security.cert.CertificateException - if something goes wrong.public static GSIConstants.CertificateType getCertificateType(org.bouncycastle.asn1.x509.TBSCertificateStructure crt, TrustedCertificates trustedCerts) throws java.security.cert.CertificateException, java.io.IOException
java.security.cert.CertificateExceptionjava.io.IOExceptionpublic static boolean[] getKeyUsage(org.bouncycastle.asn1.x509.X509Extension ext)
throws java.io.IOException
java.io.IOException - if failed to extract the KeyUsage extension value.X509Certificate.getKeyUsage()public static ProxyCertInfo getProxyCertInfo(org.bouncycastle.asn1.x509.X509Extension ext) throws java.io.IOException
ProxyCertInfo object from given
extension.ext - the extension.ProxyCertInfo object.java.io.IOException - if something fails.public static java.lang.String getIdentity(java.security.cert.X509Certificate cert)
cert - the certificate to get the subject of. The certificate
must be of X509CertificateObject type.public static java.lang.String getIdentityPrefix(java.security.cert.X509Certificate cert)
public static java.lang.String getIdentity(java.security.cert.X509Certificate[] chain)
throws java.security.cert.CertificateException
chain - the certificate chain to find the identity
certificate in. The certificates must be
of X509CertificateObject type.java.security.cert.CertificateException - if something goes wrong.public static java.security.cert.X509Certificate getIdentityCertificate(java.security.cert.X509Certificate[] chain)
throws java.security.cert.CertificateException
chain - the certificate chain to find the identity
certificate in.java.security.cert.CertificateException - if something goes wrong.public static byte[] getExtensionValue(byte[] certExtValue)
throws java.io.IOException
certExtValue - the DER-encoded OCTET string value of the extension.java.io.IOExceptionpublic static byte[] getExtensionValue(java.security.cert.X509Certificate cert,
java.lang.String oid)
throws java.io.IOException
cert - the certificate that contains the extensions to retrieve.oid - the oid of the extension to retrieve.java.io.IOException - if decoding the extension fails.public static int getProxyPathConstraint(java.security.cert.X509Certificate cert)
throws java.io.IOException,
java.security.cert.CertificateEncodingException
java.io.IOExceptionjava.security.cert.CertificateEncodingExceptionpublic static int getProxyPathConstraint(org.bouncycastle.asn1.x509.TBSCertificateStructure crt)
throws java.io.IOException
java.io.IOExceptionpublic static ProxyCertInfo getProxyCertInfo(org.bouncycastle.asn1.x509.TBSCertificateStructure crt) throws java.io.IOException
java.io.IOExceptionCopyright © 2013. All Rights Reserved.