Class PrivateKeyReader

java.lang.Object
com.kosdev.kos.commons.util.PrivateKeyReader

public class PrivateKeyReader extends Object
Reader to load a private key stored in PKCS8 format.
Since:
1
Version:
1
  • Constructor Details

    • PrivateKeyReader

      public PrivateKeyReader()
  • Method Details

    • fromFile

      public PrivateKey fromFile(File keyFile) throws IOException
      Return a private key contained in the specified file.
      Parameters:
      keyFile - the file containing the key
      Returns:
      the private key
      Throws:
      IOException
      Since:
      1
    • fromResource

      public PrivateKey fromResource(String resource) throws IOException
      Return a private key contained in the specified resource.
      Parameters:
      resource - the resource containing the key
      Returns:
      the private key
      Throws:
      IOException
      Since:
      1
    • fromInputStream

      public PrivateKey fromInputStream(InputStream is) throws IOException
      Return a private key accessible via the input stream.
      Parameters:
      is - the stream containing the key
      Returns:
      the private key
      Throws:
      IOException
      Since:
      1