import { default as VIP030026BaseCredential } from './VIP030026BaseCredential'; import { IVIP030026PrivateKeyCredential, IVIP030026PrivateKeyCredentialGenerateOptions } from '../types'; /** * The private key credential adheres to the VIP-03-0026 standard that allows providers to create a credential that * can be used to sign client message response and ensure the integrity of the message result. * * **NOTE:** A VIP-03-0026 private key credential should be exclusively used by the provider and should not be exposed * to the client. */ export default class VIP030026PrivateKeyCredential extends VIP030026BaseCredential { /** * public static methods */ /** * Creates a credential from raw bytes. * @param {Uint8Array} credential - A VIP-03-0026 credential as raw bytes. * @returns {VIP030026PublicKeyCredential} An initialized VIP030026PublicKeyCredential. * @throws {VIP030026InvalidCredentialLengthError} If the credential length is invalid. * @static * @public */ static fromBytes(credential: Uint8Array): VIP030026PrivateKeyCredential; /** * Creates a credential from a JSON. * @param {IVIP030026PrivateKeyCredential} credential - A JSON containing the values of a credential. * @returns {VIP030026PrivateKeyCredential} An initialized VIP030026PrivateKeyCredential. * @throws {VIP030026UnsupportedAlgorithmIDError} If the algorithm is unsupported. * @throws {VIP030026InvalidCredentialLengthError} If the credential length is invalid. * @static * @public */ static fromJSON(credential: IVIP030026PrivateKeyCredential): VIP030026PrivateKeyCredential; /** * Generates a new VIP-03-0026 compliant private key credential. If no algorithm or ID are defined, Ed25519 is used to * create the private key and a random unique UUID is used. * @param {IVIP030026PrivateKeyCredentialGenerateOptions} options - [optional] The algorithm and a UUID identifier. * @returns {VIP030026PrivateKeyCredential} An initialized VIP030026PrivateKeyCredential. * @throws {VIP030026UnsupportedAlgorithmIDError} If the supplied algorithm is unsupported. * @throws {VIP030026InvalidCredentialLengthError} If the supplied cause the credential length to be invalid. * @static * @public */ static generate(options?: IVIP030026PrivateKeyCredentialGenerateOptions): VIP030026PrivateKeyCredential; /** * protected methods */ /** * Gets the raw public key bytes from the credential. * @returns {Uint8Array} The raw public key bytes. * @protected */ protected _publicKeyBytes(): Uint8Array; /** * Gets the raw private key bytes from the credential. * @returns {Uint8Array} The raw private key bytes. * @protected */ protected _privateKeyBytes(): Uint8Array; /** * public methods */ /** * Gets the base64 encoded private key of the credential. * @returns {string} The private key as a base64 encoded string. * @public */ privateKey(): string; /** * Signs a hash of the supplied bytes using the provided credentials. * @param {Uint8Array} bytes - The bytes to be signed. * @returns {Uint8Array} The signature of the . */ sign(bytes: Uint8Array): Uint8Array; /** * Gets the credential as a JSON. * @returns {IVIP030026PrivateKeyCredential} The credential formatted as a JSON. * @throws {VIP030026UnsupportedAlgorithmIDError} If the algorithm is unsupported. * @public */ toJSON(): IVIP030026PrivateKeyCredential; } //# sourceMappingURL=VIP030026PrivateKeyCredential.d.ts.map