diff options
author | Ingela Anderton Andin <[email protected]> | 2012-11-16 10:25:55 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2012-11-16 10:25:55 +0100 |
commit | 9aa4de3c97b98974f32c2b8e07c971343faf3f13 (patch) | |
tree | 19e1b2574a6d27f32c59a343049abfa1ebd41809 /lib/public_key/test/public_key_SUITE.erl | |
parent | 7a637b67d2c97ed682fb338f66ec9aabbf8d47c9 (diff) | |
parent | 1180643da5bedf3b3b50ef9c25c361c1c2be7316 (diff) | |
download | otp-9aa4de3c97b98974f32c2b8e07c971343faf3f13.tar.gz otp-9aa4de3c97b98974f32c2b8e07c971343faf3f13.tar.bz2 otp-9aa4de3c97b98974f32c2b8e07c971343faf3f13.zip |
Merge branch 'ia/public_key/Additional-PKCS-support/OTP-10509' into maint
* ia/public_key/Additional-PKCS-support/OTP-10509:
Prepare for release
public_key: Add PKCS-10 documentation and PKCS-7 test case
public_key: Simplified PKCS-7 and PKCS-10 specs.
public_key: Added PKCS-10
public_key: Modified PKCS-7.asn1, removing unnecessary IMPORTS.
public_key: Add PKCS-7
Diffstat (limited to 'lib/public_key/test/public_key_SUITE.erl')
-rw-r--r-- | lib/public_key/test/public_key_SUITE.erl | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl index 6a879867e1..1db3b9df90 100644 --- a/lib/public_key/test/public_key_SUITE.erl +++ b/lib/public_key/test/public_key_SUITE.erl @@ -111,7 +111,7 @@ all() -> groups() -> [{pem_decode_encode, [], [dsa_pem, rsa_pem, encrypted_pem, - dh_pem, cert_pem]}, + dh_pem, cert_pem, pkcs10_pem]}, {ssh_public_key_decode_encode, [], [ssh_rsa_public_key, ssh_dsa_public_key, ssh_rfc4716_rsa_comment, ssh_rfc4716_dsa_comment, ssh_rfc4716_rsa_subject, ssh_known_hosts, @@ -249,7 +249,42 @@ dh_pem(Config) when is_list(Config) -> DHParameter = public_key:pem_entry_decode(Entry), Entry = public_key:pem_entry_encode('DHParameter', DHParameter). - + +%%-------------------------------------------------------------------- + +pkcs10_pem(doc) -> + [""]; +pkcs10_pem(suite) -> + []; +pkcs10_pem(Config) when is_list(Config) -> + Datadir = ?config(data_dir, Config), + [{'CertificationRequest', DerPKCS10, not_encrypted} = Entry] = + erl_make_certs:pem_to_der(filename:join(Datadir, "req.pem")), + + erl_make_certs:der_to_pem(filename:join(Datadir, "new_req.pem"), [Entry]), + + PKCS10 = public_key:der_decode('CertificationRequest', DerPKCS10), + PKCS10 = public_key:pem_entry_decode(Entry), + + Entry = public_key:pem_entry_encode('CertificationRequest', PKCS10). + +%%-------------------------------------------------------------------- +pkcs7_pem(doc) -> + [""]; +pkcs7_pem(suite) -> + []; +pkcs7_pem(Config) when is_list(Config) -> + Datadir = ?config(data_dir, Config), + [{'ContentInfo', DerPKCS7, not_encrypted} = Entry] = + erl_make_certs:pem_to_der(filename:join(Datadir, "pkcs7_cert.pem")), + + erl_make_certs:der_to_pem(filename:join(Datadir, "new_pkcs7_cert.pem"), [Entry]), + + PKCS7 = public_key:der_decode('ContentInfo', DerPKCS7), + PKCS7 = public_key:pem_entry_decode(Entry), + + Entry = public_key:pem_entry_encode('ContentInfo', PKCS7). + %%-------------------------------------------------------------------- cert_pem(doc) -> [""]; |