Record Class CertificateExtension

java.lang.Object
java.lang.Record
zeroecho.pkix.CertificateExtension
Record Components:
oid - dotted-decimal extension OID
critical - whether the extension is marked critical
derValue - exact DER of the extension value (the contents of the extnValue OCTET STRING, not the OCTET STRING wrapper)

public record CertificateExtension(String oid, boolean critical, byte[] derValue) extends Record
A generic X.509 v3 extension (RFC 5280, 4.1): an OID, a criticality flag, and the exact DER of the extnValue OCTET STRING contents.

High-level typed extensions (key usage, extended key usage, basic constraints, subject alternative names, key identifiers) are expressed through the builder's dedicated methods; this generic form carries any other extension and is what a parsed request exposes for extensions the API does not model explicitly.

  • Constructor Summary

    Constructors
    Constructor
    Description
    CertificateExtension(String oid, boolean critical, byte[] derValue)
    Canonicalizing constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the critical record component.
    byte[]
    Returns the encoded extension value without exposing the record's internal array.
    boolean
    equals(Object other)
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this object.
    oid()
    Returns the value of the oid record component.
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • CertificateExtension

      public CertificateExtension(String oid, boolean critical, byte[] derValue)
      Canonicalizing constructor.
  • Method Details

    • derValue

      public byte[] derValue()
      Returns the encoded extension value without exposing the record's internal array.
      Returns:
      a defensive copy of the extension value DER
    • equals

      public boolean equals(Object other)
      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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      other - the object with which to compare
      Returns:
      true if this object is the same as the other argument; false otherwise.
    • hashCode

      public 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
    • toString

      public 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
    • oid

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

      public boolean critical()
      Returns the value of the critical record component.
      Returns:
      the value of the critical record component