Class BCMcElieceCCA2PublicKey
- java.lang.Object
-
- org.bouncycastle.pqc.jcajce.provider.mceliece.BCMcElieceCCA2PublicKey
-
- All Implemented Interfaces:
java.io.Serializable,java.security.Key,java.security.PublicKey,CipherParameters
public class BCMcElieceCCA2PublicKey extends java.lang.Object implements CipherParameters, java.security.PublicKey
This class implements a McEliece CCA2 public key and is usually instantiated by theMcElieceCCA2KeyPairGeneratororMcElieceCCA2KeyFactorySpi.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BCMcElieceCCA2PublicKey(McElieceCCA2PublicKeyParameters params)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)Compare this key with another object.java.lang.StringgetAlgorithm()Return the name of the algorithm.byte[]getEncoded()Return the keyData to encode in the SubjectPublicKeyInfo structure.java.lang.StringgetFormat()GF2MatrixgetG()intgetK()intgetN()intgetT()inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
BCMcElieceCCA2PublicKey
public BCMcElieceCCA2PublicKey(McElieceCCA2PublicKeyParameters params)
-
-
Method Detail
-
getAlgorithm
public java.lang.String getAlgorithm()
Return the name of the algorithm.- Specified by:
getAlgorithmin interfacejava.security.Key- Returns:
- "McEliece"
-
getN
public int getN()
- Returns:
- the length of the code
-
getK
public int getK()
- Returns:
- the dimension of the code
-
getT
public int getT()
- Returns:
- the error correction capability of the code
-
getG
public GF2Matrix getG()
- Returns:
- the generator matrix
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- a human readable form of the key
-
equals
public boolean equals(java.lang.Object other)
Compare this key with another object.- Overrides:
equalsin classjava.lang.Object- Parameters:
other- the other object- Returns:
- the result of the comparison
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hash code of this key
-
getEncoded
public byte[] getEncoded()
Return the keyData to encode in the SubjectPublicKeyInfo structure.The ASN.1 definition of the key structure is
McEliecePublicKey ::= SEQUENCE { n Integer -- length of the code t Integer -- error correcting capability matrixG OctetString -- generator matrix as octet string }- Specified by:
getEncodedin interfacejava.security.Key- Returns:
- the keyData to encode in the SubjectPublicKeyInfo structure
-
getFormat
public java.lang.String getFormat()
- Specified by:
getFormatin interfacejava.security.Key
-
-