Package com.netscape.certsrv.util
Class CryptoProvider
- java.lang.Object
-
- com.netscape.certsrv.util.CryptoProvider
-
- Direct Known Subclasses:
NSSCryptoProvider
public abstract class CryptoProvider extends java.lang.Object
An abstract class defining the functionality to be provided by sub classes to perform cryptographic operations.- Author:
- akoneru
-
-
Constructor Summary
Constructors Constructor Description CryptoProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract byte[]
encryptSecret(byte[] secret, byte[] iv, org.mozilla.jss.crypto.SymmetricKey key, java.lang.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
generateSessionKey()
abstract org.mozilla.jss.crypto.SymmetricKey
generateSessionKey(org.mozilla.jss.crypto.EncryptionAlgorithm algorithm)
abstract org.mozilla.jss.crypto.SymmetricKey
generateSymmetricKey(java.lang.String keyAlgorithm, int keySize)
abstract void
initialize()
abstract byte[]
unwrapAsymmetricKeyWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlgorithm, byte[] nonceData, java.security.PublicKey pubKey)
abstract byte[]
unwrapSymmetricKeyWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlgorithm, byte[] nonceData, java.lang.String algorithm, int size)
abstract byte[]
unwrapWithPassphrase(byte[] wrappedRecoveredKey, java.lang.String recoveryPassphrase)
abstract byte[]
unwrapWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, java.lang.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, java.security.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)
-
-
-
Method Detail
-
initialize
public abstract void initialize() throws java.lang.Exception
- Throws:
java.lang.Exception
-
generateSymmetricKey
public abstract org.mozilla.jss.crypto.SymmetricKey generateSymmetricKey(java.lang.String keyAlgorithm, int keySize) throws java.lang.Exception
- Throws:
java.lang.Exception
-
generateSessionKey
public abstract org.mozilla.jss.crypto.SymmetricKey generateSessionKey() throws java.lang.Exception
- Throws:
java.lang.Exception
-
generateSessionKey
public abstract org.mozilla.jss.crypto.SymmetricKey generateSessionKey(org.mozilla.jss.crypto.EncryptionAlgorithm algorithm) throws java.lang.Exception
- Throws:
java.lang.Exception
-
wrapSymmetricKey
public abstract byte[] wrapSymmetricKey(org.mozilla.jss.crypto.SymmetricKey symmetricKey, java.security.PublicKey wrappingKey) throws java.lang.Exception
- Throws:
java.lang.Exception
-
encryptSecret
public abstract byte[] encryptSecret(byte[] secret, byte[] iv, org.mozilla.jss.crypto.SymmetricKey key, java.lang.String keyAlgorithm) throws java.lang.Exception
- Throws:
java.lang.Exception
-
encryptSecret
public abstract byte[] encryptSecret(byte[] secret, byte[] iv, org.mozilla.jss.crypto.SymmetricKey key, org.mozilla.jss.crypto.EncryptionAlgorithm keyAlgorithm) throws java.lang.Exception
- Throws:
java.lang.Exception
-
wrapWithSessionKey
public abstract byte[] wrapWithSessionKey(org.mozilla.jss.crypto.SymmetricKey secret, org.mozilla.jss.crypto.SymmetricKey sessionKey, byte[] iv) throws java.lang.Exception
- Throws:
java.lang.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 java.lang.Exception
- Throws:
java.lang.Exception
-
unwrapWithSessionKey
public abstract byte[] unwrapWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, java.lang.String keyAlgorithm, byte[] nonceData) throws java.lang.Exception
- Throws:
java.lang.Exception
-
unwrapWithSessionKey
public abstract byte[] unwrapWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.EncryptionAlgorithm keyAlgorithm, byte[] nonceData) throws java.lang.Exception
- Throws:
java.lang.Exception
-
unwrapWithPassphrase
public abstract byte[] unwrapWithPassphrase(byte[] wrappedRecoveredKey, java.lang.String recoveryPassphrase) throws java.lang.Exception
- Throws:
java.lang.Exception
-
unwrapSymmetricKeyWithSessionKey
public abstract byte[] unwrapSymmetricKeyWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlgorithm, byte[] nonceData, java.lang.String algorithm, int size) throws java.lang.Exception
- Throws:
java.lang.Exception
-
unwrapAsymmetricKeyWithSessionKey
public abstract byte[] unwrapAsymmetricKeyWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlgorithm, byte[] nonceData, java.security.PublicKey pubKey) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-