Class BcMTCCosignerVerifierProvider
java.lang.Object
org.bouncycastle.cert.plants.bc.BcMTCCosignerVerifierProvider
- All Implemented Interfaces:
MTCCosignerVerifierProvider
Lightweight-side
MTCCosignerVerifierProvider that holds a table of
cosigner trust anchor IDs mapped to MTCSignatureVerifier instances.
The convenience BcMTCCosignerVerifierProvider.Builder.addCosigner(byte[], AsymmetricKeyParameter)
overload wraps a lightweight AsymmetricKeyParameter in a
BcMTCSignatureVerifier, auto-detecting the draft algorithm
identifier from the key type:
ECPublicKeyParameterswith a 256-bit field →ECDSA-P256-SHA256ECPublicKeyParameterswith a 384-bit field →ECDSA-P384-SHA384Ed25519PublicKeyParameters→Ed25519MLDSAPublicKeyParameters→ML-DSA-44/ML-DSA-65/ML-DSA-87per the key's parameter set
Callers needing a different algorithm string for the same key type, or a
key flavour from another module (e.g. a JCA java.security.PublicKey
wrapped in org.bouncycastle.cert.plants.jcajce.JcaMTCSignatureVerifier),
can use BcMTCCosignerVerifierProvider.Builder.addCosigner(byte[], MTCSignatureVerifier) directly.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionget(byte[] cosignerId) singleCosigner(byte[] cosignerId, MTCSignatureVerifier verifier) Convenience factory for the single-cosigner case — wrapsBuilder().addCosigner(cosignerId, verifier).build().singleCosigner(byte[] cosignerId, org.bouncycastle.crypto.params.AsymmetricKeyParameter publicKey) Convenience factory for the single-cosigner case taking a lightweight public key; the draft algorithm identifier is detected from the key type.
-
Method Details
-
singleCosigner
public static BcMTCCosignerVerifierProvider singleCosigner(byte[] cosignerId, MTCSignatureVerifier verifier) Convenience factory for the single-cosigner case — wrapsBuilder().addCosigner(cosignerId, verifier).build(). Suitable when the relying party trusts exactly one cosigner (e.g. the CA itself, per Section 5.3 of draft-ietf-plants-merkle-tree-certs). -
singleCosigner
public static BcMTCCosignerVerifierProvider singleCosigner(byte[] cosignerId, org.bouncycastle.crypto.params.AsymmetricKeyParameter publicKey) Convenience factory for the single-cosigner case taking a lightweight public key; the draft algorithm identifier is detected from the key type.- Throws:
IllegalArgumentException- if the public key type is unsupported
-
get
- Specified by:
getin interfaceMTCCosignerVerifierProvider- Parameters:
cosignerId- the binary trust anchor ID of the cosigner- Returns:
- a verifier for the cosigner, or
nullif the cosigner is unknown
-