aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public_key/doc/src
diff options
context:
space:
mode:
authorSeth Falcon <[email protected]>2011-01-18 17:34:41 -0800
committerNiclas Axelsson <[email protected]>2011-02-14 17:28:14 +0100
commitc730d2fb0342523fa9014373b234b426bd9ca6f2 (patch)
treeaf8ff4145b1e9b2bd081bb5258cc611302e8c80c /lib/public_key/doc/src
parent62dad961329a603110ce0e1d3f62554cc5228152 (diff)
downloadotp-c730d2fb0342523fa9014373b234b426bd9ca6f2.tar.gz
otp-c730d2fb0342523fa9014373b234b426bd9ca6f2.tar.bz2
otp-c730d2fb0342523fa9014373b234b426bd9ca6f2.zip
Improved support for RSA and DSA public keys
This patch allows the public_key module to decode and encode RSA and DSA keys encoded using the SubjectPublicKeyInfo format. When pem_entry_encode is called on an RSA or DSA public key type, the key is wrapped in the SubjectPublicKeyInfo format.
Diffstat (limited to 'lib/public_key/doc/src')
-rw-r--r--lib/public_key/doc/src/public_key.xml21
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/public_key/doc/src/public_key.xml b/lib/public_key/doc/src/public_key.xml
index c72719fac4..91e058f74e 100644
--- a/lib/public_key/doc/src/public_key.xml
+++ b/lib/public_key/doc/src/public_key.xml
@@ -64,8 +64,8 @@
<p><c>decrypt_der() = binary() </c></p>
- <p><c>pki_asn1_type() = 'Certificate' | 'RSAPrivateKey'|
- 'DSAPrivateKey' | 'DHParameter'</c></p>
+ <p><c>pki_asn1_type() = 'Certificate' | 'RSAPrivateKey'| 'RSAPublicKey'
+ 'DSAPrivateKey' | 'DSAPublicKey' | 'DHParameter' | 'SubjectPublicKeyInfo'</c></p>
<p><c>pem_entry () = {pki_asn1_type(), der_encoded() | decrypt_der(), not_encrypted |
{"DES-CBC" | "DES-EDE3-CBC", crypto:rand_bytes(8)}}.</c></p>
@@ -207,17 +207,24 @@
<v> Password = string() </v>
</type>
<desc>
- <p>Decodes a pem entry. pem_decode/1 returns a list of
- pem entries.</p>
+ <p>Decodes a pem entry. pem_decode/1 returns a list of pem
+ entries. Note that if the pem entry is of type
+ 'SubjectPublickeyInfo' it will be further decoded to an
+ rsa_public_key() or dsa_public_key().</p>
</desc>
</func>
<func>
<name>pem_entry_encode(Asn1Type, Entity [,{CipherInfo, Password}]) -> pem_entry()</name>
- <fsummary> Creates a pem entry that can be feed to pem_encode/1.</fsummary>
+ <fsummary> Creates a pem entry that can be fed to pem_encode/1.</fsummary>
<type>
- <v>Asn1Type = atom()</v>
- <v>Entity = term()</v>
+ <v>Asn1Type = pki_asn1_type()</v>
+ <v>Entity = term() - The Erlang representation of
+ <c>Asn1Type</c>. If <c>Asn1Type</c> is 'SubjectPublicKeyInfo'
+ then <c>Entity</c> must be either an rsa_public_key() or a
+ dsa_public_key() and this function will create the appropriate
+ 'SubjectPublicKeyInfo' entry.
+ </v>
<v>CipherInfo = {"DES-CBC" | "DES-EDE3-CBC", crypto:rand_bytes(8)}</v>
<v>Password = string()</v>
</type>