|
| 1 | +/// <reference types="node" /> |
| 2 | + |
| 3 | +export class DistinguishedName { |
| 4 | + constructor(rdns?: ReadonlyArray<RelativeDistinguishedName>); |
| 5 | + has(key: number | Buffer | string): boolean; |
| 6 | + get(key: number | Buffer | string): RelativeDistinguishedName; |
| 7 | + getAll(key: number | Buffer | string): RelativeDistinguishedName[]; |
| 8 | + set(key: number | Buffer | string, value: RelativeDistinguishedName | Buffer | string): number; |
| 9 | + delete(key: number | Buffer | string): RelativeDistinguishedName[]; |
| 10 | + push(rdn: RelativeDistinguishedName): number; |
| 11 | + pop(): RelativeDistinguishedName | undefined; |
| 12 | + unshift(rdn: RelativeDistinguishedName): number | undefined; |
| 13 | + shift(): RelativeDistinguishedName | undefined; |
| 14 | + count(): number; |
| 15 | + match(dn: DistinguishedName): boolean; |
| 16 | + format(): string; |
| 17 | + toString(): string; |
| 18 | +} |
| 19 | + |
| 20 | +export class RelativeDistinguishedName { |
| 21 | + constructor(map?: DistinguishedName | RelativeDistinguishedName); |
| 22 | + has(key: Buffer | string): boolean; |
| 23 | + get(key: Buffer | string): Buffer | string; |
| 24 | + set(key: Buffer | string, value: Buffer | string): void; |
| 25 | + delete(key: Buffer | string): boolean; |
| 26 | + count(): number; |
| 27 | + match(rdn: RelativeDistinguishedName): boolean; |
| 28 | + format(): string; |
| 29 | + toString(): string; |
| 30 | +} |
| 31 | + |
| 32 | +/** |
| 33 | + * Escapes an attribute key or value and returns the escaped string. |
| 34 | + * @param value The value to escape. If the value is a {@link Buffer} it will be formatted as an octothorpe (#) followed by the hexadecimal representation of each byte in the buffer. Otherwise the value will be converted to a string and escaped according to RFC 2253. |
| 35 | + */ |
| 36 | +export function escape(value: Buffer | string): string; |
| 37 | + |
| 38 | +/** |
| 39 | + * Formats a {@link DistinguishedName} or {@link RelativeDistinguishedName} instance according to RFC 2253 and returns a UTF-8 encoded string. |
| 40 | + * @param dn The distinguished name or relative distinguished name to format as a string. |
| 41 | + */ |
| 42 | +export function format(dn: ReadonlyArray<RelativeDistinguishedName> | DistinguishedName): string; |
| 43 | + |
| 44 | +/** |
| 45 | + * Parses an RFC 2253 string representation of a distinguished name and returns a {@link DistinguishedName} object. |
| 46 | + * @param seq A UTF-8 encoded distinguished name. |
| 47 | + */ |
| 48 | +export function parse(seq: string): DistinguishedName; |
0 commit comments