@@ -72,7 +72,7 @@ public static KeyStore createKeyStore(final String keypem, final String certpem)
72
72
/**
73
73
* from "cert.pem" String
74
74
*/
75
- private static List <Certificate > loadCertificates (final String certpem ) throws IOException ,
75
+ public static List <Certificate > loadCertificates (final String certpem ) throws IOException ,
76
76
CertificateException {
77
77
final StringReader certReader = new StringReader (certpem );
78
78
try (BufferedReader reader = new BufferedReader (certReader )) {
@@ -83,7 +83,7 @@ private static List<Certificate> loadCertificates(final String certpem) throws I
83
83
/**
84
84
* "cert.pem" from reader
85
85
*/
86
- private static List <Certificate > loadCertificates (final Reader reader ) throws IOException ,
86
+ public static List <Certificate > loadCertificates (final Reader reader ) throws IOException ,
87
87
CertificateException {
88
88
try (PEMParser pemParser = new PEMParser (reader )) {
89
89
List <Certificate > certificates = new ArrayList <>();
@@ -105,7 +105,7 @@ private static List<Certificate> loadCertificates(final Reader reader) throws IO
105
105
* Return private key ("key.pem") from Reader
106
106
*/
107
107
@ CheckForNull
108
- private static PrivateKey loadPrivateKey (final Reader reader ) throws IOException , NoSuchAlgorithmException ,
108
+ public static PrivateKey loadPrivateKey (final Reader reader ) throws IOException , NoSuchAlgorithmException ,
109
109
InvalidKeySpecException {
110
110
try (PEMParser pemParser = new PEMParser (reader )) {
111
111
Object readObject = pemParser .readObject ();
@@ -138,7 +138,7 @@ private static PrivateKey loadPrivateKey(final Reader reader) throws IOException
138
138
}
139
139
140
140
@ CheckForNull
141
- private static PrivateKey guessKey (byte [] encodedKey ) throws NoSuchAlgorithmException {
141
+ public static PrivateKey guessKey (byte [] encodedKey ) throws NoSuchAlgorithmException {
142
142
//no way to know, so iterate
143
143
for (String guessFactory : new String []{"RSA" , "ECDSA" }) {
144
144
try {
@@ -157,7 +157,7 @@ private static PrivateKey guessKey(byte[] encodedKey) throws NoSuchAlgorithmExce
157
157
* Return KeyPair from "key.pem"
158
158
*/
159
159
@ CheckForNull
160
- private static PrivateKey loadPrivateKey (final String keypem ) throws IOException , NoSuchAlgorithmException ,
160
+ public static PrivateKey loadPrivateKey (final String keypem ) throws IOException , NoSuchAlgorithmException ,
161
161
InvalidKeySpecException {
162
162
try (StringReader certReader = new StringReader (keypem );
163
163
BufferedReader reader = new BufferedReader (certReader )) {
0 commit comments