Class EdDSAUtils
- java.lang.Object
-
- org.apache.sshd.common.util.security.eddsa.generic.EdDSAUtils
-
public final class EdDSAUtils extends java.lang.ObjectUtilities 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.
-
-
Field Summary
Fields Modifier and Type Field Description private static intED25519_LENGTHprivate static byte[]ED25519_X509_PREFIXprivate static intED448_LENGTHprivate static byte[]ED448_X509_PREFIX
-
Constructor Summary
Constructors Modifier Constructor Description privateEdDSAUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]getBytes(java.security.PublicKey key)Retrieves the raw key bytes from an ed25519 or ed448PublicKey.private static booleanstartsWith(byte[] data, byte[] prefix)
-
-
-
Field Detail
-
ED25519_LENGTH
private static final int ED25519_LENGTH
- See Also:
- Constant Field Values
-
ED448_LENGTH
private static final int ED448_LENGTH
- See Also:
- Constant Field Values
-
ED25519_X509_PREFIX
private static final byte[] ED25519_X509_PREFIX
-
ED448_X509_PREFIX
private static final byte[] ED448_X509_PREFIX
-
-
Method Detail
-
startsWith
private static boolean startsWith(byte[] data, byte[] prefix)
-
getBytes
public static byte[] getBytes(java.security.PublicKey key) throws java.security.InvalidKeyExceptionRetrieves the raw key bytes from an ed25519 or ed448PublicKey.- Parameters:
key-PublicKeyto get the bytes of- Returns:
- the raw key bytes
- Throws:
java.security.InvalidKeyException- if the key is not an ed25519 or ed448 key, or if it doesn't use X.509 encoding
-
-