modif comtabilite
This commit is contained in:
+89
-1
@@ -507,6 +507,24 @@ is valid for. The possible strings at the moment are:
|
||||
Authority)
|
||||
* `'crl'` -- key can be used to sign Certificate Revocation Lists (CRLs)
|
||||
|
||||
### `Certificate#getExtension(nameOrOid)`
|
||||
|
||||
Retrieves information about a certificate extension, if present, or returns
|
||||
`undefined` if not. The string argument `nameOrOid` should be either the OID
|
||||
(for X509 extensions) or the name (for OpenSSH extensions) of the extension
|
||||
to retrieve.
|
||||
|
||||
The object returned will have the following properties:
|
||||
|
||||
* `format` -- String, set to either `'x509'` or `'openssh'`
|
||||
* `name` or `oid` -- String, only one set based on value of `format`
|
||||
* `data` -- Buffer, the raw data inside the extension
|
||||
|
||||
### `Certificate#getExtensions()`
|
||||
|
||||
Returns an Array of all present certificate extensions, in the same manner and
|
||||
format as `getExtension()`.
|
||||
|
||||
### `Certificate#isExpired([when])`
|
||||
|
||||
Tests whether the Certificate is currently expired (i.e. the `validFrom` and
|
||||
@@ -614,6 +632,44 @@ Parameters
|
||||
|
||||
Returns an Identity instance.
|
||||
|
||||
### `identityFromArray(arr)`
|
||||
|
||||
Constructs an Identity from an array of DN components (see `Identity#toArray()`
|
||||
for the format).
|
||||
|
||||
Parameters
|
||||
|
||||
- `arr` -- an Array of Objects, DN components with `name` and `value`
|
||||
|
||||
Returns an Identity instance.
|
||||
|
||||
|
||||
Supported attributes in DNs:
|
||||
|
||||
| Attribute name | OID |
|
||||
| -------------- | --- |
|
||||
| `cn` | `2.5.4.3` |
|
||||
| `o` | `2.5.4.10` |
|
||||
| `ou` | `2.5.4.11` |
|
||||
| `l` | `2.5.4.7` |
|
||||
| `s` | `2.5.4.8` |
|
||||
| `c` | `2.5.4.6` |
|
||||
| `sn` | `2.5.4.4` |
|
||||
| `postalCode` | `2.5.4.17` |
|
||||
| `serialNumber` | `2.5.4.5` |
|
||||
| `street` | `2.5.4.9` |
|
||||
| `x500UniqueIdentifier` | `2.5.4.45` |
|
||||
| `role` | `2.5.4.72` |
|
||||
| `telephoneNumber` | `2.5.4.20` |
|
||||
| `description` | `2.5.4.13` |
|
||||
| `dc` | `0.9.2342.19200300.100.1.25` |
|
||||
| `uid` | `0.9.2342.19200300.100.1.1` |
|
||||
| `mail` | `0.9.2342.19200300.100.1.3` |
|
||||
| `title` | `2.5.4.12` |
|
||||
| `gn` | `2.5.4.42` |
|
||||
| `initials` | `2.5.4.43` |
|
||||
| `pseudonym` | `2.5.4.65` |
|
||||
|
||||
### `Identity#toString()`
|
||||
|
||||
Returns the identity as an LDAP-style DN string.
|
||||
@@ -631,7 +687,39 @@ Set when `type` is `'host'`, `'user'`, or `'email'`, respectively. Strings.
|
||||
|
||||
### `Identity#cn`
|
||||
|
||||
The value of the first `CN=` in the DN, if any.
|
||||
The value of the first `CN=` in the DN, if any. It's probably better to use
|
||||
the `#get()` method instead of this property.
|
||||
|
||||
### `Identity#get(name[, asArray])`
|
||||
|
||||
Returns the value of a named attribute in the Identity DN. If there is no
|
||||
attribute of the given name, returns `undefined`. If multiple components
|
||||
of the DN contain an attribute of this name, an exception is thrown unless
|
||||
the `asArray` argument is given as `true` -- then they will be returned as
|
||||
an Array in the same order they appear in the DN.
|
||||
|
||||
Parameters
|
||||
|
||||
- `name` -- a String
|
||||
- `asArray` -- an optional Boolean
|
||||
|
||||
### `Identity#toArray()`
|
||||
|
||||
Returns the Identity as an Array of DN component objects. This looks like:
|
||||
|
||||
```js
|
||||
[ {
|
||||
"name": "cn",
|
||||
"value": "Joe Bloggs"
|
||||
},
|
||||
{
|
||||
"name": "o",
|
||||
"value": "Organisation Ltd"
|
||||
} ]
|
||||
```
|
||||
|
||||
Each object has a `name` and a `value` property. The returned objects may be
|
||||
safely modified.
|
||||
|
||||
Errors
|
||||
------
|
||||
|
||||
Reference in New Issue
Block a user