Bouncy Castle Cryptography Library 1.87

org.bouncycastle.crypto.params
Class MLKEMPrivateKeyParameters

java.lang.Object
  extended byorg.bouncycastle.crypto.params.AsymmetricKeyParameter
      extended byorg.bouncycastle.crypto.params.MLKEMKeyParameters
          extended byorg.bouncycastle.crypto.params.MLKEMPrivateKeyParameters
All Implemented Interfaces:
CipherParameters, javax.security.auth.Destroyable

public class MLKEMPrivateKeyParameters
extends MLKEMKeyParameters
implements javax.security.auth.Destroyable


Field Summary
static int BOTH
           
static int EXPANDED_KEY
           
static int SEED_ONLY
           
 
Constructor Summary
MLKEMPrivateKeyParameters(MLKEMParameters params, byte[] encoding)
           
MLKEMPrivateKeyParameters(MLKEMParameters params, byte[] s, byte[] hpk, byte[] nonce, byte[] t, byte[] rho)
           
MLKEMPrivateKeyParameters(MLKEMParameters params, byte[] s, byte[] hpk, byte[] nonce, byte[] t, byte[] rho, byte[] seed)
           
MLKEMPrivateKeyParameters(MLKEMParameters params, byte[] encoding, MLKEMPublicKeyParameters pubKey)
           
 
Method Summary
 void destroy()
          Zeroize the secret key material held by this object.
 byte[] getEncoded()
           
 byte[] getHPK()
           
 byte[] getNonce()
           
 MLKEMPrivateKeyParameters getParametersWithFormat(int format)
          Deprecated. Use withPreferredFormat(int) instead.
 int getPreferredFormat()
           
 byte[] getPublicKey()
           
 MLKEMPublicKeyParameters getPublicKeyParameters()
           
 byte[] getRho()
           
 byte[] getS()
           
 byte[] getSeed()
           
 byte[] getT()
           
 boolean isDestroyed()
           
 MLKEMPrivateKeyParameters withPreferredFormat(int format)
          Return a copy of this key with the given preferred encoding format.
 
Methods inherited from class org.bouncycastle.crypto.params.MLKEMKeyParameters
getParameters
 
Methods inherited from class org.bouncycastle.crypto.params.AsymmetricKeyParameter
isPrivate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOTH

public static final int BOTH
See Also:
Constant Field Values

SEED_ONLY

public static final int SEED_ONLY
See Also:
Constant Field Values

EXPANDED_KEY

public static final int EXPANDED_KEY
See Also:
Constant Field Values
Constructor Detail

MLKEMPrivateKeyParameters

public MLKEMPrivateKeyParameters(MLKEMParameters params,
                                 byte[] s,
                                 byte[] hpk,
                                 byte[] nonce,
                                 byte[] t,
                                 byte[] rho)

MLKEMPrivateKeyParameters

public MLKEMPrivateKeyParameters(MLKEMParameters params,
                                 byte[] s,
                                 byte[] hpk,
                                 byte[] nonce,
                                 byte[] t,
                                 byte[] rho,
                                 byte[] seed)

MLKEMPrivateKeyParameters

public MLKEMPrivateKeyParameters(MLKEMParameters params,
                                 byte[] encoding)

MLKEMPrivateKeyParameters

public MLKEMPrivateKeyParameters(MLKEMParameters params,
                                 byte[] encoding,
                                 MLKEMPublicKeyParameters pubKey)
Method Detail

getParametersWithFormat

public MLKEMPrivateKeyParameters getParametersWithFormat(int format)
Deprecated. Use withPreferredFormat(int) instead.


withPreferredFormat

public MLKEMPrivateKeyParameters withPreferredFormat(int format)
Return a copy of this key with the given preferred encoding format. The copy holds its own copy of the key material, so destroying either object leaves the other usable.

Parameters:
format - the preferred format: BOTH, SEED_ONLY or EXPANDED_KEY.
Returns:
a new key object with the given preferred format.
Throws:
java.lang.IllegalStateException - if this key has been destroyed, or a seed format is asked for and there is no seed.

getPreferredFormat

public int getPreferredFormat()

getEncoded

public byte[] getEncoded()

getHPK

public byte[] getHPK()

getNonce

public byte[] getNonce()

getPublicKey

public byte[] getPublicKey()

getPublicKeyParameters

public MLKEMPublicKeyParameters getPublicKeyParameters()

getRho

public byte[] getRho()

getS

public byte[] getS()

getT

public byte[] getT()

getSeed

public byte[] getSeed()

destroy

public void destroy()
Zeroize the secret key material held by this object. Objects derived from this one, for example through withPreferredFormat(int), hold their own copies and are not affected.

Specified by:
destroy in interface javax.security.auth.Destroyable

isDestroyed

public boolean isDestroyed()
Specified by:
isDestroyed in interface javax.security.auth.Destroyable

Bouncy Castle Cryptography Library 1.87