@License(copyright="Copyright (c) 2012-2014 Andrea Funto\', Svetlin Nakov") public final class Certificates extends CryptoService
| Modifier and Type | Method and Description |
|---|---|
static org.bouncycastle.asn1.ASN1Primitive |
getExtensionValue(X509Certificate certificate,
String oid) |
static boolean |
hasCriticalExtension(X509Certificate certificate,
String oid)
Checks if the given certificate has the given OID among its critical
extensions.
|
static boolean |
isNonRepudiationX509Certificate(X509Certificate certificate)
Checks if the given certificate has all the necessary extensions to be used
as a signing certificate (non repudiation).
|
static boolean |
isSelfSigned(X509Certificate certificate)
Checks whether given X.509 certificate is self-signed.
|
static boolean |
isSignatureX509Certificate(X509Certificate certificate)
Checks if the given certificate has all the necessary extensions to be used
as a signing certificate.
|
static CertStore |
makeCertificateStore(Certificate certificate) |
static org.bouncycastle.asn1.ess.ESSCertID |
makeESSCertIdV1(X509Certificate x509certificate,
org.bouncycastle.asn1.x509.IssuerSerial issuerSerial,
DigestAlgorithm digestAlgorithm) |
static org.bouncycastle.asn1.ess.ESSCertIDv2[] |
makeESSCertIdV2(X509Certificate x509certificate,
org.bouncycastle.asn1.x509.IssuerSerial issuerSerial,
DigestAlgorithm digestAlgorithm) |
static org.bouncycastle.asn1.x509.IssuerSerial |
makeIssuerSerial(X509Certificate x509certificate)
Creates an IssuerSerial object for the given certificate.
|
static PKIXCertPathBuilderResult |
verifyCertificate(X509Certificate certificate,
Collection<X509Certificate> additionalCerts)
Attempts to build a certification chain for given certificate and to
verify it.
|
static boolean |
writeToFile(Certificate certificate,
String filename) |
public static boolean isSignatureX509Certificate(X509Certificate certificate)
certificate - the certificate to test.public static boolean isNonRepudiationX509Certificate(X509Certificate certificate)
certificate - the certificate to test.public static boolean isSelfSigned(X509Certificate certificate) throws CertificateException, NoSuchAlgorithmException, NoSuchProviderException
public static boolean hasCriticalExtension(X509Certificate certificate, String oid)
certificate - the certificate on which to look for the critical extensio OID.oid - the critical extension OID to lookup.public static PKIXCertPathBuilderResult verifyCertificate(X509Certificate certificate, Collection<X509Certificate> additionalCerts) throws CertificateVerificationException
certificate - certificate for validation.additionalCerts - set of trusted root CA certificates that will be used as "trust anchors"
and intermediate CA certificates that will be used as part of the
certification chain. All self-signed certificates are considered to be
trusted root CA certificates. All the rest are considered to be
intermediate CA certificates.CertificateVerificationException - if the certification is not successful (e.g. certification path cannot
be built or some certificate in the chain is expired or CRL checks are
failed).public static org.bouncycastle.asn1.ASN1Primitive getExtensionValue(X509Certificate certificate, String oid) throws IOException
certificate - the certificate in which to look to the extension value.oid - the Object Identifier of the extension.ASN1Primitive object.IOExceptionpublic static org.bouncycastle.asn1.x509.IssuerSerial makeIssuerSerial(X509Certificate x509certificate) throws CertificateEncodingException, IOException
x509certificate - the certificate whose issuer serial must be retrieved.CertificateEncodingExceptionIOExceptionpublic static org.bouncycastle.asn1.ess.ESSCertID makeESSCertIdV1(X509Certificate x509certificate, org.bouncycastle.asn1.x509.IssuerSerial issuerSerial, DigestAlgorithm digestAlgorithm) throws NoSuchAlgorithmException, CertificateEncodingException
public static org.bouncycastle.asn1.ess.ESSCertIDv2[] makeESSCertIdV2(X509Certificate x509certificate, org.bouncycastle.asn1.x509.IssuerSerial issuerSerial, DigestAlgorithm digestAlgorithm) throws NoSuchAlgorithmException, CertificateEncodingException
public static CertStore makeCertificateStore(Certificate certificate) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException
public static boolean writeToFile(Certificate certificate, String filename)
Copyright © 2012-2014 Andrea Funtò. See here for terms and conditions.