Class RSABlindSignatureClient
blind(byte[]) call performs both Prepare
(sec. 4.1) and Blind (sec. 4.2); finalize(Blinded, byte[])
performs Finalize (sec. 4.4). The BlindSign server step lives
in RSABlindSignatureServer and the variant choices in
RSABlindSignatureParameters.
The client side is therefore two calls — blind then finalize —
with the server's BlindSign in between:
RSABlindSignatureClient client = new RSABlindSignatureClient(
RSABlindSignatureParameters.RSABSSA_SHA384_PSS_RANDOMIZED, publicKey);
RSABlindSignatureClient.Blinded blinded = client.blind(msg);
// send blinded.getBlindedMessage() to the server; receive blind_sig
byte[] sig = client.finalize(blinded, blindSig);
// (blinded.getPreparedMessage(), sig) is the RSASSA-PSS pair verifiers check
The SecureRandom used for the prepare prefix, the EMSA-PSS salt, and
the blinding factor is supplied at construction; the
(parameters, publicKey) convenience constructor uses the
CryptoServicesRegistrar default.
Blind is expressed on the existing BC RSA blinding toolkit —
RSABlindingFactorGenerator, RSABlindingParameters and
PSSSigner driven by an RSABlindingEngine — the same
composition PSSBlindTest uses for Chaum RSA-PSS blind signing.
Each request's state is carried by the returned RSABlindSignatureClient.Blinded (the blinded
message, the prepared message, and the secret unblinding value), so a single
instance is reusable across requests.
For randomised variants the resulting signature is over a prepared message
that prepends a fresh 32-byte prefix to msg (RFC 9474 sec. 4.1); that
prepared message — RSABlindSignatureClient.Blinded.getPreparedMessage() — is what downstream
verifiers check the signature against, not the original msg.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionRSABlindSignatureClient(RSABlindSignatureParameters parameters, RSAKeyParameters publicKey) Equivalent toRSABlindSignatureClient(RSABlindSignatureParameters, RSAKeyParameters, SecureRandom)with aSecureRandomobtained fromCryptoServicesRegistrar.RSABlindSignatureClient(RSABlindSignatureParameters parameters, RSAKeyParameters publicKey, SecureRandom random) -
Method Summary
Modifier and TypeMethodDescriptionblind(byte[] msg) RFC 9474Prepare(sec. 4.1) followed byBlind(sec. 4.2): preparemsg(prepend a fresh 32-byte prefix for randomised variants, identity otherwise), EMSA-PSS encode it, draw an invertible blinding factorr, and blind the encoding toz = encoded_msg * r^e mod n.byte[]finalize(RSABlindSignatureClient.Blinded blinded, byte[] blindSig) RFC 9474Finalize(sec. 4.4): unblind the server's signature for the suppliedRSABlindSignatureClient.Blindedrequest and verify it as a standard RSASSA-PSS signature over the prepared message.
-
Constructor Details
-
RSABlindSignatureClient
Equivalent toRSABlindSignatureClient(RSABlindSignatureParameters, RSAKeyParameters, SecureRandom)with aSecureRandomobtained fromCryptoServicesRegistrar.- Parameters:
parameters- the RFC 9474 sec. 5 variant.publicKey- the server's RSA public key.
-
RSABlindSignatureClient
public RSABlindSignatureClient(RSABlindSignatureParameters parameters, RSAKeyParameters publicKey, SecureRandom random) - Parameters:
parameters- the RFC 9474 sec. 5 variant.publicKey- the server's RSA public key.random- source of randomness for the prepare prefix (randomised variants), the EMSA-PSS salt, and the blinding factor; must not benull— useRSABlindSignatureClient(RSABlindSignatureParameters, RSAKeyParameters)for theCryptoServicesRegistrardefault.
-
-
Method Details
-
blind
RFC 9474Prepare(sec. 4.1) followed byBlind(sec. 4.2): preparemsg(prepend a fresh 32-byte prefix for randomised variants, identity otherwise), EMSA-PSS encode it, draw an invertible blinding factorr, and blind the encoding toz = encoded_msg * r^e mod n. The returnedRSABlindSignatureClient.Blindedcarries the prepared message, theblinded_msgto send to the server, and the secret unblinding value forfinalize(Blinded, byte[]).- Parameters:
msg- the application message to be signed.- Throws:
CryptoException- if EMSA-PSS encoding fails (e.g. the modulus is too small for the variant's hash/salt lengths) or the encoded message is not coprime with the modulus.
-
finalize
public byte[] finalize(RSABlindSignatureClient.Blinded blinded, byte[] blindSig) throws CryptoException RFC 9474Finalize(sec. 4.4): unblind the server's signature for the suppliedRSABlindSignatureClient.Blindedrequest and verify it as a standard RSASSA-PSS signature over the prepared message.The method name follows the RFC 9474 sec. 4.4
Finalizestep; it is an overload ofObject.finalize()(distinct signature), not an override.- Parameters:
blinded- the value returned byblind(byte[])for this request.blindSig- theblind_sigreturned by the server.- Returns:
- the unblinded RSASSA-PSS signature; it verifies against
blinded.getPreparedMessage(). - Throws:
CryptoException- ifblindSighas the wrong length or the unblinded signature fails RSASSA-PSS verification.
-