Class PublicKeyReader

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

public class PublicKeyReader extends Object
Reader to load a public key stored in PKCS8 format.
Version:
2024-0214
  • 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
    • 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
    • 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