de.flexiprovider.pqc.ecc.niederreiter
Class NiederreiterPublicKey

java.lang.Object
  |
  +--de.flexiprovider.api.keys.PublicKey
        |
        +--de.flexiprovider.pqc.ecc.niederreiter.NiederreiterPublicKey
All Implemented Interfaces:
java.security.Key, Key, java.security.PublicKey, java.io.Serializable

public class NiederreiterPublicKey
extends PublicKey

This class implements a Niederreiter public key and is usually instantiated by the NiederreiterKeyPairGenerator.

Author:
Elena Klintsevich
See Also:
NiederreiterKeyPairGenerator, NiederreiterPublicKey, Serialized Form

Fields inherited from interface java.security.Key
serialVersionUID
 
Fields inherited from interface java.security.PublicKey
serialVersionUID
 
Constructor Summary
protected NiederreiterPublicKey(int n, int t, GF2Matrix h)
          Constructor, used by NiederreiterKeyPairGenerator.
protected NiederreiterPublicKey(NiederreiterPublicKeySpec keySpec)
          Constructor, used by NiederreiterKeyFactory.
 
Method Summary
 boolean equals(java.lang.Object other)
          Compare this key with another object.
 java.lang.String getAlgorithm()
          Return the name of the algorithm.
protected  codec.asn1.ASN1Type getAlgParams()
           
 GF2Matrix getH()
           
 int getK()
           
protected  byte[] getKeyData()
          Return the key data to encode in the SubjectPublicKeyInfo structure.
 int getN()
           
protected  codec.asn1.ASN1ObjectIdentifier getOID()
           
 int getT()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class de.flexiprovider.api.keys.PublicKey
getEncoded, getFormat
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NiederreiterPublicKey

protected NiederreiterPublicKey(int n,
                                int t,
                                GF2Matrix h)
Constructor, used by NiederreiterKeyPairGenerator.
Parameters:
n - length of the code
t - error correction capability of the code
h - check matrix

NiederreiterPublicKey

protected NiederreiterPublicKey(NiederreiterPublicKeySpec keySpec)
Constructor, used by NiederreiterKeyFactory.
Parameters:
keySpec - a NiederreiterPublicKeySpec
Method Detail

getAlgorithm

public java.lang.String getAlgorithm()
Return the name of the algorithm.
Returns:
"Niederreiter"

getN

public int getN()
Returns:
the length of the code

getT

public int getT()
Returns:
the error correction capability of the code

getK

public int getK()
Returns:
the dimension of the code

getH

public GF2Matrix getH()
Returns:
the check matrix

toString

public java.lang.String toString()
Overrides:
toString in class java.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:
equals in class java.lang.Object
Parameters:
other - the other object
Returns:
the result of the comparison

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
the hash code of this key

getOID

protected codec.asn1.ASN1ObjectIdentifier getOID()
Overrides:
getOID in class PublicKey
Returns:
the OID to encode in the SubjectPublicKeyInfo structure

getAlgParams

protected codec.asn1.ASN1Type getAlgParams()
Overrides:
getAlgParams in class PublicKey
Returns:
the algorithm parameters to encode in the SubjectPublicKeyInfo structure

getKeyData

protected byte[] getKeyData()
Return the key data to encode in the SubjectPublicKeyInfo structure.

The ASN.1 definition of the key structure is

 NiederreiterPublicKey ::= SEQUENCE {
   n   INTEGER       -- the length of the code
   t   INTEGER       -- the error correcting capability
   h   OCTET STRING  -- the encoded check matrix
 }
 
Overrides:
getKeyData in class PublicKey
Returns:
the keyData to encode in the SubjectPublicKeyInfo structure