Class CryptoProvider

java.lang.Object
com.netscape.certsrv.util.CryptoProvider
Direct Known Subclasses:
NSSCryptoProvider

public abstract class CryptoProvider extends Object
An abstract class defining the functionality to be provided by sub classes to perform cryptographic operations.
Author:
akoneru
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract byte[]
    encryptSecret(byte[] secret, byte[] iv, org.mozilla.jss.crypto.SymmetricKey key, String keyAlgorithm)
     
    abstract byte[]
    encryptSecret(byte[] secret, byte[] iv, org.mozilla.jss.crypto.SymmetricKey key, org.mozilla.jss.crypto.EncryptionAlgorithm keyAlgorithm)
     
    abstract org.mozilla.jss.crypto.SymmetricKey
     
    abstract org.mozilla.jss.crypto.SymmetricKey
    generateSessionKey(org.mozilla.jss.crypto.EncryptionAlgorithm algorithm)
     
    abstract org.mozilla.jss.crypto.SymmetricKey
    generateSymmetricKey(String keyAlgorithm, int keySize)
     
    abstract void
     
    abstract byte[]
    unwrapAsymmetricKeyWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlgorithm, byte[] nonceData, PublicKey pubKey)
     
    abstract byte[]
    unwrapSymmetricKeyWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlgorithm, byte[] nonceData, String algorithm, int size)
     
    abstract byte[]
    unwrapWithPassphrase(byte[] wrappedRecoveredKey, String recoveryPassphrase)
     
    abstract byte[]
    unwrapWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, String keyAlgorithm, byte[] nonceData)
     
    abstract byte[]
    unwrapWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.EncryptionAlgorithm keyAlgorithm, byte[] nonceData)
     
    abstract byte[]
    wrapSymmetricKey(org.mozilla.jss.crypto.SymmetricKey symmetricKey, PublicKey wrappingKey)
     
    abstract byte[]
    wrapWithSessionKey(org.mozilla.jss.crypto.SymmetricKey secret, org.mozilla.jss.crypto.SymmetricKey sessionKey, byte[] iv)
     
    abstract byte[]
    wrapWithSessionKey(org.mozilla.jss.crypto.SymmetricKey secret, org.mozilla.jss.crypto.SymmetricKey sessionKey, byte[] iv, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlg)
     

    Methods inherited from class java.lang.Object

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

    • CryptoProvider

      public CryptoProvider()
  • Method Details

    • initialize

      public abstract void initialize() throws Exception
      Throws:
      Exception
    • generateSymmetricKey

      public abstract org.mozilla.jss.crypto.SymmetricKey generateSymmetricKey(String keyAlgorithm, int keySize) throws Exception
      Throws:
      Exception
    • generateSessionKey

      public abstract org.mozilla.jss.crypto.SymmetricKey generateSessionKey() throws Exception
      Throws:
      Exception
    • generateSessionKey

      public abstract org.mozilla.jss.crypto.SymmetricKey generateSessionKey(org.mozilla.jss.crypto.EncryptionAlgorithm algorithm) throws Exception
      Throws:
      Exception
    • wrapSymmetricKey

      public abstract byte[] wrapSymmetricKey(org.mozilla.jss.crypto.SymmetricKey symmetricKey, PublicKey wrappingKey) throws Exception
      Throws:
      Exception
    • encryptSecret

      public abstract byte[] encryptSecret(byte[] secret, byte[] iv, org.mozilla.jss.crypto.SymmetricKey key, String keyAlgorithm) throws Exception
      Throws:
      Exception
    • encryptSecret

      public abstract byte[] encryptSecret(byte[] secret, byte[] iv, org.mozilla.jss.crypto.SymmetricKey key, org.mozilla.jss.crypto.EncryptionAlgorithm keyAlgorithm) throws Exception
      Throws:
      Exception
    • wrapWithSessionKey

      public abstract byte[] wrapWithSessionKey(org.mozilla.jss.crypto.SymmetricKey secret, org.mozilla.jss.crypto.SymmetricKey sessionKey, byte[] iv) throws Exception
      Throws:
      Exception
    • wrapWithSessionKey

      public abstract byte[] wrapWithSessionKey(org.mozilla.jss.crypto.SymmetricKey secret, org.mozilla.jss.crypto.SymmetricKey sessionKey, byte[] iv, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlg) throws Exception
      Throws:
      Exception
    • unwrapWithSessionKey

      public abstract byte[] unwrapWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, String keyAlgorithm, byte[] nonceData) throws Exception
      Throws:
      Exception
    • unwrapWithSessionKey

      public abstract byte[] unwrapWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.EncryptionAlgorithm keyAlgorithm, byte[] nonceData) throws Exception
      Throws:
      Exception
    • unwrapWithPassphrase

      public abstract byte[] unwrapWithPassphrase(byte[] wrappedRecoveredKey, String recoveryPassphrase) throws Exception
      Throws:
      Exception
    • unwrapSymmetricKeyWithSessionKey

      public abstract byte[] unwrapSymmetricKeyWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlgorithm, byte[] nonceData, String algorithm, int size) throws Exception
      Throws:
      Exception
    • unwrapAsymmetricKeyWithSessionKey

      public abstract byte[] unwrapAsymmetricKeyWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlgorithm, byte[] nonceData, PublicKey pubKey) throws Exception
      Throws:
      Exception