~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/public_key/doc/src/public_key.xml

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0" encoding="latin1" ?>
 
1
<?xml version="1.0" encoding="iso-8859-1" ?>
2
2
<!DOCTYPE erlref SYSTEM "erlref.dtd">
3
3
 
4
4
<erlref>
5
5
  <header>
6
6
    <copyright>
7
7
      <year>2008</year>
8
 
      <year>2008</year>
 
8
      <year>2011</year>
9
9
      <holder>Ericsson AB, All Rights Reserved</holder>
10
10
    </copyright>
11
11
    <legalnotice>
34
34
  <modulesummary> API module for public key infrastructure.</modulesummary>
35
35
  <description>
36
36
    <p>This module provides functions to handle public key infrastructure
37
 
    from RFC 3280 - X.509 certificates (will later be upgraded to RFC 5280)
38
 
    and some parts of the PKCS-standard.
39
 
    Currently this application is mainly used by the new
40
 
    ssl implementation. The API is yet under construction 
41
 
    and only a few of the functions are currently documented and thereby supported.
 
37
    from RFC 5280 - X.509 certificates and some parts of the PKCS-standard.
42
38
    </p>
43
39
  </description>
44
40
 
62
58
    
63
59
    <p><c>boolean() = true | false</c></p> 
64
60
 
65
 
    <p><c>string = [bytes()]</c></p> 
 
61
    <p><c>string = [bytes()]</c></p>
 
62
   
 
63
    <p><c>der_encoded() = binary() </c></p>
 
64
 
 
65
    <p><c>decrypt_der() = binary() </c></p>
 
66
    
 
67
    <p><c>pki_asn1_type() = 'Certificate' | 'RSAPrivateKey'| 'RSAPublicKey'
 
68
    'DSAPrivateKey' | 'DSAPublicKey' | 'DHParameter' | 'SubjectPublicKeyInfo'</c></p>
 
69
 
 
70
     <p><c>pem_entry () = {pki_asn1_type(), der_encoded() | decrypt_der(), not_encrypted |
 
71
     {"DES-CBC" | "DES-EDE3-CBC",  crypto:rand_bytes(8)}}.</c></p>
66
72
     
67
 
    <p><c>asn1_der_encoded() = binary() | [bytes()]</c></p> 
68
 
 
69
 
    <p><c>der_bin() = binary() </c></p> 
70
 
    
71
 
    <p><c>oid() - a tuple of integers 
72
 
    as generated by the asn1 compiler.</c></p>
73
 
 
74
 
    <p><c>public_key() = rsa_public_key() | dsa_public_key()</c></p> 
75
 
 
76
73
    <p><c>rsa_public_key()  = #'RSAPublicKey'{}</c></p> 
77
74
    
78
75
    <p><c>rsa_private_key() = #'RSAPrivateKey'{} </c></p>
79
76
 
80
 
    <p><c>dsa_public_key() = integer() </c></p> 
81
 
 
82
 
    <p><c>public_key_params() = dsa_key_params() </c></p>
83
 
    
84
 
    <p><c>dsa_key_params()  = #'Dss-Parms'{} </c></p> 
85
 
    
86
 
    <p><c>private_key() =  rsa_private_key() | dsa_private_key()</c></p> 
 
77
    <p><c>dsa_public_key() = {integer(),  #'Dss-Parms'{}} </c></p> 
87
78
 
88
79
    <p><c>rsa_private_key() = #'RSAPrivateKey'{} </c></p> 
89
80
    
90
81
    <p><c>dsa_private_key() = #'DSAPrivateKey'{}</c></p>
91
 
 
92
 
    <p><c>x509_certificate() = "#Certificate{}"</c></p>
93
 
 
94
 
    <p><c>x509_tbs_certificate() = #'TBSCertificate'{} </c></p> 
95
 
 
 
82
    
 
83
    <p><c> public_crypt_options() = [{rsa_pad, rsa_padding()}]. </c></p>
 
84
 
 
85
    <p><c> rsa_padding() =  'rsa_pkcs1_padding' | 'rsa_pkcs1_oaep_padding' 
 
86
    | 'rsa_no_padding'</c></p>
 
87
    
 
88
    <p><c> rsa_digest_type()  = 'md5' | 'sha' </c></p>
 
89
    
 
90
    <p><c> dss_digest_type()  = 'none' | 'sha' </c></p>
 
91
    
96
92
<!--     <p><c>policy_tree() = [Root, Children]</c></p> -->
97
93
    
98
94
<!--     <p><c>Root = #policy_tree_node{}</c></p>    -->
121
117
<!--          that would satisfy this policy in the certificate x+1. </item>         -->
122
118
<!--     </taglist> -->
123
119
  </section> 
124
 
  
125
 
<funcs>  
126
 
  <func> 
127
 
    <name>decode_private_key(KeyInfo) -> </name> 
128
 
    <name>decode_private_key(KeyInfo, Password) -> {ok, PrivateKey} | {error, Reason}</name> 
129
 
    <fsummary> Decodes an asn1 der encoded private key.</fsummary> 
130
 
    <type> 
131
 
      <v> KeyInfo =  {KeyType, der_bin(), ChipherInfo} </v>
132
 
      <d> As returned from pem_to_der/1 for private keys</d>
133
 
      <v> KeyType =  rsa_private_key | dsa_private_key </v>
134
 
      <v> ChipherInfo = opaque() | no_encryption </v>
135
 
      <d> ChipherInfo may contain encryption parameters if the private key is password
136
 
      protected, these are opaque to the user just pass the value returned by pem_to_der/1
137
 
      to this function.</d>
138
 
      <v> Password =  string() </v>
139
 
      <d>Must be specified if CipherInfo =/= no_encryption</d>
140
 
      <v> PrivateKey =  private_key() </v>
141
 
      <v> Reason = term() </v> 
142
 
    </type>
143
 
    <desc>
144
 
         <p>Decodes an asn1 der encoded private key.</p>
145
 
    </desc> 
146
 
  </func> 
147
 
     
148
 
  <func>
149
 
    <name>pem_to_der(File) -> {ok, [Entry]}</name>
150
 
    <fsummary>Reads a PEM file and translates it into its asn1 der
151
 
    encoded parts.</fsummary>
152
 
    <type>
153
 
      <v>File = path()</v> 
154
 
    <v>Password = string()</v> 
155
 
    <v>Entry = {entry_type(), der_bin(), CipherInfo}</v>
156
 
    <v> ChipherInfo = opaque() | no_encryption </v>
157
 
    <d> ChipherInfo may contain encryption parameters if the private key is password
158
 
    protected, these will be handled by the function decode_private_key/2. </d>
159
 
    <v>entry_type() = cert | cert_req | rsa_private_key | dsa_private_key | 
160
 
    dh_params </v>
161
 
  </type> 
162
 
  <desc> 
163
 
    <p>Reads a PEM file and translates it into its asn1 der 
164
 
    encoded parts.</p> 
165
 
  </desc> 
166
 
  </func> 
167
 
    
168
 
  <func> 
169
 
    <name>pkix_decode_cert(Cert, Type) -> {ok, DecodedCert} | {error, Reason}</name> 
170
 
    <fsummary> Decodes an asn1 der encoded pkix certificate. </fsummary> 
171
 
    <type> 
172
 
      <v>Cert = asn1_der_encoded() </v>
173
 
      <v>Type = plain | otp</v> 
174
 
      <v>DecodeCert = x509_certificate() </v> 
175
 
      <d>When type is specified as otp the asn1 spec OTP-PKIX.asn1 is used to decode known
176
 
      extensions and enhance the signature field in
177
 
      #'Certificate'{} and '#TBSCertificate'{}. This is currently used by the new ssl
178
 
      implementation but not documented and supported for the public_key application.</d> 
179
 
      <v>Reason = term() </v> 
180
 
    </type> 
181
 
    <desc>
182
 
      <p> Decodes an asn1 encoded pkix certificate.</p> 
183
 
    </desc> 
184
 
  </func>
185
 
  
186
 
<!--     <func> -->
187
 
<!--       <name> pkix_encode_cert(Cert) -> {ok, EncodedCert} | {error, Reason}</name> -->
188
 
<!--       <fsummary>Encodes a certificate record using asn1. </fsummary> -->
189
 
<!--       <type> -->
190
 
<!--    <v>Cert = x509_certificate() </v> -->
191
 
<!--    <v>EncodedCert = asn1_der_encoded() </v> -->
192
 
<!--    <v>Reason = term() </v> -->
193
 
<!--       </type> -->
194
 
<!--       <desc> -->
195
 
<!--    <p> Encodes a certificate record using asn1.</p> -->
196
 
<!--       </desc> -->
197
 
<!--     </func> -->
198
 
 
199
 
<!--     <func> -->
200
 
<!--       <name>pkix_path_validation(TrustedCert, CertChain, Options) -> {ok, Result} | {error, Reason}</name> -->
201
 
      
202
 
<!--       <fsummary>Performs a basic path validation according to RFC 3280</fsummary> -->
203
 
<!--       <type> -->
204
 
<!--    <v>TrustedCert = asn1_der_encoded()</v> -->
205
 
<!--    <v>CertChain = [asn1_der_encoded()]</v> -->
206
 
<!--    <v>Options = [{Option, Value}]</v>       -->
207
 
<!--       <v>Result = {{algorithm(), public_key(), -->
208
 
<!--       public_key_params()}, policy_tree()}</v> -->
209
 
<!--       </type> -->
210
 
 
211
 
<!--       <desc>  -->
212
 
<!--     <p>Available options are: </p> -->
213
 
<!--       <taglist> -->
214
 
<!--        <tag>{validate_extension_fun, fun()}</tag> -->
215
 
<!--        <item> A fun behaving according to the following outline: -->
216
 
<!--        <code> -->
217
 
<!-- [...] -->
218
 
<!-- ValidateExtensionFun = fun(Extensions, UserState) -> -->
219
 
<!--                            validate_extensions(Extensions, UserState, []) -->
220
 
<!--                        end, -->
221
 
<!-- [...] -->
222
 
 
223
 
<!-- validate_extensions([], UserState, UnknowExtension) -> -->
224
 
<!--     {UserState, UnknowExtension}; -->
225
 
<!-- validate_extensions([#'Extension'{} = Ext | Rest], UserState, UnknowExtension) -> -->
226
 
<!--     case valid_extension(Ext) of -->
227
 
<!--    {true, NewUserState} ->  -->
228
 
<!--        validate_extensions(Rest, NewUserState, UnknowExtension); -->
229
 
<!--    unknown -> -->
230
 
<!--        validate_extensions(Rest, UserState, [Ext | UnknowExtension]); -->
231
 
<!--    {false, Reason} -> -->
232
 
<!--        throw(bad_cert, Reason) -->
233
 
<!--     end.                               -->
234
 
<!--        </code> -->
235
 
            
236
 
<!--        </item> -->
237
 
            
238
 
<!--        <tag>{policy_set, [oid()]}</tag> -->
239
 
<!--        <item>A set of certificate policy -->
240
 
<!--        identifiers naming the policies that are acceptable to the -->
241
 
<!--        certificate user. If the user is not concerned about -->
242
 
<!--        certificate policy there is no need -->
243
 
<!--        to set this option. Defaults to the -->
244
 
<!--        special value [?anyPolicy]. -->
245
 
<!--        </item> -->
246
 
            
247
 
<!--        <tag>{policy_mapping, boolean()}</tag> -->
248
 
<!--        <item>Indicates if policy -->
249
 
<!--        mapping, initially, is allowed in the certification path. -->
250
 
<!--        Defaults to false. -->
251
 
<!--        </item> -->
252
 
            
253
 
<!--        <tag> {explicit_policy, boolean()}</tag> -->
254
 
<!--        <item>Indicates if the path, initially, must be -->
255
 
<!--        valid for at least one of the certificate policies in the user -->
256
 
<!--        specified policy set. -->
257
 
<!--        Defaults to false. -->
258
 
<!--        </item>  -->
259
 
 
260
 
<!--        <tag>{inhibit_any_policy, boolean()}</tag> -->
261
 
<!--        <item>Indicates whether the anyPolicy OID, initially, should -->
262
 
<!--        be processed if it is included in a certificate. -->
263
 
<!--        Defaults to false. -->
264
 
<!--        </item> -->
265
 
            
266
 
<!--      </taglist> -->
267
 
 
268
 
<!--    <p>Performs a basic path validation according to RFC 3280, -->
269
 
<!--    e.i. signature validation, time validation, issuer validation, -->
270
 
<!--    alternative subject name validation, CRL validation, policy -->
271
 
<!--    validation and checks that no unknown extensions -->
272
 
<!--    are marked as critical. The option <c>validate_extension_fun</c> -->
273
 
<!--    may be used to validate application specific extensions. If -->
274
 
<!--    a validation criteria is found to be invalid the validation process -->
275
 
<!--    will immediately be stopped and this functions will return -->
276
 
<!--    {error, Reason}. -->
277
 
<!--    </p> -->
278
 
<!--       </desc> -->
279
 
<!--     </func> -->
280
 
 
281
 
<!--     <func> -->
282
 
<!--       <name>sign(DigestOrTBSCert, Key) -> </name> -->
283
 
<!--       <name>sign(DigestOrTBSCert, Key, KeyParams) -> {ok, SignatureOrDerCert} | {error, Reason}</name> -->
284
 
<!--       <fsummary>Signs Digest/Certificate using Key.</fsummary> -->
285
 
<!--       <type> -->
286
 
<!--    <v>DigestOrTBSCert = binary() | x509_tbs_certificate()</v> -->
287
 
<!--    <v>Key = private_key()</v> -->
288
 
<!--    <v>SignatureORDerCert = binary() | der_bin() </v> -->
289
 
<!--    <v>Reason = term() </v> -->
290
 
<!--       </type> -->
291
 
<!--       <desc> -->
292
 
<!--    <p> Signs Digest/Certificate using Key, in the later -->
293
 
<!--    case a der encoded x509_certificate() will be returned. </p> -->
294
 
<!--       </desc> -->
295
 
<!--     </func> -->
296
 
 
297
 
<!--     <func> -->
298
 
<!--      <name>verify_signature(Digest, Signature, Key) -> </name> -->
299
 
<!--      <name>verify_signature(DerCert, Key, KeyParams) -> </name> -->
300
 
<!--      <name>verify_signature(Digest, Signature, Key, Params) -> Verified </name> -->
301
 
<!--       <fsummary> Verifies the signature. </fsummary> -->
302
 
<!--       <type> -->
303
 
<!--    <v>Digest = binary() </v> -->
304
 
<!--    <v>DerCert = der_bin() </v> -->
305
 
<!--    <v>Signature = binary() </v> -->
306
 
<!--    <v>Key = public_key() </v> -->
307
 
<!--    <v>Params = key_params()</v> -->
308
 
<!--    <v>Verified = boolean()</v> -->
309
 
<!--       </type> -->
310
 
<!--       <desc> -->
311
 
<!--    <p> Verifies the signature Signature. If the key is an rsa-key no -->
312
 
<!--    paramters are neeed.</p> -->
313
 
<!--       </desc> -->
314
 
<!--     </func> -->
 
120
 
 
121
<funcs>    
 
122
 
 
123
  <func>
 
124
    <name>decrypt_private(CipherText, Key [, Options]) -> binary()</name>
 
125
    <fsummary>Public key decryption.</fsummary>
 
126
    <type>
 
127
      <v>CipherText = binary()</v>
 
128
      <v>Key = rsa_private_key()</v>
 
129
      <v>Options = public_crypt_options()</v>
 
130
  </type> 
 
131
  <desc> 
 
132
    <p>Public key decryption using the private key.</p> 
 
133
  </desc> 
 
134
  </func>
 
135
 
 
136
  <func>
 
137
    <name>decrypt_public(CipherText, Key [, Options]) - > binary()</name>
 
138
    <fsummary></fsummary>
 
139
    <type>
 
140
      <v>CipherText = binary()</v>
 
141
      <v>Key = rsa_public_key()</v>
 
142
      <v>Options = public_crypt_options()</v>
 
143
  </type> 
 
144
  <desc> 
 
145
    <p> Public key decryption using the public key.</p> 
 
146
  </desc> 
 
147
  </func> 
 
148
 
 
149
  <func>
 
150
    <name>der_decode(Asn1type, Der) -> term()</name>
 
151
    <fsummary> Decodes a public key asn1 der encoded entity.</fsummary>
 
152
    <type>
 
153
      <v>Asn1Type = atom() -</v>
 
154
      <d> Asn1 type present in the public_key applications
 
155
      asn1 specifications.</d>
 
156
      <v>Der = der_encoded()</v>
 
157
    </type> 
 
158
    <desc> 
 
159
      <p> Decodes a public key asn1 der encoded entity.</p> 
 
160
    </desc> 
 
161
  </func>
 
162
    
 
163
  <func>
 
164
    <name>der_encode(Asn1Type, Entity) -> der_encoded()</name>
 
165
    <fsummary> Encodes a public key entity with asn1 DER encoding.</fsummary>
 
166
    <type>
 
167
      <v>Asn1Type = atom()</v>
 
168
      <d> Asn1 type present in the public_key applications
 
169
         asn1 specifications.</d>
 
170
      <v>Entity = term() - The erlang representation of <c> Asn1Type</c></v>
 
171
  </type> 
 
172
  <desc> 
 
173
    <p> Encodes a public key entity with asn1 DER encoding.</p> 
 
174
  </desc> 
 
175
  </func>
 
176
 
 
177
  <func>
 
178
    <name>pem_decode(PemBin) -> [pem_entry()]</name>
 
179
    <fsummary>Decode PEM binary data and return
 
180
    entries as asn1 der encoded entities. </fsummary>
 
181
    <type>
 
182
      <v>PemBin = binary()</v>
 
183
      <d>Example {ok, PemBin} = file:read_file("cert.pem").</d>
 
184
    </type> 
 
185
  <desc> 
 
186
    <p>Decode PEM binary data and return
 
187
    entries as asn1 der encoded entities.</p> 
 
188
  </desc> 
 
189
  </func> 
 
190
    
 
191
   <func>
 
192
    <name>pem_encode(PemEntries) -> binary()</name>
 
193
    <fsummary>Creates a PEM binary</fsummary>
 
194
    <type>
 
195
      <v> PemEntries = [pem_entry()] </v> 
 
196
  </type> 
 
197
  <desc> 
 
198
    <p>Creates a PEM binary</p> 
 
199
  </desc> 
 
200
  </func>
 
201
 
 
202
   <func>
 
203
    <name>pem_entry_decode(PemEntry [, Password]) -> term()</name>
 
204
    <fsummary>Decodes a pem entry.</fsummary>
 
205
    <type>
 
206
      <v> PemEntry = pem_entry() </v> 
 
207
      <v> Password = string() </v> 
 
208
  </type> 
 
209
  <desc> 
 
210
    <p>Decodes a pem entry. pem_decode/1 returns a list of pem
 
211
    entries. Note that if the pem entry is of type
 
212
    'SubjectPublickeyInfo' it will be further decoded to an
 
213
    rsa_public_key() or dsa_public_key().</p>
 
214
  </desc> 
 
215
  </func>
 
216
 
 
217
   <func>
 
218
    <name>pem_entry_encode(Asn1Type, Entity [,{CipherInfo, Password}]) -> pem_entry()</name>
 
219
    <fsummary> Creates a pem entry that can be fed to pem_encode/1.</fsummary>
 
220
    <type>
 
221
      <v>Asn1Type = pki_asn1_type()</v>
 
222
      <v>Entity = term() - The Erlang representation of
 
223
      <c>Asn1Type</c>.  If <c>Asn1Type</c> is 'SubjectPublicKeyInfo'
 
224
      then <c>Entity</c> must be either an rsa_public_key() or a
 
225
      dsa_public_key() and this function will create the appropriate
 
226
      'SubjectPublicKeyInfo' entry.
 
227
      </v>
 
228
      <v>CipherInfo = {"DES-CBC" | "DES-EDE3-CBC",  crypto:rand_bytes(8)}</v>
 
229
      <v>Password = string()</v> 
 
230
  </type> 
 
231
  <desc> 
 
232
    <p> Creates a pem entry that can be feed to pem_encode/1.</p> 
 
233
  </desc> 
 
234
  </func>
 
235
 
 
236
  <func>
 
237
    <name>encrypt_private(PlainText, Key) -> binary()</name>
 
238
    <fsummary> Public key encryption using the private key.</fsummary>
 
239
    <type>
 
240
      <v>PlainText = binary()</v>
 
241
      <v>Key = rsa_private_key()</v> 
 
242
  </type> 
 
243
  <desc> 
 
244
    <p> Public key encryption using the private key.</p> 
 
245
  </desc> 
 
246
  </func>   
 
247
 
 
248
  <func>
 
249
    <name>encrypt_public(PlainText, Key) -> binary()</name>
 
250
    <fsummary> Public key encryption using the public key.</fsummary>
 
251
    <type>
 
252
      <v>PlainText = binary()</v>
 
253
      <v>Key = rsa_public_key()</v> 
 
254
  </type> 
 
255
  <desc> 
 
256
    <p> Public key encryption using the public key.</p> 
 
257
  </desc> 
 
258
  </func>   
 
259
  
 
260
  <func>
 
261
    <name>pkix_decode_cert(Cert, otp|plain) ->  #'Certificate'{} | #'OTPCertificate'{}</name>
 
262
    <fsummary> Decodes an asn1 der encoded pkix x509 certificate.</fsummary>
 
263
    <type>
 
264
      <v>Cert = der_encoded()</v> 
 
265
  </type> 
 
266
  <desc> 
 
267
    <p>Decodes an asn1 der encoded pkix certificate.  The otp option
 
268
    will use the customized asn1 specification OTP-PKIX.asn1 for
 
269
    decoding and also recursively decode most of the standard
 
270
    parts.</p>
 
271
  </desc> 
 
272
  </func>
 
273
 
 
274
  <func>
 
275
    <name>pkix_encode(Asn1Type, Entity, otp | plain) -> der_encoded()</name>
 
276
    <fsummary>Der encodes a pkix x509 certificate or part of such a
 
277
    certificate.</fsummary>
 
278
    <type>
 
279
      <v>Asn1Type = atom()</v>
 
280
      <d>The asn1 type can be 'Certificate', 'OTPCertificate' or a subtype of either .</d>
 
281
  </type> 
 
282
  <desc> 
 
283
    <p>Der encodes a pkix x509 certificate or part of such a
 
284
    certificate. This function must be used for encoding certificates or parts of certificates
 
285
    that are decoded/created on the otp format, whereas for the plain format this
 
286
    function will directly call der_encode/2. </p> 
 
287
  </desc> 
 
288
  </func>
 
289
 
 
290
 <func>
 
291
    <name>pkix_is_issuer(Cert, IssuerCert) -> boolean()</name>
 
292
    <fsummary> Checks if <c>IssuerCert</c> issued <c>Cert</c> </fsummary>
 
293
    <type>
 
294
      <v>Cert = der_encode() | #'OTPCertificate'{}</v> 
 
295
      <v>IssuerCert = der_encode() | #'OTPCertificate'{}</v> 
 
296
  </type> 
 
297
  <desc> 
 
298
    <p> Checks if <c>IssuerCert</c> issued <c>Cert</c> </p> 
 
299
  </desc> 
 
300
  </func>
 
301
  
 
302
  <func>
 
303
    <name>pkix_is_fixed_dh_cert(Cert) -> boolean()</name>
 
304
    <fsummary> Checks if a Certificate is a fixed Diffie-Hellman Cert.</fsummary>
 
305
    <type>
 
306
        <v>Cert = der_encode() | #'OTPCertificate'{}</v> 
 
307
  </type> 
 
308
  <desc> 
 
309
    <p> Checks if a Certificate is a fixed Diffie-Hellman Cert.</p> 
 
310
  </desc> 
 
311
  </func>  
 
312
  
 
313
  <func>
 
314
    <name>pkix_is_self_signed(Cert) -> boolean()</name>
 
315
    <fsummary> Checks if a Certificate is self signed.</fsummary>
 
316
    <type>
 
317
       <v>Cert = der_encode() | #'OTPCertificate'{}</v> 
 
318
  </type> 
 
319
  <desc> 
 
320
    <p> Checks if a Certificate is self signed.</p> 
 
321
  </desc> 
 
322
  </func>
 
323
 
 
324
  <func>
 
325
    <name>pkix_issuer_id(Cert, IssuedBy) -> {ok, IssuerID} | {error, Reason}</name>
 
326
    <fsummary> Returns the issuer id.</fsummary>
 
327
    <type>
 
328
        <v>Cert = der_encode() | #'OTPCertificate'{}</v>
 
329
        <v>IssuedBy = self | other</v>
 
330
        <v>IssuerID = {integer(), {rdnSequence, [#'AttributeTypeAndValue'{}]}}</v>
 
331
        <d>The issuer id consists of the serial number and the issuers name.</d>
 
332
        <v>Reason = term()</v>
 
333
  </type> 
 
334
  <desc> 
 
335
    <p> Returns the issuer id.</p> 
 
336
  </desc> 
 
337
  </func>
 
338
 
 
339
  <func>
 
340
    <name>pkix_normalize_name(Issuer) -> Normalized</name>
 
341
    <fsummary>Normalizes a issuer name so that it can be easily
 
342
    compared to another issuer name. </fsummary>
 
343
    <type>
 
344
      <v>Issuer = {rdnSequence,[#'AttributeTypeAndValue'{}]}</v>
 
345
      <v>Normalized = {rdnSequence, [#'AttributeTypeAndValue'{}]}</v>
 
346
  </type> 
 
347
  <desc> 
 
348
    <p>Normalizes a issuer name so that it can be easily
 
349
    compared to another issuer name.</p> 
 
350
  </desc> 
 
351
  </func>
 
352
   
 
353
  <!-- <func> -->
 
354
  <!--   <name>pkix_path_validation()</name> -->
 
355
  <!--   <fsummary> Performs a basic path validation according to RFC 5280.</fsummary> -->
 
356
  <!--   <type> -->
 
357
  <!--     <v></v>  -->
 
358
  <!--   </type>  -->
 
359
  <!--   <desc>  -->
 
360
  <!--     <p> Performs a basic path validation according to RFC 5280.</p>  -->
 
361
  <!--   </desc>  -->
 
362
  <!-- </func> -->
 
363
 
 
364
  
 
365
  <func>
 
366
    <name>pkix_sign(#'OTPTBSCertificate'{}, Key) -> der_encode()</name>
 
367
    <fsummary>Signs certificate.</fsummary>
 
368
    <type>
 
369
      <v>Key = rsa_public_key() | dsa_public_key()</v> 
 
370
    </type> 
 
371
    <desc> 
 
372
      <p>Signs a 'OTPTBSCertificate'. Returns the corresponding
 
373
      der encoded certificate.</p> 
 
374
    </desc> 
 
375
  </func> 
 
376
 
 
377
  <func>  
 
378
    <name>pkix_verify(Cert, Key) -> boolean()</name>
 
379
    <fsummary> Verify pkix x.509 certificate signature.</fsummary>
 
380
    <type>
 
381
      <v>Cert = der_encode()</v> 
 
382
      <v>Key = rsa_public_key() | dsa_public_key()</v> 
 
383
    </type> 
 
384
  <desc> 
 
385
    <p> Verify pkix x.509 certificate signature.</p> 
 
386
  </desc> 
 
387
  </func> 
 
388
 
 
389
  <func>
 
390
    <name>sign(Msg, DigestType, Key) -> binary()</name>
 
391
    <fsummary> Create digital signature.</fsummary>
 
392
    <type>
 
393
       <v>Msg = binary()</v>
 
394
       <d>The msg is either the binary "plain text" data to be
 
395
       signed or in the case that digest type is <c>none</c>
 
396
       it is the hashed value of "plain text" i.e. the digest.</d>
 
397
       <v>DigestType = rsa_digest_type() | dsa_digest_type()</v>
 
398
       <v>Key = rsa_public_key() | dsa_public_key()</v> 
 
399
  </type> 
 
400
  <desc> 
 
401
    <p> Creates a digital signature.</p> 
 
402
  </desc> 
 
403
  </func>   
 
404
 
 
405
  <func>
 
406
    <name>verify(Msg, DigestType, Signature, Key) -> boolean()</name>
 
407
    <fsummary>Verifies a digital signature.</fsummary>
 
408
    <type>
 
409
      <v>Msg = binary()</v>
 
410
       <d>The msg is either the binary "plain text" data 
 
411
        or in the case that digest type is <c>none</c>
 
412
        it is the hashed value of "plain text" i.e. the digest.</d>
 
413
      <v>DigestType = rsa_digest_type() | dsa_digest_type()</v>
 
414
      <v>Signature = binary()</v>
 
415
      <v>Key = rsa_public_key() | dsa_public_key()</v> 
 
416
  </type> 
 
417
  <desc> 
 
418
    <p>Verifies a digital signature</p> 
 
419
  </desc> 
 
420
  </func>
 
421
  
315
422
</funcs>
316
423
 
317
424
</erlref>