Record Class CertificateProfileDefinition

java.lang.Object
java.lang.Record
zeroecho.pki.api.profile.CertificateProfileDefinition
Record Components:
certificateType - kind of certificate governed by the profile
profileId - stable profile identifier
profileVersion - positive configuration version
formatId - framework/format identifier
displayName - human-readable profile name
maximumValidity - positive maximum validity
approvalRequirement - multi-party approval requirement for issuance
subjectPolicy - complete subject policy
certificatePolicy - closed certificate-specific policy variant
algorithmBindingPolicy - explicit X.509 representation policy
confirmationPolicy - exact leaf confirmation policy; absent for CA profiles
hybridMode - hybrid certificate mode; HybridCertificateMode.None for standard profiles

public record CertificateProfileDefinition(CertificateProfileKind certificateType, String profileId, long profileVersion, FormatId formatId, String displayName, Duration maximumValidity, IssuanceApprovalRequirement approvalRequirement, SubjectPolicy subjectPolicy, CertificatePolicy certificatePolicy, X509AlgorithmBindingPolicy algorithmBindingPolicy, Optional<CredentialConfirmationPolicy> confirmationPolicy, HybridCertificateMode hybridMode) extends Record
Immutable, versioned certificate-profile configuration.

Schema version 4 adds an exact immutable confirmation policy to end-entity profiles in the closed pre-release profile shape. Schema version 5 adds an explicit IssuanceApprovalRequirement that selects the multi-party approval control applied to issuance. The hybridMode component selects the hybrid certificate variant; it is optional in the codec and defaults to HybridCertificateMode.None. The certificate kind and its closed policy variant are immutable across the definition. Runtime activation state is deliberately excluded.

  • Field Details

    • SCHEMA_VERSION

      public static final int SCHEMA_VERSION
      Current certificate-profile document schema version.
      See Also:
  • Constructor Details

    • CertificateProfileDefinition

      public CertificateProfileDefinition(CertificateProfileKind certificateType, String profileId, long profileVersion, FormatId formatId, String displayName, Duration maximumValidity, SubjectPolicy subjectPolicy, CertificatePolicy certificatePolicy)
      Creates a standard-only CA profile definition without an issuance approval requirement.
      Parameters:
      certificateType - CA certificate kind governed by the profile
      profileId - nonblank stable profile identifier
      profileVersion - positive imported profile version
      formatId - credential framework and encoding format
      displayName - nonblank human-readable profile name
      maximumValidity - positive maximum credential validity
      subjectPolicy - complete CA subject policy
      certificatePolicy - closed CA certificate policy
    • CertificateProfileDefinition

      public CertificateProfileDefinition(CertificateProfileKind certificateType, String profileId, long profileVersion, FormatId formatId, String displayName, Duration maximumValidity, SubjectPolicy subjectPolicy, CertificatePolicy certificatePolicy, X509AlgorithmBindingPolicy algorithmBindingPolicy)
      Creates a profile without a leaf confirmation policy; valid only for CA profiles.
      Parameters:
      certificateType - CA certificate kind governed by the profile
      profileId - nonblank stable profile identifier
      profileVersion - positive imported profile version
      formatId - credential framework and encoding format
      displayName - nonblank human-readable profile name
      maximumValidity - positive maximum credential validity
      subjectPolicy - complete CA subject policy
      certificatePolicy - closed CA certificate policy
      algorithmBindingPolicy - explicit X.509 representation policy
    • CertificateProfileDefinition

      public CertificateProfileDefinition(CertificateProfileKind certificateType, String profileId, long profileVersion, FormatId formatId, String displayName, Duration maximumValidity, SubjectPolicy subjectPolicy, CertificatePolicy certificatePolicy, X509AlgorithmBindingPolicy algorithmBindingPolicy, Optional<CredentialConfirmationPolicy> confirmationPolicy)
      Creates a profile with the pre-approval-requirement component order, defaulting issuance approval to IssuanceApprovalRequirement.NONE. Retained so existing programmatic callers stay source-compatible across the schema-5 field addition.
      Parameters:
      certificateType - certificate kind governed by the profile
      profileId - nonblank stable profile identifier
      profileVersion - positive imported profile version
      formatId - credential framework and encoding format
      displayName - nonblank human-readable profile name
      maximumValidity - positive maximum credential validity
      subjectPolicy - complete subject policy
      certificatePolicy - closed certificate-specific policy
      algorithmBindingPolicy - explicit X.509 representation policy
      confirmationPolicy - exact leaf confirmation policy; absent for CA profiles
    • CertificateProfileDefinition

      public CertificateProfileDefinition(CertificateProfileKind certificateType, String profileId, long profileVersion, FormatId formatId, String displayName, Duration maximumValidity, IssuanceApprovalRequirement approvalRequirement, SubjectPolicy subjectPolicy, CertificatePolicy certificatePolicy, X509AlgorithmBindingPolicy algorithmBindingPolicy, Optional<CredentialConfirmationPolicy> confirmationPolicy)
      Creates a profile with full components except hybridMode, defaulting it to HybridCertificateMode.None. Retained so existing programmatic callers that use the approval-requirement order stay source-compatible.
      Parameters:
      certificateType - certificate kind governed by the profile
      profileId - nonblank stable profile identifier
      profileVersion - positive imported profile version
      formatId - credential framework and encoding format
      displayName - nonblank human-readable profile name
      maximumValidity - positive maximum credential validity
      approvalRequirement - multi-party approval requirement for issuance
      subjectPolicy - complete subject policy
      certificatePolicy - closed certificate-specific policy
      algorithmBindingPolicy - explicit X.509 representation policy
      confirmationPolicy - exact leaf confirmation policy; absent for CA profiles
    • CertificateProfileDefinition

      public CertificateProfileDefinition(CertificateProfileKind certificateType, String profileId, long profileVersion, FormatId formatId, String displayName, Duration maximumValidity, IssuanceApprovalRequirement approvalRequirement, SubjectPolicy subjectPolicy, CertificatePolicy certificatePolicy, X509AlgorithmBindingPolicy algorithmBindingPolicy, Optional<CredentialConfirmationPolicy> confirmationPolicy, HybridCertificateMode hybridMode)
      Creates a certificate-profile definition.
      Throws:
      IllegalArgumentException - if a required value is absent or the profile version is not positive
  • Method Details

    • leafPolicy

      public LeafCertificatePolicy leafPolicy()
      Returns the end-entity policy.
      Returns:
      leaf policy
      Throws:
      IllegalStateException - if this is a CA profile
    • caPolicy

      public CaCertificatePolicy caPolicy()
      Returns the CA policy.
      Returns:
      CA policy
      Throws:
      IllegalStateException - if this is an end-entity profile
    • requireSupportedIssuance

      public void requireSupportedIssuance()
      Requires a currently supported certificate lifecycle before import, activation or issuance. Historical definitions remain representable for archival reads and backup even when their lifecycle is unsupported.
      Throws:
      IllegalArgumentException - if the requested hybrid lifecycle is unsupported
    • 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. 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.
    • certificateType

      public CertificateProfileKind certificateType()
      Returns the value of the certificateType record component.
      Returns:
      the value of the certificateType record component
    • profileId

      public String profileId()
      Returns the value of the profileId record component.
      Returns:
      the value of the profileId record component
    • profileVersion

      public long profileVersion()
      Returns the value of the profileVersion record component.
      Returns:
      the value of the profileVersion record component
    • formatId

      public FormatId formatId()
      Returns the value of the formatId record component.
      Returns:
      the value of the formatId record component
    • displayName

      public String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • maximumValidity

      public Duration maximumValidity()
      Returns the value of the maximumValidity record component.
      Returns:
      the value of the maximumValidity record component
    • approvalRequirement

      public IssuanceApprovalRequirement approvalRequirement()
      Returns the value of the approvalRequirement record component.
      Returns:
      the value of the approvalRequirement record component
    • subjectPolicy

      public SubjectPolicy subjectPolicy()
      Returns the value of the subjectPolicy record component.
      Returns:
      the value of the subjectPolicy record component
    • certificatePolicy

      public CertificatePolicy certificatePolicy()
      Returns the value of the certificatePolicy record component.
      Returns:
      the value of the certificatePolicy record component
    • algorithmBindingPolicy

      public X509AlgorithmBindingPolicy algorithmBindingPolicy()
      Returns the value of the algorithmBindingPolicy record component.
      Returns:
      the value of the algorithmBindingPolicy record component
    • confirmationPolicy

      public Optional<CredentialConfirmationPolicy> confirmationPolicy()
      Returns the value of the confirmationPolicy record component.
      Returns:
      the value of the confirmationPolicy record component
    • hybridMode

      public HybridCertificateMode hybridMode()
      Returns the value of the hybridMode record component.
      Returns:
      the value of the hybridMode record component