Package javax0.license3j.io
Class KeyPairReader
- java.lang.Object
-
- javax0.license3j.io.KeyPairReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class KeyPairReader extends java.lang.Object implements java.io.CloseableClass 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 theread...()methods to read the key into aLicenseKeyPairobject.
-
-
Constructor Summary
Constructors Constructor Description KeyPairReader(java.io.File file)KeyPairReader(java.io.InputStream is)KeyPairReader(java.lang.String fileName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()LicenseKeyPairreadPrivate()LicenseKeyPairreadPrivate(IOFormat format)LicenseKeyPairreadPublic()LicenseKeyPairreadPublic(IOFormat format)
-
-
-
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.IOExceptionjava.security.spec.InvalidKeySpecExceptionjava.security.NoSuchAlgorithmException
-
readPublic
public LicenseKeyPair readPublic(IOFormat format) throws java.io.IOException, java.security.spec.InvalidKeySpecException, java.security.NoSuchAlgorithmException
- Throws:
java.io.IOExceptionjava.security.spec.InvalidKeySpecExceptionjava.security.NoSuchAlgorithmException
-
readPrivate
public LicenseKeyPair readPrivate() throws java.io.IOException, java.security.spec.InvalidKeySpecException, java.security.NoSuchAlgorithmException
- Throws:
java.io.IOExceptionjava.security.spec.InvalidKeySpecExceptionjava.security.NoSuchAlgorithmException
-
readPrivate
public LicenseKeyPair readPrivate(IOFormat format) throws java.io.IOException, java.security.spec.InvalidKeySpecException, java.security.NoSuchAlgorithmException
- Throws:
java.io.IOExceptionjava.security.spec.InvalidKeySpecExceptionjava.security.NoSuchAlgorithmException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-