Example usage for org.bouncycastle.asn1.x509 Extension biometricInfo

List of usage examples for org.bouncycastle.asn1.x509 Extension biometricInfo

Introduction

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

Prototype

ASN1ObjectIdentifier biometricInfo

To view the source code for org.bouncycastle.asn1.x509 Extension biometricInfo.

Click Source Link

Document

BiometricInfo

Usage

From source file:org.xipki.pki.ca.qa.ExtensionsChecker.java

License:Open Source License

public static Map<ASN1ObjectIdentifier, QaExtensionValue> buildConstantExtesions(
        final ExtensionsType extensionsType) throws CertprofileException {
    if (extensionsType == null) {
        return null;
    }/*ww w . j a  va2 s .  com*/

    Map<ASN1ObjectIdentifier, QaExtensionValue> map = new HashMap<>();

    for (ExtensionType m : extensionsType.getExtension()) {
        if (m.getValue() == null || !(m.getValue().getAny() instanceof ConstantExtValue)) {
            continue;
        }

        ASN1ObjectIdentifier oid = new ASN1ObjectIdentifier(m.getType().getValue());
        if (Extension.subjectAlternativeName.equals(oid) || Extension.subjectInfoAccess.equals(oid)
                || Extension.biometricInfo.equals(oid)) {
            continue;
        }

        ConstantExtValue extConf = (ConstantExtValue) m.getValue().getAny();
        byte[] encodedValue = extConf.getValue();
        ASN1StreamParser parser = new ASN1StreamParser(encodedValue);
        try {
            parser.readObject();
        } catch (IOException ex) {
            throw new CertprofileException("could not parse the constant extension value", ex);
        }
        QaExtensionValue extension = new QaExtensionValue(m.isCritical(), encodedValue);
        map.put(oid, extension);
    }

    if (CollectionUtil.isEmpty(map)) {
        return null;
    }

    return Collections.unmodifiableMap(map);
}