Class JcaMTCCosigner.Builder
- java.lang.Object
-
- org.bouncycastle.cert.plants.jcajce.JcaMTCCosigner.Builder
-
- Enclosing class:
- JcaMTCCosigner
public static class JcaMTCCosigner.Builder extends java.lang.ObjectBuilder forJcaMTCCosigner. Selects the JCA provider used to obtain the underlyingSignatureinstance; the draft algorithm identifier is detected from the private key type atbuild(byte[], java.security.PrivateKey)time.ECPrivateKeywith a 256-bit order →ECDSA-P256-SHA256ECPrivateKeywith a 384-bit order →ECDSA-P384-SHA384getAlgorithm()equal to"Ed25519"or"EdDSA"→Ed25519getAlgorithm()equal to"ML-DSA-44"/"ML-DSA-65"/"ML-DSA-87"→ same string
Callers who need to override the detected algorithm string can use the explicit
build(String, byte[], PrivateKey)overload.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JcaMTCCosignerbuild(byte[] cosignerId, java.security.PrivateKey privateKey)JcaMTCCosignerbuild(java.lang.String algorithm, byte[] cosignerId, java.security.PrivateKey privateKey)Explicit-algorithm overload for cases where the key-type detection inbuild(byte[], PrivateKey)doesn't apply (e.g. a key whosegetAlgorithm()doesn't carry the MTC algorithm name).JcaMTCCosigner.BuildersetProvider(java.lang.String providerName)JcaMTCCosigner.BuildersetProvider(java.security.Provider provider)
-
-
-
Method Detail
-
setProvider
public JcaMTCCosigner.Builder setProvider(java.lang.String providerName)
-
setProvider
public JcaMTCCosigner.Builder setProvider(java.security.Provider provider)
-
build
public JcaMTCCosigner build(byte[] cosignerId, java.security.PrivateKey privateKey)
- Parameters:
cosignerId- binary trust anchor ID of this cosigner — the CA's own trust anchor ID when the CA itself cosigns (Section 5.3); the cosigner's own trust anchor ID otherwiseprivateKey- JCA private key whose algorithm determines the MTC signature algorithm string (see class javadoc)- Throws:
java.lang.IllegalArgumentException- if the private key type is unsupported
-
build
public JcaMTCCosigner build(java.lang.String algorithm, byte[] cosignerId, java.security.PrivateKey privateKey)
Explicit-algorithm overload for cases where the key-type detection inbuild(byte[], PrivateKey)doesn't apply (e.g. a key whosegetAlgorithm()doesn't carry the MTC algorithm name).- Parameters:
algorithm- one of theMTCSignatureAlgorithmconstantscosignerId- binary trust anchor ID of this cosigner — the CA's own trust anchor ID when the CA itself cosigns (Section 5.3); the cosigner's own trust anchor ID otherwiseprivateKey- JCA private key foralgorithm
-
-