From 68e803093b8bf43b39f3090a1b717b850a5e8f4b Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 24 Oct 2011 15:01:28 +0200 Subject: Clean up of public_key code adding specs and documentation --- lib/public_key/doc/src/public_key.xml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'lib/public_key/doc') diff --git a/lib/public_key/doc/src/public_key.xml b/lib/public_key/doc/src/public_key.xml index 9a3832c68b..821e7a2300 100644 --- a/lib/public_key/doc/src/public_key.xml +++ b/lib/public_key/doc/src/public_key.xml @@ -61,11 +61,14 @@

string = [bytes()]

pki_asn1_type() = 'Certificate' | 'RSAPrivateKey'| 'RSAPublicKey' - 'DSAPrivateKey' | 'DSAPublicKey' | 'DHParameter' | 'SubjectPublicKeyInfo'

+ 'DSAPrivateKey' | 'DSAPublicKey' | 'DHParameter' | 'SubjectPublicKeyInfo'| 'PrivateKeyInfo'

pem_entry () = {pki_asn1_type(), binary(), %% DER or encrypted DER - not_encrypted | {"DES-CBC" | "DES-EDE3-CBC", crypto:rand_bytes(8)}}.

- + not_encrypted | cipher_info()}

+ +

cipher_info() = {"RC2-CBC | "DES-CBC" | "DES-EDE3-CBC", crypto:rand_bytes(8)} | + 'PBES2-params'}

+

rsa_public_key() = #'RSAPublicKey'{}

rsa_private_key() = #'RSAPrivateKey'{}

@@ -118,7 +121,8 @@ - decrypt_private(CipherText, Key [, Options]) -> binary() + decrypt_private(CipherText, Key) -> binary() + decrypt_private(CipherText, Key, Options) -> binary() Public key decryption. CipherText = binary() @@ -131,7 +135,8 @@ - decrypt_public(CipherText, Key [, Options]) - > binary() + decrypt_public(CipherText, Key) - > binary() + decrypt_public(CipherText, Key, Options) - > binary() CipherText = binary() @@ -198,7 +203,8 @@ - pem_entry_decode(PemEntry [, Password]) -> term() + pem_entry_decode(PemEntry) -> term() + pem_entry_decode(PemEntry, Password) -> term() Decodes a pem entry. PemEntry = pem_entry() @@ -213,7 +219,8 @@ - pem_entry_encode(Asn1Type, Entity [,{CipherInfo, Password}]) -> pem_entry() + pem_entry_encode(Asn1Type, Entity) -> pem_entry() + pem_entry_encode(Asn1Type, Entity, {CipherInfo, Password}) -> pem_entry() Creates a pem entry that can be fed to pem_encode/1. Asn1Type = pki_asn1_type() @@ -224,7 +231,7 @@ dsa_public_key() and this function will create the appropriate 'SubjectPublicKeyInfo' entry. - CipherInfo = {"DES-CBC" | "DES-EDE3-CBC", crypto:rand_bytes(8)} + CipherInfo = cipher_info() Password = string() -- cgit v1.2.3