Mar 24, 2018 In the feature film National Treasure, the cipher on the back of the United States constitution is an example of a symmetric key. A lot of digital cryptography.
Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Use the
generateKey() method of the SubtleCrypto interface to generate a new key (for symmetric algorithms) or key pair (for public-key algorithms).
SyntaxParameters
Return value
Exceptions
The promise is rejected when the following exception is encountered: Crypto key generate rsa usage-keys label.
ExamplesRSA key pair generation
This code generates anà RSA-OAEP encryption key pair. See the complete code on GitHub.
Elliptic curve key pair generation
This code generates an ECDSA signing key pair. See the complete code on GitHub.
HMAC key generation
This code generates an HMAC signing key. See the complete code on GitHub.
AES key generation
This code generates an AES-GCM encryption key. See the complete code on GitHub.
Specifications
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Legend
See also
A basic example of how to perform symmetric key encryption/decryption using AES and Java's cryptography API.
CryptoHelper.java
commented Dec 25, 2017
commented Mar 8, 2018
commented Jun 20, 2018
commented Sep 8, 2018
commented Feb 9, 2019
Golang Crypto Symmetric Key Generate Generator
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |