|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.ibm.security.pkcsutil.PKCSDerObject
|
+--com.ibm.security.pkcs8.EncryptedPrivateKeyInfo
Implements the EncryptedPrivateKeyInfo data type as defined in PKCS #8.
EncryptedPrivateKeyInfo objects are immutable; they cannot be changed once created.
| Fields inherited from class com.ibm.security.pkcsutil.PKCSDerObject |
provider |
| Constructor Summary | |
EncryptedPrivateKeyInfo(AlgorithmId alg,
byte[] encryptedKey)
Create an EncryptedPrivateKeyInfo object with the specified values. |
|
EncryptedPrivateKeyInfo(AlgorithmId alg,
byte[] encryptedKey,
String provider)
Create an EncryptedPrivateKeyInfo object with the specified values. |
|
EncryptedPrivateKeyInfo(byte[] der)
Create an EncryptedPrivateKeyInfo object with a DER byte array. |
|
EncryptedPrivateKeyInfo(byte[] der,
String provider)
Create an EncryptedPrivateKeyInfo object with a DER byte array. |
|
EncryptedPrivateKeyInfo(char[] passwd,
PrivateKeyInfo pki,
String digest,
String cryptoAlg)
Constructs an EncryptedPrivateKeyInfo from the key data in this object using a password-based encryption algorithm and the input password. |
|
EncryptedPrivateKeyInfo(char[] passwd,
PrivateKeyInfo pki,
String digest,
String cryptoAlg,
String provider)
Constructs an EncryptedPrivateKeyInfo from the key data in this object using a password-based encryption algorithm and the input password. |
|
EncryptedPrivateKeyInfo(String filename,
boolean base64)
Create an EncryptedPrivateKeyInfo with the filename of the DER-encoded or BASE64-encoded object. |
|
EncryptedPrivateKeyInfo(String filename,
boolean base64,
String provider)
Create an EncryptedPrivateKeyInfo with the filename of the DER-encoded or BASE64-encoded object. |
|
| Method Summary | |
Object |
clone()
Creates a clone of this EncryptedPrivateKeyInfo object. |
protected void |
decode(com.ibm.security.pkcs8.DerValue encoding)
Initializes an EncryptedPrivateKeyInfo object from a DerValue. |
byte[] |
decrypt(char[] passwd)
Decrypts the encrypted private key info using the input password. |
void |
encode(OutputStream os)
Encodes this object to an OutputStream. |
boolean |
equals(Object other)
Determines if this EncryptedPrivateKeyInfo object is equivalent to the input object. |
String |
getAlgorithm()
Returns the encryption algorithm name. |
AlgorithmId |
getAlgorithmId()
Returns the encryption algorithm identifier. |
byte[] |
getEncryptedData()
Returns a copy of the encrypted data. |
String |
toString()
Returns a string representation of this EncryptedPrivateKeyInfo object. |
| Methods inherited from class com.ibm.security.pkcsutil.PKCSDerObject |
decode,
decode,
encode,
getObjectIdentifier,
hashCode,
read,
readBASE64,
write,
write,
writeBASE64 |
| Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public EncryptedPrivateKeyInfo(byte[] der)
throws IOException
der - a DER byte array of an EncryptedPrivateKeyInfo object.
public EncryptedPrivateKeyInfo(byte[] der,
String provider)
throws IOException
der - a DER byte array of an EncryptedPrivateKeyInfo object.provider - the provider to be used.
public EncryptedPrivateKeyInfo(AlgorithmId alg,
byte[] encryptedKey)
alg - the algorithm identifier representing the algorithm used to
encrypt the key data.encryptedKey - a byte[] encoding of the encrypted key data.
public EncryptedPrivateKeyInfo(AlgorithmId alg,
byte[] encryptedKey,
String provider)
alg - the algorithm identifier representing the algorithm used to
encrypt the key data.encryptedKey - a byte[] encoding of the encrypted key data.provider - the provider to be used.
public EncryptedPrivateKeyInfo(char[] passwd,
PrivateKeyInfo pki,
String digest,
String cryptoAlg)
throws PKCSException,
IOException
passwd - the password to use in the encryption process.digest - the message digest function to be used in the encryption
process. Valid values are MD2, MD5 and SHA1 (for PKCS #5 defined
algorithms) and SHA (for PKCS #12 defined algorithms).cryptoAlg - the crytographic algorithm to use in the encryption
process. Valid values are RC2 and DES (for PKCS #5 defined
algorithms) and 40BitRC2, 128BitRC2, 40BitRC4, 128BitRC4, 3KeyTripleDES
and 2KeyTripleDES (for PKCS #12 defined algorithms).
public EncryptedPrivateKeyInfo(char[] passwd,
PrivateKeyInfo pki,
String digest,
String cryptoAlg,
String provider)
throws PKCSException,
IOException
passwd - the password to use in the encryption process.digest - the message digest function to be used in the encryption
process. Valid values are MD2, MD5 and SHA1 (for PKCS #5 defined
algorithms) and SHA (for PKCS #12 defined algorithms).cryptoAlg - the crytographic algorithm to use in the encryption
process. Valid values are RC2 and DES (for PKCS #5 defined
algorithms) and 40BitRC2, 128BitRC2, 40BitRC4, 128BitRC4, 3KeyTripleDES
and 2KeyTripleDES (for PKCS #12 defined algorithms).provider - the provider to be used
public EncryptedPrivateKeyInfo(String filename,
boolean base64)
throws IOException
filename - name of the DER-encoded or base64-encoded objectbase64 - true if BASE64-encoded, false if DER-encoded
public EncryptedPrivateKeyInfo(String filename,
boolean base64,
String provider)
throws IOException
filename - name of the DER-encoded or base64-encoded objectbase64 - true if BASE64-encoded, false if DER-encodedprovider - the provider to be used| Method Detail |
public Object clone()
public void encode(OutputStream os)
throws IOException
os - the OutputStream to write the encoded data to.public boolean equals(Object other)
other - the object to compare this one to.public String getAlgorithm()
public AlgorithmId getAlgorithmId()
public byte[] getEncryptedData()
public byte[] decrypt(char[] passwd)
throws IOException,
PKCSException
passwd - the password to use in the decryption operation.public String toString()
protected void decode(com.ibm.security.pkcs8.DerValue encoding)
throws IOException
encoding - a DER-encoded EncryptedPrivateKeyInfo object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||