Class JcaContentSignerBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionJcaContentSignerBuilder(String signatureAlgorithm) Construct a basic content signer where the signature algorithm name tells us all we need to know.JcaContentSignerBuilder(String signatureAlgorithm, PublicKey verificationKey) Constructor which calculates the digest algorithm used from the public key, if necessary.JcaContentSignerBuilder(String signatureAlgorithm, AlgorithmParameterSpec sigParamSpec) Constructor which includes a parameter spec for the signature algorithm.JcaContentSignerBuilder(String signatureAlgorithm, AlgorithmParameterSpec sigParamSpec, org.bouncycastle.asn1.x509.AlgorithmIdentifier signatureDigestAlgorithmID) JcaContentSignerBuilder(String signatureAlgorithm, org.bouncycastle.asn1.x509.AlgorithmIdentifier signatureDigestAlgorithmID) Constructor which includes the digest algorithm identifier used. -
Method Summary
Modifier and TypeMethodDescriptionbuild(PrivateKey privateKey) setProvider(String providerName) setProvider(Provider provider) setSecureRandom(SecureRandom random)
-
Constructor Details
-
JcaContentSignerBuilder
Construct a basic content signer where the signature algorithm name tells us all we need to know.- Parameters:
signatureAlgorithm- the signature algorithm we perform.
-
JcaContentSignerBuilder
Constructor which calculates the digest algorithm used from the public key, if necessary.Some PKIX operations, such as CMS signing, require the digest algorithm used for in the signature. Some algorithms, such as LMS, use different digests with different parameter sets but the same OID is used to represent the signature. In this case we either need to be told what digest is associated with the parameter set, or we need the public key so we can work it out.
- Parameters:
signatureAlgorithm- the signature algorithm we perform.verificationKey- the public key associated with our private key.
-
JcaContentSignerBuilder
public JcaContentSignerBuilder(String signatureAlgorithm, org.bouncycastle.asn1.x509.AlgorithmIdentifier signatureDigestAlgorithmID) Constructor which includes the digest algorithm identifier used.Some PKIX operations, such as CMS signing, require the digest algorithm used for in the signature, this constructor allows the digest algorithm identifier to be explicitly specified.
- Parameters:
signatureAlgorithm- the signature algorithm we perform.signatureDigestAlgorithmID- the public key associated with our private key.
-
JcaContentSignerBuilder
Constructor which includes a parameter spec for the signature algorithm.A
PSSParameterSpecselects RSASSA-PSS and its parameters are recorded in the signature algorithm identifier. AContextParameterSpecsupplies the context string of an ML-DSA, SLH-DSA or composite signature (FIPS 204 and FIPS 205); it is passed to the Signature object and does not appear in the algorithm identifier, so a verifier must be given the same context out of band (seeJcaContentVerifierProviderBuilder.setContext(ContextParameterSpec)). The X.509 and CMS profiles for these algorithms (RFC 9881, RFC 9882, RFC 9814) require the empty context, which is what a builder with no spec produces.- Parameters:
signatureAlgorithm- the signature algorithm we perform.sigParamSpec- the parameter spec for the signature algorithm.
-
JcaContentSignerBuilder
public JcaContentSignerBuilder(String signatureAlgorithm, AlgorithmParameterSpec sigParamSpec, org.bouncycastle.asn1.x509.AlgorithmIdentifier signatureDigestAlgorithmID)
-
-
Method Details
-
setProvider
-
setProvider
-
setSecureRandom
-
build
- Throws:
OperatorCreationException
-