Package com.netscape.certsrv.util
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.SymmetricKey
org.mozilla.jss.crypto.SymmetricKey
generateSessionKey
(org.mozilla.jss.crypto.EncryptionAlgorithm algorithm) org.mozilla.jss.crypto.SymmetricKey
generateSymmetricKey
(String keyAlgorithm, int keySize) org.mozilla.jss.crypto.EncryptionAlgorithm
getEncryptionAlgorithm
(String encryptionAlgorithm) org.mozilla.jss.crypto.KeyGenAlgorithm
getKeyGenAlgorithm
(String keyAlgorithm) org.mozilla.jss.CryptoManager
org.mozilla.jss.crypto.CryptoToken
getToken()
void
Initializes the NSS DB.void
setManager
(org.mozilla.jss.CryptoManager manager) void
setToken
(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[]
wrapSymmetricKey
(org.mozilla.jss.crypto.SymmetricKey symmetricKey, PublicKey wrappingKey, org.mozilla.jss.crypto.KeyWrapAlgorithm alg) 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:
initialize
in classCryptoProvider
- Throws:
Exception
-
generateSymmetricKey
public org.mozilla.jss.crypto.SymmetricKey generateSymmetricKey(String keyAlgorithm, int keySize) throws Exception - Specified by:
generateSymmetricKey
in classCryptoProvider
- Throws:
Exception
-
generateSessionKey
- Specified by:
generateSessionKey
in classCryptoProvider
- Throws:
Exception
-
generateSessionKey
public org.mozilla.jss.crypto.SymmetricKey generateSessionKey(org.mozilla.jss.crypto.EncryptionAlgorithm algorithm) throws Exception - Specified by:
generateSessionKey
in classCryptoProvider
- Throws:
Exception
-
wrapSymmetricKey
public byte[] wrapSymmetricKey(org.mozilla.jss.crypto.SymmetricKey symmetricKey, PublicKey wrappingKey) throws Exception - Specified by:
wrapSymmetricKey
in classCryptoProvider
- Throws:
Exception
-
wrapSymmetricKey
public byte[] wrapSymmetricKey(org.mozilla.jss.crypto.SymmetricKey symmetricKey, PublicKey wrappingKey, org.mozilla.jss.crypto.KeyWrapAlgorithm alg) throws Exception - Specified by:
wrapSymmetricKey
in classCryptoProvider
- Throws:
Exception
-
encryptSecret
public byte[] encryptSecret(byte[] secret, byte[] iv, org.mozilla.jss.crypto.SymmetricKey key, String encryptionAlgorithm) throws Exception - Specified by:
encryptSecret
in 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:
encryptSecret
in classCryptoProvider
- Throws:
Exception
-
unwrapWithSessionKey
public byte[] unwrapWithSessionKey(byte[] wrappedRecoveredKey, org.mozilla.jss.crypto.SymmetricKey recoveryKey, String encryptionAlgorithm, byte[] nonceData) throws Exception - Specified by:
unwrapWithSessionKey
in 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:
unwrapWithSessionKey
in 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:
unwrapSymmetricKeyWithSessionKey
in 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:
unwrapAsymmetricKeyWithSessionKey
in classCryptoProvider
- Throws:
Exception
-
unwrapWithPassphrase
public byte[] unwrapWithPassphrase(byte[] wrappedRecoveredKey, String recoveryPassphrase) throws Exception - Specified by:
unwrapWithPassphrase
in 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:
wrapWithSessionKey
in 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:
wrapWithSessionKey
in classCryptoProvider
- Throws:
Exception
-