File: ssl_pkix.3

package info (click to toggle)
erlang-manpages 1%3A12.b.3-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,188 kB
  • ctags: 2
  • sloc: makefile: 68; perl: 30; sh: 15
file content (78 lines) | stat: -rw-r--r-- 2,528 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
.TH ssl_pkix 3 "ssl  3.9" "Ericsson AB" "ERLANG MODULE DEFINITION"
.SH MODULE
ssl_pkix \- Decoding of PKIX certificates with representation in Erlang\&.
.SH DESCRIPTION
.LP
This module provides decoding of PKIX certificates either provided as files or as binaries\&. 

.SH EXPORTS
.LP
.B
decode_cert(Bin) -> {ok, Cert} | {error, Reason}
.br
.B
decode_cert(Bin, Opts) -> {ok, Cert} | {error, Reason}
.br
.RS
.TP
Types
Bin = binary()
.br
Opts = [pkix | ssl | subject]
.br
Cert = term()
.br
.RE
.RS
.LP
\fIdecode_cert(Bin)\fR is equivalent to \fIdecode_cert(Bin, [])\fR\&.
.LP

.LP
The form of the returned certificate depends on the options\&. 
.LP
If the options list is empty the certificate is returned as a DER encoded binary, i\&.e\&. \fI{ok, Bin}\fR is returned, where \fIBin>\fR is the provided input\&. 
.LP
The options \fIpkix\fR and \fIssl\fR imply that the certificate is returned as a parsed ASN\&.1 structure in the form of an Erlang term\&. 
.LP
The \fIssl\fR option gives a more elaborate return structure, with more explicit information\&. In particular object identifiers are replaced by atoms\&. 
.LP
The options \fIpkix\fR, and \fIssl\fR are mutually exclusive\&. 
.LP
The option \fIsubject\fR implies that only the subject\&'s distinguished name part of the certificate is returned\&. It can only be used together with the option \fIpkix\fR or the option \fIssl\fR\&.
.RE
.LP
.B
decode_cert_file(File) -> {ok, Cert} | {error, Reason}
.br
.B
decode_cert_file(File, Opts) -> {ok, Cert} | {error, Reason}
.br
.RS
.TP
Types
File = path()
.br
Opts = [pem | pkix | ssl | subject]
.br
Cert = term()
.br
.RE
.RS
.LP
\fIdecode_cert_file(File)\fR is equivalent to \fIdecode_cert_file(File, [])\fR\&.
.LP

.LP
The form of the returned certificate depends on the options\&. 
.LP
If the options list is empty the certificate is returned as a DER encoded binary, i\&.e\&. the contents of the input \fIFile\fR is returned as a binary\&. 
.LP
The options \fIpkix\fR and \fIssl\fR implies that the certificate is returned as a parsed ASN\&.1 structure in the form of an Erlang term\&. 
.LP
The \fIssl\fR option gives a more elaborate return structure, with more explicit information\&. In particular object identifiers are replaced by atoms\&. 
.LP
The options \fIpkix\fR, and \fIssl\fR are mutually exclusive\&. 
.LP
The option \fIsubject\fR implies that only the subject\&'s distinguished name part of the peer certificate is returned\&. It can only be used together with the option \fIpkix\fR or the option \fIssl\fR\&.
.RE