public interface IEncryptionUnit extends IToken
Modifier and Type | Method and Description |
---|---|
byte[] |
decryptExternalPrivate(byte[] sessionKey,
java.lang.String symmAlgOID,
byte[] symmAlgParams,
byte[] privateKey)
Decrypts the external private key (private key from the end-user).
|
byte[] |
decryptInternalPrivate(byte[] wrappedPrivateData)
Decrypts the internal private key (private key from the KRA's
internal storage).
|
byte[] |
encryptInternalPrivate(byte[] rawPrivate)
Encrypts the internal private key (private key to the KRA's
internal storage).
|
java.security.PublicKey |
getPublicKey()
Retrieves the public key in this unit.
|
org.mozilla.jss.crypto.PrivateKey |
unwrap(byte[] privateKey,
java.security.PublicKey pubKey)
Unwraps data.
|
org.mozilla.jss.crypto.PrivateKey |
unwrap(byte[] sessionKey,
java.lang.String symmAlgOID,
byte[] symmAlgParams,
byte[] privateKey,
java.security.PublicKey pubKey)
Unwraps data.
|
void |
verify(java.security.PublicKey publicKey,
org.mozilla.jss.crypto.PrivateKey privateKey)
Verifies the given key pair.
|
byte[] |
wrap(org.mozilla.jss.crypto.PrivateKey priKey)
Wraps data.
|
java.security.PublicKey getPublicKey()
byte[] wrap(org.mozilla.jss.crypto.PrivateKey priKey) throws EBaseException
priKey
- private key to be wrappedEBaseException
- failed to wrapvoid verify(java.security.PublicKey publicKey, org.mozilla.jss.crypto.PrivateKey privateKey) throws EBaseException
publicKey
- public keyprivateKey
- private keyEBaseException
org.mozilla.jss.crypto.PrivateKey unwrap(byte[] sessionKey, java.lang.String symmAlgOID, byte[] symmAlgParams, byte[] privateKey, java.security.PublicKey pubKey) throws EBaseException
sessionKey
- session key that unwrap the private keysymmAlgOID
- symmetric algorithmsymmAlgParams
- symmetric algorithm parametersprivateKey
- private key datapubKey
- public keyEBaseException
- failed to unwraporg.mozilla.jss.crypto.PrivateKey unwrap(byte[] privateKey, java.security.PublicKey pubKey) throws EBaseException
privateKey
- private key datapubKey
- public key objectEBaseException
- failed to unwrapbyte[] encryptInternalPrivate(byte[] rawPrivate) throws EBaseException
rawPrivate
- user's private key (key to be archived)EBaseException
- failed to encryptbyte[] decryptInternalPrivate(byte[] wrappedPrivateData) throws EBaseException
wrappedPrivateData
- unwrapped private key data (key to be recovered)EBaseException
- failed to decryptbyte[] decryptExternalPrivate(byte[] sessionKey, java.lang.String symmAlgOID, byte[] symmAlgParams, byte[] privateKey) throws EBaseException
sessionKey
- session key that protects the user privatesymmAlgOID
- symmetric algorithmsymmAlgParams
- symmetric algorithm parametersprivateKey
- private key dataEBaseException
- failed to decrypt