UNPKG

@ucanto/principal

Version:
58 lines 2.03 kB
/** * @typedef {import('./public-key.js').RSAPublicKey} RSAPublicKey */ /** * Described in RFC 5208 Section 4.1: https://tools.ietf.org/html/rfc5280#section-4.1 * ``` * SubjectPublicKeyInfo ::= SEQUENCE { * algorithm AlgorithmIdentifier, * subjectPublicKey BIT STRING } * ``` * * @typedef {object} SubjectPublicKeyInfo * @property {API.ByteView<AlgorithmIdentifier>} algorithm * @property {API.ByteView<RSAPublicKey>} subjectPublicKey * @typedef {import('./pkcs8.js').AlgorithmIdentifier} AlgorithmIdentifier */ /** * The ASN.1 DER encoded header that needs to be added to an * ASN.1 DER encoded RSAPublicKey to make it a SubjectPublicKeyInfo. * * This byte sequence is always the same. * * A human-readable version of this as part of a dumpasn1 dump: * * SEQUENCE { * OBJECT IDENTIFIER rsaEncryption (1 2 840 113549 1 1 1) * NULL * } * * See https://github.com/ucan-wg/ts-ucan/issues/30 */ export const SPKI_PARAMS_ENCODED: Uint8Array; export function encode(key: API.ByteView<RSAPublicKey>): API.ByteView<SubjectPublicKeyInfo>; export function decode(info: API.ByteView<SubjectPublicKeyInfo>): API.ByteView<RSAPublicKey>; export type RSAPublicKey = import('./public-key.js').RSAPublicKey; /** * Described in RFC 5208 Section 4.1: https://tools.ietf.org/html/rfc5280#section-4.1 * ``` * SubjectPublicKeyInfo ::= SEQUENCE { * algorithm AlgorithmIdentifier, * subjectPublicKey BIT STRING } * ``` */ export type SubjectPublicKeyInfo = { algorithm: API.ByteView<AlgorithmIdentifier>; subjectPublicKey: API.ByteView<RSAPublicKey>; }; /** * Described in RFC 5208 Section 4.1: https://tools.ietf.org/html/rfc5280#section-4.1 * ``` * SubjectPublicKeyInfo ::= SEQUENCE { * algorithm AlgorithmIdentifier, * subjectPublicKey BIT STRING } * ``` */ export type AlgorithmIdentifier = import('./pkcs8.js').AlgorithmIdentifier; import * as API from '@ucanto/interface'; //# sourceMappingURL=spki.d.ts.map