The message digest hash, H, is encapsulated to form a byte string as follows
EB = 06 || PS || 0xBA || H || TRAILERwhere PS is a string of bytes all of value 0xBB of length such that |EB|=|n|, and TRAILER is the ISO/IEC 10118 part number† for the digest. The byte string, EB, is converted to an integer value, the message representative, f.
| Modifier and Type | Field and Description |
|---|---|
| private byte[] | |
| private AsymmetricBlockCipher | |
| private Digest | |
| private int | |
| private RsaKeyParameters | |
| private int | |
| public static final int |
| Access | Constructor and Description |
|---|---|
| public | BaseX931Signer(AsymmetricBlockCipher
base cipher to use for signature creation/verification cipher, Digest digest to use. digest, boolean whether or not the trailer is implicit or gives the hash. implicit)Generate a signer with either implicit or explicit trailers for X9.31 |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| public byte[] | generateSignature()
Implements org. |
| public void | init(boolean
true if for signing, false otherwise forSigning, CipherParameters necessary parameters. param)Implements org. |
| public void | |
| public void | update(byte b)
Implements org. |
| public void | update(byte[] in, int off, int len)
Implements org. |
| public boolean | verifySignature(byte[] signature)
Implements org. |
| block | back to summary |
|---|---|
| private byte[] block | |
| cipher | back to summary |
|---|---|
| private AsymmetricBlockCipher cipher | |
| digest | back to summary |
|---|---|
| private Digest digest | |
| keyBits | back to summary |
|---|---|
| private int keyBits | |
| kParam | back to summary |
|---|---|
| private RsaKeyParameters kParam | |
| trailer | back to summary |
|---|---|
| private int trailer | |
| TRAILER_IMPLICIT | back to summary |
|---|---|
| public static final int TRAILER_IMPLICIT | |
| BaseX931Signer | back to summary |
|---|---|
| public BaseX931Signer(AsymmetricBlockCipher cipher, Digest digest, boolean implicit) Generate a signer with either implicit or explicit trailers for X9.31
| |
| clearBlock | back to summary |
|---|---|
| private void clearBlock(byte[] block) clear possible sensitive data | |
| createSignatureBlock | back to summary |
|---|---|
| private void createSignatureBlock(int trailer) | |
| 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. | |
| init | back to summary |
|---|---|
| public void init(boolean forSigning, CipherParameters param) Implements org. Doc from org. Initialise the signer for signing or verification.
| |
| 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 | |
| verifySignature | back to summary |
|---|---|
| public boolean verifySignature(byte[] signature) Implements org. return true if the signature represents a X9.31 signature for the passed in message. | |