File tree Expand file tree Collapse file tree 4 files changed +39
-4
lines changed
libs/ssl-config/src/test/java/org/elasticsearch/common/ssl
x-pack/plugin/core/src/test
java/org/elasticsearch/xpack/core/ssl
resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple Expand file tree Collapse file tree 4 files changed +39
-4
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ public void testBuildKeyConfigFromPkcs8PemFilesWithoutPassword() throws Exceptio
70
70
}
71
71
72
72
public void testBuildKeyConfigFromPkcs8PemFilesWithPassword () throws Exception {
73
+ assumeFalse ("Can't run in a FIPS JVM, PBE KeySpec is not available" , inFipsJvm ());
73
74
final Path cert = getDataPath ("/certs/cert2/cert2.crt" );
74
75
final Path key = getDataPath ("/certs/cert2/cert2-pkcs8.key" );
75
76
final PemKeyConfig keyConfig = new PemKeyConfig (cert , key , "c2-pass" .toCharArray ());
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ public class PEMKeyConfigTests extends ESTestCase {
23
23
public static final SecureString TESTNODE_PASSWORD = new SecureString ("testnode" .toCharArray ());
24
24
25
25
public void testEncryptedPkcs8RsaKey () throws Exception {
26
+ assumeFalse ("Can't run in a FIPS JVM, PBE KeySpec is not available" , inFipsJvm ());
26
27
verifyKeyConfig ("testnode.crt" , "key_pkcs8_encrypted.pem" , TESTNODE_PASSWORD );
27
28
}
28
29
@@ -31,11 +32,11 @@ public void testUnencryptedPkcs8RsaKey() throws Exception {
31
32
}
32
33
33
34
public void testUnencryptedPkcs8DsaKey () throws Exception {
34
- verifyKeyConfig ("testnode .crt" , "dsa_key_pkcs8_plain.pem" , NO_PASSWORD );
35
+ verifyKeyConfig ("testnode_dsa .crt" , "dsa_key_pkcs8_plain.pem" , NO_PASSWORD );
35
36
}
36
37
37
38
public void testUnencryptedPkcs8EcKey () throws Exception {
38
- verifyKeyConfig ("testnode .crt" , "ec_key_pkcs8_plain.pem" , NO_PASSWORD );
39
+ verifyKeyConfig ("testnode_ec .crt" , "ec_key_pkcs8_plain.pem" , NO_PASSWORD );
39
40
}
40
41
41
42
public void testEncryptedPkcs1RsaKey () throws Exception {
Original file line number Diff line number Diff line change @@ -91,6 +91,10 @@ openssl pkcs12 -in dsa.p12 -nodes -nocerts | openssl pkcs8 -topk8 -nocrypt -outf
91
91
----
92
92
[source,shell]
93
93
----
94
+ openssl pkcs12 -in dsa.p12 -nodes -nokeys -cacerts -out testnode_dsa.crt
95
+ ----
96
+ [source,shell]
97
+ ----
94
98
keytool -importkeystore -srckeystore testnode.jks -destkeystore ec.p12 -deststoretype PKCS12 \
95
99
-srcalias testnode_ec -deststorepass testnode -destkeypass testnode
96
100
----
@@ -99,8 +103,10 @@ keytool -importkeystore -srckeystore testnode.jks -destkeystore ec.p12 -deststor
99
103
openssl pkcs12 -in ec.p12 -nodes -nocerts | openssl pkcs8 -topk8 -nocrypt -outform pem \
100
104
-out ec_key_pkcs8_plain.pem
101
105
----
102
-
103
-
106
+ [source,shell]
107
+ ----
108
+ openssl pkcs12 -in ec.p12 -nodes -nokeys -cacerts -out testnode_ec.crt
109
+ ----
104
110
105
111
Create `PKCS#8` encrypted key from the encrypted `PKCS#1` encoded `testnode.pem`
106
112
[source,shell]
Original file line number Diff line number Diff line change
1
+ Bag Attributes
2
+ friendlyName: testnode_dsa
3
+ localKeyID: 54 69 6D 65 20 31 35 38 37 35 35 38 39 34 34 36 39 38
4
+ subject=CN = Elasticsearch Test Node
5
+
6
+ issuer=CN = Elasticsearch Test Node
7
+
8
+ -----BEGIN CERTIFICATE-----
9
+ MIIDODCCAvSgAwIBAgIEIjxzajANBglghkgBZQMEAwIFADAiMSAwHgYDVQQDExdF
10
+ bGFzdGljc2VhcmNoIFRlc3QgTm9kZTAeFw0xODA1MTcwOTQzMThaFw00NTEwMDIw
11
+ OTQzMThaMCIxIDAeBgNVBAMTF0VsYXN0aWNzZWFyY2ggVGVzdCBOb2RlMIIBtzCC
12
+ ASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9KnC7s5Of2Eb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