Class BcMTCCosigner

  • All Implemented Interfaces:
    MTCCosigner

    public class BcMTCCosigner
    extends java.lang.Object
    implements MTCCosigner
    Lightweight implementation of MTCCosigner for the MTC signature algorithms enumerated in Section 6.1 of draft-ietf-plants-merkle-tree-certs: "ECDSA-P256-SHA256", "ECDSA-P384-SHA384", "Ed25519", "ML-DSA-44", "ML-DSA-65", "ML-DSA-87".

    Symmetric counterpart of BcMTCSignatureVerifier — encapsulates the MTCCosignedMessage encode plus the underlying lightweight Signer ceremony.

    • Constructor Summary

      Constructors 
      Constructor Description
      BcMTCCosigner​(byte[] cosignerId, org.bouncycastle.crypto.params.AsymmetricKeyParameter privateKey)  
      BcMTCCosigner​(java.lang.String algorithm, byte[] cosignerId, org.bouncycastle.crypto.params.AsymmetricKeyParameter privateKey)
      Override constructor that takes an explicit MTC algorithm string instead of detecting it from the key type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      MTCSignature cosignSubtree​(MTCLog log, byte[] subtreeHash)
      Cosigns the subtree [log.getStart(), log.getEnd()) of the issuance log identified by log.getLogId().
      byte[] getCosignerId()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BcMTCCosigner

        public BcMTCCosigner​(byte[] cosignerId,
                             org.bouncycastle.crypto.params.AsymmetricKeyParameter 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 otherwise
        privateKey - lightweight private key whose type determines the MTC signature algorithm (see BcMTCSigners.detectAlgorithm(org.bouncycastle.crypto.params.AsymmetricKeyParameter))
      • BcMTCCosigner

        public BcMTCCosigner​(java.lang.String algorithm,
                             byte[] cosignerId,
                             org.bouncycastle.crypto.params.AsymmetricKeyParameter privateKey)
        Override constructor that takes an explicit MTC algorithm string instead of detecting it from the key type. Use when the key's key-type dispatch doesn't apply.
    • Method Detail

      • getCosignerId

        public byte[] getCosignerId()
        Specified by:
        getCosignerId in interface MTCCosigner
        Returns:
        the binary trust anchor ID of this cosigner — the value that appears in MTCSignature.getCosignerId() on every signature produced by this instance. Per Section 5.3 of the draft, when the CA itself is acting as a cosigner this is the CA's own trust anchor ID.
      • cosignSubtree

        public MTCSignature cosignSubtree​(MTCLog log,
                                          byte[] subtreeHash)
                                   throws java.io.IOException
        Description copied from interface: MTCCosigner
        Cosigns the subtree [log.getStart(), log.getEnd()) of the issuance log identified by log.getLogId().
        Specified by:
        cosignSubtree in interface MTCCosigner
        Throws:
        java.io.IOException - if the CosignedMessage cannot be encoded or the underlying signing operation fails