Package net.schmizz.sshj.common
Class Ed25519KeyFactory
- java.lang.Object
-
- net.schmizz.sshj.common.Ed25519KeyFactory
-
public class Ed25519KeyFactory extends java.lang.Object
Factory for generating Edwards-curve 25519 Public and Private Keys
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]
ED25519_PKCS8_PRIVATE_KEY_HEADER
private static byte[]
ED25519_PKCS8_PUBLIC_KEY_HEADER
private static java.lang.String
KEY_ALGORITHM
private static int
KEY_LENGTH
private static int
PRIVATE_KEY_ENCODED_LENGTH
private static int
PUBLIC_KEY_ENCODED_LENGTH
-
Constructor Summary
Constructors Modifier Constructor Description private
Ed25519KeyFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.security.PrivateKey
getPrivateKey(byte[] privateKeyBinary)
Get Edwards-curve Private Key for private key binarystatic java.security.PublicKey
getPublicKey(byte[] publicKeyBinary)
Get Edwards-curve Public Key for public key binary
-
-
-
Field Detail
-
KEY_LENGTH
private static final int KEY_LENGTH
- See Also:
- Constant Field Values
-
KEY_ALGORITHM
private static final java.lang.String KEY_ALGORITHM
- See Also:
- Constant Field Values
-
ED25519_PKCS8_PRIVATE_KEY_HEADER
private static final byte[] ED25519_PKCS8_PRIVATE_KEY_HEADER
-
ED25519_PKCS8_PUBLIC_KEY_HEADER
private static final byte[] ED25519_PKCS8_PUBLIC_KEY_HEADER
-
PRIVATE_KEY_ENCODED_LENGTH
private static final int PRIVATE_KEY_ENCODED_LENGTH
- See Also:
- Constant Field Values
-
PUBLIC_KEY_ENCODED_LENGTH
private static final int PUBLIC_KEY_ENCODED_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPrivateKey
public static java.security.PrivateKey getPrivateKey(byte[] privateKeyBinary) throws java.security.GeneralSecurityException
Get Edwards-curve Private Key for private key binary- Parameters:
privateKeyBinary
- Private Key byte array consisting of 32 bytes- Returns:
- Edwards-curve 25519 Private Key
- Throws:
java.security.GeneralSecurityException
- Thrown on failure to generate Private Key
-
getPublicKey
public static java.security.PublicKey getPublicKey(byte[] publicKeyBinary) throws java.security.GeneralSecurityException
Get Edwards-curve Public Key for public key binary- Parameters:
publicKeyBinary
- Public Key byte array consisting of 32 bytes- Returns:
- Edwards-curve 25519 Public Key
- Throws:
java.security.GeneralSecurityException
- Thrown on failure to generate Public Key
-
-