Lingua

KeyGenParameterSpec.Builder.SetEncryptionPaddings(String[]) Method

Definition

Sets the set of padding schemes (e.g., PKCS7Padding, OAEPPadding, PKCS1Padding, NoPadding) with which the key can be used when encrypting/decrypting.

[Android.Runtime.Register("setEncryptionPaddings", "([Ljava/lang/String;)Landroid/security/keystore/KeyGenParameterSpec$Builder;", "", ApiSince=23)]
public Android.Security.Keystore.KeyGenParameterSpec.Builder SetEncryptionPaddings(params string[]? paddings);
[<Android.Runtime.Register("setEncryptionPaddings", "([Ljava/lang/String;)Landroid/security/keystore/KeyGenParameterSpec$Builder;", "", ApiSince=23)>]
member this.SetEncryptionPaddings : string[] -> Android.Security.Keystore.KeyGenParameterSpec.Builder

Parameters

paddings
String[]

Value is one of the following: KeyProperties.ENCRYPTION_PADDING_NONE; KeyProperties.ENCRYPTION_PADDING_PKCS7; KeyProperties.ENCRYPTION_PADDING_RSA_PKCS1; KeyProperties.ENCRYPTION_PADDING_RSA_OAEP

Returns

Attributes

Remarks

Sets the set of padding schemes (e.g., PKCS7Padding, OAEPPadding, PKCS1Padding, NoPadding) with which the key can be used when encrypting/decrypting. Attempts to use the key with any other padding scheme will be rejected.

This must be specified for keys which are used for encryption/decryption.

For RSA private keys used by TLS/SSL servers to authenticate themselves to clients it is usually necessary to authorize the use of no/any padding (KeyProperties.ENCRYPTION_PADDING_NONE) and/or PKCS#1 encryption padding (KeyProperties.ENCRYPTION_PADDING_RSA_PKCS1). This is because RSA decryption is required by some cipher suites, and some stacks request decryption using no padding whereas others request PKCS#1 padding.

See KeyProperties.ENCRYPTION_PADDING constants.

Android reference for android.security.keystore.KeyGenParameterSpec.Builder.setEncryptionPaddings.

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