Class BCHawkPrivateKey
- java.lang.Object
-
- org.bouncycastle.pqc.jcajce.provider.hawk.BCHawkPrivateKey
-
- All Implemented Interfaces:
java.io.Serializable,java.security.Key,java.security.PrivateKey,javax.security.auth.Destroyable,HawkKey
public class BCHawkPrivateKey extends java.lang.Object implements java.security.PrivateKey, HawkKey
JCA private key wrapper for Hawk. Round-trips through PKCS#8PrivateKeyInfovia the lightweightPrivateKeyFactory. Equality usesArrays.constantTimeAreEqual(byte[], byte[])on the encoded private key bytes to avoid leaking secret material through timing-distinguishable comparisons.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BCHawkPrivateKey(PrivateKeyInfo keyInfo)BCHawkPrivateKey(HawkPrivateKeyParameters params)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.StringgetAlgorithm()byte[]getEncoded()java.lang.StringgetFormat()HawkParameterSpecgetParameterSpec()Return the parameters for this key.inthashCode()
-
-
-
Constructor Detail
-
BCHawkPrivateKey
public BCHawkPrivateKey(HawkPrivateKeyParameters params)
-
BCHawkPrivateKey
public BCHawkPrivateKey(PrivateKeyInfo keyInfo) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getAlgorithm
public final java.lang.String getAlgorithm()
- Specified by:
getAlgorithmin interfacejava.security.Key- Returns:
- name of the algorithm - upper-case form of the Hawk parameter-set name
-
getEncoded
public byte[] getEncoded()
- Specified by:
getEncodedin interfacejava.security.Key
-
getParameterSpec
public HawkParameterSpec getParameterSpec()
Description copied from interface:HawkKeyReturn the parameters for this key.- Specified by:
getParameterSpecin interfaceHawkKey- Returns:
- a HawkParameterSpec
-
getFormat
public java.lang.String getFormat()
- Specified by:
getFormatin interfacejava.security.Key
-
-