Class KeyPairWriter

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class KeyPairWriter
    extends Object
    implements Closeable
    Class to write the key pair into two files. Key are read individually but they are written in pairs right after they are generated. This class can be used by applications that generate keys, and it is used by the repl application. Create an instance of the class using one of the constructors specifying the output files and then invoke the write(LicenseKeyPair, IOFormat) method to save the keys into the files.
    • Constructor Detail

      • KeyPairWriter

        public KeyPairWriter​(OutputStream privateKeyOutputStream,
                             OutputStream publicKeyOutputStream)
        Create a target for license key pair writing specifying the outputs as streams.
        Parameters:
        privateKeyOutputStream - output stream for the private key
        publicKeyOutputStream - output stream for the public key
      • KeyPairWriter

        public KeyPairWriter​(File privateKeyFile,
                             File publicKeyFile)
                      throws FileNotFoundException
        Create a target for license key pair writing specifying the outputs as files.
        Parameters:
        privateKeyFile - file for the private key
        publicKeyFile - file for the public key
        Throws:
        FileNotFoundException - when some of the files cannot be opened to write into.
      • KeyPairWriter

        public KeyPairWriter​(String privateKeyFileName,
                             String publicKeyFileName)
                      throws FileNotFoundException
        Create a target for license key pair writing specifying the outputs as file names.
        Parameters:
        privateKeyFileName - the name of the file for the private key
        publicKeyFileName - the name of the file for the public key
        Throws:
        FileNotFoundException - when some of the files cannot be opened to write into.