CordaX500Name
Keywords: net.corda.core.identity.CordaX500Name class
Date: 2023-09-18

net.corda.core.identity

## Class CordaX500Name

- net.corda.core.identity.CordaX500Name

-     public class CordaX500Name

  X.500 distinguished name data type customised to how Corda uses names. This restricts the attributes to those Corda supports, and requires that organisation, locality and country attributes are specified. See also RFC 4519 for the underlying attribute type definitions

- - ### Field Detail

    - #### LENGTH_COUNTRY

          public static int LENGTH_COUNTRY

      Deprecated.
      See Also:
        Constant Field Values

    - #### MAX_LENGTH_ORGANISATION

          public static int MAX_LENGTH_ORGANISATION

      See Also:
        Constant Field Values

    - #### MAX_LENGTH_LOCALITY

          public static int MAX_LENGTH_LOCALITY

      See Also:
        Constant Field Values

    - #### MAX_LENGTH_STATE

          public static int MAX_LENGTH_STATE

      See Also:
        Constant Field Values

    - #### MAX_LENGTH_ORGANISATION_UNIT

          public static int MAX_LENGTH_ORGANISATION_UNIT

      See Also:
        Constant Field Values

    - #### MAX_LENGTH_COMMON_NAME

          public static int MAX_LENGTH_COMMON_NAME

      See Also:
        Constant Field Values

    - #### Companion

          public static net.corda.core.identity.CordaX500Name.Companion Companion

  - ### Constructor Detail

    - #### CordaX500Name

          public CordaX500Name(@Nullable
                               java.lang.String commonName,
                               @Nullable
                               java.lang.String organisationUnit,
                               @NotNull
                               java.lang.String organisation,
                               @NotNull
                               java.lang.String locality,
                               @Nullable
                               java.lang.String state,
                               @NotNull
                               java.lang.String country)

      X.500 distinguished name data type customised to how Corda uses names. This restricts the attributes to those Corda supports, and requires that organisation, locality and country attributes are specified. See also RFC 4519 for the underlying attribute type definitions

      Parameters:
        `commonName` - optional name by the which the entity is usually known. Used only for services (fororganisations, the organisation property is the name). Corresponds to the "CN" attribute type.
        `organisationUnit` - optional name of a unit within the organisation. Corresponds to the "OU" attribute type.
        `organisation` - name of the organisation. Corresponds to the "O" attribute type.
        `locality` - locality of the organisation, typically nearest major city. For distributed services this would bewhere one of the organisations is based. Corresponds to the "L" attribute type.
        `state` - the full name of the state or province the organisation is based in. Corresponds to the "ST"attribute type.
        `country` - country the organisation is in, as an ISO 3166-1 2-letter country code. Corresponds to the "C"attribute type.

    - #### CordaX500Name

          public CordaX500Name(@NotNull
                               java.lang.String commonName,
                               @NotNull
                               java.lang.String organisation,
                               @NotNull
                               java.lang.String locality,
                               @NotNull
                               java.lang.String country)

    - #### CordaX500Name

          public CordaX500Name(@NotNull
                               java.lang.String organisation,
                               @NotNull
                               java.lang.String locality,
                               @NotNull
                               java.lang.String country)

      Parameters:
        `organisation` - name of the organisation.
        `locality` - locality of the organisation, typically nearest major city.
        `country` - country the organisation is in, as an ISO 3166-1 2-letter country code.

  - ### Method Detail

    - #### getX500Principal

          @NotNull
          public javax.security.auth.x500.X500Principal getX500Principal()

      Return the X500Principal equivalent of this name.

      See Also:
        X500Principal

    - #### toString

          @NotNull
          public java.lang.String toString()

    - #### getCommonName

          @Nullable
          public java.lang.String getCommonName()

      optional name by the which the entity is usually known.

      Used only for services (fororganisations, the organisation property is the name). Corresponds to the "CN" attribute type.

    - #### getOrganisationUnit

          @Nullable
          public java.lang.String getOrganisationUnit()

      optional name of a unit within the

      organisation. Corresponds to the "OU" attribute type.

    - #### getOrganisation

          @NotNull
          public java.lang.String getOrganisation()

      name of the organisation.

      Corresponds to the "O" attribute type.

    - #### getLocality

          @NotNull
          public java.lang.String getLocality()

      locality of the organisation,

      typically nearest major city. For distributed services this would bewhere one of the organisations is based. Corresponds to the "L" attribute type.

    - #### getState

          @Nullable
          public java.lang.String getState()

      the full name of the state or province the organisation is based in.

      Corresponds to the "ST"attribute type.

    - #### getCountry

          @NotNull
          public java.lang.String getCountry()

      country the organisation is in,

      as an ISO 3166-1 2-letter country code. Corresponds to the "C"attribute type.

    - #### component1

          @Nullable
          public java.lang.String component1()

      optional name by the which the entity is usually known.

      Used only for services (fororganisations, the organisation property is the name). Corresponds to the "CN" attribute type.

    - #### component2

          @Nullable
          public java.lang.String component2()

      optional name of a unit within the

      organisation. Corresponds to the "OU" attribute type.

    - #### component3

          @NotNull
          public java.lang.String component3()

      name of the organisation.

      Corresponds to the "O" attribute type.

    - #### component4

          @NotNull
          public java.lang.String component4()

      locality of the organisation,

      typically nearest major city. For distributed services this would bewhere one of the organisations is based. Corresponds to the "L" attribute type.

    - #### component5

          @Nullable
          public java.lang.String component5()

      the full name of the state or province the organisation is based in.

      Corresponds to the "ST"attribute type.

    - #### component6

          @NotNull
          public java.lang.String component6()

      country the organisation is in,

      as an ISO 3166-1 2-letter country code. Corresponds to the "C"attribute type.

    - #### copy

          @NotNull
          public CordaX500Name copy(@Nullable
                                             java.lang.String commonName,
                                             @Nullable
                                             java.lang.String organisationUnit,
                                             @NotNull
                                             java.lang.String organisation,
                                             @NotNull
                                             java.lang.String locality,
                                             @Nullable
                                             java.lang.String state,
                                             @NotNull
                                             java.lang.String country)

      X.500 distinguished name data type customised to how Corda uses names. This restricts the attributes to those Corda supports, and requires that organisation, locality and country attributes are specified. See also RFC 4519 for the underlying attribute type definitions

    - #### hashCode

          public int hashCode()

      X.500 distinguished name data type customised to how Corda uses names. This restricts the attributes to those Corda supports, and requires that organisation, locality and country attributes are specified. See also RFC 4519 for the underlying attribute type definitions

    - #### equals

          public boolean equals(@Nullable
                                java.lang.Object p)

      X.500 distinguished name data type customised to how Corda uses names. This restricts the attributes to those Corda supports, and requires that organisation, locality and country attributes are specified. See also RFC 4519 for the underlying attribute type definitions

    - #### build

          @JvmStatic
           @NotNull
          public static CordaX500Name build(@NotNull
                                                                 javax.security.auth.x500.X500Principal principal)

    - #### parse

          @JvmStatic
           @NotNull
          public static CordaX500Name parse(@NotNull
                                                                 java.lang.String name)