static void Main1(string[] args)
        {
            const string ak        = "{your ak string}";
            const string sk        = "{your sk string}";
            const string endpoint  = "{your endpoint string}";
            const string projectId = "{your projectID string}";

            var config = HttpConfig.GetDefaultConfig();

            config.IgnoreSslVerification = true;
            var auth = new BasicCredentials(ak, sk, projectId);

            var kmsClient = KmsClient.NewBuilder()
                            .WithCredential(auth)
                            .WithEndPoint(endpoint)
                            .WithHttpConfig(config).Build();

            CreateKey(kmsClient);
            DeleteKey(kmsClient);
            CancelKeyDeletion(kmsClient);
            EnableKey(kmsClient);
            DisableKey(kmsClient);
            EnableKey(kmsClient);
            UpdateKeyAlias(kmsClient);
            UpdateKeyDescription(kmsClient);
        }
Ejemplo n.º 2
0
        static void Main1(string[] args)
        {
            const string ak        = "{your ak string}";
            const string sk        = "{your sk string}";
            const string endpoint  = "{your endpoint string}";
            const string projectId = "{your projectID string}";

            var config = HttpConfig.GetDefaultConfig();

            config.IgnoreSslVerification = true;
            var auth = new BasicCredentials(ak, sk, projectId);

            var kmsClient = KmsClient.NewBuilder()
                            .WithCredential(auth)
                            .WithEndPoint(endpoint)
                            .WithHttpConfig(config).Build();

            CreateTag(kmsClient);
            DeleteTag(kmsClient);
            BatchCreateTags(kmsClient);
            BatchDeleteTags(kmsClient);
            GetKeyTag(kmsClient);
            GetProjectTags(kmsClient);
            GetResourceInstance(kmsClient);
        }
Ejemplo n.º 3
0
        static void Main1(string[] args)
        {
            const string ak        = "{your ak string}";
            const string sk        = "{your sk string}";
            const string endpoint  = "{your endpoint string}";
            const string projectId = "{your projectID string}";

            var config = HttpConfig.GetDefaultConfig();

            config.IgnoreSslVerification = true;
            var auth = new BasicCredentials(ak, sk, projectId);

            var kmsClient = KmsClient.NewBuilder()
                            .WithCredential(auth)
                            .WithEndPoint(endpoint)
                            .WithHttpConfig(config).Build();

            DecryptData(kmsClient);
        }
        static void Main1(string[] args)
        {
            const string ak        = "{your ak string}";
            const string sk        = "{your sk string}";
            const string endpoint  = "{your endpoint string}";
            const string projectId = "{your projectID string}";

            var config = HttpConfig.GetDefaultConfig();

            config.IgnoreSslVerification = true;
            var auth = new BasicCredentials(ak, sk, projectId);

            var kmsClient = KmsClient.NewBuilder()
                            .WithCredential(auth)
                            .WithEndPoint(endpoint)
                            .WithHttpConfig(config).Build();

            var keyId = GetKeyByStatus.GetKeyByKeyStatus(kmsClient, "5");

            GetParametersForImport(kmsClient, keyId);
            ImportKeyMaterial(kmsClient, keyId);
            DeleteKeyMaterial(kmsClient, keyId);
        }