Options
All
  • Public
  • Public/Protected
  • All
Menu

@azure/keyvault-keys

Package version

Index

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

EncryptionAlgorithm

EncryptionAlgorithm: "RSA-OAEP" | "RSA-OAEP-256" | "RSA1_5"

Defines values for EncryptionAlgorithm. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'

readonly

KeyCurveName

KeyCurveName: "P-256" | "P-384" | "P-521" | "P-256K"

Defines values for KeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K'

readonly

KeyOperation

KeyOperation: "encrypt" | "decrypt" | "sign" | "verify" | "wrapKey" | "unwrapKey" | "import"

Defines values for KeyOperation. Possible values include: 'encrypt', 'decrypt', 'sign', 'verify', 'wrapKey', 'unwrapKey', 'import'

readonly

KeyType

KeyType: "EC" | "EC-HSM" | "RSA" | "RSA-HSM" | "oct"

Defines values for KeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct'

readonly

KeyWrapAlgorithm

KeyWrapAlgorithm: "RSA-OAEP" | "RSA-OAEP-256" | "RSA1_5"

Supported algorithms for key wrapping/unwrapping

LocalCryptographyOperationFunction

LocalCryptographyOperationFunction: (keyPEM: string, data: Buffer) => Promise<Buffer>

Abstract representation of a Local Cryptography Operation function.

param

The string representation of a PEM key.

param

The data used on the cryptography operation, in Buffer type.

Type declaration

    • (keyPEM: string, data: Buffer): Promise<Buffer>
    • Parameters

      • keyPEM: string
      • data: Buffer

      Returns Promise<Buffer>

LocalCryptographyOperationFunctionWithSignature

LocalCryptographyOperationFunctionWithSignature: (keyPEM: string, data: Buffer, signature: Buffer) => Promise<boolean>

Abstract representation of a Local Cryptography Operation function, this time with an additional signature buffer.

param

The string representation of a PEM key.

param

The data used on the cryptography operation, in Buffer type.

param

The signature used on the cryptography operation, in Buffer type.

Type declaration

    • (keyPEM: string, data: Buffer, signature: Buffer): Promise<boolean>
    • Parameters

      • keyPEM: string
      • data: Buffer
      • signature: Buffer

      Returns Promise<boolean>

LocalCryptographyOperationName

LocalCryptographyOperationName: "encrypt" | "wrapKey" | "createHash" | "verify"

Union type representing the names of the supported local cryptography operations.

LocalCryptographyOperations

Key-value map of local cryptography operations.

LocalSupportedAlgorithmName

LocalSupportedAlgorithmName: "RSA1_5" | "RSA-OAEP" | "PS256" | "RS256" | "PS384" | "RS384" | "PS512" | "RS512"

A union type representing the names of all of the locally supported algorithms.

LocalSupportedAlgorithmsRecord

LocalSupportedAlgorithmsRecord: Record<LocalSupportedAlgorithmName, LocalSupportedAlgorithm>

A Record containing all of the locally supported algorithms.

ParsedWWWAuthenticate

ParsedWWWAuthenticate: {}

Type declaration

RequireAtLeastOne

RequireAtLeastOne<T>: {}[keyof T]

TypeScript fancy for making plain objects require at least one key-value pair of another set of key-values.

Type parameters

  • T

SignAlgorithmName

SignAlgorithmName: "SHA256" | "SHA384" | "SHA512"

A union type representing the names of all of the locally supported sign algorithms.

SignatureAlgorithm

SignatureAlgorithm: "PS256" | "PS384" | "PS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "ES256K"

Defines values for SignatureAlgorithm.

readonly

ValidParsedWWWAuthenticateProperties

ValidParsedWWWAuthenticateProperties: "authorization" | "resource" | "scope"

Variables

Const LATEST_API_VERSION

LATEST_API_VERSION: "7.1" = "7.1"

The latest supported Key Vault service API version

Const logger

logger: any = createClientLogger("keyvault-keys")

The @azure/logger configuration for this package.

Functions

cancel

challengeBasedAuthenticationPolicy

  • challengeBasedAuthenticationPolicy(credential: TokenCredential): RequestPolicyFactory

checkKeyValidity

  • checkKeyValidity(keyId?: undefined | string, keyBundle?: KeyBundle): void
  • Checks whether a key can be used at that specific moment, by comparing the current date with the bundle's notBefore and expires values.

    Parameters

    • Optional keyId: undefined | string
    • Optional keyBundle: KeyBundle

    Returns void

formatBase64Sequence

  • formatBase64Sequence(base64Sequence: string): string
  • Fill in the PEM with 64 character lines as per RFC:

    "To represent the encapsulated text of a PEM message, the encoding function's output is delimited into text lines (using local conventions), with each line except the last containing exactly 64 printable characters and the final line containing 64 or fewer printable characters."

    Parameters

    • base64Sequence: string

    Returns string

isLocallySupported

  • isLocallySupported(algorithm: string): boolean

makeDeleteKeyPollOperation

makeRecoverDeletedKeyPollOperation

makeSequence

  • makeSequence(encodedParts: Uint8Array[]): string

Const makeSigner

parseKeyVaultKeyId

  • Parses the given Key Vault Key Id. An example is:

    https://.vault.azure.net/keys//

    On parsing the above Id, this function returns:

    { sourceId: "https://.vault.azure.net/keys//", vaultUrl: "https://.vault.azure.net", version: "", name: "" }

    Parameters

    • id: string

      The Id of the Key Vault Key.

    Returns KeyVaultKeyId

parseWWWAuthenticate

  • Parses an WWW-Authenticate response. This transforms a string value like: Bearer authorization="some_authorization", resource="https://some.url" into an object like: { authorization: "some_authorization", resource: "https://some.url" }

    Parameters

    • wwwAuthenticate: string

      string value in the WWW-Authenticate header

    Returns ParsedWWWAuthenticate

Const pipeAssertions

  • pipeAssertions(...assertions: LocalAssertion[]): LocalAssertion

runOperation

toString

update

Object literals

Const RSA1_5

RSA1_5: object

Local support of the RSA1_5 algorithm. We currently only support encrypting and wrapping keys with it.

validate

validate: (key?: JsonWebKey, operationName?: LocalCryptographyOperationName) => void = pipeAssertions(assertions.keyOps, assertions.rsa, assertions.nodeOnly)

Type declaration

operations

operations: object

encrypt

  • encrypt(keyPEM: string, data: Buffer): Promise<Buffer>

wrapKey

  • wrapKey(keyPEM: string, data: Buffer): Promise<Buffer>

Const RSA_OAEP

RSA_OAEP: object

Local support of the RSA-OAEP algorithm. We currently only support encrypting and wrapping keys with it.

validate

validate: (key?: JsonWebKey, operationName?: LocalCryptographyOperationName) => void = pipeAssertions(assertions.keyOps, assertions.rsa, assertions.nodeOnly)

Type declaration

operations

operations: object

encrypt

  • encrypt(keyPEM: string, data: Buffer): Promise<Buffer>

wrapKey

  • wrapKey(keyPEM: string, data: Buffer): Promise<Buffer>

Const localSupportedAlgorithms

localSupportedAlgorithms: object

A plain object containing all of the locally supported algorithms.

PS256

PS256: LocalSupportedAlgorithm = makeSigner("SHA256")

PS384

PS384: LocalSupportedAlgorithm = makeSigner("SHA384")

PS512

PS512: LocalSupportedAlgorithm = makeSigner("SHA512")

RS256

RS256: LocalSupportedAlgorithm = makeSigner("SHA256")

RS384

RS384: LocalSupportedAlgorithm = makeSigner("SHA384")

RS512

RS512: LocalSupportedAlgorithm = makeSigner("SHA512")

RSA-OAEP

RSA-OAEP: LocalSupportedAlgorithm = RSA_OAEP

RSA1_5

Generated using TypeDoc