Class SLHDSAPublicBCPGKey
java.lang.Object
org.bouncycastle.bcpg.BCPGObject
org.bouncycastle.bcpg.OctetArrayBCPGKey
org.bouncycastle.bcpg.SLHDSAPublicBCPGKey
- All Implemented Interfaces:
BCPGKey, org.bouncycastle.util.Encodable
Public key of the SLH-DSA signature algorithms
PublicKeyAlgorithmTags.SLHDSA_SHAKE_128s,
PublicKeyAlgorithmTags.SLHDSA_SHAKE_128f and PublicKeyAlgorithmTags.SLHDSA_SHAKE_256s
(RFC 9980 sec. 6.2.2.1): the fixed-length SLH-DSA public key in the FIPS 205 encoding (PK.seed || PK.root).- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSLHDSAPublicBCPGKey(int algorithm, byte[] key) Construct the public key of the given SLH-DSA algorithm.SLHDSAPublicBCPGKey(int algorithm, BCPGInputStream in) Parse the public key of the given SLH-DSA algorithm from the packet stream. -
Method Summary
Modifier and TypeMethodDescriptionintReturn the public key algorithm ID this key belongs to.static intgetLength(int algorithm) Return the length of the SLH-DSA public key (RFC 9980 Table 8).static intgetSignatureLength(int algorithm) Return the length of an SLH-DSA signature (RFC 9980 Table 8).Methods inherited from class OctetArrayBCPGKey
encode, getEncoded, getFormat, getKey
-
Constructor Details
-
SLHDSAPublicBCPGKey
Parse the public key of the given SLH-DSA algorithm from the packet stream.- Parameters:
algorithm- public key algorithm ID, one of the SLH-DSA code pointsin- packet input stream positioned at the algorithm-specific key material- Throws:
IOException- if the key cannot be read
-
SLHDSAPublicBCPGKey
public SLHDSAPublicBCPGKey(int algorithm, byte[] key) Construct the public key of the given SLH-DSA algorithm.- Parameters:
algorithm- public key algorithm ID, one of the SLH-DSA code pointskey- the SLH-DSA public key, 32 octets for the 128-bit parameter sets and 64 for SLH-DSA-SHAKE-256s
-
-
Method Details
-
getAlgorithm
public int getAlgorithm()Return the public key algorithm ID this key belongs to.- Returns:
- one of the SLH-DSA code points
-
getLength
public static int getLength(int algorithm) Return the length of the SLH-DSA public key (RFC 9980 Table 8).- Parameters:
algorithm- public key algorithm ID- Returns:
- 32 for SLH-DSA-SHAKE-128s and -128f, 64 for SLH-DSA-SHAKE-256s
-
getSignatureLength
public static int getSignatureLength(int algorithm) Return the length of an SLH-DSA signature (RFC 9980 Table 8).- Parameters:
algorithm- public key algorithm ID- Returns:
- 7856 for SLH-DSA-SHAKE-128s, 17088 for SLH-DSA-SHAKE-128f, 29792 for SLH-DSA-SHAKE-256s
-