Class SLHDSASecretBCPGKey
java.lang.Object
org.bouncycastle.bcpg.BCPGObject
org.bouncycastle.bcpg.OctetArrayBCPGKey
org.bouncycastle.bcpg.SLHDSASecretBCPGKey
- All Implemented Interfaces:
BCPGKey, org.bouncycastle.util.Encodable
Secret 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.2): the fixed-length SLH-DSA secret key in the FIPS 205 encoding
(SK.seed || SK.prf || PK.seed || PK.root).- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSLHDSASecretBCPGKey(int algorithm, byte[] key) Construct the secret key of the given SLH-DSA algorithm.SLHDSASecretBCPGKey(int algorithm, BCPGInputStream in) Parse the secret key of the given SLH-DSA algorithm from the (decrypted) secret key material. -
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 secret key (RFC 9980 Table 8).Methods inherited from class OctetArrayBCPGKey
encode, getEncoded, getFormat, getKey
-
Constructor Details
-
SLHDSASecretBCPGKey
Parse the secret key of the given SLH-DSA algorithm from the (decrypted) secret key material.- Parameters:
algorithm- public key algorithm ID, one of the SLH-DSA code pointsin- input stream positioned at the algorithm-specific secret key material- Throws:
IOException- if the key cannot be read
-
SLHDSASecretBCPGKey
public SLHDSASecretBCPGKey(int algorithm, byte[] key) Construct the secret key of the given SLH-DSA algorithm.- Parameters:
algorithm- public key algorithm ID, one of the SLH-DSA code pointskey- the SLH-DSA secret key, 64 octets for the 128-bit parameter sets and 128 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 secret key (RFC 9980 Table 8).- Parameters:
algorithm- public key algorithm ID- Returns:
- 64 for SLH-DSA-SHAKE-128s and -128f, 128 for SLH-DSA-SHAKE-256s
-