org.mozilla.jss.pkix.primitive
public class EncryptedPrivateKeyInfo extends Object implements ASN1Value
EncryptedPrivateKeyInfo ::= SEQUENCE { encryptionAlgorithm AlgorithmIdentifier, encryptedData OCTET STRING }
Nested Class Summary | |
---|---|
static class | EncryptedPrivateKeyInfo.Template
A template class for decoding EncryptedPrivateKeyInfos from BER. |
Constructor Summary | |
---|---|
EncryptedPrivateKeyInfo(AlgorithmIdentifier encryptionAlgorithm, OCTET_STRING encryptedData)
Creates an EncryptedPrivateKeyInfo from its components.
|
Method Summary | |
---|---|
static EncryptedPrivateKeyInfo | createPBE(PBEAlgorithm keyGenAlg, Password password, byte[] salt, int iterationCount, KeyGenerator.CharToByteConverter charToByteConverter, PrivateKeyInfo pki)
Creates a new EncryptedPrivateKeyInfo, where the data is encrypted
with a password-based key.
|
PrivateKeyInfo | decrypt(Password pass, KeyGenerator.CharToByteConverter charToByteConverter)
Decrypts an EncryptedPrivateKeyInfo that was encrypted with a PBE
algorithm. |
void | encode(OutputStream ostream) |
void | encode(Tag implicitTag, OutputStream ostream) |
OCTET_STRING | getEncryptedData() |
AlgorithmIdentifier | getEncryptionAlgorithm() |
Tag | getTag() |
static EncryptedPrivateKeyInfo.Template | getTemplate() |
Parameters: keyGenAlg The algorithm for generating a symmetric key from a password, salt, and iteration count. password The password to use in generating the key. salt The salt to use in generating the key. iterationCount The number of hashing iterations to perform while generating the key. charToByteConverter The mechanism for converting the characters in the password into bytes. If null, the default mechanism will be used, which is UTF8. pki The PrivateKeyInfo to be encrypted and stored in the EncryptedContentInfo. Before they are encrypted, they will be padded using PKCS padding.
Parameters: pass The password to use to generate the PBE key. charToByteConverter The converter to change the password characters to bytes. If null, the default conversion is used.