java.lang.Object | |
↳ | sun.security.rsa.RSAPadding |
RSA padding and unpadding. Format of PKCS#1 v1.5 padding is: 0x00 | BT | PS...PS | 0x00 | data...data where BT is the blocktype (1 or 2). The length of the entire string must be the same as the size of the modulus (i.e. 128 byte for a 1024 bit key). Per spec, the padding string must be at least 8 bytes long. That leaves up to (length of key in bytes) - 11 bytes for the data. OAEP padding is a bit more complicated and has a number of options. We support: . arbitrary hash functions ('Hash' in the specification), MessageDigest implementation must be available . MGF1 as the mask generation function . the empty string as the default value for label L and whatever specified in javax.crypto.spec.OAEPParameterSpec Note: RSA keys should be at least 512 bits long
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | PAD_BLOCKTYPE_1 | ||||||||||
int | PAD_BLOCKTYPE_2 | ||||||||||
int | PAD_NONE | ||||||||||
int | PAD_OAEP_MGF1 |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get a RSAPadding instance of the specified type.
| |||||||||||
Get a RSAPadding instance of the specified type, which must be
OAEP.
| |||||||||||
Get a RSAPadding instance of the specified type.
| |||||||||||
Return the maximum size of the plaintext data that can be processed using
this object.
| |||||||||||
Pad the data and return the padded block.
| |||||||||||
Pad the data and return the padded block.
| |||||||||||
Unpad the padded block and return the data.
| |||||||||||
Unpad the padded block and return the data.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Get a RSAPadding instance of the specified type. Keys used with this padding must be paddedSize bytes long.
Get a RSAPadding instance of the specified type, which must be OAEP. Keys used with this padding must be paddedSize bytes long.
Get a RSAPadding instance of the specified type. Keys used with this padding must be paddedSize bytes long.
Return the maximum size of the plaintext data that can be processed using this object.
Pad the data and return the padded block.
BadPaddingException |
---|
Pad the data and return the padded block.
BadPaddingException |
---|
Unpad the padded block and return the data.
BadPaddingException |
---|
Unpad the padded block and return the data.
BadPaddingException |
---|