java.lang.Object
org.codelibs.saml2.core.model.hsm.HSM
Direct Known Subclasses:
AzureKeyVault

public abstract class HSM extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    HSM()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract byte[]
    decrypt(String algorithm, byte[] cipherText)
    Decrypts an array of bytes with a particular algorithm using the HSM.
    abstract byte[]
    encrypt(String algorithm, byte[] plainText)
    Encrypts an array of bytes with a particular algorithm using the HSM.
    abstract void
    Sets the client to connect to the Azure Key Vault.
    abstract byte[]
    unwrapKey(String algorithmUrl, byte[] wrappedKey)
    Unwraps a key with a particular algorithm using the HSM.
    abstract byte[]
    wrapKey(String algorithm, byte[] key)
    Wraps a key with a particular algorithm using the HSM

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HSM

      public HSM()
  • Method Details

    • setClient

      public abstract void setClient()
      Sets the client to connect to the Azure Key Vault.
    • wrapKey

      public abstract byte[] wrapKey(String algorithm, byte[] key)
      Wraps a key with a particular algorithm using the HSM
      Parameters:
      algorithm - The algorithm to use to wrap the key.
      key - The key to wrap
      Returns:
      A wrapped key.
    • unwrapKey

      public abstract byte[] unwrapKey(String algorithmUrl, byte[] wrappedKey)
      Unwraps a key with a particular algorithm using the HSM.
      Parameters:
      algorithmUrl - The algorithm URL to use to unwrap the key.
      wrappedKey - The key to unwrap
      Returns:
      An unwrapped key.
    • encrypt

      public abstract byte[] encrypt(String algorithm, byte[] plainText)
      Encrypts an array of bytes with a particular algorithm using the HSM.
      Parameters:
      algorithm - The algorithm to use for encryption.
      plainText - The array of bytes to encrypt.
      Returns:
      An encrypted array of bytes.
    • decrypt

      public abstract byte[] decrypt(String algorithm, byte[] cipherText)
      Decrypts an array of bytes with a particular algorithm using the HSM.
      Parameters:
      algorithm - The algorithm to use for decryption.
      cipherText - The encrypted array of bytes.
      Returns:
      A decrypted array of bytes.