Class PublicKeyReader

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

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

    • PublicKeyReader

      public PublicKeyReader()
  • Method Details

    • fromFile

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

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

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