From dbf18b8a7713d76c0be307af40e97cd7c564aa53 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Thu, 15 Nov 2012 10:38:05 +0100 Subject: public_key: Simplified PKCS-7 and PKCS-10 specs. Used defenitions from PKIX1Explicit88 to avoid most of the overcomplicated InformationalFrameWork (and friends) ASN-1 specs. We want to keep the public_key API as small and simple as possible. --- lib/public_key/src/pubkey_pem.erl | 4 +++- lib/public_key/src/public_key.erl | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/public_key/src') diff --git a/lib/public_key/src/pubkey_pem.erl b/lib/public_key/src/pubkey_pem.erl index 15290387ff..4012825f20 100644 --- a/lib/public_key/src/pubkey_pem.erl +++ b/lib/public_key/src/pubkey_pem.erl @@ -219,7 +219,9 @@ pem_end(<<"-----BEGIN ENCRYPTED PRIVATE KEY-----">>) -> pem_end(<<"-----BEGIN CERTIFICATE REQUEST-----">>) -> <<"-----END CERTIFICATE REQUEST-----">>; pem_end(<<"-----BEGIN PKCS7-----">>) -> - <<"-----END PKCS7-----">>. + <<"-----END PKCS7-----">>; +pem_end(_) -> + undefined. asn1_type(<<"-----BEGIN CERTIFICATE-----">>) -> 'Certificate'; diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl index f7252d18a6..d5df53e848 100644 --- a/lib/public_key/src/public_key.erl +++ b/lib/public_key/src/public_key.erl @@ -176,9 +176,7 @@ der_decode(Asn1Type, Der) when is_atom(Asn1Type), is_binary(Der) -> %% Description: Encodes a public key entity with asn1 DER encoding. %%-------------------------------------------------------------------- der_encode(Asn1Type, Entity) when (Asn1Type == 'PrivateKeyInfo') or - (Asn1Type == 'EncryptedPrivateKeyInfo') or - (Asn1Type == 'CertificationRequest') - -> + (Asn1Type == 'EncryptedPrivateKeyInfo') -> try {ok, Encoded} = 'PKCS-FRAME':encode(Asn1Type, Entity), iolist_to_binary(Encoded) -- cgit v1.2.3