| Modifier and Type | Method and Description |
|---|---|
String |
encode(Certificate certificate)
Render a certificate in PEM format
|
String |
encode(Iterable<? extends Certificate> certificates)
Render a certificate chain in PEM format
|
byte[] |
encode(PrivateKey privateKey)
Render a private key in PEM format.
|
String |
encode(PublicKey publicKey)
Render a public key in PEM format using PKCS1
|
Pem.Encoder |
with(Pem.Encryption encryption)
Configure an encoder to produce encrypted private keys.
|
Pem.Encoder |
with(Pem.Format format)
Configure a new instance with the specified PKCS format.
|
Pem.Encoder |
with(Pem.Passphrase passphrase)
Configure an encoder to produce encrypted private keys.
|
WritableByteChannel |
write(WritableByteChannel output,
Certificate certificate)
Write a certificate to a byte stream
|
WritableByteChannel |
write(WritableByteChannel output,
PrivateKey privateKey)
Write a private key to a byte stream
|
WritableByteChannel |
write(WritableByteChannel output,
PublicKey publicKey)
Write a public key to a byte stream
|
public Pem.Encoder with(Pem.Format format)
Configure a new instance with the specified PKCS format. Note that the format applies to private and public keys only. Certificates always use X509 PEM encoding.
format - The encoding format for public and private keyspublic Pem.Encoder with(Pem.Encryption encryption)
Configure an encoder to produce encrypted private keys.
Encryption does not apply to public keys or certificates
encryption - The encryption configuration, or null if no encryption is requiredpublic Pem.Encoder with(Pem.Passphrase passphrase)
Configure an encoder to produce encrypted private keys.
Encryption does not apply to public keys or certificates
passphrase - The encryption passphrase, or null if no encryption is requiredpublic String encode(PublicKey publicKey)
Render a public key in PEM format using PKCS1
publicKey - The public keypublic String encode(Certificate certificate)
Render a certificate in PEM format
certificate - The certificatepublic String encode(Iterable<? extends Certificate> certificates)
Render a certificate chain in PEM format
certificates - The certificatespublic byte[] encode(PrivateKey privateKey)
Render a private key in PEM format. The private key is sensitive data and is returned as a byte array. The caller is responsible for erasing the byte array after use.
privateKey - The private keypublic WritableByteChannel write(WritableByteChannel output, PrivateKey privateKey) throws IOException
Write a private key to a byte stream
output - The byte streamprivateKey - The private keyIOException - if an error occurs writing to the streampublic WritableByteChannel write(WritableByteChannel output, PublicKey publicKey) throws IOException
Write a public key to a byte stream
output - The byte streampublicKey - The public keyIOException - if an error occurs writing to the streampublic WritableByteChannel write(WritableByteChannel output, Certificate certificate) throws IOException
Write a certificate to a byte stream
output - The byte streamcertificate - The certificateIOException - if an error occurs writing to the streamCopyright © 2016–2024. All rights reserved.