org.bouncycastle.crypto.signers

Class PSSSigner

public class PSSSigner extends Object implements Signer

RSA-PSS as described in PKCS# 1 v 2.1.

Note: the usual value for the salt length is the number of bytes in the hash function.

Field Summary
static byteTRAILER_IMPLICIT
Constructor Summary
PSSSigner(AsymmetricBlockCipher cipher, Digest digest, int sLen)
basic constructor
PSSSigner(AsymmetricBlockCipher cipher, Digest digest, int sLen, byte trailer)
Method Summary
byte[]generateSignature()
generate a signature for the message we've been loaded with using the key we were initialised with.
voidinit(boolean forSigning, CipherParameters param)
voidreset()
reset the internal state
voidupdate(byte b)
update the internal digest with the byte b
voidupdate(byte[] in, int off, int len)
update the internal digest with the byte array in
booleanverifySignature(byte[] signature)
return true if the internal state represents the signature described in the passed in array.

Field Detail

TRAILER_IMPLICIT

public static final byte TRAILER_IMPLICIT

Constructor Detail

PSSSigner

public PSSSigner(AsymmetricBlockCipher cipher, Digest digest, int sLen)
basic constructor

Parameters: cipher the assymetric cipher to use. digest the digest to use. sLen the length of the salt to use (in bytes).

PSSSigner

public PSSSigner(AsymmetricBlockCipher cipher, Digest digest, int sLen, byte trailer)

Method Detail

generateSignature

public byte[] generateSignature()
generate a signature for the message we've been loaded with using the key we were initialised with.

init

public void init(boolean forSigning, CipherParameters param)

reset

public void reset()
reset the internal state

update

public void update(byte b)
update the internal digest with the byte b

update

public void update(byte[] in, int off, int len)
update the internal digest with the byte array in

verifySignature

public boolean verifySignature(byte[] signature)
return true if the internal state represents the signature described in the passed in array.