Search in sources :

Example 1 with Asn1Integer

use of org.apache.kerby.asn1.type.Asn1Integer in project webauthn4j by webauthn4j.

the class KeyDescriptionValidator method getIntegerFromAsn1.

@Nullable
private BigInteger getIntegerFromAsn1(Asn1ParseResult asn1Value) throws IOException {
    if (asn1Value == null) {
        return null;
    }
    if (!asn1Value.isPrimitive()) {
        throw new BadAttestationStatementException(String.format("ASN1Integer is expected. Found %s instead.", asn1Value.getClass().getName()));
    }
    Asn1Integer value = new Asn1Integer();
    value.decode(asn1Value);
    return value.getValue();
}
Also used : BadAttestationStatementException(com.webauthn4j.validator.exception.BadAttestationStatementException) Asn1Integer(org.apache.kerby.asn1.type.Asn1Integer) Nullable(org.checkerframework.checker.nullness.qual.Nullable)

Aggregations

BadAttestationStatementException (com.webauthn4j.validator.exception.BadAttestationStatementException)1 Asn1Integer (org.apache.kerby.asn1.type.Asn1Integer)1 Nullable (org.checkerframework.checker.nullness.qual.Nullable)1