be.fgov.ehealth.etee.crypto.policies

## Class SigningCredential

- java.lang.Object
- - be.fgov.ehealth.etee.crypto.policies.SigningCredential

-     public final class SigningCredential
      extends java.lang.Object

  A signing credential consists of a `PrivateKey` and a chain of certificates.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SigningCredential` | `create(java.util.List<java.security.cert.X509Certificate> certificateChain)` Create a new `SigningCredential` with a certificate(chain) to verify if messages are signed by an expected signer.
    `static SigningCredential` | `create(java.security.PrivateKey privateKey, java.util.List<java.security.cert.X509Certificate> certificateChain)` Create a new `SigningCredential` with a `PrivateKey` and a list of certificates to sign messages with a certified public key.
    `static SigningCredential` | `create(java.security.PrivateKey privateKey, java.lang.String subjectKeyIdentifier)` Create a new `SigningCredential` with a `PrivateKey` and a subject's key id to sign messages with a registered public key.
    `static SigningCredential` | `create(java.security.PrivateKey privateKey, java.security.cert.X509Certificate... certificateChain)` Create a new `SigningCredential` with a `PrivateKey` and a dynamic list of certificates.
    `static SigningCredential` | `create(java.lang.String subjectKeyIdentifier, java.security.PublicKey publicKey)` Create a new `SigningCredential` with a key id and registered public key to validate signed messages.
    `static SigningCredential` | `create(java.security.cert.X509Certificate... certificateChain)` Create a new `SigningCredential` with a certificate(chain) to verify if messages are signed by an expected signer.
    `boolean` | `equals(java.lang.Object obj)`
    `java.util.List<java.security.cert.X509Certificate>` | `getCertificateChain()`
    `java.security.PrivateKey` | `getPrivateKey()`
    `java.security.PublicKey` | `getPublicKey()`
    `java.lang.String` | `getSubjectKeyIdentifier()`
    `int` | `hashCode()`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### create

          public static SigningCredential create(java.util.List<java.security.cert.X509Certificate> certificateChain)

      Create a new `SigningCredential` with a certificate(chain) to verify if messages are signed by an expected signer.
      Parameters:
        `certificateChain` - A chain of trusted certificates, used for trust of the Certificate Authority.
      Returns:
        A new SigningCredential

    - #### create

          public static SigningCredential create(java.security.cert.X509Certificate... certificateChain)

      Create a new `SigningCredential` with a certificate(chain) to verify if messages are signed by an expected signer.
      Parameters:
        `certificateChain` - A chain of trusted certificates, used for trust of the Certificate Authority.
      Returns:
        A new SigningCredential

    - #### create

          public static SigningCredential create(java.security.PrivateKey privateKey,
                                                 java.security.cert.X509Certificate... certificateChain)

      Create a new `SigningCredential` with a `PrivateKey` and a dynamic list of certificates.
      Parameters:
        `privateKey` - A private key to sign the message.
        `certificateChain` - A chain of trusted certificates.
      Returns:
        A new SigningCredential

    - #### create

          public static SigningCredential create(java.security.PrivateKey privateKey,
                                                 java.util.List<java.security.cert.X509Certificate> certificateChain)

      Create a new `SigningCredential` with a `PrivateKey` and a list of certificates to sign messages with a certified public key.
      Parameters:
        `privateKey` - A private key to sign the message.
        `certificateChain` - A chain of trusted certificates, used for trust of the Certificate Authority.
      Returns:
        A new SigningCredential

    - #### create

          public static SigningCredential create(java.security.PrivateKey privateKey,
                                                 java.lang.String subjectKeyIdentifier)

      Create a new `SigningCredential` with a `PrivateKey` and a subject's key id to sign messages with a registered public key.
      Parameters:
        `privateKey` - A private key to sign the message.
        `subjectKeyIdentifier` - registrationId of the public key at the Registration Authority.
      Returns:
        A new SigningCredential

    - #### create

          public static SigningCredential create(java.lang.String subjectKeyIdentifier,
                                                 java.security.PublicKey publicKey)

      Create a new `SigningCredential` with a key id and registered public key to validate signed messages.
      Parameters:
        `subjectKeyIdentifier` - registrationId of the public key at the Registration Authority.
        `publicKey` - A public key to validate the signed message.
      Returns:
        A new SigningCredential

    - #### getSubjectKeyIdentifier

          public java.lang.String getSubjectKeyIdentifier()

    - #### getPrivateKey

          public java.security.PrivateKey getPrivateKey()

    - #### getPublicKey

          public java.security.PublicKey getPublicKey()

    - #### getCertificateChain

          public java.util.List<java.security.cert.X509Certificate> getCertificateChain()

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

Copyright © 2025 eHealth. All rights reserved.