java.lang.Object
com.hedera.hashgraph.sdk.Pem

final class Pem extends Object
Internal utility class for handling PEM objects.
Privacy-Enhanced Mail (PEM) is a de facto file format for storing and sending cryptographic keys, certificates, and other data, based on a set of 1993 IETF standards defining "privacy-enhanced mail."
  • Method Details

    • writeEncryptedPrivateKey

      static void writeEncryptedPrivateKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo pkInfo, Writer out, String passphrase) throws IOException
      For some reason, this generates PEM encodings that we ourselves can import, but OpenSSL doesn't like. We decided to punt on generating encrypted PEMs for now but saving the code for when we get back to it and/or any demand arises.
      Throws:
      IOException
    • readPrivateKey

      static org.bouncycastle.asn1.pkcs.PrivateKeyInfo readPrivateKey(Reader input, @Nullable String passphrase) throws IOException
      Create a private key info object from a reader.
      Parameters:
      input - reader object
      passphrase - passphrase
      Returns:
      private key info object
      Throws:
      IOException - if IO operations fail