aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public_key/src/pubkey_pem.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2012-11-06 16:08:09 +0100
committerIngela Anderton Andin <[email protected]>2012-11-15 14:02:00 +0100
commitdab8d695015acd7574c4b35217c319b13f661234 (patch)
tree57e5654e39659b65064b439ce09b597be0c7865c /lib/public_key/src/pubkey_pem.erl
parent55c2b0b6d55fe6a011671832b5529cb1c7b636a8 (diff)
downloadotp-dab8d695015acd7574c4b35217c319b13f661234.tar.gz
otp-dab8d695015acd7574c4b35217c319b13f661234.tar.bz2
otp-dab8d695015acd7574c4b35217c319b13f661234.zip
public_key: Add PKCS-7
First attempt to add PKCS-7 does not compile
Diffstat (limited to 'lib/public_key/src/pubkey_pem.erl')
-rw-r--r--lib/public_key/src/pubkey_pem.erl13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/public_key/src/pubkey_pem.erl b/lib/public_key/src/pubkey_pem.erl
index 910473d629..f51d59a789 100644
--- a/lib/public_key/src/pubkey_pem.erl
+++ b/lib/public_key/src/pubkey_pem.erl
@@ -194,7 +194,10 @@ pem_start('SubjectPublicKeyInfo') ->
pem_start('DSAPrivateKey') ->
<<"-----BEGIN DSA PRIVATE KEY-----">>;
pem_start('DHParameter') ->
- <<"-----BEGIN DH PARAMETERS-----">>.
+ <<"-----BEGIN DH PARAMETERS-----">>;
+pem_start('ContentInfo') ->
+ <<"-----BEGIN PKCS7-----">>.
+
pem_end(<<"-----BEGIN CERTIFICATE-----">>) ->
<<"-----END CERTIFICATE-----">>;
pem_end(<<"-----BEGIN RSA PRIVATE KEY-----">>) ->
@@ -211,8 +214,8 @@ pem_end(<<"-----BEGIN PRIVATE KEY-----">>) ->
<<"-----END PRIVATE KEY-----">>;
pem_end(<<"-----BEGIN ENCRYPTED PRIVATE KEY-----">>) ->
<<"-----END ENCRYPTED PRIVATE KEY-----">>;
-pem_end(_) ->
- undefined.
+pem_end(<<"-----BEGIN PKCS7-----">>) ->
+ <<"-----END PKCS7-----">>.
asn1_type(<<"-----BEGIN CERTIFICATE-----">>) ->
'Certificate';
@@ -229,7 +232,9 @@ asn1_type(<<"-----BEGIN DH PARAMETERS-----">>) ->
asn1_type(<<"-----BEGIN PRIVATE KEY-----">>) ->
'PrivateKeyInfo';
asn1_type(<<"-----BEGIN ENCRYPTED PRIVATE KEY-----">>) ->
- 'EncryptedPrivateKeyInfo'.
+ 'EncryptedPrivateKeyInfo';
+asn1_type(<<"-----BEGIN PKCS7-----">>) ->
+ 'ContentInfo'.
pem_decrypt() ->
<<"Proc-Type: 4,ENCRYPTED">>.