Record Class CertificateBinding
java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.domain.x509.CertificateBinding
- Record Components:
id- identifier of the binding.userId- identifier of the account (theusersrow).fingerprintSha256- SHA-256 fingerprint of the DER-encoded certificate, as 64 lower case hexadecimal digits.subjectDn- subject distinguished name of the certificate, kept to tell the bindings apart.createdAt- instant at which the certificate was bound.
public record CertificateBinding(UUID id, UUID userId, String fingerprintSha256, String subjectDn, Instant createdAt)
extends Record
The binding of a client certificate to an account: the certificate is recognised by the SHA-256 fingerprint of its
encoded form, never by its subject, which anyone can choose.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final InstantThe field for thecreatedAtrecord component.private static final PatternShape of a fingerprint: lower case hexadecimal digits only.static final intNumber of hexadecimal digits of a SHA-256 fingerprint.private final StringThe field for thefingerprintSha256record component.private final UUIDThe field for theidrecord component.private final StringThe field for thesubjectDnrecord component.private final UUIDThe field for theuserIdrecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecreatedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefingerprintSha256record component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of thesubjectDnrecord component.final StringtoString()Returns a string representation of this record class.userId()Returns the value of theuserIdrecord component.
-
Field Details
-
id
The field for theidrecord component. -
userId
The field for theuserIdrecord component. -
fingerprintSha256
The field for thefingerprintSha256record component. -
subjectDn
The field for thesubjectDnrecord component. -
createdAt
The field for thecreatedAtrecord component. -
FINGERPRINT_LENGTH
public static final int FINGERPRINT_LENGTHNumber of hexadecimal digits of a SHA-256 fingerprint.- See Also:
-
FINGERPRINT
Shape of a fingerprint: lower case hexadecimal digits only.
-
-
Constructor Details
-
CertificateBinding
public CertificateBinding(UUID id, UUID userId, String fingerprintSha256, String subjectDn, Instant createdAt) Validates the binding.- Throws:
IllegalArgumentException- if the id, the account or the creation instant is missing, the fingerprint is not 64 lower case hexadecimal digits, or the subject is blank.
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
userId
Returns the value of theuserIdrecord component.- Returns:
- the value of the
userIdrecord component
-
fingerprintSha256
Returns the value of thefingerprintSha256record component.- Returns:
- the value of the
fingerprintSha256record component
-
subjectDn
Returns the value of thesubjectDnrecord component.- Returns:
- the value of the
subjectDnrecord component
-
createdAt
Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-