public class BCMLDSAPrivateKey extends java.lang.Object implements MLDSAPrivateKey, BCKey
| Constructor and Description |
|---|
BCMLDSAPrivateKey(MLDSAPrivateKeyParameters params) |
BCMLDSAPrivateKey(PrivateKeyInfo keyInfo) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy this key, zeroizing the secret key material it holds.
|
boolean |
equals(java.lang.Object o)
Compare this ML-DSA private key with another object.
|
java.lang.String |
getAlgorithm() |
byte[] |
getEncoded() |
java.lang.String |
getFormat() |
MLDSAParameterSpec |
getParameterSpec()
Return the parameters for this key.
|
byte[] |
getPrivateData()
Return the long form private data for the ML-DSA private key.
|
MLDSAPrivateKey |
getPrivateKey(boolean preferSeedOnly)
Return a privateKey which will encode as seed-only or as an expanded-key.
|
MLDSAPublicKey |
getPublicKey()
Return the public key corresponding to this private key.
|
byte[] |
getSeed()
Return the seed the private key was generated from (if available).
|
int |
hashCode() |
boolean |
isDestroyed() |
java.lang.String |
toString() |
public BCMLDSAPrivateKey(MLDSAPrivateKeyParameters params)
public BCMLDSAPrivateKey(PrivateKeyInfo keyInfo) throws java.io.IOException
java.io.IOExceptionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the other objectpublic int hashCode()
hashCode in class java.lang.Objectpublic final java.lang.String getAlgorithm()
getAlgorithm in interface java.security.Keypublic MLDSAPrivateKey getPrivateKey(boolean preferSeedOnly)
MLDSAPrivateKeygetPrivateKey in interface MLDSAPrivateKeypreferSeedOnly - if true, return a privateKey which will encode to seed-only if possible.public byte[] getEncoded()
getEncoded in interface java.security.Keypublic MLDSAPublicKey getPublicKey()
MLDSAPrivateKeygetPublicKey in interface MLDSAPrivateKeypublic byte[] getPrivateData()
MLDSAPrivateKeygetPrivateData in interface MLDSAPrivateKeypublic byte[] getSeed()
MLDSAPrivateKeygetSeed in interface MLDSAPrivateKeypublic MLDSAParameterSpec getParameterSpec()
MLDSAKeygetParameterSpec in interface MLDSAKeypublic java.lang.String getFormat()
getFormat in interface java.security.Keypublic java.lang.String toString()
toString in class java.lang.Objectpublic void destroy()
After destruction isDestroyed() returns true and the secret-bearing accessors
(such as getEncoded(), getPrivateData() and getSeed()) throw
IllegalStateException. As the underlying parameter arrays may be shared with keys
derived from this one, destruction invalidates those references too.
destroy in interface javax.security.auth.Destroyablepublic boolean isDestroyed()
isDestroyed in interface javax.security.auth.Destroyable