azure_security_keyvault_keys 0.13.0

Rust wrappers around Microsoft Azure REST APIs - Azure Key Vault Keys
Documentation
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT.

/// Elliptic curve name. For valid values, see JsonWebKeyCurveName.
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum CurveName {
    /// The NIST P-256 elliptic curve, AKA SECG curve SECP256R1.
    P256,

    /// The SECG SECP256K1 elliptic curve.
    P256K,

    /// The NIST P-384 elliptic curve, AKA SECG curve SECP384R1.
    P384,

    /// The NIST P-521 elliptic curve, AKA SECG curve SECP521R1.
    P521,

    /// Any other value not defined in `CurveName`.
    UnknownValue(String),
}

/// Reflects the deletion recovery level currently in effect for certificates in the current vault. If it contains 'Purgeable',
/// the certificate can be permanently deleted by a privileged user; otherwise, only the system can purge the certificate,
/// at the end of the retention interval.
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum DeletionRecoveryLevel {
    /// Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e.
    /// purge when 7 <= SoftDeleteRetentionInDays < 90).This level guarantees the recoverability of the deleted entity during
    /// the retention interval and while the subscription is still available.
    CustomizedRecoverable,

    /// Denotes a vault and subscription state in which deletion is recoverable, immediate and permanent deletion (i.e. purge)
    /// is not permitted, and in which the subscription itself cannot be permanently canceled when 7 <= SoftDeleteRetentionInDays
    /// < 90. This level guarantees the recoverability of the deleted entity during the retention interval, and also reflects
    /// the fact that the subscription itself cannot be cancelled.
    CustomizedRecoverableProtectedSubscription,

    /// Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e.
    /// purge when 7 <= SoftDeleteRetentionInDays < 90). This level guarantees the recoverability of the deleted entity during
    /// the retention interval, unless a Purge operation is requested, or the subscription is cancelled.
    CustomizedRecoverablePurgeable,

    /// Denotes a vault state in which deletion is an irreversible operation, without the possibility for recovery. This level
    /// corresponds to no protection being available against a Delete operation; the data is irretrievably lost upon accepting
    /// a Delete operation at the entity level or higher (vault, resource group, subscription etc.)
    Purgeable,

    /// Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e.
    /// purge). This level guarantees the recoverability of the deleted entity during the retention interval(90 days) and while
    /// the subscription is still available. System wil permanently delete it after 90 days, if not recovered
    Recoverable,

    /// Denotes a vault and subscription state in which deletion is recoverable within retention interval (90 days), immediate
    /// and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled.
    /// System wil permanently delete it after 90 days, if not recovered
    RecoverableProtectedSubscription,

    /// Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e.
    /// purge). This level guarantees the recoverability of the deleted entity during the retention interval (90 days), unless
    /// a Purge operation is requested, or the subscription is cancelled. System wil permanently delete it after 90 days, if not
    /// recovered
    RecoverablePurgeable,

    /// Any other value not defined in `DeletionRecoveryLevel`.
    UnknownValue(String),
}

/// An algorithm used for encryption and decryption.
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum EncryptionAlgorithm {
    /// 128-bit AES-CBC.
    A128Cbc,

    /// 128-bit AES-CBC with PKCS padding.
    A128Cbcpad,

    /// 128-bit AES-GCM.
    A128Gcm,

    /// 128-bit AES key wrap.
    A128Kw,

    /// 192-bit AES-CBC.
    A192Cbc,

    /// 192-bit AES-CBC with PKCS padding.
    A192Cbcpad,

    /// 192-bit AES-GCM.
    A192Gcm,

    /// 192-bit AES key wrap.
    A192Kw,

    /// 256-bit AES-CBC.
    A256Cbc,

    /// 256-bit AES-CBC with PKCS padding.
    A256Cbcpad,

    /// 256-bit AES-GCM.
    A256Gcm,

    /// 256-bit AES key wrap.
    A256Kw,

    /// CKM AES key wrap.
    CkmAesKeyWrap,

    /// CKM AES key wrap with padding.
    CkmAesKeyWrapPad,

    /// [Not recommended] RSAES-PKCS1-V1_5 key encryption, as described in <https://tools.ietf.org/html/rfc3447>. Microsoft recommends
    /// using RSA_OAEP_256 or stronger algorithms for enhanced security. Microsoft does *not* recommend RSA_1_5, which is included
    /// solely for backwards compatibility. Cryptographic standards no longer consider RSA with the PKCS#1 v1.5 padding scheme
    /// secure for encryption.
    Rsa1_5,

    /// [Not recommended] RSAES using Optimal Asymmetric Encryption Padding (OAEP), as described in <https://tools.ietf.org/html/rfc3447>,
    /// with the default parameters specified by RFC 3447 in Section A.2.1. Those default parameters are using a hash function
    /// of SHA-1 and a mask generation function of MGF1 with SHA-1. Microsoft recommends using RSA_OAEP_256 or stronger algorithms
    /// for enhanced security. Microsoft does *not* recommend RSA_OAEP, which is included solely for backwards compatibility.
    /// RSA_OAEP utilizes SHA1, which has known collision problems.
    RsaOaep,

    /// RSAES using Optimal Asymmetric Encryption Padding with a hash function of SHA-256 and a mask generation function of MGF1
    /// with SHA-256.
    RsaOaep256,

    /// Any other value not defined in `EncryptionAlgorithm`.
    UnknownValue(String),
}

/// The encryption algorithm to use to protected the exported key material
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum KeyEncryptionAlgorithm {
    /// The CKM_RSA_AES_KEY_WRAP key wrap mechanism.
    CkmRsaAesKeyWrap,

    /// The RSA_AES_KEY_WRAP_256 key wrap mechanism.
    RsaAesKeyWrap256,

    /// The RSA_AES_KEY_WRAP_384 key wrap mechanism.
    RsaAesKeyWrap384,

    /// Any other value not defined in `KeyEncryptionAlgorithm`.
    UnknownValue(String),
}

/// JSON web key operations. For more information, see JsonWebKeyOperation.
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum KeyOperation {
    /// Indicates that the key can be used to decrypt.
    Decrypt,

    /// Indicates that the key can be used to encrypt.
    Encrypt,

    /// Indicates that the private component of the key can be exported.
    Export,

    /// Indicates that the key can be imported during creation.
    Import,

    /// Indicates that the key can be used to sign.
    Sign,

    /// Indicates that the key can be used to unwrap another key.
    UnwrapKey,

    /// Indicates that the key can be used to verify.
    Verify,

    /// Indicates that the key can be used to wrap another key.
    WrapKey,

    /// Any other value not defined in `KeyOperation`.
    UnknownValue(String),
}

/// The type of the action. The value should be compared case-insensitively.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum KeyRotationPolicyAction {
    /// Trigger Event Grid events. Defaults to 30 days before expiry. Key Vault only.
    Notify,

    /// Rotate the key based on the key policy.
    Rotate,
}

/// JsonWebKey Key Type (kty), as defined in <https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40>.
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum KeyType {
    /// Elliptic Curve.
    Ec,

    /// Elliptic Curve with a private key which is stored in the HSM.
    EcHsm,

    /// Octet sequence (used to represent symmetric keys)
    Oct,

    /// Octet sequence (used to represent symmetric keys) which is stored the HSM.
    OctHsm,

    /// RSA (https://tools.ietf.org/html/rfc3447)
    Rsa,

    /// RSA with a private key which is stored in the HSM.
    RsaHsm,

    /// Any other value not defined in `KeyType`.
    UnknownValue(String),
}

/// The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm.
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum SignatureAlgorithm {
    /// ECDSA using P-256 and SHA-256, as described in <https://tools.ietf.org/html/rfc7518>.
    Es256,

    /// ECDSA using P-256K and SHA-256, as described in <https://tools.ietf.org/html/rfc7518>
    Es256K,

    /// ECDSA using P-384 and SHA-384, as described in <https://tools.ietf.org/html/rfc7518>
    Es384,

    /// ECDSA using P-521 and SHA-512, as described in <https://tools.ietf.org/html/rfc7518>
    Es512,

    /// HMAC using SHA-256, as described in <https://tools.ietf.org/html/rfc7518>
    Hs256,

    /// HMAC using SHA-384, as described in <https://tools.ietf.org/html/rfc7518>
    Hs384,

    /// HMAC using SHA-512, as described in <https://tools.ietf.org/html/rfc7518>
    Hs512,

    /// RSASSA-PSS using SHA-256 and MGF1 with SHA-256, as described in <https://tools.ietf.org/html/rfc7518>
    Ps256,

    /// RSASSA-PSS using SHA-384 and MGF1 with SHA-384, as described in <https://tools.ietf.org/html/rfc7518>
    Ps384,

    /// RSASSA-PSS using SHA-512 and MGF1 with SHA-512, as described in <https://tools.ietf.org/html/rfc7518>
    Ps512,

    /// RSASSA-PKCS1-v1_5 using SHA-256, as described in <https://tools.ietf.org/html/rfc7518>
    Rs256,

    /// RSASSA-PKCS1-v1_5 using SHA-384, as described in <https://tools.ietf.org/html/rfc7518>
    Rs384,

    /// RSASSA-PKCS1-v1_5 using SHA-512, as described in <https://tools.ietf.org/html/rfc7518>
    Rs512,

    /// Reserved
    Rsnull,

    /// Any other value not defined in `SignatureAlgorithm`.
    UnknownValue(String),
}