Package org.bouncycastle.pqc.crypto.ntru
Class NTRUSigningPrivateKeyParameters
- java.lang.Object
-
- org.bouncycastle.crypto.params.AsymmetricKeyParameter
-
- org.bouncycastle.pqc.crypto.ntru.NTRUSigningPrivateKeyParameters
-
- All Implemented Interfaces:
CipherParameters
public class NTRUSigningPrivateKeyParameters extends AsymmetricKeyParameter
A NtruSign private key comprises one or moreNTRUSigningPrivateKeyParameters.Basis
of three polynomials each, except the zeroth basis for whichh
is undefined.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NTRUSigningPrivateKeyParameters.Basis
A NtruSign basis.
-
Constructor Summary
Constructors Constructor Description NTRUSigningPrivateKeyParameters(byte[] b, NTRUSigningKeyGenerationParameters params)
Constructs a new private key from a byte arrayNTRUSigningPrivateKeyParameters(java.io.InputStream is, NTRUSigningKeyGenerationParameters params)
Constructs a new private key from an input streamNTRUSigningPrivateKeyParameters(java.util.List<NTRUSigningPrivateKeyParameters.Basis> bases, NTRUSigningPublicKeyParameters publicKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
NTRUSigningPrivateKeyParameters.Basis
getBasis(int i)
Returns thei
-th basisbyte[]
getEncoded()
Converts the key to a byte arrayNTRUSigningPublicKeyParameters
getPublicKey()
int
hashCode()
void
writeTo(java.io.OutputStream os)
Writes the key to an output stream-
Methods inherited from class org.bouncycastle.crypto.params.AsymmetricKeyParameter
isPrivate
-
-
-
-
Constructor Detail
-
NTRUSigningPrivateKeyParameters
public NTRUSigningPrivateKeyParameters(byte[] b, NTRUSigningKeyGenerationParameters params) throws java.io.IOException
Constructs a new private key from a byte array- Parameters:
b
- an encoded private keyparams
- the NtruSign parameters to use- Throws:
java.io.IOException
-
NTRUSigningPrivateKeyParameters
public NTRUSigningPrivateKeyParameters(java.io.InputStream is, NTRUSigningKeyGenerationParameters params) throws java.io.IOException
Constructs a new private key from an input stream- Parameters:
is
- an input streamparams
- the NtruSign parameters to use- Throws:
java.io.IOException
-
NTRUSigningPrivateKeyParameters
public NTRUSigningPrivateKeyParameters(java.util.List<NTRUSigningPrivateKeyParameters.Basis> bases, NTRUSigningPublicKeyParameters publicKey)
-
-
Method Detail
-
getBasis
public NTRUSigningPrivateKeyParameters.Basis getBasis(int i)
Returns thei
-th basis- Parameters:
i
- the index- Returns:
- the basis at index
i
-
getPublicKey
public NTRUSigningPublicKeyParameters getPublicKey()
-
getEncoded
public byte[] getEncoded() throws java.io.IOException
Converts the key to a byte array- Returns:
- the encoded key
- Throws:
java.io.IOException
-
writeTo
public void writeTo(java.io.OutputStream os) throws java.io.IOException
Writes the key to an output stream- Parameters:
os
- an output stream- Throws:
java.io.IOException
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-