---
id: object/codeunit/1266
type: object
title: Codeunit 1266 "Cryptography Management"
summary: Codeunit 1266 "Cryptography Management" in System Application (System.Security.Encryption). 32 public procedures, 2 events. Present since at least BC23, still in BC30, changed in BC24-25, BC27-29.
tier: official
language: en
tags:
  - codeunit
  - system application
versions:
  introduced: null
  last_changed: "29"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 44f08c1078926db8b2ff4624e70e0624c5d2906a827acde9f1840f155e041f74
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Cryptography%20Management/src/CryptographyManagement.Codeunit.al
    title: src/System Application/App/Cryptography Management/src/CryptographyManagement.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/9291
object_type: codeunit
object_id: 1266
name: Cryptography Management
namespace: System.Security.Encryption
app: System Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "25"
  - "27"
  - "28"
  - "29"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 34
  events: 2
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 1
  called_by: 14
  implements: 0
---

# Codeunit 1266 "Cryptography Management"

> Codeunit 1266 "Cryptography Management" in System Application (System.Security.Encryption). 32 public procedures, 2 events. Present since at least BC23, still in BC30, changed in BC24-25, BC27-29.

System Application · System.Security.Encryption · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Cryptography%20Management/src/CryptographyManagement.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Public |

## Events published

- `OnBeforeEnableEncryptionOnPrem()` (integration): Publishes an event that allows subscription when enabling encryption.
- `OnBeforeDisableEncryptionOnPrem()` (integration): Publishes an event that allows subscription when disabling encryption.

## Procedures

- `EncryptText(InputString: Text[215]): Text`: Returns plain text as an encrypted value.
- `Decrypt(EncryptedString: Text): Text`: Returns encrypted text as plain text.
- `IsEncryptionEnabled(): Boolean`: Checks if Encryption is enabled.
- `IsEncryptionPossible(): Boolean`: Checks whether the encryption key is present, which only works if encryption is enabled.
- `GetEncryptionIsNotActivatedQst(): Text`: Gets the recommended question to activate encryption.
- `EnableEncryption(Silent: Boolean)`: Enables encryption.
- `DisableEncryption(Silent: Boolean)`: Disables encryption.
- `GenerateHash(InputString: SecretText; HashAlgorithmType: Option MD5,SHA1,SHA256,SHA384,SHA512): SecretText`: Generates a hash from a string based on the provided hash algorithm.
- `GenerateHash(InputString: Text; HashAlgorithmType: Option MD5,SHA1,SHA256,SHA384,SHA512): Text`: Generates a hash from a string based on the provided hash algorithm.
- `GenerateHash(InputString: SecretText; Key: SecretText; HashAlgorithmType: Option HMACMD5,HMACSHA1,HMACSHA256,HMACSHA384,HMACSHA512): SecretText`: Generates a keyed hash from a string based on provided hash algorithm and key.
- `GenerateHash(InputString: Text; Key: SecretText; HashAlgorithmType: Option HMACMD5,HMACSHA1,HMACSHA256,HMACSHA384,HMACSHA512): Text`: Generates a keyed hash from a string based on provided hash algorithm and key.
- `GenerateHash(InputInStream: InStream; HashAlgorithmType: Option MD5,SHA1,SHA256,SHA384,SHA512): Text`: Generates a hash from a stream based on the provided hash algorithm.
- `GenerateHashAsBase64String(InputString: SecretText; HashAlgorithmType: Option MD5,SHA1,SHA256,SHA384,SHA512): SecretText`: Generates a base64 encoded hash from a string based on provided hash algorithm.
- `GenerateHashAsBase64String(InputString: Text; HashAlgorithmType: Option MD5,SHA1,SHA256,SHA384,SHA512): Text`: Generates a base64 encoded hash from a string based on provided hash algorithm.
- `GenerateHashAsBase64String(InputString: SecretText; Key: SecretText; HashAlgorithmType: Option HMACMD5,HMACSHA1,HMACSHA256,HMACSHA384,HMACSHA512): SecretText`: Generates a keyed base64 encoded hash from a string based on provided hash algorithm and key.
- `GenerateHashAsBase64String(InputString: Text; Key: SecretText; HashAlgorithmType: Option HMACMD5,HMACSHA1,HMACSHA256,HMACSHA384,HMACSHA512): Text`: Generates a keyed base64 encoded hash from a string based on provided hash algorithm and key.
- `GenerateBase64KeyedHashAsBase64String(InputString: SecretText; Key: SecretText; HashAlgorithmType: Option HMACMD5,HMACSHA1,HMACSHA256,HMACSHA384,HMACSHA512): SecretText`: Generates keyed base64 encoded hash from provided string based on provided hash algorithm and base64 key.
- `GenerateBase64KeyedHashAsBase64String(InputString: Text; Key: SecretText; HashAlgorithmType: Option HMACMD5,HMACSHA1,HMACSHA256,HMACSHA384,HMACSHA512): Text`: Generates keyed base64 encoded hash from provided string based on provided hash algorithm and base64 key.
- `GenerateBase64KeyedHash(InputString: SecretText; Key: SecretText; HashAlgorithmType: Option HMACMD5,HMACSHA1,HMACSHA256,HMACSHA384,HMACSHA512): SecretText`: Generates keyed base64 encoded hash from provided string based on provided hash algorithm and base64 key.
- `GenerateBase64KeyedHash(InputString: Text; Key: SecretText; HashAlgorithmType: Option HMACMD5,HMACSHA1,HMACSHA256,HMACSHA384,HMACSHA512): Text`: Generates keyed base64 encoded hash from provided string based on provided hash algorithm and base64 key.
- `SignData(InputString: Text; XmlString: SecretText; HashAlgorithm: Enum "Hash Algorithm"; SignatureOutStream: OutStream)`: Computes the hash value of the specified string and signs it.
- `SignData(InputString: SecretText; XmlString: SecretText; HashAlgorithm: Enum "Hash Algorithm"; SignatureOutStream: OutStream)`: Computes the hash value of the specified string and signs it.
- `SignData(DataInStream: InStream; XmlString: SecretText; HashAlgorithm: Enum "Hash Algorithm"; SignatureOutStream: OutStream)`: Computes the hash value of the specified data and signs it.
- `SignData(InputString: Text; SignatureKey: Codeunit "Signature Key"; HashAlgorithm: Enum "Hash Algorithm"; SignatureOutStream: OutStream)`: Computes the hash value of the specified string and signs it.
- `SignData(InputString: SecretText; SignatureKey: Codeunit "Signature Key"; HashAlgorithm: Enum "Hash Algorithm"; SignatureOutStream: OutStream)`: Computes the hash value of the specified string and signs it.
- `SignData(DataInStream: InStream; SignatureKey: Codeunit "Signature Key"; HashAlgorithm: Enum "Hash Algorithm"; SignatureOutStream: OutStream)`: Computes the hash value of the specified data and signs it.
- `SignData(InputString: Text; XmlString: SecretText; HashAlgorithm: Enum "Hash Algorithm"; RSASignaturePadding: Enum "RSA Signature Padding"; SignatureOutStream: OutStream)`: Computes the hash value of the specified string and signs it.
- `VerifyData(InputString: Text; XmlString: Text; HashAlgorithm: Enum "Hash Algorithm"; SignatureInStream: InStream): Boolean`: Verifies that a digital signature is valid.
- `VerifyData(DataInStream: InStream; XmlString: Text; HashAlgorithm: Enum "Hash Algorithm"; SignatureInStream: InStream): Boolean`: Verifies that a digital signature is valid.
- `VerifyData(InputString: Text; SignatureKey: Codeunit "Signature Key"; HashAlgorithm: Enum "Hash Algorithm"; SignatureInStream: InStream): Boolean`: Verifies that a digital signature is valid.
- `VerifyData(InputString: SecretText; XmlString: Text; HashAlgorithm: Enum "Hash Algorithm"; SignatureInStream: InStream): Boolean`: Verifies that a digital signature is valid.
- `VerifyData(DataInStream: InStream; SignatureKey: Codeunit "Signature Key"; HashAlgorithm: Enum "Hash Algorithm"; SignatureInStream: InStream): Boolean`: Verifies that a digital signature is valid.

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 1279 "Cryptography Management Impl."](../codeunit/1279.md) (13 calls: `Decrypt → Decrypt`, `DisableEncryption → DisableEncryption`, `EnableEncryption → EnableEncryption`, …)

## Called by

- [Codeunit 1279 "Cryptography Management Impl."](../codeunit/1279.md) (2 calls: `CreateEncryptionKeys → OnBeforeEnableEncryptionOnPrem`, `DisableEncryption → OnBeforeDisableEncryptionOnPrem`)
- [Page 1263 "Certificate"](../page/1263.md) (2 calls: `CheckEncryption → GetEncryptionIsNotActivatedQst`, `CheckEncryption → IsEncryptionEnabled`)
- [Table 1853 "MS - Sales Forecast Setup"](../table/1853.md) (2 calls: `EnableEncryption → EnableEncryption`, `EnableEncryption → IsEncryptionEnabled`)
- [Table 843 "Cash Flow Setup"](../table/843.md) (2 calls: `EnableEncryption → EnableEncryption`, `EnableEncryption → IsEncryptionEnabled`)
- [Codeunit 1140 "OAuth 2.0 Mgt."](../codeunit/1140.md) (1 call: `GenerateCodeChallenge → GenerateHashAsBase64String`)
- [Codeunit 1259 "Certificate Management"](../codeunit/1259.md) (1 call: `SavePasswordToIsolatedStorage → IsEncryptionEnabled`)
- [Codeunit 3307 "Payables Agent Setup"](../codeunit/3307.md) (1 call: `GetInstructionsConfigHash → GenerateHash`)
- [Codeunit 6989 "Expense Attachment Mgt."](../codeunit/6989.md) (1 call: `UpdateContentHash → GenerateHash`)
- [Codeunit 7297 "Mapping Cache Management"](../codeunit/7297.md) (1 call: `GenerateFileHashInHex → GenerateHash`)
- [Codeunit 7333 "Search"](../codeunit/7333.md) (1 call: `SearchMultiple → GenerateHash`)
- [Codeunit 8751 "DA External Storage Impl."](../codeunit/8751.md) (1 call: `GetCurrentEnvironmentHash → GenerateHash`)
- [Codeunit 9002 "Permission Manager"](../codeunit/9002.md) (1 call: `GenerateHashForPermissionSet → GenerateHash`)
- [Codeunit 9060 "Auth. Format Helper"](../codeunit/9060.md) (1 call: `GetAccessKeyHashCode → GenerateBase64KeyedHashAsBase64String`)
- [Codeunit 9510 "Document Service Management"](../codeunit/9510.md) (1 call: `InvokeDocumentSharingFlowFromMedia → GenerateHash`)

## Recent changes

- 2026-07-10 [#9291 Add [NonDebuggable] to Cryptography Management encrypt/decrypt procedures](../../changes/bcapps/9291.md) (main, BC30, fix)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-25, BC27-29

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Cryptography Management")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
