Unlike symmetric keys, asymmetric keys are used to verify digital signatures or encrypt sensitive information between systems with different trust levels.
An asymmetric key pair consists of a public key and a private key, which are cryptographically related to each other. The public key is available for all to use, but the private key must be kept secure and used only by trusted users. Alibaba Cloud supports popular asymmetric key algorithms and provides sufficient security strength to ensure the security of encrypted data and digital signatures.
Key Management Service (KMS) generates a certificate signing request (CSR) file for an asymmetric customer master key (CMK). A certificate applicant submits the CSR file to a certificate authority (CA). Then, the CA sends back a digital certificate that is signed by using the private key of the CA. The digital certificate can be used to ensure the security of emails, terminals, code signing, trusted website services, and identity authorization management systems.
Types of asymmetric keys
||RSA asymmetric cryptosystem||
||Elliptic-curve cryptography (ECC)||Generate a digital signature.|
|SM2||EC_SM2||ECC defined by GB/T 32918||
- An information receiver distributes a public key to a transmitter.
- The transmitter uses the public key to encrypt sensitive information.
- The transmitter sends the ciphertext generated from the sensitive information to the information receiver.
- The information receiver uses the private key to decrypt the ciphertext.
The private key can be used only by the information receiver. This ensures that the plaintext of sensitive information cannot be intercepted and decrypted by unauthorized parties during transmission. This encryption method is widely used to exchange keys. For example, session keys are exchanged in Transport Layer Security (TLS) handshakes, and encryption keys are exported and imported between different hardware security modules (HSMs).
For more information, see Encrypt and decrypt data by using an asymmetric CMK.
- Verify data integrity. If the data does not match its signature, the data may be tampered with.
- Verify message authenticity. If a message does not match its signature, the message transmitter does not hold the private key.
- Provide non-repudiation for signatures. If the data matches its signature, the signer cannot deny this signature.
- A signer sends a public key to a receiver.
- The signer uses the private key that matches the public key to sign data.
- The signer sends the data and signature to the message receiver.
- After the data and signature are received, the receiver uses the public key to verify the signature.
Digital signatures are widely used to defend against data tampering and authenticate identities.
- Case 1: You can use digital signatures to protect the integrity of your binary code and verify that the code is not manipulated. This helps provide a trusted execution environment.
- Case 2: Digital signatures can also be used in digital certificate systems. In such a system, a CA provides a signature for digital certificates to certify the entity information, public and private key information, key purpose, expiration date, and issuer. The private key holder of a certificate uses the private key to sign a message. The message receiver uses the public key contained in the certificate to verify the message signature and uses the public key of the certificate issuer to verify the certificate.
For more information, see Generate and verify a digital signature by using an asymmetric CMK.
KMS does not support automatic rotation of asymmetric CMKs due to the limits of public and private keys. You can call the CreateKeyVersion operation to create a key version in a specific CMK and generate a new pair of public and private keys. If you use a new key version to generate a digital signature or encrypt data, you must also distribute the new version of the public key.
In addition, unlike symmetric CMKs, asymmetric CMKs do not have a primary key version. Therefore, you must specify the corresponding CMK ID or CMK alias and a key version if you need to call the operations related to asymmetric CMKs in KMS.
Public key operations
In most cases, you can call the GetPublicKey operation to obtain a public key and distribute it to users for encryption or verification. Then, the users can use cryptographic libraries such as OpenSSL and Java Cryptography Extension (JCE) to perform calculation in their business systems.
You can also call the AsymmetricEncrypt or AsymmetricVerify operation to perform public key operations. KMS records the logs of the calls and allows you to use Resource Access Management (RAM) to limit the use of public keys. Compared with calculation in business systems, KMS offers flexible features that better suit your needs.