public class RsaKeyConverters
extends java.lang.Object
Key
converter instancesConstructor and Description |
---|
RsaKeyConverters() |
Modifier and Type | Method and Description |
---|---|
static org.springframework.core.convert.converter.Converter<java.io.InputStream,java.security.interfaces.RSAPrivateKey> |
pkcs8()
Construct a
Converter for converting a PEM-encoded PKCS#8 RSA Private Key
into a RSAPrivateKey . |
static org.springframework.core.convert.converter.Converter<java.io.InputStream,java.security.interfaces.RSAPublicKey> |
x509()
Construct a
Converter for converting a PEM-encoded X.509 RSA Public Key
into a RSAPublicKey . |
public static org.springframework.core.convert.converter.Converter<java.io.InputStream,java.security.interfaces.RSAPrivateKey> pkcs8()
Converter
for converting a PEM-encoded PKCS#8 RSA Private Key
into a RSAPrivateKey
.
Note that keys are often formatted in PKCS#1 and this can easily be identified by the header.
If the key file begins with "-----BEGIN RSA PRIVATE KEY-----", then it is PKCS#1. If it is
PKCS#8 formatted, then it begins with "-----BEGIN PRIVATE KEY-----".
This converter does not close the InputStream
in order to avoid making non-portable
assumptions about the streams' origin and further use.Converter
that can read a PEM-encoded PKCS#8 RSA Private Key and return a
RSAPrivateKey
.public static org.springframework.core.convert.converter.Converter<java.io.InputStream,java.security.interfaces.RSAPublicKey> x509()
Converter
for converting a PEM-encoded X.509 RSA Public Key
into a RSAPublicKey
.
This converter does not close the InputStream
in order to avoid making non-portable
assumptions about the streams' origin and further use.Converter
that can read a PEM-encoded X.509 RSA Public Key and return a
RSAPublicKey
.