Class EdDSAUtils


  • public final class EdDSAUtils
    extends java.lang.Object
    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.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private EdDSAUtils()  
    • 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 ed448 PublicKey.
      private static boolean startsWith​(byte[] data, byte[] prefix)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ED25519_X509_PREFIX

        private static final byte[] ED25519_X509_PREFIX
      • ED448_X509_PREFIX

        private static final byte[] ED448_X509_PREFIX
    • Constructor Detail

      • EdDSAUtils

        private EdDSAUtils()
    • Method Detail

      • startsWith

        private static boolean startsWith​(byte[] data,
                                          byte[] prefix)
      • getBytes

        public static byte[] getBytes​(java.security.PublicKey key)
                               throws java.security.InvalidKeyException
        Retrieves the raw key bytes from an ed25519 or ed448 PublicKey.
        Parameters:
        key - PublicKey to 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