Example usage for org.bouncycastle.asn1.x509 NameConstraints NameConstraints

List of usage examples for org.bouncycastle.asn1.x509 NameConstraints NameConstraints

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.x509 NameConstraints NameConstraints.

Prototype

private NameConstraints(ASN1Sequence seq) 

Source Link

Usage

From source file:org.qipki.crypto.x509.X509ExtensionsReaderImpl.java

License:Open Source License

@Override
public NameConstraints getNameConstraints(X509Certificate cert) {
    try {/*from  w  ww. j  a v  a2s  .c  o m*/
        byte[] value = cert.getExtensionValue(X509Extensions.NameConstraints.getId());
        if (value == null) {
            return null;
        }
        return new NameConstraints((ASN1Sequence) ASN1Object.fromByteArray(value));
    } catch (IOException ex) {
        throw new CryptoFailure("Unable to extract NameConstraints from X509Certificate extensions", ex);
    }
}