NodeOPCUA API Documentation
    Preparing search index...

    Interface CryptoFactory

    interface CryptoFactory {
        asymmetricDecrypt: (buffer: Buffer, privateKey: PrivateKey) => Buffer;
        asymmetricEncrypt: (buffer: Buffer, publicKey: KeyObject) => Buffer;
        asymmetricEncryptionAlgorithm: string;
        asymmetricSign: (buffer: Buffer, privateKey: PrivateKey) => Buffer;
        asymmetricSignatureAlgorithm: string;
        asymmetricVerify: (
            buffer: Buffer,
            signature: Signature,
            certificate: DER,
        ) => boolean;
        asymmetricVerifyChunk: (
            self: CryptoFactory,
            chunk: Buffer,
            certificate: DER,
        ) => { signatureIsOK: boolean; signatureLength: number };
        blockPaddingSize: number;
        decryptParams?: AsymmetricDecryptParams;
        derivedEncryptionKeyLength: number;
        derivedSignatureKeyLength: number;
        encryptingBlockSize: number;
        maximumAsymmetricKeyLength: number;
        minimumAsymmetricKeyLength: number;
        securityPolicy: SecurityPolicy;
        sha1or256: "SHA1" | "SHA256";
        signatureLength: number;
        signParams?: AsymmetricSignParams;
        symmetricEncryptionAlgorithm: "aes-256-cbc" | "aes-128-cbc";
        symmetricKeyLength: number;
    }
    Index
    asymmetricDecrypt: (buffer: Buffer, privateKey: PrivateKey) => Buffer

    raw-key decryption is superseded by the opaque key-operations path: declare decryptParams and decrypt through asymmetricDecryptWithKeyOps(+Sync). Still populated and functional; a removal candidate for the next major.

    asymmetricEncrypt: (buffer: Buffer, publicKey: KeyObject) => Buffer
    asymmetricEncryptionAlgorithm: string

    for info only

    asymmetricSign: (buffer: Buffer, privateKey: PrivateKey) => Buffer

    raw-key signing is superseded by the opaque key-operations path: declare signParams and sign through an IKeyOperations (see computeSignatureAsync / the OPN builders). Still populated and functional; a removal candidate for the next major.

    asymmetricSignatureAlgorithm: string

    for info only

    asymmetricVerify: (
        buffer: Buffer,
        signature: Signature,
        certificate: DER,
    ) => boolean
    asymmetricVerifyChunk: (
        self: CryptoFactory,
        chunk: Buffer,
        certificate: DER,
    ) => { signatureIsOK: boolean; signatureLength: number }
    blockPaddingSize: number
    decryptParams?: AsymmetricDecryptParams

    Same as signParams, for asymmetricDecrypt.

    derivedEncryptionKeyLength: number
    derivedSignatureKeyLength: number
    encryptingBlockSize: number
    maximumAsymmetricKeyLength: number

    for info only

    minimumAsymmetricKeyLength: number

    for info only

    securityPolicy: SecurityPolicy
    sha1or256: "SHA1" | "SHA256"
    signatureLength: number
    signParams?: AsymmetricSignParams

    The policy's asymmetric signature scheme as parameters an opaque IKeyOperations provider understands — the algorithm-URI-free twin of asymmetricSign. Optional so third-party factory literals predating it stay valid; using an opaque key against a factory that lacks it fails with a clear error (see getSignParams).

    symmetricEncryptionAlgorithm: "aes-256-cbc" | "aes-128-cbc"
    symmetricKeyLength: number