public class BcMTCCosignerVerifierProvider extends java.lang.Object implements MTCCosignerVerifierProvider
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:
ECPublicKeyParameters with a 256-bit field → ECDSA-P256-SHA256ECPublicKeyParameters with a 384-bit field → ECDSA-P384-SHA384Ed25519PublicKeyParameters → Ed25519MLDSAPublicKeyParameters → ML-DSA-44 / ML-DSA-65 /
ML-DSA-87 per the key's parameter setCallers 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.
| Modifier and Type | Class and Description |
|---|---|
static class |
BcMTCCosignerVerifierProvider.Builder
Builder for
BcMTCCosignerVerifierProvider. |
| Modifier and Type | Method and Description |
|---|---|
MTCCosignerVerifier |
get(byte[] cosignerId) |
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.
|
static BcMTCCosignerVerifierProvider |
singleCosigner(byte[] cosignerId,
MTCSignatureVerifier verifier)
Convenience factory for the single-cosigner case — wraps
Builder().addCosigner(cosignerId, verifier).build(). |
public static BcMTCCosignerVerifierProvider singleCosigner(byte[] cosignerId, MTCSignatureVerifier verifier)
Builder().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).public static BcMTCCosignerVerifierProvider singleCosigner(byte[] cosignerId, org.bouncycastle.crypto.params.AsymmetricKeyParameter publicKey)
java.lang.IllegalArgumentException - if the public key type is unsupportedpublic MTCCosignerVerifier get(byte[] cosignerId)
get in interface MTCCosignerVerifierProvidercosignerId - the binary trust anchor ID of the cosignernull if the cosigner is unknown