"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Sign = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Sign resource in Oracle Cloud Infrastructure Kms service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/key/latest/Sign
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/kms
 *
 * Creates a digital signature for a message or message digest by using the private key of a public-private key pair,
 * also known as an asymmetric key. To verify the generated signature, you can use the [Verify](https://docs.cloud.oracle.com/iaas/api/#/en/key/latest/VerifiedData/Verify)
 * operation. Or, if you want to validate the signature outside of the service, you can do so by using the public key of the same asymmetric key.
 * This operation is not supported for keys having protection mode `EXTERNAL`.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testSign = new oci.kms.Sign("test_sign", {
 *     cryptoEndpoint: signMessageCryptoEndpoint,
 *     keyId: testKey.id,
 *     message: signMessage,
 *     signingAlgorithm: signSigningAlgorithm,
 *     keyVersionId: testKeyVersion.id,
 *     loggingContext: signLoggingContext,
 *     messageType: signMessageType,
 * });
 * ```
 *
 * ## Import
 *
 * Sign can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:Kms/sign:Sign test_sign "id"
 * ```
 */
class Sign extends pulumi.CustomResource {
    /**
     * Get an existing Sign resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new Sign(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:Kms/sign:Sign';
    /**
     * Returns true if the given object is an instance of Sign.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === Sign.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["cryptoEndpoint"] = state?.cryptoEndpoint;
            resourceInputs["keyId"] = state?.keyId;
            resourceInputs["keyVersionId"] = state?.keyVersionId;
            resourceInputs["message"] = state?.message;
            resourceInputs["messageType"] = state?.messageType;
            resourceInputs["signature"] = state?.signature;
            resourceInputs["signingAlgorithm"] = state?.signingAlgorithm;
        }
        else {
            const args = argsOrState;
            if (args?.cryptoEndpoint === undefined && !opts.urn) {
                throw new Error("Missing required property 'cryptoEndpoint'");
            }
            if (args?.keyId === undefined && !opts.urn) {
                throw new Error("Missing required property 'keyId'");
            }
            if (args?.message === undefined && !opts.urn) {
                throw new Error("Missing required property 'message'");
            }
            if (args?.signingAlgorithm === undefined && !opts.urn) {
                throw new Error("Missing required property 'signingAlgorithm'");
            }
            resourceInputs["cryptoEndpoint"] = args?.cryptoEndpoint;
            resourceInputs["keyId"] = args?.keyId;
            resourceInputs["keyVersionId"] = args?.keyVersionId;
            resourceInputs["message"] = args?.message;
            resourceInputs["messageType"] = args?.messageType;
            resourceInputs["signingAlgorithm"] = args?.signingAlgorithm;
            resourceInputs["signature"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Sign.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Sign = Sign;
//# sourceMappingURL=sign.js.map