java.lang.Object
com.hedera.hashgraph.sdk.Pem
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."
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 Summary
Modifier and TypeMethodDescription(package private) static org.bouncycastle.asn1.pkcs.PrivateKeyInforeadPrivateKey(Reader input, String passphrase) Create a private key info object from a reader.(package private) static voidwriteEncryptedPrivateKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo pkInfo, Writer out, String passphrase) For some reason, this generates PEM encodings that we ourselves can import, but OpenSSL doesn't like.
-
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 objectpassphrase- passphrase- Returns:
- private key info object
- Throws:
IOException- if IO operations fail
-