Class NSSCryptoProvider
java.lang.Object
com.netscape.certsrv.util.CryptoProvider
com.netscape.certsrv.util.NSSCryptoProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]encryptSecret(byte[] secret, byte[] iv, org.mozilla.jss.crypto.SymmetricKey key, String encryptionAlgorithm) byte[]encryptSecret(byte[] secret, byte[] iv, org.mozilla.jss.crypto.SymmetricKey key, org.mozilla.jss.crypto.EncryptionAlgorithm encryptionAlgorithm) org.mozilla.jss.crypto.SymmetricKeyorg.mozilla.jss.crypto.SymmetricKeygenerateSessionKey(org.mozilla.jss.crypto.EncryptionAlgorithm algorithm) org.mozilla.jss.crypto.SymmetricKeygenerateSymmetricKey(String keyAlgorithm, int keySize) org.mozilla.jss.crypto.EncryptionAlgorithmgetEncryptionAlgorithm(String encryptionAlgorithm) org.mozilla.jss.crypto.KeyGenAlgorithmgetKeyGenAlgorithm(String keyAlgorithm) org.mozilla.jss.CryptoManagerorg.mozilla.jss.crypto.CryptoTokengetToken()voidInitializes the NSS DB.voidsetManager(org.mozilla.jss.CryptoManager manager) voidsetToken(org.mozilla.jss.crypto.CryptoToken token) byte[]unwrapAsymmetricKeyWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlgorithm, byte[] nonceData, PublicKey pubKey) byte[]unwrapSymmetricKeyWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlgorithm, byte[] nonceData, String algorithm, int size) byte[]unwrapWithPassphrase(byte[] wrappedRecoveredKey, String recoveryPassphrase) byte[]unwrapWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, String encryptionAlgorithm, byte[] nonceData) byte[]unwrapWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.EncryptionAlgorithm encryptionAlgorithm, byte[] nonceData) byte[]wrapSymmetricKey(org.mozilla.jss.crypto.SymmetricKey symmetricKey, PublicKey wrappingKey) byte[]wrapWithSessionKey(org.mozilla.jss.crypto.SymmetricKey secret, org.mozilla.jss.crypto.SymmetricKey sessionKey, byte[] iv) byte[]wrapWithSessionKey(org.mozilla.jss.crypto.SymmetricKey secret, org.mozilla.jss.crypto.SymmetricKey sessionKey, byte[] iv, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlg)
-
Constructor Details
-
NSSCryptoProvider
- Throws:
Exception
-
-
Method Details
-
getManager
public org.mozilla.jss.CryptoManager getManager() -
setManager
public void setManager(org.mozilla.jss.CryptoManager manager) -
getToken
public org.mozilla.jss.crypto.CryptoToken getToken() -
setToken
public void setToken(org.mozilla.jss.crypto.CryptoToken token) -
initialize
Initializes the NSS DB.- Specified by:
initializein classCryptoProvider- Throws:
Exception
-
generateSymmetricKey
public org.mozilla.jss.crypto.SymmetricKey generateSymmetricKey(String keyAlgorithm, int keySize) throws Exception - Specified by:
generateSymmetricKeyin classCryptoProvider- Throws:
Exception
-
generateSessionKey
- Specified by:
generateSessionKeyin classCryptoProvider- Throws:
Exception
-
generateSessionKey
public org.mozilla.jss.crypto.SymmetricKey generateSessionKey(org.mozilla.jss.crypto.EncryptionAlgorithm algorithm) throws Exception - Specified by:
generateSessionKeyin classCryptoProvider- Throws:
Exception
-
wrapSymmetricKey
public byte[] wrapSymmetricKey(org.mozilla.jss.crypto.SymmetricKey symmetricKey, PublicKey wrappingKey) throws Exception - Specified by:
wrapSymmetricKeyin classCryptoProvider- Throws:
Exception
-
encryptSecret
public byte[] encryptSecret(byte[] secret, byte[] iv, org.mozilla.jss.crypto.SymmetricKey key, String encryptionAlgorithm) throws Exception - Specified by:
encryptSecretin classCryptoProvider- Throws:
Exception
-
encryptSecret
public byte[] encryptSecret(byte[] secret, byte[] iv, org.mozilla.jss.crypto.SymmetricKey key, org.mozilla.jss.crypto.EncryptionAlgorithm encryptionAlgorithm) throws Exception - Specified by:
encryptSecretin classCryptoProvider- Throws:
Exception
-
unwrapWithSessionKey
public byte[] unwrapWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, String encryptionAlgorithm, byte[] nonceData) throws Exception - Specified by:
unwrapWithSessionKeyin classCryptoProvider- Throws:
Exception
-
unwrapWithSessionKey
public byte[] unwrapWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.EncryptionAlgorithm encryptionAlgorithm, byte[] nonceData) throws Exception - Specified by:
unwrapWithSessionKeyin classCryptoProvider- Throws:
Exception
-
unwrapSymmetricKeyWithSessionKey
public byte[] unwrapSymmetricKeyWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlgorithm, byte[] nonceData, String algorithm, int size) throws Exception - Specified by:
unwrapSymmetricKeyWithSessionKeyin classCryptoProvider- Throws:
Exception
-
unwrapAsymmetricKeyWithSessionKey
public byte[] unwrapAsymmetricKeyWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlgorithm, byte[] nonceData, PublicKey pubKey) throws Exception - Specified by:
unwrapAsymmetricKeyWithSessionKeyin classCryptoProvider- Throws:
Exception
-
unwrapWithPassphrase
public byte[] unwrapWithPassphrase(byte[] wrappedRecoveredKey, String recoveryPassphrase) throws Exception - Specified by:
unwrapWithPassphrasein classCryptoProvider- Throws:
Exception
-
getKeyGenAlgorithm
public org.mozilla.jss.crypto.KeyGenAlgorithm getKeyGenAlgorithm(String keyAlgorithm) throws NoSuchAlgorithmException - Throws:
NoSuchAlgorithmException
-
getEncryptionAlgorithm
public org.mozilla.jss.crypto.EncryptionAlgorithm getEncryptionAlgorithm(String encryptionAlgorithm) throws NoSuchAlgorithmException - Throws:
NoSuchAlgorithmException
-
wrapWithSessionKey
public byte[] wrapWithSessionKey(org.mozilla.jss.crypto.SymmetricKey secret, org.mozilla.jss.crypto.SymmetricKey sessionKey, byte[] iv) throws Exception - Specified by:
wrapWithSessionKeyin classCryptoProvider- Throws:
Exception
-
wrapWithSessionKey
public byte[] wrapWithSessionKey(org.mozilla.jss.crypto.SymmetricKey secret, org.mozilla.jss.crypto.SymmetricKey sessionKey, byte[] iv, org.mozilla.jss.crypto.KeyWrapAlgorithm wrapAlg) throws Exception - Specified by:
wrapWithSessionKeyin classCryptoProvider- Throws:
Exception
-