Top Description Fields Constructors Methods
org.bouncycastle.pqc.jcajce.provider.mceliece

public Class BCMcEliecePublicKey

extends Object
implements PublicKey
Class Inheritance
All Implemented Interfaces
java.security.PublicKey, java.security.Key, java.io.Serializable
Imports
java.io.IOException, java.security.PublicKey, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .SubjectPublicKeyInfo, org.bouncycastle.crypto.params.AsymmetricKeyParameter, org.bouncycastle.pqc.asn1.McEliecePublicKey, .PQCObjectIdentifiers, org.bouncycastle.pqc.legacy.crypto.mceliece.McElieceKeyPairGenerator, .McEliecePublicKeyParameters, org.bouncycastle.pqc.legacy.math.linearalgebra.GF2Matrix

This class implements a McEliece public key and is usually instantiated by the McElieceKeyPairGenerator or McElieceKeyFactorySpi.

Field Summary

Modifier and TypeField and Description
private McEliecePublicKeyParameters
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

the result of the comparison
equals
(Object
the other object
other
)

Overrides java.lang.Object.equals.

Compare this key with another object.
public String

Returns:

"McEliece"
getAlgorithm
()

Implements java.security.Key.getAlgorithm.

Return the name of the algorithm.
public byte[]

Returns:

the keyData to encode in the SubjectPublicKeyInfo structure
getEncoded
()

Implements java.security.Key.getEncoded.

Return the keyData to encode in the SubjectPublicKeyInfo structure.
public String
getFormat()

Implements java.security.Key.getFormat.

Returns the name of the primary encoding format of this key, or null if this key does not support encoding.
public GF2Matrix

Returns:

the generator matrix
getG
()

public int

Returns:

the dimension of the code
getK
()

pack-priv AsymmetricKeyParameter
public int

Returns:

the length of the code
getN
()

public int

Returns:

the error correction capability of the code
getT
()

public int

Returns:

the hash code of this key
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public String

Returns:

a human readable form of the key
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

paramsback to summary
private McEliecePublicKeyParameters params
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.security.PublicKey.serialVersionUID.

Constructor Detail

BCMcEliecePublicKeyback to summary
public BCMcEliecePublicKey(McEliecePublicKeyParameters params)

Method Detail

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Compare this key with another object.

Parameters
other:Object

the other object

Returns:boolean

the result of the comparison

getAlgorithmback to summary
public String getAlgorithm()

Implements java.security.Key.getAlgorithm.

Return the name of the algorithm.

Returns:String

"McEliece"

getEncodedback to summary
public byte[] getEncoded()

Implements java.security.Key.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
      }
Returns:byte[]

the keyData to encode in the SubjectPublicKeyInfo structure

getFormatback to summary
public String getFormat()

Implements java.security.Key.getFormat.

Doc from java.security.Key.getFormat.

Returns the name of the primary encoding format of this key, or null if this key does not support encoding. The primary encoding format is named in terms of the appropriate ASN.1 data format, if an ASN.1 specification for this key exists. For example, the name of the ASN.1 data format for public keys is SubjectPublicKeyInfo, as defined by the X.509 standard; in this case, the returned format is "X.509". Similarly, the name of the ASN.1 data format for private keys is PrivateKeyInfo, as defined by the PKCS #8 standard; in this case, the returned format is "PKCS#8".

Returns:String

the primary encoding format of the key.

getGback to summary
public GF2Matrix getG()
Returns:GF2Matrix

the generator matrix

getKback to summary
public int getK()
Returns:int

the dimension of the code

getKeyParamsback to summary
pack-priv AsymmetricKeyParameter getKeyParams()
getNback to summary
public int getN()
Returns:int

the length of the code

getTback to summary
public int getT()
Returns:int

the error correction capability of the code

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

the hash code of this key

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a human readable form of the key