All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.core.cryptography.AsyncKeyEncryptionKey Maven / Gradle / Ivy

There is a newer version: 1.54.1
Show newest version
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.core.cryptography;

import reactor.core.publisher.Mono;

/**
 * A key which is used to asynchronously encrypt, or wrap, another key.
 */
public interface AsyncKeyEncryptionKey {

    /**
     * Retrieves the key identifier.
     *
     * @return A {@link Mono} containing key identifier.
     */
    Mono getKeyId();
    
    /**
     * Encrypts the specified key using the specified algorithm.
     *
     * @param algorithm The key wrap algorithm used to encrypt the specified key.
     * @param key The key content to be encrypted.
     * @return A {@link Mono} containing the encrypted key bytes.
     */
    Mono wrapKey(String algorithm, byte[] key);

    /**
     * Decrypts the specified encrypted key using the specified algorithm.
     *
     * @param algorithm The key wrap algorithm which was used to encrypt the specified encrypted key.
     * @param encryptedKey The encrypted key content to be decrypted.
     * @return A {@link Mono} containing the decrypted key bytes.
     */
    Mono unwrapKey(String algorithm, byte[] encryptedKey);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy