@types/rfc2253
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Installation

npm install --save @types/rfc2253

Summary

This package contains type definitions for rfc2253 (https://github.com/foss-haas/rfc2253).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rfc2253.

/// <reference types="node" />

export class DistinguishedName {
    constructor(rdns?: ReadonlyArray<RelativeDistinguishedName>);
    has(key: number | Buffer | string): boolean;
    get(key: number | Buffer | string): RelativeDistinguishedName;
    getAll(key: number | Buffer | string): RelativeDistinguishedName[];
    set(key: number | Buffer | string, value: RelativeDistinguishedName | Buffer | string): number;
    delete(key: number | Buffer | string): RelativeDistinguishedName[];
    push(rdn: RelativeDistinguishedName): number;
    pop(): RelativeDistinguishedName | undefined;
    unshift(rdn: RelativeDistinguishedName): number | undefined;
    shift(): RelativeDistinguishedName | undefined;
    count(): number;
    match(dn: DistinguishedName): boolean;
    format(): string;
    toString(): string;
}

export class RelativeDistinguishedName {
    constructor(map?: DistinguishedName | RelativeDistinguishedName);
    has(key: Buffer | string): boolean;
    get(key: Buffer | string): Buffer | string;
    set(key: Buffer | string, value: Buffer | string): void;
    delete(key: Buffer | string): boolean;
    count(): number;
    match(rdn: RelativeDistinguishedName): boolean;
    format(): string;
    toString(): string;
}

/**
 * Escapes an attribute key or value and returns the escaped string.
 * @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.
 */
export function escape(value: Buffer | string): string;

/**
 * Formats a {@link DistinguishedName} or {@link RelativeDistinguishedName} instance according to RFC 2253 and returns a UTF-8 encoded string.
 * @param dn The distinguished name or relative distinguished name to format as a string.
 */
export function format(dn: ReadonlyArray<RelativeDistinguishedName> | DistinguishedName): string;

/**
 * Parses an RFC 2253 string representation of a distinguished name and returns a {@link DistinguishedName} object.
 * @param seq A UTF-8 encoded distinguished name.
 */
export function parse(seq: string): DistinguishedName;

Additional Details

  • Last updated: Thu, 16 Jan 2025 18:02:24 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Arnd Issler.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/rfc2253

Weekly Downloads

11

Version

0.2.0

License

MIT

Unpacked Size

7.06 kB

Total Files

5

Last publish

Collaborators

  • types