Package io.fusionauth.pem.domain
Class PEM
java.lang.Object
io.fusionauth.pem.domain.PEM
- Author:
- Daniel DeGroff
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPEM(Certificate certificate) PEM(PrivateKey privateKey) PEM(PrivateKey privateKey, PublicKey publicKey) -
Method Summary
Modifier and TypeMethodDescriptionstatic PEMdecode(byte[] bytes) Decode a PEM in string format.static PEMDecode a PEM in string format.static PEMDecode a PEM in string format.static Stringencode(Certificate certificate) Encode a certificate in PEM format.static StringEncode a key in PEM format.static Stringencode(PrivateKey privateKey, PublicKey publicKey) Encode a private key in PEM format given both the private and public key.boolean<T extends PrivateKey>
T<T extends PublicKey>
TinthashCode()
-
Field Details
-
EC_PRIVATE_KEY_PREFIX
- See Also:
-
EC_PRIVATE_KEY_SUFFIX
- See Also:
-
PKCS_1_PRIVATE_KEY_PREFIX
- See Also:
-
PKCS_1_PRIVATE_KEY_SUFFIX
- See Also:
-
PKCS_1_PUBLIC_KEY_PREFIX
- See Also:
-
PKCS_1_PUBLIC_KEY_SUFFIX
- See Also:
-
PKCS_8_PRIVATE_KEY_PREFIX
- See Also:
-
PKCS_8_PRIVATE_KEY_SUFFIX
- See Also:
-
X509_CERTIFICATE_PREFIX
- See Also:
-
X509_CERTIFICATE_SUFFIX
- See Also:
-
X509_PUBLIC_KEY_PREFIX
- See Also:
-
X509_PUBLIC_KEY_SUFFIX
- See Also:
-
certificate
-
privateKey
-
publicKey
-
-
Constructor Details
-
PEM
-
PEM
-
PEM
-
PEM
-
-
Method Details
-
decode
Decode a PEM in string format.- Parameters:
path- a path to an encoded PEM- Returns:
- a PEM object
-
decode
Decode a PEM in string format.- Parameters:
encodedPEM- an encoded PEM- Returns:
- a PEM object
-
decode
Decode a PEM in string format.- Parameters:
bytes- a byte array of the PEM- Returns:
- a PEM object
-
encode
Encode a key in PEM format.- Parameters:
key- a key- Returns:
- an encoded PEM
-
encode
Encode a private key in PEM format given both the private and public key.The use of this method is only necessary if you are providing a private key that does not contain the encoded public key.
- Parameters:
privateKey- a private keypublicKey- a public key- Returns:
- an encoded PEM
-
encode
Encode a certificate in PEM format.- Parameters:
certificate- The certificate.- Returns:
- An encoded PEM.
-
equals
-
getCertificate
-
getPrivateKey
-
getPublicKey
-
hashCode
public int hashCode()
-