public class CertificateExtensions extends Object
CertificateExtensions provides extension methods for X509Certificate
objects.| Constructor and Description |
|---|
CertificateExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getCountry(X509Certificate certificate)
Gets the country value of the given
X509Certificate. |
static String |
getFingerprint(X509Certificate certificate,
HashAlgorithm hashAlgorithm)
Gets the fingerprint from the given
X509Certificate and the given algorithm. |
static String |
getFirstValueOf(X509Certificate certificate,
org.bouncycastle.asn1.ASN1ObjectIdentifier style)
Gets the first value of the given
X509Certificate and the given
ASN1ObjectIdentifier. |
static String |
getIssuedBy(X509Certificate certificate)
Gets the issued by value of the given
X509Certificate. |
static String |
getIssuedTo(X509Certificate certificate)
Gets the issued to value of the given
X509Certificate. |
static String |
getLocality(X509Certificate certificate)
Gets the locality value of the given
X509Certificate. |
static String |
getOrganization(X509Certificate certificate)
Gets the organization value of the given
X509Certificate. |
static String |
getSignatureAlgorithm(X509Certificate certificate)
Gets the signature algorithm.
|
static Date |
getValidFrom(X509Certificate certificate)
Gets the valid from of the given
X509Certificate. |
static Date |
getValidUntil(X509Certificate certificate)
Gets the valid until of the given
X509Certificate. |
public static String getIssuedTo(X509Certificate certificate)
X509Certificate.certificate - the certificateX509Certificate.public static String getIssuedBy(X509Certificate certificate)
X509Certificate.certificate - the certificateX509Certificate.public static String getOrganization(X509Certificate certificate) throws CertificateEncodingException
X509Certificate.certificate - the certificateCertificateEncodingException - is thrown if an encoding error occurs.public static String getLocality(X509Certificate certificate) throws CertificateEncodingException
X509Certificate.certificate - the certificateCertificateEncodingException - is thrown if an encoding error occurs.public static String getCountry(X509Certificate certificate) throws CertificateEncodingException
X509Certificate.certificate - the certificateCertificateEncodingException - is thrown if an encoding error occurs.public static String getFirstValueOf(X509Certificate certificate, org.bouncycastle.asn1.ASN1ObjectIdentifier style) throws CertificateEncodingException
X509Certificate and the given
ASN1ObjectIdentifier.certificate - the certificatestyle - the styleX509Certificate and the given
ASN1ObjectIdentifier or an empty String if the ASN1ObjectIdentifier
does not exists.CertificateEncodingException - is thrown if an encoding error occurs.public static Date getValidFrom(X509Certificate certificate)
X509Certificate.certificate - the certificateDate that represents from when the given X509Certificate object
is valid from.public static Date getValidUntil(X509Certificate certificate)
X509Certificate.certificate - the certificateDate that represents from when the given X509Certificate object
is valid until.public static String getFingerprint(X509Certificate certificate, HashAlgorithm hashAlgorithm) throws CertificateEncodingException, NoSuchAlgorithmException
X509Certificate and the given algorithm.certificate - the certificatehashAlgorithm - the hash algorithmCertificateEncodingException - is thrown if an encoding error occurs.NoSuchAlgorithmException - is thrown if instantiation of the MessageDigest object fails.public static String getSignatureAlgorithm(X509Certificate certificate)
certificate - the certificateCopyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.