Crypto

interface Crypto : RandomSource

JavaScript: crypto

Main interface providing the Web Crypto API to guest JavaScript VMs. The Web Crypto API is primarily substantiated by this interface, in addition to SubtleCrypto, which focuses on cryptographic primitives which operate in constants time.

 

Summary

"The Crypto interface represents basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives."

 

Specification compliance

Elide's implementation of the Web Crypto API is backed by primitives provided by the JVM host environment; random data uses java.security.SecureRandom, and UUIDs are generated using java.util.UUID.randomUUID. SubtleCrypto is provided via the subtle property.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val subtle: SubtleCrypto

Access to so-called "Subtle Crypto," which is a module constituent to the Web Crypto API that focuses on cryptographic primitives which run in constant-time.

Functions

Link copied to clipboard
abstract fun getRandomValues(typedArray: Any)

From MDN: "The Crypto.getRandomValues() method lets you get cryptographically strong random values. The array given as the parameter is filled with random numbers (random in its cryptographic meaning).

Link copied to clipboard
abstract fun randomUUID(): UUID

From MDN: "The randomUUID method of the Crypto interface is used to generate a v4 UUID using a cryptographically secure random number generator."