Class BCKeyPair

java.lang.Object
convex.core.crypto.AKeyPair
convex.core.crypto.bc.BCKeyPair

public class BCKeyPair extends AKeyPair
Class representing an Ed25519 Key Pair using Sodium library
  • Field Details

    • priv

      protected final org.bouncycastle.crypto.params.Ed25519PrivateKeyParameters priv
      Secret key in the specific format that Sodium expects, we wrap this complexity in this class
    • signatureCount

      public static long signatureCount
  • Method Details

    • create

      public static BCKeyPair create(Blob seed)
    • getSeed

      public Blob getSeed()
      Description copied from class: AKeyPair
      Gets the Ed25519 seed for this key pair
      Specified by:
      getSeed in class AKeyPair
      Returns:
      Seed blob of 32 bytes
    • getAccountKey

      public AccountKey getAccountKey()
      Description copied from class: AKeyPair
      Gets the Account Public Key of this KeyPair
      Specified by:
      getAccountKey in class AKeyPair
      Returns:
      AccountKey for this KeyPair
    • signData

      public <R extends ACell> SignedData<R> signData(R value)
      Description copied from class: AKeyPair
      Signs a value with this key pair
      Specified by:
      signData in class AKeyPair
      Type Parameters:
      R - Type of Value
      Parameters:
      value - Value to sign. Can be any valid CVM value.
      Returns:
      Signed Data Object
    • sign

      public ASignature sign(AArrayBlob hash)
      Description copied from class: AKeyPair
      Signs a hash value with this key pair, producing a signature of the appropriate type.
      Specified by:
      sign in class AKeyPair
      Parameters:
      hash - Hash of value to sign
      Returns:
      A Signature compatible with the key pair.
    • equals

      public boolean equals(AKeyPair kp)
      Description copied from class: AKeyPair
      Tests if this keypair is equal to another key pair. Generally, a key pair should be considered equal if it has the same public key and produces identical signatures in all cases.
      Specified by:
      equals in class AKeyPair
      Parameters:
      kp - Other key pair to compare with
      Returns:
      True if key pairs are equal
    • equals

      public boolean equals(BCKeyPair other)