Class EdDSAUtils
java.lang.Object
org.apache.sshd.common.util.security.eddsa.generic.EdDSAUtils
Utilities to extract the raw key bytes from ed25519 or ed448 public keys, in a manner that is independent of the
actual concrete key implementation classes.
- Author:
- Apache MINA SSHD Project
-
Method Summary
Modifier and TypeMethodDescriptionstatic KeySpeccreatePrivateKeySpec(byte[] keyData) Creates aKeySpecfor re-creating an ed25519 or ed448 public key from the raw key bytes.static KeySpeccreatePublicKeySpec(byte[] keyData) Creates aKeySpecfor re-creating an ed25519 or ed448 public key from the raw key bytes.static byte[]getBytes(PrivateKey key) Retrieves the raw key bytes from an ed25519 or ed448PrivateKey.static byte[]Retrieves the raw key bytes from an ed25519 or ed448PublicKey.
-
Method Details
-
getBytes
Retrieves the raw key bytes from an ed25519 or ed448PublicKey.- Parameters:
key-PublicKeyto get the bytes of- Returns:
- the raw key bytes
- Throws:
InvalidKeyException- if the key is not an ed25519 or ed448 key, or if it doesn't use X.509 encoding
-
getBytes
Retrieves the raw key bytes from an ed25519 or ed448PrivateKey.- Parameters:
key-PrivateKeyto get the bytes of- Returns:
- the raw key bytes
- Throws:
InvalidKeyException- if the key is not an ed25519 or ed448 key, or if it doesn't use PKCS#8 encoding
-
createPublicKeySpec
Creates aKeySpecfor re-creating an ed25519 or ed448 public key from the raw key bytes.- Parameters:
keyData- the raw key bytes- Returns:
- the
KeySpec - Throws:
InvalidKeyException- if the key bytes do not have the appropriate length for an ed25519 or ed448 key
-
createPrivateKeySpec
Creates aKeySpecfor re-creating an ed25519 or ed448 public key from the raw key bytes.- Parameters:
keyData- the raw key bytes- Returns:
- the
KeySpec - Throws:
InvalidKeyException- if the key bytes do not have the appropriate length for an ed25519 or ed448 key
-