Package net.i2p.router.transport.crypto
Class X25519PrivateKey
- java.lang.Object
-
- net.i2p.router.transport.crypto.X25519PrivateKey
-
- All Implemented Interfaces:
Serializable
,Key
,PrivateKey
,Destroyable
public class X25519PrivateKey extends Object implements PrivateKey
A PrivateKey we can stick in a KeyPair. Raw data is accessible via getEncoded(). Also provides a toPublic() method.- Since:
- 0.9.36
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface java.security.PrivateKey
serialVersionUID
-
-
Constructor Summary
Constructors Constructor Description X25519PrivateKey(byte[] data)
Montgomery representation, little-endian
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAlgorithm()
byte[]
getEncoded()
The raw byte array, there is no encoding.String
getFormat()
X25519PublicKey
toPublic()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyed
-
-
-
-
Constructor Detail
-
X25519PrivateKey
public X25519PrivateKey(byte[] data)
Montgomery representation, little-endian- Parameters:
data
- 32 bytes- Throws:
IllegalArgumentException
- if not 32 bytes
-
-
Method Detail
-
toPublic
public X25519PublicKey toPublic()
-
getEncoded
public byte[] getEncoded()
The raw byte array, there is no encoding.- Specified by:
getEncoded
in interfaceKey
- Returns:
- the data passed in
-
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithm
in interfaceKey
-
-