Class OtpChallenge
java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.est.OtpChallenge
- All Implemented Interfaces:
org.bouncycastle.asn1.ASN1Encodable, org.bouncycastle.util.Encodable
public class OtpChallenge
extends org.bouncycastle.asn1.ASN1Object
RFC 7894 ยง3.1
otpChallenge attribute: a one-time password value conveyed as part of
a CSR request. The companion OTP generation and verification mechanisms (e.g.
RFC 4226 HOTP, RFC 6238 TOTP) are out of scope.
otpChallenge ATTRIBUTE ::= {
WITH SYNTAX DirectoryString {ub-aa-otpChallenge}
EQUALITY MATCHING RULE caseExactMatch
SINGLE VALUE TRUE
ID id-aa-otpChallenge
}
ub-aa-otpChallenge INTEGER ::= 255
Identified by PKCSObjectIdentifiers.id_aa_otpChallenge.-
Constructor Summary
ConstructorsConstructorDescriptionOtpChallenge(String value) OtpChallenge(org.bouncycastle.asn1.x500.DirectoryString value) -
Method Summary
Modifier and TypeMethodDescriptionstatic OtpChallengefromAttribute(org.bouncycastle.asn1.pkcs.Attribute attribute) Extract theotpChallengevalue carried by a PKCS#9Attribute.protected org.bouncycastle.asn1.ASN1ObjectIdentifierThe attribute-type OID for this RFC 7894 attribute.static OtpChallengegetInstance(Object obj) Return the value as a JavaString, decoded from whichever underlyingDirectoryStringencoding was used.org.bouncycastle.asn1.x500.DirectoryStringgetValue()Return the value as aDirectoryString.org.bouncycastle.asn1.ASN1Primitiveorg.bouncycastle.asn1.pkcs.AttributeWrap this value in a PKCS#9Attributecarrying the RFC 7894 OID, ready for inclusion in aCertificationRequest'sattributesset (or in a CSR-Attributes response).Methods inherited from class org.bouncycastle.asn1.ASN1Object
encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode
-
Constructor Details
-
OtpChallenge
-
OtpChallenge
public OtpChallenge(org.bouncycastle.asn1.x500.DirectoryString value)
-
-
Method Details
-
getInstance
-
fromAttribute
Extract theotpChallengevalue carried by a PKCS#9Attribute.- Throws:
IllegalArgumentException- if the attribute is notPKCSObjectIdentifiers.id_aa_otpChallengeor does not carry exactly one value.
-
getAttrType
protected org.bouncycastle.asn1.ASN1ObjectIdentifier getAttrType()The attribute-type OID for this RFC 7894 attribute. Used bytoAttribute()to wrap the value in a PKCS#9Attribute. -
getValue
public org.bouncycastle.asn1.x500.DirectoryString getValue()Return the value as aDirectoryString. -
getString
-
toAttribute
public org.bouncycastle.asn1.pkcs.Attribute toAttribute()Wrap this value in a PKCS#9Attributecarrying the RFC 7894 OID, ready for inclusion in aCertificationRequest'sattributesset (or in a CSR-Attributes response).- Returns:
- an
Attributeof the form(oid, {value}).
-
toASN1Primitive
public org.bouncycastle.asn1.ASN1Primitive toASN1Primitive()- Specified by:
toASN1Primitivein interfaceorg.bouncycastle.asn1.ASN1Encodable- Specified by:
toASN1Primitivein classorg.bouncycastle.asn1.ASN1Object
-