Class PEMHelper
- java.lang.Object
-
- org.jenkinsci.main.modules.instance_identity.pem.PEMHelper
-
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class PEMHelper extends Object
Helper class to decode and encode PEM formatted strings usingPEMEncodable
- See Also:
PEMEncodable
,PEMEncodable.encode()
,PEMEncodable.decode(String, char[])
-
-
Constructor Summary
Constructors Constructor Description PEMHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static KeyPair
decodePEM(String pem)
Decodes a PEM formatted string toKeyPair
.static String
encodePEM(KeyPair keys)
Encodes aKeyPair
in a PCKS1 PEM formatted string.
-
-
-
Method Detail
-
decodePEM
@NonNull public static KeyPair decodePEM(@NonNull String pem) throws IOException
Decodes a PEM formatted string toKeyPair
. Wrapper forPEMEncodable.decode(String)
.- Parameters:
pem
-String
with the PEM format- Returns:
- decoded PEM as
KeyPair
- Throws:
IOException
- if a problem exists decoding the PEM- See Also:
PEMEncodable.decode(String, char[])
-
encodePEM
@NonNull public static String encodePEM(@NonNull KeyPair keys) throws IOException
Encodes aKeyPair
in a PCKS1 PEM formatted string. Wrapper forPEMEncodable.encode()
.- Parameters:
keys
-KeyPair
to encode- Returns:
KeyPair
as an encoded PEM String- Throws:
IOException
- if a problem exists decoding the PEM- See Also:
PEMEncodable.encode()
-
-