Class CertificateExtension

java.lang.Object
com.mulesoft.connectors.mcp.api.certificate.CertificateExtension
All Implemented Interfaces:
Serializable

public class CertificateExtension extends Object implements Serializable
A custom Data Transfer Object (DTO) to replace the certificate extension class from the X509Extension package.

This class encapsulates details of a certificate extension, including its OID, value, criticality, and an optional subject alternative name. It implements Serializable to allow its instances to be serialized.

See Also:
  • Constructor Details

    • CertificateExtension

      public CertificateExtension(String oid, boolean criticality, byte[] value, String subjectAlternativeName)
      Constructs a new CertificateExtension instance with the specified attributes.
      Parameters:
      oid - the OID of the extension
      criticality - the criticality of the extension
      value - the value of the extension
      subjectAlternativeName - the subject alternative name (if applicable)
  • Method Details

    • getOid

      public String getOid()
      Returns the OID of the extension.
      Returns:
      the OID of the extension
    • getValue

      public byte[] getValue()
      Returns the value of the extension.
      Returns:
      the value of the extension
    • getCriticality

      public boolean getCriticality()
      Returns the criticality of the extension.
      Returns:
      the criticality of the extension
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • formatHexAndAscii

      public static String formatHexAndAscii(byte[] value)
      Formats the given byte array into a hex and ASCII string representation.
      Parameters:
      value - the byte array to format
      Returns:
      a formatted string representation of the byte array