Note
the usual length for the salt is the length of the hash function used in bytes.
| Modifier and Type | Field and Description |
|---|---|
| private byte[] | |
| private AsymmetricBlockCipher | |
| private Digest | |
| private boolean | |
| private int | |
| private int | |
| private byte[] | |
| private int | |
| private byte[] | |
| private int | |
| private byte[] | |
| private int | |
| private SecureRandom | |
| private byte[] | |
| private int | |
| private byte[] | |
| private int | |
| public static final int | TRAILER_IMPLICIT
Deprecated
use ISOTrailers
|
| public static final int | TRAILER_RIPEMD128
Deprecated
use ISOTrailers
|
| public static final int | TRAILER_RIPEMD160
Deprecated
use ISOTrailers
|
| public static final int | TRAILER_SHA1
Deprecated
use ISOTrailers
|
| public static final int | TRAILER_SHA256
Deprecated
use ISOTrailers
|
| public static final int | TRAILER_SHA384
Deprecated
use ISOTrailers
|
| public static final int | TRAILER_SHA512
Deprecated
use ISOTrailers
|
| public static final int | TRAILER_WHIRLPOOL
Deprecated
use ISOTrailers
|
| Access | Constructor and Description |
|---|---|
| public | ISO9796d2PSSSigner(AsymmetricBlockCipher
base cipher to use for signature creation/verification cipher, Digest digest to use. digest, int length of salt in bytes. saltLength, boolean whether or not the trailer is implicit or gives the hash. implicit)Generate a signer with either implicit or explicit trailers for ISO9796-2, scheme 2 or 3. |
| public | ISO9796d2PSSSigner(AsymmetricBlockCipher
cipher to use. cipher, Digest digest to sign with. digest, int length of salt in bytes. saltLength)Constructor for a signer with an explicit digest trailer. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public byte[] | generateSignature()
Implements org. generate a signature for the loaded message using the key we were initialised with. |
| public byte[] | Returns: the full/partial recoveredMessage message.Implements org. Return a reference to the recoveredMessage message, either as it was added to a just generated signature, or extracted from a verified one. |
| public boolean | Returns: true on full message recovery, false otherwise, or if not sure.Implements org. Return true if the full message was recoveredMessage. |
| public void | init(boolean
true if for signing, false if for verification. forSigning, CipherParameters parameters for signature generation/verification. If the
parameters are for generation they should be a ParametersWithRandom,
a ParametersWithSalt, or just an RSAKeyParameters object. If RSAKeyParameters
are passed in a SecureRandom will be created. param)Implements org. Initialise the signer. |
| private boolean | |
| private void | |
| private void | |
| private byte[] | maskGeneratorFunction1(byte[] Z, int zOff, int zLen, int length)
mask generator function, as described in PKCS1v2. |
| public void | |
| public void | update(byte b)
Implements org. update the internal digest with the byte b |
| public void | update(byte[] in, int off, int len)
Implements org. update the internal digest with the byte array in |
| public void | updateWithRecoveredMessage(byte[]
the signature that we are in the process of verifying. signature)Implements org. Perform an update with the recovered message before adding any other data. |
| public boolean | verifySignature(byte[] signature)
Implements org. return true if the signature represents a ISO9796-2 signature for the passed in message. |
| block | back to summary |
|---|---|
| private byte[] block | |
| cipher | back to summary |
|---|---|
| private AsymmetricBlockCipher cipher | |
| digest | back to summary |
|---|---|
| private Digest digest | |
| fullMessage | back to summary |
|---|---|
| private boolean fullMessage | |
| hLen | back to summary |
|---|---|
| private int hLen | |
| keyBits | back to summary |
|---|---|
| private int keyBits | |
| mBuf | back to summary |
|---|---|
| private byte[] mBuf | |
| messageLength | back to summary |
|---|---|
| private int messageLength | |
| preBlock | back to summary |
|---|---|
| private byte[] preBlock | |
| preMStart | back to summary |
|---|---|
| private int preMStart | |
| preSig | back to summary |
|---|---|
| private byte[] preSig | |
| preTLength | back to summary |
|---|---|
| private int preTLength | |
| random | back to summary |
|---|---|
| private SecureRandom random | |
| recoveredMessage | back to summary |
|---|---|
| private byte[] recoveredMessage | |
| saltLength | back to summary |
|---|---|
| private int saltLength | |
| standardSalt | back to summary |
|---|---|
| private byte[] standardSalt | |
| trailer | back to summary |
|---|---|
| private int trailer | |
| TRAILER_IMPLICIT | back to summary |
|---|---|
| public static final int TRAILER_IMPLICIT
Deprecated use ISOTrailers | |
| TRAILER_RIPEMD128 | back to summary |
|---|---|
| public static final int TRAILER_RIPEMD128
Deprecated use ISOTrailers | |
| TRAILER_RIPEMD160 | back to summary |
|---|---|
| public static final int TRAILER_RIPEMD160
Deprecated use ISOTrailers | |
| TRAILER_SHA1 | back to summary |
|---|---|
| public static final int TRAILER_SHA1
Deprecated use ISOTrailers | |
| TRAILER_SHA256 | back to summary |
|---|---|
| public static final int TRAILER_SHA256
Deprecated use ISOTrailers | |
| TRAILER_SHA384 | back to summary |
|---|---|
| public static final int TRAILER_SHA384
Deprecated use ISOTrailers | |
| TRAILER_SHA512 | back to summary |
|---|---|
| public static final int TRAILER_SHA512
Deprecated use ISOTrailers | |
| TRAILER_WHIRLPOOL | back to summary |
|---|---|
| public static final int TRAILER_WHIRLPOOL
Deprecated use ISOTrailers | |
| ISO9796d2PSSSigner | back to summary |
|---|---|
| public ISO9796d2PSSSigner(AsymmetricBlockCipher cipher, Digest digest, int saltLength, boolean implicit) Generate a signer with either implicit or explicit trailers for ISO9796-2, scheme 2 or 3.
| |
| ISO9796d2PSSSigner | back to summary |
|---|---|
| public ISO9796d2PSSSigner(AsymmetricBlockCipher cipher, Digest digest, int saltLength) Constructor for a signer with an explicit digest trailer.
| |
| clearBlock | back to summary |
|---|---|
| private void clearBlock(byte[] block) clear possible sensitive data | |
| generateSignature | back to summary |
|---|---|
| public byte[] generateSignature() throws CryptoException Implements org. generate a signature for the loaded message using the key we were initialised with. | |
| getRecoveredMessage | back to summary |
|---|---|
| public byte[] getRecoveredMessage() Implements org. Return a reference to the recoveredMessage message, either as it was added to a just generated signature, or extracted from a verified one.
| |
| hasFullMessage | back to summary |
|---|---|
| public boolean hasFullMessage() Implements org. Return true if the full message was recoveredMessage.
| |
| init | back to summary |
|---|---|
| public void init(boolean forSigning, CipherParameters param) Implements org. Initialise the signer.
| |
| isSameAs | back to summary |
|---|---|
| private boolean isSameAs(byte[] a, byte[] b) compare two byte arrays - constant time | |
| ItoOSP | back to summary |
|---|---|
| private void ItoOSP(int i, byte[] sp) int to octet string. | |
| LtoOSP | back to summary |
|---|---|
| private void LtoOSP(long l, byte[] sp) long to octet string. | |
| maskGeneratorFunction1 | back to summary |
|---|---|
| private byte[] maskGeneratorFunction1(byte[] Z, int zOff, int zLen, int length) mask generator function, as described in PKCS1v2. | |
| reset | back to summary |
|---|---|
| public void reset() Implements org. reset the internal state | |
| update | back to summary |
|---|---|
| public void update(byte b) Implements org. update the internal digest with the byte b | |
| update | back to summary |
|---|---|
| public void update(byte[] in, int off, int len) Implements org. update the internal digest with the byte array in | |
| updateWithRecoveredMessage | back to summary |
|---|---|
| public void updateWithRecoveredMessage(byte[] signature) throws InvalidCipherTextException Implements org. Doc from org. Perform an update with the recovered message before adding any other data. This must be the first update method called, and calling it will result in the signer assuming that further calls to update will include message content past what is recoverable.
| |
| verifySignature | back to summary |
|---|---|
| public boolean verifySignature(byte[] signature) Implements org. return true if the signature represents a ISO9796-2 signature for the passed in message. | |