Class KeyPair

java.lang.Object
com.exonum.binding.common.crypto.KeyPair

public class KeyPair
extends java.lang.Object
A key pair class that stores public and private keys.
  • Method Summary

    Modifier and Type Method Description
    PrivateKey getPrivateKey()
    Returns a private key of this pair.
    PublicKey getPublicKey()
    Returns a public key of this pair.
    static KeyPair newInstance​(byte[] privateKey, byte[] publicKey)
    Creates a KeyPair from two byte arrays, representing privateKey and publicKey.
    static KeyPair newInstance​(PrivateKey privateKey, PublicKey publicKey)
    Creates a new KeyPair from the given key pairs.

    Methods inherited from class java.lang.Object

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

    • newInstance

      public static KeyPair newInstance​(PrivateKey privateKey, PublicKey publicKey)
      Creates a new KeyPair from the given key pairs.
    • newInstance

      public static KeyPair newInstance​(byte[] privateKey, byte[] publicKey)
      Creates a KeyPair from two byte arrays, representing privateKey and publicKey. All arrays are defensively copied.
    • getPrivateKey

      public PrivateKey getPrivateKey()
      Returns a private key of this pair.
    • getPublicKey

      public PublicKey getPublicKey()
      Returns a public key of this pair.