|
Android 2.3 Gingerbread | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.crypto.EncryptedPrivateKeyInfo
public class EncryptedPrivateKeyInfo
This class implements the EncryptedPrivateKeyInfo ASN.1 type as
specified in PKCS
#8 - Private-Key Information Syntax Standard.
The definition of ASN.1 is as follows:
| Constructor Summary | |
|---|---|
EncryptedPrivateKeyInfo(AlgorithmParameters algParams,
byte[] encryptedData)
Creates an EncryptedPrivateKeyInfo instance from the
encryption algorithm parameters an its encrypted data. |
|
EncryptedPrivateKeyInfo(byte[] encoded)
Creates an EncryptedPrivateKeyInfo instance from its encoded
representation by parsing it. |
|
EncryptedPrivateKeyInfo(String encrAlgName,
byte[] encryptedData)
Creates an EncryptedPrivateKeyInfo instance from an algorithm
name and its encrypted data. |
|
| Method Summary | |
|---|---|
String |
getAlgName()
Returns the name of the encryption algorithm. |
AlgorithmParameters |
getAlgParameters()
Returns the parameters used by the encryption algorithm. |
byte[] |
getEncoded()
Returns the ASN.1 encoded representation of this object. |
byte[] |
getEncryptedData()
Returns the encrypted data of this key. |
PKCS8EncodedKeySpec |
getKeySpec(Cipher cipher)
Returns the PKCS8EncodedKeySpec object extracted from the
encrypted data. |
PKCS8EncodedKeySpec |
getKeySpec(Key decryptKey)
Returns the PKCS8EncodedKeySpec object extracted from the
encrypted data. |
PKCS8EncodedKeySpec |
getKeySpec(Key decryptKey,
Provider provider)
Returns the PKCS8EncodedKeySpec object extracted from the
encrypted data. |
PKCS8EncodedKeySpec |
getKeySpec(Key decryptKey,
String providerName)
Returns the PKCS8EncodedKeySpec object extracted from the
encrypted data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EncryptedPrivateKeyInfo(byte[] encoded)
throws IOException
EncryptedPrivateKeyInfo instance from its encoded
representation by parsing it.
encoded - the encoded representation of this object
IOException - if parsing the encoded representation fails.
NullPointerException - if encoded is null.
public EncryptedPrivateKeyInfo(String encrAlgName,
byte[] encryptedData)
throws NoSuchAlgorithmException
EncryptedPrivateKeyInfo instance from an algorithm
name and its encrypted data.
encrAlgName - the name of an algorithm.encryptedData - the encrypted data.
NoSuchAlgorithmException - if the encrAlgName is not a supported algorithm.
NullPointerException - if encrAlgName or encryptedData is null.
IllegalArgumentException - if encryptedData is empty.
public EncryptedPrivateKeyInfo(AlgorithmParameters algParams,
byte[] encryptedData)
throws NoSuchAlgorithmException
EncryptedPrivateKeyInfo instance from the
encryption algorithm parameters an its encrypted data.
algParams - the encryption algorithm parameters.encryptedData - the encrypted data.
NoSuchAlgorithmException - if the algorithm name of the specified algParams
parameter is not supported.
NullPointerException - if algParams or encryptedData is
null.| Method Detail |
|---|
public String getAlgName()
public AlgorithmParameters getAlgParameters()
public byte[] getEncryptedData()
public PKCS8EncodedKeySpec getKeySpec(Cipher cipher)
throws InvalidKeySpecException
PKCS8EncodedKeySpec object extracted from the
encrypted data.
The cipher must be initialize in either Cipher.DECRYPT_MODE or
Cipher.UNWRAP_MODE with the same parameters and key used for
encrypting this.
cipher - the cipher initialized for decrypting the encrypted data.
PKCS8EncodedKeySpec.
InvalidKeySpecException - if the specified cipher is not suited to decrypt the
encrypted data.
NullPointerException - if cipher is null.
public PKCS8EncodedKeySpec getKeySpec(Key decryptKey)
throws NoSuchAlgorithmException,
InvalidKeyException
PKCS8EncodedKeySpec object extracted from the
encrypted data.
decryptKey - the key to decrypt the encrypted data with.
PKCS8EncodedKeySpec.
NoSuchAlgorithmException - if no usable cipher can be found to decrypt the encrypted
data.
InvalidKeyException - if decryptKey is not usable to decrypt the encrypted
data.
NullPointerException - if decryptKey is null.
public PKCS8EncodedKeySpec getKeySpec(Key decryptKey,
String providerName)
throws NoSuchProviderException,
NoSuchAlgorithmException,
InvalidKeyException
PKCS8EncodedKeySpec object extracted from the
encrypted data.
decryptKey - the key to decrypt the encrypted data with.providerName - the name of a provider whose cipher implementation should be
used.
PKCS8EncodedKeySpec.
NoSuchProviderException - if no provider with providerName can be found.
NoSuchAlgorithmException - if no usable cipher can be found to decrypt the encrypted
data.
InvalidKeyException - if decryptKey is not usable to decrypt the encrypted
data.
NullPointerException - if decryptKey or providerName is null
.
public PKCS8EncodedKeySpec getKeySpec(Key decryptKey,
Provider provider)
throws NoSuchAlgorithmException,
InvalidKeyException
PKCS8EncodedKeySpec object extracted from the
encrypted data.
decryptKey - the key to decrypt the encrypted data with.provider - the provider whose cipher implementation should be used.
PKCS8EncodedKeySpec.
NoSuchAlgorithmException - if no usable cipher can be found to decrypt the encrypted
data.
InvalidKeyException - if decryptKey is not usable to decrypt the encrypted
data.
NullPointerException - if decryptKey or provider is null.
public byte[] getEncoded()
throws IOException
IOException - if encoding this object fails.
|
Android 2.3 Gingerbread | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||