Top Description Fields Constructors Methods
org.bouncycastle.crypto.fips

pack-priv Class PSSSigner

extends Object
implements Signer
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.internal.Signer
Imports
java.security.SecureRandom, org.bouncycastle.crypto.InvalidSignatureException, org.bouncycastle.crypto.internal.AsymmetricBlockCipher, .CipherParameters, .CryptoException, .DataLengthException, .Digest, .Signer, org.bouncycastle.crypto.internal.params.ParametersWithRandom, .RsaKeyParameters

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

Modifier and TypeField and Description
private byte[]
private AsymmetricBlockCipher
private Digest
private int
private int
private byte[]
private Digest
private int
private SecureRandom
private byte[]
private int
private boolean
private int
public static final byte

Constructor Summary

AccessConstructor and Description
public
PSSSigner(AsymmetricBlockCipher cipher, Digest contentDigest, Digest mgfDigest, int sLen, int trailer)

public
PSSSigner(AsymmetricBlockCipher cipher, Digest contentDigest, Digest mgfDigest, byte[] salt, int trailer)

Method Summary

Modifier and TypeMethod and Description
private void
clearBlock(byte[] block)

clear possible sensitive data

public byte[]
generateSignature()

Implements org.bouncycastle.crypto.internal.Signer.generateSignature.

generate a signature for the message we've been loaded with using the key we were initialised with.
public void
init(boolean
true if for signing, false otherwise
forSigning
,
CipherParameters
necessary parameters.
param
)

Implements org.bouncycastle.crypto.internal.Signer.init.

Initialise the signer for signing or verification.
private void
ItoOSP(int i, byte[] sp)

int to octet string.

private byte[]
maskGeneratorFunction1(byte[] Z, int zOff, int zLen, int length)

mask generator function, as described in PKCS1v2.

public void
reset()

Implements org.bouncycastle.crypto.internal.Signer.reset.

reset the internal state
public void
update(byte b)

Implements org.bouncycastle.crypto.internal.Signer.update.

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

Implements org.bouncycastle.crypto.internal.Signer.update.

update the internal digest with the byte array in
public boolean
verifySignature(byte[] signature)

Implements org.bouncycastle.crypto.internal.Signer.verifySignature.

return true if the internal state represents the signature described in the passed in array.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

blockback to summary
private byte[] block
cipherback to summary
private AsymmetricBlockCipher cipher
contentDigestback to summary
private Digest contentDigest
emBitsback to summary
private int emBits
hLenback to summary
private int hLen
mDashback to summary
private byte[] mDash
mgfDigestback to summary
private Digest mgfDigest
mgfhLenback to summary
private int mgfhLen
randomback to summary
private SecureRandom random
saltback to summary
private byte[] salt
sLenback to summary
private int sLen
sSetback to summary
private boolean sSet
trailerback to summary
private int trailer
TRAILER_IMPLICITback to summary
public static final byte TRAILER_IMPLICIT

Constructor Detail

PSSSignerback to summary
public PSSSigner(AsymmetricBlockCipher cipher, Digest contentDigest, Digest mgfDigest, int sLen, int trailer)
PSSSignerback to summary
public PSSSigner(AsymmetricBlockCipher cipher, Digest contentDigest, Digest mgfDigest, byte[] salt, int trailer)

Method Detail

clearBlockback to summary
private void clearBlock(byte[] block)

clear possible sensitive data

generateSignatureback to summary
public byte[] generateSignature() throws CryptoException, DataLengthException

Implements org.bouncycastle.crypto.internal.Signer.generateSignature.

generate a signature for the message we've been loaded with using the key we were initialised with.

initback to summary
public void init(boolean forSigning, CipherParameters param)

Implements org.bouncycastle.crypto.internal.Signer.init.

Doc from org.bouncycastle.crypto.internal.Signer.init.

Initialise the signer for signing or verification.

Parameters
forSigning:boolean

true if for signing, false otherwise

param:CipherParameters

necessary parameters.

ItoOSPback to summary
private void ItoOSP(int i, byte[] sp)

int to octet string.

maskGeneratorFunction1back to summary
private byte[] maskGeneratorFunction1(byte[] Z, int zOff, int zLen, int length)

mask generator function, as described in PKCS1v2.

resetback to summary
public void reset()

Implements org.bouncycastle.crypto.internal.Signer.reset.

reset the internal state

updateback to summary
public void update(byte b)

Implements org.bouncycastle.crypto.internal.Signer.update.

update the internal digest with the byte b

updateback to summary
public void update(byte[] in, int off, int len)

Implements org.bouncycastle.crypto.internal.Signer.update.

update the internal digest with the byte array in

verifySignatureback to summary
public boolean verifySignature(byte[] signature) throws InvalidSignatureException

Implements org.bouncycastle.crypto.internal.Signer.verifySignature.

return true if the internal state represents the signature described in the passed in array.