Package net.i2p.crypto.eddsa.spec
Class EdDSAPrivateKeySpec
- java.lang.Object
-
- net.i2p.crypto.eddsa.spec.EdDSAPrivateKeySpec
-
- All Implemented Interfaces:
java.security.spec.KeySpec
public class EdDSAPrivateKeySpec extends java.lang.Object implements java.security.spec.KeySpec
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
a
private GroupElement
A
private byte[]
h
private byte[]
seed
private EdDSAParameterSpec
spec
-
Constructor Summary
Constructors Constructor Description EdDSAPrivateKeySpec(byte[] seed, byte[] h, byte[] a, GroupElement A, EdDSAParameterSpec spec)
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()
-
-
-
Field Detail
-
seed
private final byte[] seed
-
h
private final byte[] h
-
a
private final byte[] a
-
A
private final GroupElement A
-
spec
private final EdDSAParameterSpec spec
-
-
Constructor Detail
-
EdDSAPrivateKeySpec
public EdDSAPrivateKeySpec(byte[] seed, EdDSAParameterSpec spec)
- Parameters:
seed
- the private keyspec
- the parameter specification for this key- Throws:
java.lang.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:
java.lang.IllegalArgumentException
- if hash length is wrong- Since:
- 0.1.1
-
EdDSAPrivateKeySpec
public EdDSAPrivateKeySpec(byte[] seed, byte[] h, byte[] a, GroupElement A, EdDSAParameterSpec spec)
-
-
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()
-
-