Class DefaultCertificateAttributeIdentifier

java.lang.Object
se.swedenconnect.signservice.certificate.impl.DefaultCertificateAttributeIdentifier
All Implemented Interfaces:
Serializable, CertificateAttributeIdentifier
Direct Known Subclasses:
DefaultRequestedCertificateAttribute

public class DefaultCertificateAttributeIdentifier extends Object implements CertificateAttributeIdentifier
Default implementation of the CertificateAttributeIdentifier interface.
See Also:
  • Constructor Details

    • DefaultCertificateAttributeIdentifier

      public DefaultCertificateAttributeIdentifier(@Nonnull CertificateAttributeType type, @Nonnull String identifier)
      Constructor.
      Parameters:
      type - the type of attribute
      identifier - the attribute identifier (name)
    • DefaultCertificateAttributeIdentifier

      public DefaultCertificateAttributeIdentifier(@Nonnull CertificateAttributeType type, @Nonnull String identifier, @Nullable String friendlyName)
      Constructor.
      Parameters:
      type - the type of attribute
      identifier - the attribute identifier (name)
      friendlyName - the attribute friendly name (optional)
  • Method Details

    • getType

      @Nonnull public CertificateAttributeType getType()
      Gets the type of the attribute. With type, we mean "where in the certificate will the attribute be placed".
      Specified by:
      getType in interface CertificateAttributeIdentifier
      Returns:
      the type
    • getIdentifier

      @Nonnull public String getIdentifier()
      Gets the identifier (name) of the certificate attribute.

      This identifier is a reference to the certificate attribute or name type where the requester wants to store this attribute value. The information in this attribute depends on the CertificateAttributeType value. If the type is "rdn" or "sda", then this attribute MUST contain a string representation of an object identifier (OID). If the type is "san" (Subject Alternative Name) and the target name is a GeneralName, then this identifier MUST hold a string representation of the tag value of the target GeneralName type, e.g. "1" for rfc822Name (e-mail), "2" for dNSName and so on.

      Representation of an OID as a string in this attribute MUST consist of a sequence of integers delimited by a dot. This string MUST not contain white space or line breaks. Example: "2.5.4.32".

      Specified by:
      getIdentifier in interface CertificateAttributeIdentifier
      Returns:
      the attribute identifier
    • getFriendlyName

      @Nullable public String getFriendlyName()
      Gets the "friendly" name of the attribute, i.e., a human readable representation.
      Specified by:
      getFriendlyName in interface CertificateAttributeIdentifier
      Returns:
      the friendly name, or null if none has been provided
    • hashCode

      @GeneratedMethod public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      @GeneratedMethod public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object