Record Class ScepPkiMessage

java.lang.Object
java.lang.Record
zeroecho.pkix.scep.ScepPkiMessage
Record Components:
messageType - SCEP message type integer (e.g., 19=PKCSReq, 20=GetCertInitial)
transactionId - SCEP transaction identifier string
senderNonce - senderNonce octet string (exactly 16 bytes)
innerContent - decrypted inner content bytes (PKCS#10 CSR DER for PKCSReq, IssuerAndSubject DER for GetCertInitial)
requesterCert - the signing certificate carried in the outer CMS SignedData (the requester's self-signed certificate)

public record ScepPkiMessage(int messageType, String transactionId, byte[] senderNonce, byte[] innerContent, X509Certificate requesterCert) extends Record
Parsed representation of a SCEP PKIOperation message.

This immutable value contains PKCSReq or GetCertInitial plaintext extracted by ScepCodec.decryptRequest(ScepCodec.VerifiedRequest, X509Certificate, PrivateKey). Constructing the value directly does not establish authentication.

Since:
1.0
  • Constructor Details

    • ScepPkiMessage

      public ScepPkiMessage(int messageType, String transactionId, byte[] senderNonce, byte[] innerContent, X509Certificate requesterCert)
      Validates and defensively copies bounded request content.
  • Method Details

    • senderNonce

      public byte[] senderNonce()
      Copies the sender nonce.
      Returns:
      independently owned nonce
    • innerContent

      public byte[] innerContent()
      Copies the plaintext request.
      Returns:
      independently owned request
    • 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
    • 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. 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:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • messageType

      public int messageType()
      Returns the value of the messageType record component.
      Returns:
      the value of the messageType record component
    • transactionId

      public String transactionId()
      Returns the value of the transactionId record component.
      Returns:
      the value of the transactionId record component
    • requesterCert

      public X509Certificate requesterCert()
      Returns the value of the requesterCert record component.
      Returns:
      the value of the requesterCert record component