import * as KeetaNetClient from '@keetanetwork/keetanet-client';
import { Buffer } from './utils/buffer.js';
import type { SensitiveAttributeType, CertificateAttributeValue, CertificateAttributeOIDDB } from '../services/kyc/iso20022.generated.js';
type AccountKeyAlgorithm = InstanceType<typeof KeetaNetClient.lib.Account>['keyType'];
/**
 * An alias for the KeetaNetAccount type
 */
type KeetaNetAccount = ReturnType<typeof KeetaNetClient.lib.Account.fromSeed<AccountKeyAlgorithm>>;
/**
 * Type for certificate attribute names (derived from generated OID database)
 */
export type CertificateAttributeNames = keyof typeof CertificateAttributeOIDDB;
/**
 * Encode an attribute value using its ASN.1 schema
 */
export declare function encodeAttribute(name: CertificateAttributeNames, value: unknown): ArrayBuffer;
/**
 * Prepare a value for inclusion in a SensitiveAttribute: pre-encode complex and date types
 */
export declare function encodeForSensitive(name: CertificateAttributeNames | undefined, value: SensitiveAttributeType | Buffer | ArrayBuffer): Buffer;
export type SensitiveAttributeJSON = {
    version: string;
    publicKey: string;
    cipher: {
        algorithm: string;
        iv: string;
        key: string;
    };
    hashedValue: {
        encryptedSalt: string;
        algorithm: string;
        value: string;
    };
    encryptedValue: string;
};
export declare class SensitiveAttribute<T = ArrayBuffer> {
    #private;
    private static readonly SensitiveAttributeObjectTypeID;
    private readonly SensitiveAttributeObjectTypeID;
    constructor(account: KeetaNetAccount, data: Buffer | ArrayBuffer, decoder?: (data: Buffer | ArrayBuffer) => T | Promise<T>);
    /**
     * Check if a value is a SensitiveAttribute instance
     */
    static isInstance(input: unknown): input is SensitiveAttribute<unknown>;
    /**
     * Get the public key this attribute was encrypted for
     */
    get publicKey(): string;
    /**
     * Get the raw encrypted DER for certificate embedding
     */
    toDER(): ArrayBuffer;
    private decode;
    /**
     * Get the value of the sensitive attribute
     *
     * This will decrypt the value using the account's private key
     * and return the value as an ArrayBuffer
     *
     * Since sensitive attributes are binary blobs, this returns an
     * ArrayBuffer
     */
    get(): Promise<ArrayBuffer>;
    getValue(): Promise<T>;
    /**
     * Generate a proof that a sensitive attribute is a given value,
     * which can be validated by a third party using the certificate
     * and the `validateProof` method
     */
    getProof(): Promise<{
        value: string;
        hash: {
            salt: string;
        };
    }>;
    /**
     * Validate the proof that a sensitive attribute is a given value
     */
    validateProof(proof: Awaited<ReturnType<this['getProof']>>): Promise<boolean>;
    toJSON(): SensitiveAttributeJSON;
    /**
     * Encrypt a value and create a new SensitiveAttribute
     */
    static create<K extends CertificateAttributeNames>(account: KeetaNetAccount, name: K, value: CertificateAttributeValue<K> | Buffer | ArrayBuffer): Promise<SensitiveAttribute<CertificateAttributeValue<K>>>;
}
export {};
//# sourceMappingURL=sensitive-attribute.d.ts.map