diff options
author | Ingela Anderton Andin <[email protected]> | 2010-07-05 17:24:40 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2010-08-23 12:09:41 +0200 |
commit | 12dfe961aeaf1a826d851361a24519e54d8ef119 (patch) | |
tree | 8bf30474bdf6f7aa0cafbcc27a8f2694cc05b141 /lib/ssl/test/ssl_test_lib.erl | |
parent | 871fdb232d7facc58c202ef81634a12fbdcfefb4 (diff) | |
download | otp-12dfe961aeaf1a826d851361a24519e54d8ef119.tar.gz otp-12dfe961aeaf1a826d851361a24519e54d8ef119.tar.bz2 otp-12dfe961aeaf1a826d851361a24519e54d8ef119.zip |
Revise the public_key API
Cleaned up and documented the public_key API to
make it useful for general use.
Diffstat (limited to 'lib/ssl/test/ssl_test_lib.erl')
-rw-r--r-- | lib/ssl/test/ssl_test_lib.erl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl index dd0818827a..34e2488b6c 100644 --- a/lib/ssl/test/ssl_test_lib.erl +++ b/lib/ssl/test/ssl_test_lib.erl @@ -346,9 +346,9 @@ make_dsa_cert_files(RoleStr, Config) -> KeyFile = filename:join([?config(priv_dir, Config), RoleStr, "dsa_key.pem"]), - public_key:der_to_pem(CaCertFile, [{cert, CaCert, not_encrypted}]), - public_key:der_to_pem(CertFile, [{cert, Cert, not_encrypted}]), - public_key:der_to_pem(KeyFile, [CertKey]), + der_to_pem(CaCertFile, [{'Certificate', CaCert, not_encrypted}]), + der_to_pem(CertFile, [{'Certificate', Cert, not_encrypted}]), + der_to_pem(KeyFile, [CertKey]), {CaCertFile, CertFile, KeyFile}. start_upgrade_server(Args) -> @@ -601,3 +601,11 @@ openssl_dsa_suites() -> true end end, Ciphers). + +pem_to_der(File) -> + {ok, PemBin} = file:read_file(File), + public_key:pem_decode(PemBin). + +der_to_pem(File, Entries) -> + PemBin = public_key:pem_encode(Entries), + file:write_file(File, PemBin). |