| Modifier and Type | Field and Description |
|---|---|
| private byte[] | |
| private AsymmetricBlockCipher | |
| private byte[] | |
| private boolean | |
| private boolean | |
| private static final int | |
| public static final String | NOT_STRICT_LENGTH_ENABLED_PROPERTY
some providers fail to include the leading zero in PKCS1 encoded blocks. |
| private int | |
| private SecureRandom | |
| public static final String | STRICT_LENGTH_ENABLED_PROPERTY
Deprecated
use NOT_STRICT_LENGTH_ENABLED_PROPERTY
|
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | PKCS1Encoding(AsymmetricBlockCipher
The cipher to use for cryptographic operation. cipher, int Length of the expected plaintext. pLen)Constructor for decryption with a fixed plaintext length. |
| public | PKCS1Encoding(AsymmetricBlockCipher
The cipher to use for cryptographic operation. cipher, byte[] The fallback value, we don't do an arraycopy here. fallback)Constructor for decryption with a fixed plaintext length and a fallback value that is returned, if the padding is incorrect. |
| Modifier and Type | Method and Description |
|---|---|
| private static int | |
| private static int | |
| private static int | checkPkcs1Encoding2(byte[] buf, int plaintextLength)
Check the argument is a valid encoding with type 2 of a plaintext with the given length. |
| private byte[] | |
| private byte[] | Returns: The plaintext without padding, or a random value if the padding was incorrect.The encrypted block. in, int Offset in the encrypted block. inOff, int Length of the encrypted block.
//@param pLen Length of the desired output. inLen)Decode PKCS#1.5 encoding, and return a random value if the padding is not correct. |
| private byte[] | |
| public int | getInputBlockSize()
Implements org. |
| public int | getOutputBlockSize()
Implements org. |
| public AsymmetricBlockCipher | |
| public void | init(boolean
if true the cipher is initialised for
encryption, if false for decryption. forEncryption, CipherParameters the key and other data required by the cipher. param)Implements org. |
| public byte[] | processBlock(byte[]
the input data in, int offset into the in array where the data starts inOff, int the length of the block to be processed. inLen)Implements org. |
| private boolean |
| blockBuffer | back to summary |
|---|---|
| private byte[] blockBuffer | |
| engine | back to summary |
|---|---|
| private AsymmetricBlockCipher engine | |
| fallback | back to summary |
|---|---|
| private byte[] fallback | |
| forEncryption | back to summary |
|---|---|
| private boolean forEncryption | |
| forPrivateKey | back to summary |
|---|---|
| private boolean forPrivateKey | |
| HEADER_LENGTH | back to summary |
|---|---|
| private static final int HEADER_LENGTH | |
| NOT_STRICT_LENGTH_ENABLED_PROPERTY | back to summary |
|---|---|
| public static final String NOT_STRICT_LENGTH_ENABLED_PROPERTY some providers fail to include the leading zero in PKCS1 encoded blocks. If you need to work with one of these set the system property org.bouncycastle.pkcs1.not_strict to true. The system property is checked during construction of the encoding object, it is set to false by default. | |
| pLen | back to summary |
|---|---|
| private int pLen | |
| random | back to summary |
|---|---|
| private SecureRandom random | |
| STRICT_LENGTH_ENABLED_PROPERTY | back to summary |
|---|---|
| public static final String STRICT_LENGTH_ENABLED_PROPERTY
Deprecated use NOT_STRICT_LENGTH_ENABLED_PROPERTY | |
| useStrictLength | back to summary |
|---|---|
| private boolean useStrictLength | |
| PKCS1Encoding | back to summary |
|---|---|
| public PKCS1Encoding(AsymmetricBlockCipher cipher) Basic constructor. | |
| PKCS1Encoding | back to summary |
|---|---|
| public PKCS1Encoding(AsymmetricBlockCipher cipher, int pLen) Constructor for decryption with a fixed plaintext length.
| |
| PKCS1Encoding | back to summary |
|---|---|
| public PKCS1Encoding(AsymmetricBlockCipher cipher, byte[] fallback) Constructor for decryption with a fixed plaintext length and a fallback value that is returned, if the padding is incorrect.
| |
| checkPkcs1Encoding1 | back to summary |
|---|---|
| private static int checkPkcs1Encoding1(byte[] buf) Check the argument is a valid encoding with type 1. Returns the plaintext length if valid, or -1 if invalid. | |
| checkPkcs1Encoding2 | back to summary |
|---|---|
| private static int checkPkcs1Encoding2(byte[] buf) Check the argument is a valid encoding with type 2. Returns the plaintext length if valid, or -1 if invalid. | |
| checkPkcs1Encoding2 | back to summary |
|---|---|
| private static int checkPkcs1Encoding2(byte[] buf, int plaintextLength) Check the argument is a valid encoding with type 2 of a plaintext with the given length. Returns 0 if valid, or -1 if invalid. | |
| decodeBlock | back to summary |
|---|---|
private byte[] decodeBlock(byte[] in, int inOff, int inLen) throws InvalidCipherTextException
| |
| decodeBlockOrRandom | back to summary |
|---|---|
| private byte[] decodeBlockOrRandom(byte[] in, int inOff, int inLen) throws InvalidCipherTextException Decode PKCS#1.5 encoding, and return a random value if the padding is not correct.
| |
| encodeBlock | back to summary |
|---|---|
| private byte[] encodeBlock(byte[] in, int inOff, int inLen) throws InvalidCipherTextException | |
| getInputBlockSize | back to summary |
|---|---|
| public int getInputBlockSize() Implements org. Doc from org. returns the largest size an input block can be.
| |
| getOutputBlockSize | back to summary |
|---|---|
| public int getOutputBlockSize() Implements org. Doc from org. returns the maximum size of the block produced by this cipher.
| |
| getUnderlyingCipher | back to summary |
|---|---|
| public AsymmetricBlockCipher getUnderlyingCipher() | |
| init | back to summary |
|---|---|
| public void init(boolean forEncryption, CipherParameters param) Implements org. Doc from org. initialise the cipher.
| |
| processBlock | back to summary |
|---|---|
| public byte[] processBlock(byte[] in, int inOff, int inLen) throws InvalidCipherTextException Implements org. Doc from org. process the block of len bytes stored in in from offset inOff.
| |
| useStrict | back to summary |
|---|---|
| private boolean useStrict() | |