Modifier and Type | Field and Description |
---|---|
Certificate |
certificate |
static String |
EC_PRIVATE_KEY_PREFIX |
static String |
EC_PRIVATE_KEY_SUFFIX |
static String |
PKCS_1_PRIVATE_KEY_PREFIX |
static String |
PKCS_1_PRIVATE_KEY_SUFFIX |
static String |
PKCS_1_PUBLIC_KEY_PREFIX |
static String |
PKCS_1_PUBLIC_KEY_SUFFIX |
static String |
PKCS_8_PRIVATE_KEY_PREFIX |
static String |
PKCS_8_PRIVATE_KEY_SUFFIX |
PrivateKey |
privateKey |
PublicKey |
publicKey |
static String |
X509_CERTIFICATE_PREFIX |
static String |
X509_CERTIFICATE_SUFFIX |
static String |
X509_PUBLIC_KEY_PREFIX |
static String |
X509_PUBLIC_KEY_SUFFIX |
Constructor and Description |
---|
PEM(Certificate certificate) |
PEM(PrivateKey privateKey) |
PEM(PrivateKey privateKey,
PublicKey publicKey) |
PEM(PublicKey publicKey) |
Modifier and Type | Method and Description |
---|---|
static PEM |
decode(byte[] bytes)
Decode a PEM in string format.
|
static PEM |
decode(Path path)
Decode a PEM in string format.
|
static PEM |
decode(String encodedPEM)
Decode a PEM in string format.
|
static String |
encode(Certificate certificate)
Encode a certificate in PEM format.
|
static String |
encode(Key key)
Encode a key in PEM format.
|
static String |
encode(PrivateKey privateKey,
PublicKey publicKey)
Encode a private key in PEM format given both the private and public key.
|
boolean |
equals(Object o) |
Certificate |
getCertificate() |
<T extends PrivateKey> |
getPrivateKey() |
<T extends PublicKey> |
getPublicKey() |
int |
hashCode() |
public static final String EC_PRIVATE_KEY_PREFIX
public static final String EC_PRIVATE_KEY_SUFFIX
public static final String PKCS_1_PRIVATE_KEY_PREFIX
public static final String PKCS_1_PRIVATE_KEY_SUFFIX
public static final String PKCS_1_PUBLIC_KEY_PREFIX
public static final String PKCS_1_PUBLIC_KEY_SUFFIX
public static final String PKCS_8_PRIVATE_KEY_PREFIX
public static final String PKCS_8_PRIVATE_KEY_SUFFIX
public static final String X509_CERTIFICATE_PREFIX
public static final String X509_CERTIFICATE_SUFFIX
public static final String X509_PUBLIC_KEY_PREFIX
public static final String X509_PUBLIC_KEY_SUFFIX
public Certificate certificate
public PrivateKey privateKey
public PublicKey publicKey
public PEM(PrivateKey privateKey, PublicKey publicKey)
public PEM(PublicKey publicKey)
public PEM(Certificate certificate)
public PEM(PrivateKey privateKey)
public static PEM decode(Path path)
path
- a path to an encoded PEMpublic static PEM decode(String encodedPEM)
encodedPEM
- an encoded PEMpublic static PEM decode(byte[] bytes)
bytes
- a byte array of the PEMpublic static String encode(Key key)
key
- a keypublic static String encode(PrivateKey privateKey, PublicKey publicKey)
The use of this method is only necessary if you are providing a private key that does not contain the encoded public key.
privateKey
- a private keypublicKey
- a public keypublic static String encode(Certificate certificate)
certificate
- The certificate.public Certificate getCertificate()
public <T extends PrivateKey> T getPrivateKey()
public <T extends PublicKey> T getPublicKey()
Copyright © 2021. All rights reserved.