Package net.i2p.crypto.eddsa.spec
Class EdDSAPrivateKeySpec
- java.lang.Object
-
- net.i2p.crypto.eddsa.spec.EdDSAPrivateKeySpec
-
-
Constructor Summary
Constructors Constructor Description EdDSAPrivateKeySpec(byte[] seed, byte[] h, byte[] a, GroupElement A, EdDSAParameterSpec spec)
No validation of any parameters other than a.EdDSAPrivateKeySpec(byte[] a, GroupElement A, EdDSAParameterSpec spec)
No validation of any parameters other than a.EdDSAPrivateKeySpec(byte[] seed, EdDSAParameterSpec spec)
EdDSAPrivateKeySpec(EdDSAParameterSpec spec, byte[] h)
Initialize directly from the hash.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
geta()
GroupElement
getA()
byte[]
getH()
EdDSAParameterSpec
getParams()
byte[]
getSeed()
-
-
-
Constructor Detail
-
EdDSAPrivateKeySpec
public EdDSAPrivateKeySpec(byte[] seed, EdDSAParameterSpec spec)
- Parameters:
seed
- the private keyspec
- the parameter specification for this key- Throws:
IllegalArgumentException
- if seed length is wrong or hash algorithm is unsupported
-
EdDSAPrivateKeySpec
public EdDSAPrivateKeySpec(EdDSAParameterSpec spec, byte[] h)
Initialize directly from the hash. getSeed() will return null if this constructor is used.- Parameters:
spec
- the parameter specification for this keyh
- the private key- Throws:
IllegalArgumentException
- if hash length is wrong- Since:
- 0.9.27 (GitHub issue #17)
-
EdDSAPrivateKeySpec
public EdDSAPrivateKeySpec(byte[] a, GroupElement A, EdDSAParameterSpec spec)
No validation of any parameters other than a. getSeed() and getH() will return null if this constructor is used.- Parameters:
a
- must be "clamped" (for Ed) or reduced mod l (for Red)A
- if null, will be derived from a.- Throws:
IllegalArgumentException
- if a not clamped or reduced- Since:
- 0.9.39
-
EdDSAPrivateKeySpec
public EdDSAPrivateKeySpec(byte[] seed, byte[] h, byte[] a, GroupElement A, EdDSAParameterSpec spec)
No validation of any parameters other than a.- Parameters:
seed
- may be nullh
- may be nulla
- must be "clamped" (for Ed) or reduced mod l (for Red)A
- if null, will be derived from a.- Throws:
IllegalArgumentException
- if a not clamped or reduced
-
-
Method Detail
-
getSeed
public byte[] getSeed()
- Returns:
- will be null if constructed directly from the private key
-
getH
public byte[] getH()
- Returns:
- the hash
-
geta
public byte[] geta()
- Returns:
- the private key
-
getA
public GroupElement getA()
- Returns:
- the public key
-
getParams
public EdDSAParameterSpec getParams()
-
-