Class TestCredentialHelper


  • public final class TestCredentialHelper
    extends Object
    Helper that creates different credentials.
    • Constructor Detail

      • TestCredentialHelper

        private TestCredentialHelper()
    • Method Detail

      • createClientSecretCredential

        public static ClientSecretCredential createClientSecretCredential​(String secret)
                                                                   throws KeyException
        Create a simple symmetric key client_secret credential from from the given shared secret.
        Parameters:
        secret - the client secret
        Returns:
        the credential
        Throws:
        KeyException - on error creating the key
      • createDirectEncryptionCredentialFromSharedSecret

        public static JWKCredential createDirectEncryptionCredentialFromSharedSecret​(String secret)
                                                                              throws KeyException
        Create a direct encryption JWKCredential from the given shared secret.
        Parameters:
        secret - the secret to convert to a JWKCredential.
        Returns:
        the credential
        Throws:
        KeyException - on error creating the key
      • createAsymmetricSigningCredential

        public static JWKCredential createAsymmetricSigningCredential​(com.nimbusds.jose.jwk.AsymmetricJWK key)
                                                               throws com.nimbusds.jose.JOSEException
        Create an asymmetric signing credential.
        Parameters:
        key - the key to convert to a JWKCredential.
        Returns:
        the credential
        Throws:
        com.nimbusds.jose.JOSEException - on error
      • createKeyEncryptionCredential

        public static JWKCredential createKeyEncryptionCredential​(com.nimbusds.jose.jwk.RSAKey secret)
                                                           throws com.nimbusds.jose.JOSEException
        Create a key encryption JWKCredential from the given RSA key.
        Parameters:
        secret - the RSAKey to convert to a JWKCredential.
        Returns:
        the credential
        Throws:
        com.nimbusds.jose.JOSEException - on error
      • createKeyAgreementCredential

        public static JWKCredential createKeyAgreementCredential​(com.nimbusds.jose.jwk.ECKey secret)
                                                          throws com.nimbusds.jose.JOSEException
        Create a key agreement encryption JWKCredential from the given EC key.
        Parameters:
        secret - the ECKey to convert to a JWKCredential.
        Returns:
        the credential
        Throws:
        com.nimbusds.jose.JOSEException - on error