Class PEMDecoder

java.lang.Object
io.fusionauth.pem.PEMDecoder

public class PEMDecoder extends Object
Author:
Daniel DeGroff
  • Constructor Details

    • PEMDecoder

      public PEMDecoder()
  • Method Details

    • decode

      public PEM decode(Path path)
      Decode a PEM and extract the public or private keys. If the encoded private key contains the public key, the returned PEM object will contain both keys.
      Parameters:
      path - the path to the encoded PEM file
      Returns:
      a PEM object containing a public or private key, or both
    • decode

      public PEM decode(byte[] bytes)
      Decode a PEM and extract the public or private keys. If the encoded private key contains the public key, the returned PEM object will contain both keys.
      Parameters:
      bytes - the byte array of the encoded PEM file
      Returns:
      a PEM object containing a public or private key, or both
    • decode

      public PEM decode(String encodedKey)
      Decode a PEM and extract the public or private keys. If the encoded private key contains the public key, the returned PEM object will contain both keys.
      Parameters:
      encodedKey - the string representation the encoded PEM
      Returns:
      a PEM object containing a public or private key, or both