Class KeyPairReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class KeyPairReader
    extends java.lang.Object
    implements java.io.Closeable
    Class to read a key from file. This class can be used in the application to load the public key and it is also used in the repl application. Create an instance of this class using one of the constructors specifying the source of the license key and then use one of the read...() methods to read the key into a LicenseKeyPair object.
    • Constructor Detail

      • KeyPairReader

        public KeyPairReader​(java.io.InputStream is)
      • KeyPairReader

        public KeyPairReader​(java.io.File file)
                      throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • KeyPairReader

        public KeyPairReader​(java.lang.String fileName)
                      throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
    • Method Detail

      • readPublic

        public LicenseKeyPair readPublic()
                                  throws java.io.IOException,
                                         java.security.spec.InvalidKeySpecException,
                                         java.security.NoSuchAlgorithmException
        Throws:
        java.io.IOException
        java.security.spec.InvalidKeySpecException
        java.security.NoSuchAlgorithmException
      • readPublic

        public LicenseKeyPair readPublic​(IOFormat format)
                                  throws java.io.IOException,
                                         java.security.spec.InvalidKeySpecException,
                                         java.security.NoSuchAlgorithmException
        Throws:
        java.io.IOException
        java.security.spec.InvalidKeySpecException
        java.security.NoSuchAlgorithmException
      • readPrivate

        public LicenseKeyPair readPrivate()
                                   throws java.io.IOException,
                                          java.security.spec.InvalidKeySpecException,
                                          java.security.NoSuchAlgorithmException
        Throws:
        java.io.IOException
        java.security.spec.InvalidKeySpecException
        java.security.NoSuchAlgorithmException
      • readPrivate

        public LicenseKeyPair readPrivate​(IOFormat format)
                                   throws java.io.IOException,
                                          java.security.spec.InvalidKeySpecException,
                                          java.security.NoSuchAlgorithmException
        Throws:
        java.io.IOException
        java.security.spec.InvalidKeySpecException
        java.security.NoSuchAlgorithmException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException