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

    Constructors
    Constructor
    Description
     
    OtpChallenge(org.bouncycastle.asn1.x500.DirectoryString value)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    fromAttribute(org.bouncycastle.asn1.pkcs.Attribute attribute)
    Extract the otpChallenge value carried by a PKCS#9 Attribute.
    protected org.bouncycastle.asn1.ASN1ObjectIdentifier
    The attribute-type OID for this RFC 7894 attribute.
     
    Return the value as a Java String, decoded from whichever underlying DirectoryString encoding was used.
    org.bouncycastle.asn1.x500.DirectoryString
    Return the value as a DirectoryString.
    org.bouncycastle.asn1.ASN1Primitive
     
    org.bouncycastle.asn1.pkcs.Attribute
    Wrap this value in a PKCS#9 Attribute carrying the RFC 7894 OID, ready for inclusion in a CertificationRequest's attributes set (or in a CSR-Attributes response).

    Methods inherited from class org.bouncycastle.asn1.ASN1Object

    encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OtpChallenge

      public OtpChallenge(String value)
    • OtpChallenge

      public OtpChallenge(org.bouncycastle.asn1.x500.DirectoryString value)
  • Method Details

    • getInstance

      public static OtpChallenge getInstance(Object obj)
    • fromAttribute

      public static OtpChallenge fromAttribute(org.bouncycastle.asn1.pkcs.Attribute attribute)
      Extract the otpChallenge value carried by a PKCS#9 Attribute.
      Throws:
      IllegalArgumentException - if the attribute is not PKCSObjectIdentifiers.id_aa_otpChallenge or does not carry exactly one value.
    • getAttrType

      protected org.bouncycastle.asn1.ASN1ObjectIdentifier getAttrType()
      The attribute-type OID for this RFC 7894 attribute. Used by toAttribute() to wrap the value in a PKCS#9 Attribute.
    • getValue

      public org.bouncycastle.asn1.x500.DirectoryString getValue()
      Return the value as a DirectoryString.
    • getString

      public String getString()
      Return the value as a Java String, decoded from whichever underlying DirectoryString encoding was used.
    • toAttribute

      public org.bouncycastle.asn1.pkcs.Attribute toAttribute()
      Wrap this value in a PKCS#9 Attribute carrying the RFC 7894 OID, ready for inclusion in a CertificationRequest's attributes set (or in a CSR-Attributes response).
      Returns:
      an Attribute of the form (oid, {value}).
    • toASN1Primitive

      public org.bouncycastle.asn1.ASN1Primitive toASN1Primitive()
      Specified by:
      toASN1Primitive in interface org.bouncycastle.asn1.ASN1Encodable
      Specified by:
      toASN1Primitive in class org.bouncycastle.asn1.ASN1Object