Record Class CsrAttribute

java.lang.Object
java.lang.Record
zeroecho.pkix.csr.CsrAttribute
Record Components:
oid - the attribute type OID
derValues - the exact DER of each attribute value

public record CsrAttribute(String oid, List<byte[]> derValues) extends Record
A PKCS#10 attribute: an OID and one or more DER-encoded values.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CsrAttribute(String oid, List<byte[]> derValues)
    Canonicalizing constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Decodes one standard PKCS#9 challengePassword DirectoryString, bounded to 255 characters.
    List<byte[]>
    Returns the encoded attribute values without exposing their internal arrays.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    oid()
    Returns the value of the oid record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • CsrAttribute

      public CsrAttribute(String oid, List<byte[]> derValues)
      Canonicalizing constructor.
  • Method Details

    • derValues

      public List<byte[]> derValues()
      Returns the encoded attribute values without exposing their internal arrays.
      Returns:
      immutable list whose encoded values are defensive copies
    • challengePassword

      public String challengePassword()
      Decodes one standard PKCS#9 challengePassword DirectoryString, bounded to 255 characters. This validates syntax only; the returned secret must not enter diagnostics or ordinary request projections.
      Returns:
      challenge text
      Throws:
      IllegalArgumentException - for a different OID, multiplicity, type or size
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • oid

      public String oid()
      Returns the value of the oid record component.
      Returns:
      the value of the oid record component