Class Identity


  • public final class Identity
    extends Object
    A combination of a private and public key.
    Author:
    Rob Spoor
    Since:
    1.2
    • Method Detail

      • fromFiles

        public static Identity fromFiles​(File privateKeyFile)
        Creates a key pair from private key and public key files. The public key file will be the private key file with .pub appended to the name.
        Parameters:
        privateKeyFile - The private key file.
        Returns:
        The created key pair.
      • fromFiles

        public static Identity fromFiles​(File privateKeyFile,
                                         String passphrase)
        Creates a key pair from private key and public key files. The public key file will be the private key file with .pub appended to the name.
        Parameters:
        privateKeyFile - The private key file.
        passphrase - The passphrase for the private key.
        Returns:
        The created key pair.
      • fromFiles

        public static Identity fromFiles​(File privateKeyFile,
                                         byte[] passphrase)
        Creates a key pair from private key and public key files. The public key file will be the private key file with .pub appended to the name.
        Parameters:
        privateKeyFile - The private key file.
        passphrase - The passphrase for the private key.
        Returns:
        The created key pair.
      • fromFiles

        public static Identity fromFiles​(File privateKeyFile,
                                         File publicKeyFile,
                                         byte[] passphrase)
        Creates a key pair from private key and public key files.
        Parameters:
        privateKeyFile - The private key file.
        publicKeyFile - The public key file.
        passphrase - The passphrase for the private key.
        Returns:
        The created key pair.
      • fromData

        public static Identity fromData​(String name,
                                        byte[] privateKey,
                                        byte[] publicKey,
                                        byte[] passphrase)
        Creates a key pair from a private key and public key.
        Parameters:
        name - The name of the key pair.
        privateKey - The private key data.
        publicKey - The public key data.
        passphrase - The passphrase for the private key.
        Returns:
        The created key pair.
        Since:
        1.4