Partager via


EncryptedPrivateKeyInfo.GetKeySpec Method

Definition

Overloads

GetKeySpec(IKey)

Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.

GetKeySpec(Cipher)

Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.

GetKeySpec(IKey, Provider)

Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.

GetKeySpec(IKey, String)

Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.

GetKeySpec(IKey)

Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.

[Android.Runtime.Register("getKeySpec", "(Ljava/security/Key;)Ljava/security/spec/PKCS8EncodedKeySpec;", "GetGetKeySpec_Ljava_security_Key_Handler")]
public virtual Java.Security.Spec.PKCS8EncodedKeySpec? GetKeySpec (Java.Security.IKey? decryptKey);
[<Android.Runtime.Register("getKeySpec", "(Ljava/security/Key;)Ljava/security/spec/PKCS8EncodedKeySpec;", "GetGetKeySpec_Ljava_security_Key_Handler")>]
abstract member GetKeySpec : Java.Security.IKey -> Java.Security.Spec.PKCS8EncodedKeySpec
override this.GetKeySpec : Java.Security.IKey -> Java.Security.Spec.PKCS8EncodedKeySpec

Parameters

decryptKey
IKey

key used for decrypting the encrypted data.

Returns

the PKCS8EncodedKeySpec object.

Attributes

Exceptions

if no usable cipher can be found to decrypt the encrypted data.

if decryptKey is not usable to decrypt the encrypted data.

if decryptKey is null.

Remarks

Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.

Added in 1.5.

Java documentation for javax.crypto.EncryptedPrivateKeyInfo.getKeySpec(java.security.Key).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

GetKeySpec(Cipher)

Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.

[Android.Runtime.Register("getKeySpec", "(Ljavax/crypto/Cipher;)Ljava/security/spec/PKCS8EncodedKeySpec;", "GetGetKeySpec_Ljavax_crypto_Cipher_Handler")]
public virtual Java.Security.Spec.PKCS8EncodedKeySpec? GetKeySpec (Javax.Crypto.Cipher? cipher);
[<Android.Runtime.Register("getKeySpec", "(Ljavax/crypto/Cipher;)Ljava/security/spec/PKCS8EncodedKeySpec;", "GetGetKeySpec_Ljavax_crypto_Cipher_Handler")>]
abstract member GetKeySpec : Javax.Crypto.Cipher -> Java.Security.Spec.PKCS8EncodedKeySpec
override this.GetKeySpec : Javax.Crypto.Cipher -> Java.Security.Spec.PKCS8EncodedKeySpec

Parameters

cipher
Cipher

the initialized cipher object which will be used for decrypting the encrypted data.

Returns

the PKCS8EncodedKeySpec object.

Attributes

Exceptions

if the specified cipher is not suited to decrypt the encrypted data.

if cipher is null.

Remarks

Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it. <br>Note: In order to successfully retrieve the enclosed PKCS8EncodedKeySpec object, cipher needs to be initialized to either Cipher.DECRYPT_MODE or Cipher.UNWRAP_MODE, with the same key and parameters used for generating the encrypted data.

Java documentation for javax.crypto.EncryptedPrivateKeyInfo.getKeySpec(javax.crypto.Cipher).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

GetKeySpec(IKey, Provider)

Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.

[Android.Runtime.Register("getKeySpec", "(Ljava/security/Key;Ljava/security/Provider;)Ljava/security/spec/PKCS8EncodedKeySpec;", "GetGetKeySpec_Ljava_security_Key_Ljava_security_Provider_Handler")]
public virtual Java.Security.Spec.PKCS8EncodedKeySpec? GetKeySpec (Java.Security.IKey? decryptKey, Java.Security.Provider? provider);
[<Android.Runtime.Register("getKeySpec", "(Ljava/security/Key;Ljava/security/Provider;)Ljava/security/spec/PKCS8EncodedKeySpec;", "GetGetKeySpec_Ljava_security_Key_Ljava_security_Provider_Handler")>]
abstract member GetKeySpec : Java.Security.IKey * Java.Security.Provider -> Java.Security.Spec.PKCS8EncodedKeySpec
override this.GetKeySpec : Java.Security.IKey * Java.Security.Provider -> Java.Security.Spec.PKCS8EncodedKeySpec

Parameters

decryptKey
IKey

key used for decrypting the encrypted data.

provider
Provider

the name of provider whose Cipher implementation will be used.

Returns

the PKCS8EncodedKeySpec object.

Attributes

Exceptions

if no usable cipher can be found to decrypt the encrypted data.

if decryptKey is not usable to decrypt the encrypted data.

if decryptKey or provider is null.

Remarks

Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.

Added in 1.5.

Java documentation for javax.crypto.EncryptedPrivateKeyInfo.getKeySpec(java.security.Key, java.security.Provider).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

GetKeySpec(IKey, String)

Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.

[Android.Runtime.Register("getKeySpec", "(Ljava/security/Key;Ljava/lang/String;)Ljava/security/spec/PKCS8EncodedKeySpec;", "GetGetKeySpec_Ljava_security_Key_Ljava_lang_String_Handler")]
public virtual Java.Security.Spec.PKCS8EncodedKeySpec? GetKeySpec (Java.Security.IKey? decryptKey, string? providerName);
[<Android.Runtime.Register("getKeySpec", "(Ljava/security/Key;Ljava/lang/String;)Ljava/security/spec/PKCS8EncodedKeySpec;", "GetGetKeySpec_Ljava_security_Key_Ljava_lang_String_Handler")>]
abstract member GetKeySpec : Java.Security.IKey * string -> Java.Security.Spec.PKCS8EncodedKeySpec
override this.GetKeySpec : Java.Security.IKey * string -> Java.Security.Spec.PKCS8EncodedKeySpec

Parameters

decryptKey
IKey

key used for decrypting the encrypted data.

providerName
String

the name of provider whose Cipher implementation will be used.

Returns

the PKCS8EncodedKeySpec object.

Attributes

Exceptions

if no provider with providerName can be found.

if no usable cipher can be found to decrypt the encrypted data.

if decryptKey is not usable to decrypt the encrypted data.

if decryptKey or providerName is null .

Remarks

Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.

Added in 1.5.

Java documentation for javax.crypto.EncryptedPrivateKeyInfo.getKeySpec(java.security.Key, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to