public class PemHolder
extends java.lang.Object
Holder class that takes 2 byte arrays with a public and a private key pair and makes them available a Strings that can be written to PEM files or Keep’s config settings
Constructor and Description |
---|
PemHolder(byte[] privateKeyBytes,
byte[] publicKeyBytes,
byte[] certBytes) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
cert(boolean pemForm) |
PemHolder |
certToFile(java.io.File destination)
Write the cert out into a given file
|
java.lang.String |
privateKey(boolean pemForm) |
PemHolder |
privateKeyToFile(java.io.File destination)
Write the private key out into a given file
|
java.lang.String |
publicKey(boolean pemForm) |
PemHolder |
publicKeyToFile(java.io.File destination)
Write the public key out into a given file
|
java.lang.String |
toString() |
public PemHolder(byte[] privateKeyBytes, byte[] publicKeyBytes, byte[] certBytes)
privateKeyBytes
- publicKeyBytes
- certBytes
- Public X509 certificatepublic java.lang.String cert(boolean pemForm)
pemForm
- true for PEM, fals for one long stringpublic PemHolder certToFile(java.io.File destination) throws java.io.IOException
Write the cert out into a given file
destination
- File objectjava.io.IOException
public java.lang.String privateKey(boolean pemForm)
pemForm
- true for PEM, fals for one long stringpublic PemHolder privateKeyToFile(java.io.File destination) throws java.io.IOException
Write the private key out into a given file
destination
- File objectjava.io.IOException
public java.lang.String publicKey(boolean pemForm)
pemForm
- true for PEM, fals for one long stringpublic PemHolder publicKeyToFile(java.io.File destination) throws java.io.IOException
Write the public key out into a given file
destination
- File objectjava.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object