# @types/xml-encryption

> TypeScript definitions for xml-encryption

Latest version **1.2.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/xml-encryption
pnpm add @types/xml-encryption
yarn add @types/xml-encryption
bun add @types/xml-encryption
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2023-11-07 |
| First published | 2020-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51440 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/xml-encryption
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/xml-encryption
- npm.io page: https://npm.io/package/@types/xml-encryption

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 1.2.4 (latest) — 2023-11-07
- 1.2.2 (ts4.3) — 2023-08-30
- 1.2.1 (ts3.6) — 2021-07-02
- 1.2.0 (ts3.3) — 2020-12-16
- 1.2.3 — 2023-10-18

## README

# Installation
> `npm install --save @types/xml-encryption`

# Summary
This package contains type definitions for xml-encryption (https://github.com/auth0/node-xml-encryption#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/xml-encryption.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/xml-encryption/index.d.ts)
````ts
/// <reference types="node" />

export type Utf8AsciiBinaryEncoding = "utf8" | "ascii" | "binary";

export type KeyEncryptionAlgorithm =
    | "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
    | "http://www.w3.org/2001/04/xmlenc#rsa-1_5";

export type EncryptionAlgorithm =
    | "http://www.w3.org/2001/04/xmlenc#aes128-cbc"
    | "http://www.w3.org/2001/04/xmlenc#aes256-cbc"
    | "http://www.w3.org/2009/xmlenc11#aes128-gcm"
    | "http://www.w3.org/2009/xmlenc11#aes256-gcm"
    | "http://www.w3.org/2001/04/xmlenc#tripledes-cbc";

export interface EncryptOptions extends EncryptKeyOptions {
    encryptionAlgorithm: EncryptionAlgorithm;
    warnInsecureAlgorithm?: boolean | undefined;
    input_encoding?: Utf8AsciiBinaryEncoding | undefined;
}

export interface EncryptKeyOptions {
    rsa_pub: string | Buffer;
    pem: string | Buffer;
    keyEncryptionAlgorithm: KeyEncryptionAlgorithm;
    disallowEncryptionWithInsecureAlgorithm?: boolean | undefined;
}

export interface DecryptOptions {
    key: string | Buffer;
    disallowDecryptionWithInsecureAlgorithm?: boolean | undefined;
    warnInsecureAlgorithm?: boolean | undefined;
}

export function decrypt(
    xml: string,
    options: DecryptOptions,
    callback: (error: Error | null, result: string) => void,
): void;
export function decryptKeyInfo(doc: string, options: DecryptOptions): Buffer;
export function encrypt(
    content: string,
    options: EncryptOptions,
    callback: (error: Error, result: string) => void,
): void;
export function encryptKeyInfo(
    symmetricKey: string | Buffer,
    options: EncryptKeyOptions,
    callback: (error: Error | null, result: string) => void,
): void;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Chris Midgley](https://github.com/midgleyc).

---
_Source: https://npm.io/package/@types/xml-encryption · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
