public class BCMLKEMPrivateKey extends java.lang.Object implements MLKEMPrivateKey
Constructor and Description |
---|
BCMLKEMPrivateKey(MLKEMPrivateKeyParameters params) |
BCMLKEMPrivateKey(PrivateKeyInfo keyInfo) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Compare this ML-KEM private key with another object.
|
java.lang.String |
getAlgorithm() |
byte[] |
getEncoded() |
java.lang.String |
getFormat() |
MLKEMParameterSpec |
getParameterSpec()
Return the parameters for this key.
|
byte[] |
getPrivateData()
Return the long form private data for the ML-KEM private key.
|
MLKEMPrivateKey |
getPrivateKey(boolean preferSeedOnly)
Return a privateKey which will encode as seed-only or as an expanded-key.
|
MLKEMPublicKey |
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() |
java.lang.String |
toString() |
public BCMLKEMPrivateKey(MLKEMPrivateKeyParameters params)
public BCMLKEMPrivateKey(PrivateKeyInfo keyInfo) throws java.io.IOException
java.io.IOException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the other objectpublic int hashCode()
hashCode
in class java.lang.Object
public final java.lang.String getAlgorithm()
getAlgorithm
in interface java.security.Key
public byte[] getEncoded()
getEncoded
in interface java.security.Key
public MLKEMPublicKey getPublicKey()
MLKEMPrivateKey
getPublicKey
in interface MLKEMPrivateKey
public byte[] getPrivateData()
MLKEMPrivateKey
getPrivateData
in interface MLKEMPrivateKey
public byte[] getSeed()
MLKEMPrivateKey
getSeed
in interface MLKEMPrivateKey
public MLKEMPrivateKey getPrivateKey(boolean preferSeedOnly)
MLKEMPrivateKey
getPrivateKey
in interface MLKEMPrivateKey
preferSeedOnly
- if true, return a privateKey which will encode to seed-only if possible.public MLKEMParameterSpec getParameterSpec()
MLKEMKey
getParameterSpec
in interface MLKEMKey
public java.lang.String getFormat()
getFormat
in interface java.security.Key
public java.lang.String toString()
toString
in class java.lang.Object