Class Ed25519

java.lang.Object
net.sourceforge.plantuml.licensing.Ed25519

public final class Ed25519 extends Object
Minimal Ed25519 in pure Java.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Generates a pair (private seed 32 bytes, public key 32 bytes).
    static byte[]
    publicKeyFromSeed(byte[] seed32)
    Derives the public key (32 bytes) from a private seed (32 bytes).
    static byte[]
    sign(byte[] seed32, byte[] message)
    Signs a message with a private seed (32 bytes).
    static boolean
    verify(byte[] publicKey32, byte[] message, byte[] signature64)
    Verifies a 64-byte signature on a message using a 32-byte public key.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • generateKeyPair

      public static Ed25519.KeyPair generateKeyPair(SecureRandom rnd)
      Generates a pair (private seed 32 bytes, public key 32 bytes).
    • publicKeyFromSeed

      public static byte[] publicKeyFromSeed(byte[] seed32)
      Derives the public key (32 bytes) from a private seed (32 bytes).
    • sign

      public static byte[] sign(byte[] seed32, byte[] message)
      Signs a message with a private seed (32 bytes). Returns a 64-byte signature (R||S). The public key encoder is implicitly the one derived from the seed.
    • verify

      public static boolean verify(byte[] publicKey32, byte[] message, byte[] signature64)
      Verifies a 64-byte signature on a message using a 32-byte public key.