Class NTRUEncryptionPublicKeyParameters
java.lang.Object
org.bouncycastle.crypto.params.AsymmetricKeyParameter
org.bouncycastle.pqc.legacy.crypto.ntru.NTRUEncryptionKeyParameters
org.bouncycastle.pqc.legacy.crypto.ntru.NTRUEncryptionPublicKeyParameters
- All Implemented Interfaces:
CipherParameters
A NtruEncrypt public key is essentially a polynomial named
h
.-
Field Summary
Fields inherited from class org.bouncycastle.pqc.legacy.crypto.ntru.NTRUEncryptionKeyParameters
params
-
Constructor Summary
ConstructorDescriptionNTRUEncryptionPublicKeyParameters
(byte[] b, NTRUEncryptionParameters params) Converts a byte array to a polynomialh
and constructs a new public keyReads a polynomialh
from an input stream and constructs a new public keyConstructs a new public key from a polynomial -
Method Summary
Modifier and TypeMethodDescriptionboolean
byte[]
Converts the key to a byte arrayint
hashCode()
void
writeTo
(OutputStream os) Writes the key to an output streamMethods inherited from class org.bouncycastle.pqc.legacy.crypto.ntru.NTRUEncryptionKeyParameters
getParameters
Methods inherited from class org.bouncycastle.crypto.params.AsymmetricKeyParameter
isPrivate
-
Field Details
-
h
-
-
Constructor Details
-
NTRUEncryptionPublicKeyParameters
Constructs a new public key from a polynomial- Parameters:
h
- the polynomialh
which determines the keyparams
- the NtruEncrypt parameters to use
-
NTRUEncryptionPublicKeyParameters
Converts a byte array to a polynomialh
and constructs a new public key- Parameters:
b
- an encoded polynomialparams
- the NtruEncrypt parameters to use- See Also:
-
NTRUEncryptionPublicKeyParameters
public NTRUEncryptionPublicKeyParameters(InputStream is, NTRUEncryptionParameters params) throws IOException Reads a polynomialh
from an input stream and constructs a new public key- Parameters:
is
- an input streamparams
- the NtruEncrypt parameters to use- Throws:
IOException
- See Also:
-
-
Method Details
-
getEncoded
public byte[] getEncoded()Converts the key to a byte array- Returns:
- the encoded key
- See Also:
-
writeTo
Writes the key to an output stream- Parameters:
os
- an output stream- Throws:
IOException
- See Also:
-
hashCode
public int hashCode() -
equals
-