/** * @license * @preserve * * KeeeX SAS Public code * https://keeex.me * Copyright 2013-2023 KeeeX All Rights Reserved. * * These computer program listings and specifications, herein, * are and remain the property of KeeeX SAS. The intellectual * and technical concepts herein are proprietary to KeeeX SAS * and may be covered by EU and foreign patents, * patents in process, trade secrets and copyright law. * * These listings are published as a way to provide third party * with the ability to process KeeeX data. * As such, support for public inquiries is limited. * They are provided "as-is", without warrany of any kind. * * They shall not be reproduced or copied or used in whole or * in part as the basis for manufacture or sale of items unless * prior written permission is obtained from KeeeX SAS. * * For a license agreement, please contact: * * */ import { Keypair } from "../shared/keypair.js"; import * as x509Types from "./types.js"; import type * as x509IoTypes from "./iotypes.js"; import type { IDataFormatter } from "../shared/io.js"; import type { LocalTypeData } from "../shared/localdata.js"; export interface CreateParams { certificatePEM: string; privateKeyPEM?: string; privateKeyPassword?: string; } /** * Create and verify signature using an X509 certificate and its private key. * * There is no provision to export the raw private/public keys. * The "pretty" public key export returns the full certificate in PEM format. * The key address is a string containing the certificate type (usually "CERTIFICATE") and the full * content in base64 (directly extracted from the PEM). */ export default class X509Keypair extends Keypair, x509IoTypes.ExportOptions, x509Types.MessageFormat> { #private; private constructor(); static readonly createInstance: (params: CreateParams) => Promise; static readonly import: (data: x509IoTypes.ImportData) => Promise; getPrivateRaw: () => Uint8Array; getPublicRaw: () => Promise; getLocalTypeRaw: () => LocalTypeData; deriveKey: () => Uint8Array; convertToRaw: () => never; exportKey: () => unknown; canSign: () => boolean; signRaw: (data: Uint8Array) => Promise; verifyRaw: (data: Uint8Array, signature: Uint8Array) => Promise; protected getLabelRaw: () => string; protected getSignaturePlaceholderLength: () => Promise; }