github.com/aavshr/aws-sdk-go@v1.41.3/service/kms/api.go (about) 1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3 package kms 4 5 import ( 6 "fmt" 7 "time" 8 9 "github.com/aavshr/aws-sdk-go/aws" 10 "github.com/aavshr/aws-sdk-go/aws/awsutil" 11 "github.com/aavshr/aws-sdk-go/aws/request" 12 "github.com/aavshr/aws-sdk-go/private/protocol" 13 "github.com/aavshr/aws-sdk-go/private/protocol/jsonrpc" 14 ) 15 16 const opCancelKeyDeletion = "CancelKeyDeletion" 17 18 // CancelKeyDeletionRequest generates a "aws/request.Request" representing the 19 // client's request for the CancelKeyDeletion operation. The "output" return 20 // value will be populated with the request's response once the request completes 21 // successfully. 22 // 23 // Use "Send" method on the returned Request to send the API call to the service. 24 // the "output" return value is not valid until after Send returns without error. 25 // 26 // See CancelKeyDeletion for more information on using the CancelKeyDeletion 27 // API call, and error handling. 28 // 29 // This method is useful when you want to inject custom logic or configuration 30 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 31 // 32 // 33 // // Example sending a request using the CancelKeyDeletionRequest method. 34 // req, resp := client.CancelKeyDeletionRequest(params) 35 // 36 // err := req.Send() 37 // if err == nil { // resp is now filled 38 // fmt.Println(resp) 39 // } 40 // 41 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CancelKeyDeletion 42 func (c *KMS) CancelKeyDeletionRequest(input *CancelKeyDeletionInput) (req *request.Request, output *CancelKeyDeletionOutput) { 43 op := &request.Operation{ 44 Name: opCancelKeyDeletion, 45 HTTPMethod: "POST", 46 HTTPPath: "/", 47 } 48 49 if input == nil { 50 input = &CancelKeyDeletionInput{} 51 } 52 53 output = &CancelKeyDeletionOutput{} 54 req = c.newRequest(op, input, output) 55 return 56 } 57 58 // CancelKeyDeletion API operation for AWS Key Management Service. 59 // 60 // Cancels the deletion of a KMS key. When this operation succeeds, the key 61 // state of the KMS key is Disabled. To enable the KMS key, use EnableKey. 62 // 63 // For more information about scheduling and canceling deletion of a KMS key, 64 // see Deleting KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) 65 // in the Key Management Service Developer Guide. 66 // 67 // The KMS key that you use for this operation must be in a compatible key state. 68 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 69 // in the Key Management Service Developer Guide. 70 // 71 // Cross-account use: No. You cannot perform this operation on a KMS key in 72 // a different Amazon Web Services account. 73 // 74 // Required permissions: kms:CancelKeyDeletion (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 75 // (key policy) 76 // 77 // Related operations: ScheduleKeyDeletion 78 // 79 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 80 // with awserr.Error's Code and Message methods to get detailed information about 81 // the error. 82 // 83 // See the AWS API reference guide for AWS Key Management Service's 84 // API operation CancelKeyDeletion for usage and error information. 85 // 86 // Returned Error Types: 87 // * NotFoundException 88 // The request was rejected because the specified entity or resource could not 89 // be found. 90 // 91 // * InvalidArnException 92 // The request was rejected because a specified ARN, or an ARN in a key policy, 93 // is not valid. 94 // 95 // * DependencyTimeoutException 96 // The system timed out while trying to fulfill the request. The request can 97 // be retried. 98 // 99 // * InternalException 100 // The request was rejected because an internal exception occurred. The request 101 // can be retried. 102 // 103 // * InvalidStateException 104 // The request was rejected because the state of the specified resource is not 105 // valid for this request. 106 // 107 // For more information about how key state affects the use of a KMS key, see 108 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 109 // in the Key Management Service Developer Guide . 110 // 111 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CancelKeyDeletion 112 func (c *KMS) CancelKeyDeletion(input *CancelKeyDeletionInput) (*CancelKeyDeletionOutput, error) { 113 req, out := c.CancelKeyDeletionRequest(input) 114 return out, req.Send() 115 } 116 117 // CancelKeyDeletionWithContext is the same as CancelKeyDeletion with the addition of 118 // the ability to pass a context and additional request options. 119 // 120 // See CancelKeyDeletion for details on how to use this API operation. 121 // 122 // The context must be non-nil and will be used for request cancellation. If 123 // the context is nil a panic will occur. In the future the SDK may create 124 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 125 // for more information on using Contexts. 126 func (c *KMS) CancelKeyDeletionWithContext(ctx aws.Context, input *CancelKeyDeletionInput, opts ...request.Option) (*CancelKeyDeletionOutput, error) { 127 req, out := c.CancelKeyDeletionRequest(input) 128 req.SetContext(ctx) 129 req.ApplyOptions(opts...) 130 return out, req.Send() 131 } 132 133 const opConnectCustomKeyStore = "ConnectCustomKeyStore" 134 135 // ConnectCustomKeyStoreRequest generates a "aws/request.Request" representing the 136 // client's request for the ConnectCustomKeyStore operation. The "output" return 137 // value will be populated with the request's response once the request completes 138 // successfully. 139 // 140 // Use "Send" method on the returned Request to send the API call to the service. 141 // the "output" return value is not valid until after Send returns without error. 142 // 143 // See ConnectCustomKeyStore for more information on using the ConnectCustomKeyStore 144 // API call, and error handling. 145 // 146 // This method is useful when you want to inject custom logic or configuration 147 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 148 // 149 // 150 // // Example sending a request using the ConnectCustomKeyStoreRequest method. 151 // req, resp := client.ConnectCustomKeyStoreRequest(params) 152 // 153 // err := req.Send() 154 // if err == nil { // resp is now filled 155 // fmt.Println(resp) 156 // } 157 // 158 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ConnectCustomKeyStore 159 func (c *KMS) ConnectCustomKeyStoreRequest(input *ConnectCustomKeyStoreInput) (req *request.Request, output *ConnectCustomKeyStoreOutput) { 160 op := &request.Operation{ 161 Name: opConnectCustomKeyStore, 162 HTTPMethod: "POST", 163 HTTPPath: "/", 164 } 165 166 if input == nil { 167 input = &ConnectCustomKeyStoreInput{} 168 } 169 170 output = &ConnectCustomKeyStoreOutput{} 171 req = c.newRequest(op, input, output) 172 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 173 return 174 } 175 176 // ConnectCustomKeyStore API operation for AWS Key Management Service. 177 // 178 // Connects or reconnects a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) 179 // to its associated CloudHSM cluster. 180 // 181 // The custom key store must be connected before you can create KMS keys in 182 // the key store or use the KMS keys it contains. You can disconnect and reconnect 183 // a custom key store at any time. 184 // 185 // To connect a custom key store, its associated CloudHSM cluster must have 186 // at least one active HSM. To get the number of active HSMs in a cluster, use 187 // the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) 188 // operation. To add HSMs to the cluster, use the CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html) 189 // operation. Also, the kmsuser crypto user (https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser) 190 // (CU) must not be logged into the cluster. This prevents KMS from using this 191 // account to log in. 192 // 193 // The connection process can take an extended amount of time to complete; up 194 // to 20 minutes. This operation starts the connection process, but it does 195 // not wait for it to complete. When it succeeds, this operation quickly returns 196 // an HTTP 200 response and a JSON object with no properties. However, this 197 // response does not indicate that the custom key store is connected. To get 198 // the connection state of the custom key store, use the DescribeCustomKeyStores 199 // operation. 200 // 201 // During the connection process, KMS finds the CloudHSM cluster that is associated 202 // with the custom key store, creates the connection infrastructure, connects 203 // to the cluster, logs into the CloudHSM client as the kmsuser CU, and rotates 204 // its password. 205 // 206 // The ConnectCustomKeyStore operation might fail for various reasons. To find 207 // the reason, use the DescribeCustomKeyStores operation and see the ConnectionErrorCode 208 // in the response. For help interpreting the ConnectionErrorCode, see CustomKeyStoresListEntry. 209 // 210 // To fix the failure, use the DisconnectCustomKeyStore operation to disconnect 211 // the custom key store, correct the error, use the UpdateCustomKeyStore operation 212 // if necessary, and then use ConnectCustomKeyStore again. 213 // 214 // If you are having trouble connecting or disconnecting a custom key store, 215 // see Troubleshooting a Custom Key Store (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) 216 // in the Key Management Service Developer Guide. 217 // 218 // Cross-account use: No. You cannot perform this operation on a custom key 219 // store in a different Amazon Web Services account. 220 // 221 // Required permissions: kms:ConnectCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 222 // (IAM policy) 223 // 224 // Related operations 225 // 226 // * CreateCustomKeyStore 227 // 228 // * DeleteCustomKeyStore 229 // 230 // * DescribeCustomKeyStores 231 // 232 // * DisconnectCustomKeyStore 233 // 234 // * UpdateCustomKeyStore 235 // 236 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 237 // with awserr.Error's Code and Message methods to get detailed information about 238 // the error. 239 // 240 // See the AWS API reference guide for AWS Key Management Service's 241 // API operation ConnectCustomKeyStore for usage and error information. 242 // 243 // Returned Error Types: 244 // * CloudHsmClusterNotActiveException 245 // The request was rejected because the CloudHSM cluster that is associated 246 // with the custom key store is not active. Initialize and activate the cluster 247 // and try the command again. For detailed instructions, see Getting Started 248 // (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html) 249 // in the CloudHSM User Guide. 250 // 251 // * CustomKeyStoreInvalidStateException 252 // The request was rejected because of the ConnectionState of the custom key 253 // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores 254 // operation. 255 // 256 // This exception is thrown under the following conditions: 257 // 258 // * You requested the CreateKey or GenerateRandom operation in a custom 259 // key store that is not connected. These operations are valid only when 260 // the custom key store ConnectionState is CONNECTED. 261 // 262 // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation 263 // on a custom key store that is not disconnected. This operation is valid 264 // only when the custom key store ConnectionState is DISCONNECTED. 265 // 266 // * You requested the ConnectCustomKeyStore operation on a custom key store 267 // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid 268 // for all other ConnectionState values. 269 // 270 // * CustomKeyStoreNotFoundException 271 // The request was rejected because KMS cannot find a custom key store with 272 // the specified key store name or ID. 273 // 274 // * InternalException 275 // The request was rejected because an internal exception occurred. The request 276 // can be retried. 277 // 278 // * CloudHsmClusterInvalidConfigurationException 279 // The request was rejected because the associated CloudHSM cluster did not 280 // meet the configuration requirements for a custom key store. 281 // 282 // * The cluster must be configured with private subnets in at least two 283 // different Availability Zones in the Region. 284 // 285 // * The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html) 286 // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound 287 // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound 288 // rules and the Destination in the outbound rules must match the security 289 // group ID. These rules are set by default when you create the cluster. 290 // Do not delete or change them. To get information about a particular security 291 // group, use the DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) 292 // operation. 293 // 294 // * The cluster must contain at least as many HSMs as the operation requires. 295 // To add HSMs, use the CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html) 296 // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey 297 // operations, the CloudHSM cluster must have at least two active HSMs, each 298 // in a different Availability Zone. For the ConnectCustomKeyStore operation, 299 // the CloudHSM must contain at least one active HSM. 300 // 301 // For information about the requirements for an CloudHSM cluster that is associated 302 // with a custom key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore) 303 // in the Key Management Service Developer Guide. For information about creating 304 // a private subnet for an CloudHSM cluster, see Create a Private Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html) 305 // in the CloudHSM User Guide. For information about cluster security groups, 306 // see Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html) 307 // in the CloudHSM User Guide . 308 // 309 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ConnectCustomKeyStore 310 func (c *KMS) ConnectCustomKeyStore(input *ConnectCustomKeyStoreInput) (*ConnectCustomKeyStoreOutput, error) { 311 req, out := c.ConnectCustomKeyStoreRequest(input) 312 return out, req.Send() 313 } 314 315 // ConnectCustomKeyStoreWithContext is the same as ConnectCustomKeyStore with the addition of 316 // the ability to pass a context and additional request options. 317 // 318 // See ConnectCustomKeyStore for details on how to use this API operation. 319 // 320 // The context must be non-nil and will be used for request cancellation. If 321 // the context is nil a panic will occur. In the future the SDK may create 322 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 323 // for more information on using Contexts. 324 func (c *KMS) ConnectCustomKeyStoreWithContext(ctx aws.Context, input *ConnectCustomKeyStoreInput, opts ...request.Option) (*ConnectCustomKeyStoreOutput, error) { 325 req, out := c.ConnectCustomKeyStoreRequest(input) 326 req.SetContext(ctx) 327 req.ApplyOptions(opts...) 328 return out, req.Send() 329 } 330 331 const opCreateAlias = "CreateAlias" 332 333 // CreateAliasRequest generates a "aws/request.Request" representing the 334 // client's request for the CreateAlias operation. The "output" return 335 // value will be populated with the request's response once the request completes 336 // successfully. 337 // 338 // Use "Send" method on the returned Request to send the API call to the service. 339 // the "output" return value is not valid until after Send returns without error. 340 // 341 // See CreateAlias for more information on using the CreateAlias 342 // API call, and error handling. 343 // 344 // This method is useful when you want to inject custom logic or configuration 345 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 346 // 347 // 348 // // Example sending a request using the CreateAliasRequest method. 349 // req, resp := client.CreateAliasRequest(params) 350 // 351 // err := req.Send() 352 // if err == nil { // resp is now filled 353 // fmt.Println(resp) 354 // } 355 // 356 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateAlias 357 func (c *KMS) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, output *CreateAliasOutput) { 358 op := &request.Operation{ 359 Name: opCreateAlias, 360 HTTPMethod: "POST", 361 HTTPPath: "/", 362 } 363 364 if input == nil { 365 input = &CreateAliasInput{} 366 } 367 368 output = &CreateAliasOutput{} 369 req = c.newRequest(op, input, output) 370 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 371 return 372 } 373 374 // CreateAlias API operation for AWS Key Management Service. 375 // 376 // Creates a friendly name for a KMS key. 377 // 378 // Adding, deleting, or updating an alias can allow or deny permission to the 379 // KMS key. For details, see Using ABAC in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) 380 // in the Key Management Service Developer Guide. 381 // 382 // You can use an alias to identify a KMS key in the KMS console, in the DescribeKey 383 // operation and in cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations), 384 // such as Encrypt and GenerateDataKey. You can also change the KMS key that's 385 // associated with the alias (UpdateAlias) or delete the alias (DeleteAlias) 386 // at any time. These operations don't affect the underlying KMS key. 387 // 388 // You can associate the alias with any customer managed key in the same Amazon 389 // Web Services Region. Each alias is associated with only one KMS key at a 390 // time, but a KMS key can have multiple aliases. A valid KMS key is required. 391 // You can't create an alias without a KMS key. 392 // 393 // The alias must be unique in the account and Region, but you can have aliases 394 // with the same name in different Regions. For detailed information about aliases, 395 // see Using aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html) 396 // in the Key Management Service Developer Guide. 397 // 398 // This operation does not return a response. To get the alias that you created, 399 // use the ListAliases operation. 400 // 401 // The KMS key that you use for this operation must be in a compatible key state. 402 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 403 // in the Key Management Service Developer Guide. 404 // 405 // Cross-account use: No. You cannot perform this operation on an alias in a 406 // different Amazon Web Services account. 407 // 408 // Required permissions 409 // 410 // * kms:CreateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 411 // on the alias (IAM policy). 412 // 413 // * kms:CreateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 414 // on the KMS key (key policy). 415 // 416 // For details, see Controlling access to aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) 417 // in the Key Management Service Developer Guide. 418 // 419 // Related operations: 420 // 421 // * DeleteAlias 422 // 423 // * ListAliases 424 // 425 // * UpdateAlias 426 // 427 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 428 // with awserr.Error's Code and Message methods to get detailed information about 429 // the error. 430 // 431 // See the AWS API reference guide for AWS Key Management Service's 432 // API operation CreateAlias for usage and error information. 433 // 434 // Returned Error Types: 435 // * DependencyTimeoutException 436 // The system timed out while trying to fulfill the request. The request can 437 // be retried. 438 // 439 // * AlreadyExistsException 440 // The request was rejected because it attempted to create a resource that already 441 // exists. 442 // 443 // * NotFoundException 444 // The request was rejected because the specified entity or resource could not 445 // be found. 446 // 447 // * InvalidAliasNameException 448 // The request was rejected because the specified alias name is not valid. 449 // 450 // * InternalException 451 // The request was rejected because an internal exception occurred. The request 452 // can be retried. 453 // 454 // * LimitExceededException 455 // The request was rejected because a quota was exceeded. For more information, 456 // see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) 457 // in the Key Management Service Developer Guide. 458 // 459 // * InvalidStateException 460 // The request was rejected because the state of the specified resource is not 461 // valid for this request. 462 // 463 // For more information about how key state affects the use of a KMS key, see 464 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 465 // in the Key Management Service Developer Guide . 466 // 467 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateAlias 468 func (c *KMS) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error) { 469 req, out := c.CreateAliasRequest(input) 470 return out, req.Send() 471 } 472 473 // CreateAliasWithContext is the same as CreateAlias with the addition of 474 // the ability to pass a context and additional request options. 475 // 476 // See CreateAlias for details on how to use this API operation. 477 // 478 // The context must be non-nil and will be used for request cancellation. If 479 // the context is nil a panic will occur. In the future the SDK may create 480 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 481 // for more information on using Contexts. 482 func (c *KMS) CreateAliasWithContext(ctx aws.Context, input *CreateAliasInput, opts ...request.Option) (*CreateAliasOutput, error) { 483 req, out := c.CreateAliasRequest(input) 484 req.SetContext(ctx) 485 req.ApplyOptions(opts...) 486 return out, req.Send() 487 } 488 489 const opCreateCustomKeyStore = "CreateCustomKeyStore" 490 491 // CreateCustomKeyStoreRequest generates a "aws/request.Request" representing the 492 // client's request for the CreateCustomKeyStore operation. The "output" return 493 // value will be populated with the request's response once the request completes 494 // successfully. 495 // 496 // Use "Send" method on the returned Request to send the API call to the service. 497 // the "output" return value is not valid until after Send returns without error. 498 // 499 // See CreateCustomKeyStore for more information on using the CreateCustomKeyStore 500 // API call, and error handling. 501 // 502 // This method is useful when you want to inject custom logic or configuration 503 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 504 // 505 // 506 // // Example sending a request using the CreateCustomKeyStoreRequest method. 507 // req, resp := client.CreateCustomKeyStoreRequest(params) 508 // 509 // err := req.Send() 510 // if err == nil { // resp is now filled 511 // fmt.Println(resp) 512 // } 513 // 514 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateCustomKeyStore 515 func (c *KMS) CreateCustomKeyStoreRequest(input *CreateCustomKeyStoreInput) (req *request.Request, output *CreateCustomKeyStoreOutput) { 516 op := &request.Operation{ 517 Name: opCreateCustomKeyStore, 518 HTTPMethod: "POST", 519 HTTPPath: "/", 520 } 521 522 if input == nil { 523 input = &CreateCustomKeyStoreInput{} 524 } 525 526 output = &CreateCustomKeyStoreOutput{} 527 req = c.newRequest(op, input, output) 528 return 529 } 530 531 // CreateCustomKeyStore API operation for AWS Key Management Service. 532 // 533 // Creates a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) 534 // that is associated with an CloudHSM cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/clusters.html) 535 // that you own and manage. 536 // 537 // This operation is part of the Custom Key Store feature (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) 538 // feature in KMS, which combines the convenience and extensive integration 539 // of KMS with the isolation and control of a single-tenant key store. 540 // 541 // Before you create the custom key store, you must assemble the required elements, 542 // including an CloudHSM cluster that fulfills the requirements for a custom 543 // key store. For details about the required elements, see Assemble the Prerequisites 544 // (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore) 545 // in the Key Management Service Developer Guide. 546 // 547 // When the operation completes successfully, it returns the ID of the new custom 548 // key store. Before you can use your new custom key store, you need to use 549 // the ConnectCustomKeyStore operation to connect the new key store to its CloudHSM 550 // cluster. Even if you are not going to use your custom key store immediately, 551 // you might want to connect it to verify that all settings are correct and 552 // then disconnect it until you are ready to use it. 553 // 554 // For help with failures, see Troubleshooting a Custom Key Store (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) 555 // in the Key Management Service Developer Guide. 556 // 557 // Cross-account use: No. You cannot perform this operation on a custom key 558 // store in a different Amazon Web Services account. 559 // 560 // Required permissions: kms:CreateCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 561 // (IAM policy). 562 // 563 // Related operations: 564 // 565 // * ConnectCustomKeyStore 566 // 567 // * DeleteCustomKeyStore 568 // 569 // * DescribeCustomKeyStores 570 // 571 // * DisconnectCustomKeyStore 572 // 573 // * UpdateCustomKeyStore 574 // 575 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 576 // with awserr.Error's Code and Message methods to get detailed information about 577 // the error. 578 // 579 // See the AWS API reference guide for AWS Key Management Service's 580 // API operation CreateCustomKeyStore for usage and error information. 581 // 582 // Returned Error Types: 583 // * CloudHsmClusterInUseException 584 // The request was rejected because the specified CloudHSM cluster is already 585 // associated with a custom key store or it shares a backup history with a cluster 586 // that is associated with a custom key store. Each custom key store must be 587 // associated with a different CloudHSM cluster. 588 // 589 // Clusters that share a backup history have the same cluster certificate. To 590 // view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) 591 // operation. 592 // 593 // * CustomKeyStoreNameInUseException 594 // The request was rejected because the specified custom key store name is already 595 // assigned to another custom key store in the account. Try again with a custom 596 // key store name that is unique in the account. 597 // 598 // * CloudHsmClusterNotFoundException 599 // The request was rejected because KMS cannot find the CloudHSM cluster with 600 // the specified cluster ID. Retry the request with a different cluster ID. 601 // 602 // * InternalException 603 // The request was rejected because an internal exception occurred. The request 604 // can be retried. 605 // 606 // * CloudHsmClusterNotActiveException 607 // The request was rejected because the CloudHSM cluster that is associated 608 // with the custom key store is not active. Initialize and activate the cluster 609 // and try the command again. For detailed instructions, see Getting Started 610 // (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html) 611 // in the CloudHSM User Guide. 612 // 613 // * IncorrectTrustAnchorException 614 // The request was rejected because the trust anchor certificate in the request 615 // is not the trust anchor certificate for the specified CloudHSM cluster. 616 // 617 // When you initialize the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr), 618 // you create the trust anchor certificate and save it in the customerCA.crt 619 // file. 620 // 621 // * CloudHsmClusterInvalidConfigurationException 622 // The request was rejected because the associated CloudHSM cluster did not 623 // meet the configuration requirements for a custom key store. 624 // 625 // * The cluster must be configured with private subnets in at least two 626 // different Availability Zones in the Region. 627 // 628 // * The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html) 629 // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound 630 // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound 631 // rules and the Destination in the outbound rules must match the security 632 // group ID. These rules are set by default when you create the cluster. 633 // Do not delete or change them. To get information about a particular security 634 // group, use the DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) 635 // operation. 636 // 637 // * The cluster must contain at least as many HSMs as the operation requires. 638 // To add HSMs, use the CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html) 639 // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey 640 // operations, the CloudHSM cluster must have at least two active HSMs, each 641 // in a different Availability Zone. For the ConnectCustomKeyStore operation, 642 // the CloudHSM must contain at least one active HSM. 643 // 644 // For information about the requirements for an CloudHSM cluster that is associated 645 // with a custom key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore) 646 // in the Key Management Service Developer Guide. For information about creating 647 // a private subnet for an CloudHSM cluster, see Create a Private Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html) 648 // in the CloudHSM User Guide. For information about cluster security groups, 649 // see Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html) 650 // in the CloudHSM User Guide . 651 // 652 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateCustomKeyStore 653 func (c *KMS) CreateCustomKeyStore(input *CreateCustomKeyStoreInput) (*CreateCustomKeyStoreOutput, error) { 654 req, out := c.CreateCustomKeyStoreRequest(input) 655 return out, req.Send() 656 } 657 658 // CreateCustomKeyStoreWithContext is the same as CreateCustomKeyStore with the addition of 659 // the ability to pass a context and additional request options. 660 // 661 // See CreateCustomKeyStore for details on how to use this API operation. 662 // 663 // The context must be non-nil and will be used for request cancellation. If 664 // the context is nil a panic will occur. In the future the SDK may create 665 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 666 // for more information on using Contexts. 667 func (c *KMS) CreateCustomKeyStoreWithContext(ctx aws.Context, input *CreateCustomKeyStoreInput, opts ...request.Option) (*CreateCustomKeyStoreOutput, error) { 668 req, out := c.CreateCustomKeyStoreRequest(input) 669 req.SetContext(ctx) 670 req.ApplyOptions(opts...) 671 return out, req.Send() 672 } 673 674 const opCreateGrant = "CreateGrant" 675 676 // CreateGrantRequest generates a "aws/request.Request" representing the 677 // client's request for the CreateGrant operation. The "output" return 678 // value will be populated with the request's response once the request completes 679 // successfully. 680 // 681 // Use "Send" method on the returned Request to send the API call to the service. 682 // the "output" return value is not valid until after Send returns without error. 683 // 684 // See CreateGrant for more information on using the CreateGrant 685 // API call, and error handling. 686 // 687 // This method is useful when you want to inject custom logic or configuration 688 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 689 // 690 // 691 // // Example sending a request using the CreateGrantRequest method. 692 // req, resp := client.CreateGrantRequest(params) 693 // 694 // err := req.Send() 695 // if err == nil { // resp is now filled 696 // fmt.Println(resp) 697 // } 698 // 699 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateGrant 700 func (c *KMS) CreateGrantRequest(input *CreateGrantInput) (req *request.Request, output *CreateGrantOutput) { 701 op := &request.Operation{ 702 Name: opCreateGrant, 703 HTTPMethod: "POST", 704 HTTPPath: "/", 705 } 706 707 if input == nil { 708 input = &CreateGrantInput{} 709 } 710 711 output = &CreateGrantOutput{} 712 req = c.newRequest(op, input, output) 713 return 714 } 715 716 // CreateGrant API operation for AWS Key Management Service. 717 // 718 // Adds a grant to a KMS key. 719 // 720 // A grant is a policy instrument that allows Amazon Web Services principals 721 // to use KMS keys in cryptographic operations. It also can allow them to view 722 // a KMS key (DescribeKey) and create and manage grants. When authorizing access 723 // to a KMS key, grants are considered along with key policies and IAM policies. 724 // Grants are often used for temporary permissions because you can create one, 725 // use its permissions, and delete it without changing your key policies or 726 // IAM policies. 727 // 728 // For detailed information about grants, including grant terminology, see Using 729 // grants (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) 730 // in the Key Management Service Developer Guide . For examples of working with 731 // grants in several programming languages, see Programming grants (https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html). 732 // 733 // The CreateGrant operation returns a GrantToken and a GrantId. 734 // 735 // * When you create, retire, or revoke a grant, there might be a brief delay, 736 // usually less than five minutes, until the grant is available throughout 737 // KMS. This state is known as eventual consistency. Once the grant has achieved 738 // eventual consistency, the grantee principal can use the permissions in 739 // the grant without identifying the grant. However, to use the permissions 740 // in the grant immediately, use the GrantToken that CreateGrant returns. 741 // For details, see Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) 742 // in the Key Management Service Developer Guide . 743 // 744 // * The CreateGrant operation also returns a GrantId. You can use the GrantId 745 // and a key identifier to identify the grant in the RetireGrant and RevokeGrant 746 // operations. To find the grant ID, use the ListGrants or ListRetirableGrants 747 // operations. 748 // 749 // The KMS key that you use for this operation must be in a compatible key state. 750 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 751 // in the Key Management Service Developer Guide. 752 // 753 // Cross-account use: Yes. To perform this operation on a KMS key in a different 754 // Amazon Web Services account, specify the key ARN in the value of the KeyId 755 // parameter. 756 // 757 // Required permissions: kms:CreateGrant (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 758 // (key policy) 759 // 760 // Related operations: 761 // 762 // * ListGrants 763 // 764 // * ListRetirableGrants 765 // 766 // * RetireGrant 767 // 768 // * RevokeGrant 769 // 770 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 771 // with awserr.Error's Code and Message methods to get detailed information about 772 // the error. 773 // 774 // See the AWS API reference guide for AWS Key Management Service's 775 // API operation CreateGrant for usage and error information. 776 // 777 // Returned Error Types: 778 // * NotFoundException 779 // The request was rejected because the specified entity or resource could not 780 // be found. 781 // 782 // * DisabledException 783 // The request was rejected because the specified KMS key is not enabled. 784 // 785 // * DependencyTimeoutException 786 // The system timed out while trying to fulfill the request. The request can 787 // be retried. 788 // 789 // * InvalidArnException 790 // The request was rejected because a specified ARN, or an ARN in a key policy, 791 // is not valid. 792 // 793 // * InternalException 794 // The request was rejected because an internal exception occurred. The request 795 // can be retried. 796 // 797 // * InvalidGrantTokenException 798 // The request was rejected because the specified grant token is not valid. 799 // 800 // * LimitExceededException 801 // The request was rejected because a quota was exceeded. For more information, 802 // see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) 803 // in the Key Management Service Developer Guide. 804 // 805 // * InvalidStateException 806 // The request was rejected because the state of the specified resource is not 807 // valid for this request. 808 // 809 // For more information about how key state affects the use of a KMS key, see 810 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 811 // in the Key Management Service Developer Guide . 812 // 813 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateGrant 814 func (c *KMS) CreateGrant(input *CreateGrantInput) (*CreateGrantOutput, error) { 815 req, out := c.CreateGrantRequest(input) 816 return out, req.Send() 817 } 818 819 // CreateGrantWithContext is the same as CreateGrant with the addition of 820 // the ability to pass a context and additional request options. 821 // 822 // See CreateGrant for details on how to use this API operation. 823 // 824 // The context must be non-nil and will be used for request cancellation. If 825 // the context is nil a panic will occur. In the future the SDK may create 826 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 827 // for more information on using Contexts. 828 func (c *KMS) CreateGrantWithContext(ctx aws.Context, input *CreateGrantInput, opts ...request.Option) (*CreateGrantOutput, error) { 829 req, out := c.CreateGrantRequest(input) 830 req.SetContext(ctx) 831 req.ApplyOptions(opts...) 832 return out, req.Send() 833 } 834 835 const opCreateKey = "CreateKey" 836 837 // CreateKeyRequest generates a "aws/request.Request" representing the 838 // client's request for the CreateKey operation. The "output" return 839 // value will be populated with the request's response once the request completes 840 // successfully. 841 // 842 // Use "Send" method on the returned Request to send the API call to the service. 843 // the "output" return value is not valid until after Send returns without error. 844 // 845 // See CreateKey for more information on using the CreateKey 846 // API call, and error handling. 847 // 848 // This method is useful when you want to inject custom logic or configuration 849 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 850 // 851 // 852 // // Example sending a request using the CreateKeyRequest method. 853 // req, resp := client.CreateKeyRequest(params) 854 // 855 // err := req.Send() 856 // if err == nil { // resp is now filled 857 // fmt.Println(resp) 858 // } 859 // 860 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateKey 861 func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, output *CreateKeyOutput) { 862 op := &request.Operation{ 863 Name: opCreateKey, 864 HTTPMethod: "POST", 865 HTTPPath: "/", 866 } 867 868 if input == nil { 869 input = &CreateKeyInput{} 870 } 871 872 output = &CreateKeyOutput{} 873 req = c.newRequest(op, input, output) 874 return 875 } 876 877 // CreateKey API operation for AWS Key Management Service. 878 // 879 // Creates a unique customer managed KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms-keys) 880 // in your Amazon Web Services account and Region. 881 // 882 // KMS is replacing the term customer master key (CMK) with KMS key and KMS 883 // key. The concept has not changed. To prevent breaking changes, KMS is keeping 884 // some variations of this term. 885 // 886 // You can use the CreateKey operation to create symmetric or asymmetric KMS 887 // keys. 888 // 889 // * Symmetric KMS keys contain a 256-bit symmetric key that never leaves 890 // KMS unencrypted. To use the KMS key, you must call KMS. You can use a 891 // symmetric KMS key to encrypt and decrypt small amounts of data, but they 892 // are typically used to generate data keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) 893 // and data keys pairs (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-key-pairs). 894 // For details, see GenerateDataKey and GenerateDataKeyPair. 895 // 896 // * Asymmetric KMS keys can contain an RSA key pair or an Elliptic Curve 897 // (ECC) key pair. The private key in an asymmetric KMS key never leaves 898 // KMS unencrypted. However, you can use the GetPublicKey operation to download 899 // the public key so it can be used outside of KMS. KMS keys with RSA key 900 // pairs can be used to encrypt or decrypt data or sign and verify messages 901 // (but not both). KMS keys with ECC key pairs can be used only to sign and 902 // verify messages. 903 // 904 // For information about symmetric and asymmetric KMS keys, see Using Symmetric 905 // and Asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) 906 // in the Key Management Service Developer Guide. 907 // 908 // To create different types of KMS keys, use the following guidance: 909 // 910 // Asymmetric KMS keys 911 // 912 // To create an asymmetric KMS key, use the KeySpec parameter to specify the 913 // type of key material in the KMS key. Then, use the KeyUsage parameter to 914 // determine whether the KMS key will be used to encrypt and decrypt or sign 915 // and verify. You can't change these properties after the KMS key is created. 916 // 917 // Symmetric KMS keys 918 // 919 // When creating a symmetric KMS key, you don't need to specify the KeySpec 920 // or KeyUsage parameters. The default value for KeySpec, SYMMETRIC_DEFAULT, 921 // and the default value for KeyUsage, ENCRYPT_DECRYPT, are the only valid values 922 // for symmetric KMS keys. 923 // 924 // Multi-Region primary keys 925 // 926 // Imported key material 927 // 928 // To create a multi-Region primary key in the local Amazon Web Services Region, 929 // use the MultiRegion parameter with a value of True. To create a multi-Region 930 // replica key, that is, a KMS key with the same key ID and key material as 931 // a primary key, but in a different Amazon Web Services Region, use the ReplicateKey 932 // operation. To change a replica key to a primary key, and its primary key 933 // to a replica key, use the UpdatePrimaryRegion operation. 934 // 935 // This operation supports multi-Region keys, an KMS feature that lets you create 936 // multiple interoperable KMS keys in different Amazon Web Services Regions. 937 // Because these KMS keys have the same key ID, key material, and other metadata, 938 // you can use them interchangeably to encrypt data in one Amazon Web Services 939 // Region and decrypt it in a different Amazon Web Services Region without re-encrypting 940 // the data or making a cross-Region call. For more information about multi-Region 941 // keys, see Using multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) 942 // in the Key Management Service Developer Guide. 943 // 944 // You can create symmetric and asymmetric multi-Region keys and multi-Region 945 // keys with imported key material. You cannot create multi-Region keys in a 946 // custom key store. 947 // 948 // To import your own key material, begin by creating a symmetric KMS key with 949 // no key material. To do this, use the Origin parameter of CreateKey with a 950 // value of EXTERNAL. Next, use GetParametersForImport operation to get a public 951 // key and import token, and use the public key to encrypt your key material. 952 // Then, use ImportKeyMaterial with your import token to import the key material. 953 // For step-by-step instructions, see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) 954 // in the Key Management Service Developer Guide . You cannot import the key 955 // material into an asymmetric KMS key. 956 // 957 // To create a multi-Region primary key with imported key material, use the 958 // Origin parameter of CreateKey with a value of EXTERNAL and the MultiRegion 959 // parameter with a value of True. To create replicas of the multi-Region primary 960 // key, use the ReplicateKey operation. For more information about multi-Region 961 // keys, see Using multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) 962 // in the Key Management Service Developer Guide. 963 // 964 // Custom key store 965 // 966 // To create a symmetric KMS key in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html), 967 // use the CustomKeyStoreId parameter to specify the custom key store. You must 968 // also use the Origin parameter with a value of AWS_CLOUDHSM. The CloudHSM 969 // cluster that is associated with the custom key store must have at least two 970 // active HSMs in different Availability Zones in the Amazon Web Services Region. 971 // 972 // You cannot create an asymmetric KMS key in a custom key store. For information 973 // about custom key stores in KMS see Using Custom Key Stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) 974 // in the Key Management Service Developer Guide . 975 // 976 // Cross-account use: No. You cannot use this operation to create a KMS key 977 // in a different Amazon Web Services account. 978 // 979 // Required permissions: kms:CreateKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 980 // (IAM policy). To use the Tags parameter, kms:TagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 981 // (IAM policy). For examples and information about related permissions, see 982 // Allow a user to create KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policy-example-create-key) 983 // in the Key Management Service Developer Guide. 984 // 985 // Related operations: 986 // 987 // * DescribeKey 988 // 989 // * ListKeys 990 // 991 // * ScheduleKeyDeletion 992 // 993 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 994 // with awserr.Error's Code and Message methods to get detailed information about 995 // the error. 996 // 997 // See the AWS API reference guide for AWS Key Management Service's 998 // API operation CreateKey for usage and error information. 999 // 1000 // Returned Error Types: 1001 // * MalformedPolicyDocumentException 1002 // The request was rejected because the specified policy is not syntactically 1003 // or semantically correct. 1004 // 1005 // * DependencyTimeoutException 1006 // The system timed out while trying to fulfill the request. The request can 1007 // be retried. 1008 // 1009 // * InvalidArnException 1010 // The request was rejected because a specified ARN, or an ARN in a key policy, 1011 // is not valid. 1012 // 1013 // * UnsupportedOperationException 1014 // The request was rejected because a specified parameter is not supported or 1015 // a specified resource is not valid for this operation. 1016 // 1017 // * InternalException 1018 // The request was rejected because an internal exception occurred. The request 1019 // can be retried. 1020 // 1021 // * LimitExceededException 1022 // The request was rejected because a quota was exceeded. For more information, 1023 // see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) 1024 // in the Key Management Service Developer Guide. 1025 // 1026 // * TagException 1027 // The request was rejected because one or more tags are not valid. 1028 // 1029 // * CustomKeyStoreNotFoundException 1030 // The request was rejected because KMS cannot find a custom key store with 1031 // the specified key store name or ID. 1032 // 1033 // * CustomKeyStoreInvalidStateException 1034 // The request was rejected because of the ConnectionState of the custom key 1035 // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores 1036 // operation. 1037 // 1038 // This exception is thrown under the following conditions: 1039 // 1040 // * You requested the CreateKey or GenerateRandom operation in a custom 1041 // key store that is not connected. These operations are valid only when 1042 // the custom key store ConnectionState is CONNECTED. 1043 // 1044 // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation 1045 // on a custom key store that is not disconnected. This operation is valid 1046 // only when the custom key store ConnectionState is DISCONNECTED. 1047 // 1048 // * You requested the ConnectCustomKeyStore operation on a custom key store 1049 // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid 1050 // for all other ConnectionState values. 1051 // 1052 // * CloudHsmClusterInvalidConfigurationException 1053 // The request was rejected because the associated CloudHSM cluster did not 1054 // meet the configuration requirements for a custom key store. 1055 // 1056 // * The cluster must be configured with private subnets in at least two 1057 // different Availability Zones in the Region. 1058 // 1059 // * The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html) 1060 // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound 1061 // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound 1062 // rules and the Destination in the outbound rules must match the security 1063 // group ID. These rules are set by default when you create the cluster. 1064 // Do not delete or change them. To get information about a particular security 1065 // group, use the DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) 1066 // operation. 1067 // 1068 // * The cluster must contain at least as many HSMs as the operation requires. 1069 // To add HSMs, use the CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html) 1070 // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey 1071 // operations, the CloudHSM cluster must have at least two active HSMs, each 1072 // in a different Availability Zone. For the ConnectCustomKeyStore operation, 1073 // the CloudHSM must contain at least one active HSM. 1074 // 1075 // For information about the requirements for an CloudHSM cluster that is associated 1076 // with a custom key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore) 1077 // in the Key Management Service Developer Guide. For information about creating 1078 // a private subnet for an CloudHSM cluster, see Create a Private Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html) 1079 // in the CloudHSM User Guide. For information about cluster security groups, 1080 // see Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html) 1081 // in the CloudHSM User Guide . 1082 // 1083 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateKey 1084 func (c *KMS) CreateKey(input *CreateKeyInput) (*CreateKeyOutput, error) { 1085 req, out := c.CreateKeyRequest(input) 1086 return out, req.Send() 1087 } 1088 1089 // CreateKeyWithContext is the same as CreateKey with the addition of 1090 // the ability to pass a context and additional request options. 1091 // 1092 // See CreateKey for details on how to use this API operation. 1093 // 1094 // The context must be non-nil and will be used for request cancellation. If 1095 // the context is nil a panic will occur. In the future the SDK may create 1096 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1097 // for more information on using Contexts. 1098 func (c *KMS) CreateKeyWithContext(ctx aws.Context, input *CreateKeyInput, opts ...request.Option) (*CreateKeyOutput, error) { 1099 req, out := c.CreateKeyRequest(input) 1100 req.SetContext(ctx) 1101 req.ApplyOptions(opts...) 1102 return out, req.Send() 1103 } 1104 1105 const opDecrypt = "Decrypt" 1106 1107 // DecryptRequest generates a "aws/request.Request" representing the 1108 // client's request for the Decrypt operation. The "output" return 1109 // value will be populated with the request's response once the request completes 1110 // successfully. 1111 // 1112 // Use "Send" method on the returned Request to send the API call to the service. 1113 // the "output" return value is not valid until after Send returns without error. 1114 // 1115 // See Decrypt for more information on using the Decrypt 1116 // API call, and error handling. 1117 // 1118 // This method is useful when you want to inject custom logic or configuration 1119 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 1120 // 1121 // 1122 // // Example sending a request using the DecryptRequest method. 1123 // req, resp := client.DecryptRequest(params) 1124 // 1125 // err := req.Send() 1126 // if err == nil { // resp is now filled 1127 // fmt.Println(resp) 1128 // } 1129 // 1130 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Decrypt 1131 func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output *DecryptOutput) { 1132 op := &request.Operation{ 1133 Name: opDecrypt, 1134 HTTPMethod: "POST", 1135 HTTPPath: "/", 1136 } 1137 1138 if input == nil { 1139 input = &DecryptInput{} 1140 } 1141 1142 output = &DecryptOutput{} 1143 req = c.newRequest(op, input, output) 1144 return 1145 } 1146 1147 // Decrypt API operation for AWS Key Management Service. 1148 // 1149 // Decrypts ciphertext that was encrypted by a KMS key using any of the following 1150 // operations: 1151 // 1152 // * Encrypt 1153 // 1154 // * GenerateDataKey 1155 // 1156 // * GenerateDataKeyPair 1157 // 1158 // * GenerateDataKeyWithoutPlaintext 1159 // 1160 // * GenerateDataKeyPairWithoutPlaintext 1161 // 1162 // You can use this operation to decrypt ciphertext that was encrypted under 1163 // a symmetric or asymmetric KMS key. When the KMS key is asymmetric, you must 1164 // specify the KMS key and the encryption algorithm that was used to encrypt 1165 // the ciphertext. For information about symmetric and asymmetric KMS keys, 1166 // see Using Symmetric and Asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) 1167 // in the Key Management Service Developer Guide. 1168 // 1169 // The Decrypt operation also decrypts ciphertext that was encrypted outside 1170 // of KMS by the public key in an KMS asymmetric KMS key. However, it cannot 1171 // decrypt ciphertext produced by other libraries, such as the Amazon Web Services 1172 // Encryption SDK (https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/) 1173 // or Amazon S3 client-side encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html). 1174 // These libraries return a ciphertext format that is incompatible with KMS. 1175 // 1176 // If the ciphertext was encrypted under a symmetric KMS key, the KeyId parameter 1177 // is optional. KMS can get this information from metadata that it adds to the 1178 // symmetric ciphertext blob. This feature adds durability to your implementation 1179 // by ensuring that authorized users can decrypt ciphertext decades after it 1180 // was encrypted, even if they've lost track of the key ID. However, specifying 1181 // the KMS key is always recommended as a best practice. When you use the KeyId 1182 // parameter to specify a KMS key, KMS only uses the KMS key you specify. If 1183 // the ciphertext was encrypted under a different KMS key, the Decrypt operation 1184 // fails. This practice ensures that you use the KMS key that you intend. 1185 // 1186 // Whenever possible, use key policies to give users permission to call the 1187 // Decrypt operation on a particular KMS key, instead of using IAM policies. 1188 // Otherwise, you might create an IAM user policy that gives the user Decrypt 1189 // permission on all KMS keys. This user could decrypt ciphertext that was encrypted 1190 // by KMS keys in other accounts if the key policy for the cross-account KMS 1191 // key permits it. If you must use an IAM policy for Decrypt permissions, limit 1192 // the user to particular KMS keys or particular trusted accounts. For details, 1193 // see Best practices for IAM policies (https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policies-best-practices) 1194 // in the Key Management Service Developer Guide. 1195 // 1196 // Applications in Amazon Web Services Nitro Enclaves can call this operation 1197 // by using the Amazon Web Services Nitro Enclaves Development Kit (https://github.com/aavshr/aws-nitro-enclaves-sdk-c). 1198 // For information about the supporting parameters, see How Amazon Web Services 1199 // Nitro Enclaves use KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) 1200 // in the Key Management Service Developer Guide. 1201 // 1202 // The KMS key that you use for this operation must be in a compatible key state. 1203 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 1204 // in the Key Management Service Developer Guide. 1205 // 1206 // Cross-account use: Yes. To perform this operation with a KMS key in a different 1207 // Amazon Web Services account, specify the key ARN or alias ARN in the value 1208 // of the KeyId parameter. 1209 // 1210 // Required permissions: kms:Decrypt (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 1211 // (key policy) 1212 // 1213 // Related operations: 1214 // 1215 // * Encrypt 1216 // 1217 // * GenerateDataKey 1218 // 1219 // * GenerateDataKeyPair 1220 // 1221 // * ReEncrypt 1222 // 1223 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1224 // with awserr.Error's Code and Message methods to get detailed information about 1225 // the error. 1226 // 1227 // See the AWS API reference guide for AWS Key Management Service's 1228 // API operation Decrypt for usage and error information. 1229 // 1230 // Returned Error Types: 1231 // * NotFoundException 1232 // The request was rejected because the specified entity or resource could not 1233 // be found. 1234 // 1235 // * DisabledException 1236 // The request was rejected because the specified KMS key is not enabled. 1237 // 1238 // * InvalidCiphertextException 1239 // From the Decrypt or ReEncrypt operation, the request was rejected because 1240 // the specified ciphertext, or additional authenticated data incorporated into 1241 // the ciphertext, such as the encryption context, is corrupted, missing, or 1242 // otherwise invalid. 1243 // 1244 // From the ImportKeyMaterial operation, the request was rejected because KMS 1245 // could not decrypt the encrypted (wrapped) key material. 1246 // 1247 // * KeyUnavailableException 1248 // The request was rejected because the specified KMS key was not available. 1249 // You can retry the request. 1250 // 1251 // * IncorrectKeyException 1252 // The request was rejected because the specified KMS key cannot decrypt the 1253 // data. The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request 1254 // must identify the same KMS key that was used to encrypt the ciphertext. 1255 // 1256 // * InvalidKeyUsageException 1257 // The request was rejected for one of the following reasons: 1258 // 1259 // * The KeyUsage value of the KMS key is incompatible with the API operation. 1260 // 1261 // * The encryption algorithm or signing algorithm specified for the operation 1262 // is incompatible with the type of key material in the KMS key (KeySpec). 1263 // 1264 // For encrypting, decrypting, re-encrypting, and generating data keys, the 1265 // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage 1266 // must be SIGN_VERIFY. To find the KeyUsage of a KMS key, use the DescribeKey 1267 // operation. 1268 // 1269 // To find the encryption or signing algorithms supported for a particular KMS 1270 // key, use the DescribeKey operation. 1271 // 1272 // * DependencyTimeoutException 1273 // The system timed out while trying to fulfill the request. The request can 1274 // be retried. 1275 // 1276 // * InvalidGrantTokenException 1277 // The request was rejected because the specified grant token is not valid. 1278 // 1279 // * InternalException 1280 // The request was rejected because an internal exception occurred. The request 1281 // can be retried. 1282 // 1283 // * InvalidStateException 1284 // The request was rejected because the state of the specified resource is not 1285 // valid for this request. 1286 // 1287 // For more information about how key state affects the use of a KMS key, see 1288 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 1289 // in the Key Management Service Developer Guide . 1290 // 1291 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Decrypt 1292 func (c *KMS) Decrypt(input *DecryptInput) (*DecryptOutput, error) { 1293 req, out := c.DecryptRequest(input) 1294 return out, req.Send() 1295 } 1296 1297 // DecryptWithContext is the same as Decrypt with the addition of 1298 // the ability to pass a context and additional request options. 1299 // 1300 // See Decrypt for details on how to use this API operation. 1301 // 1302 // The context must be non-nil and will be used for request cancellation. If 1303 // the context is nil a panic will occur. In the future the SDK may create 1304 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1305 // for more information on using Contexts. 1306 func (c *KMS) DecryptWithContext(ctx aws.Context, input *DecryptInput, opts ...request.Option) (*DecryptOutput, error) { 1307 req, out := c.DecryptRequest(input) 1308 req.SetContext(ctx) 1309 req.ApplyOptions(opts...) 1310 return out, req.Send() 1311 } 1312 1313 const opDeleteAlias = "DeleteAlias" 1314 1315 // DeleteAliasRequest generates a "aws/request.Request" representing the 1316 // client's request for the DeleteAlias operation. The "output" return 1317 // value will be populated with the request's response once the request completes 1318 // successfully. 1319 // 1320 // Use "Send" method on the returned Request to send the API call to the service. 1321 // the "output" return value is not valid until after Send returns without error. 1322 // 1323 // See DeleteAlias for more information on using the DeleteAlias 1324 // API call, and error handling. 1325 // 1326 // This method is useful when you want to inject custom logic or configuration 1327 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 1328 // 1329 // 1330 // // Example sending a request using the DeleteAliasRequest method. 1331 // req, resp := client.DeleteAliasRequest(params) 1332 // 1333 // err := req.Send() 1334 // if err == nil { // resp is now filled 1335 // fmt.Println(resp) 1336 // } 1337 // 1338 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteAlias 1339 func (c *KMS) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, output *DeleteAliasOutput) { 1340 op := &request.Operation{ 1341 Name: opDeleteAlias, 1342 HTTPMethod: "POST", 1343 HTTPPath: "/", 1344 } 1345 1346 if input == nil { 1347 input = &DeleteAliasInput{} 1348 } 1349 1350 output = &DeleteAliasOutput{} 1351 req = c.newRequest(op, input, output) 1352 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 1353 return 1354 } 1355 1356 // DeleteAlias API operation for AWS Key Management Service. 1357 // 1358 // Deletes the specified alias. 1359 // 1360 // Adding, deleting, or updating an alias can allow or deny permission to the 1361 // KMS key. For details, see Using ABAC in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) 1362 // in the Key Management Service Developer Guide. 1363 // 1364 // Because an alias is not a property of a KMS key, you can delete and change 1365 // the aliases of a KMS key without affecting the KMS key. Also, aliases do 1366 // not appear in the response from the DescribeKey operation. To get the aliases 1367 // of all KMS keys, use the ListAliases operation. 1368 // 1369 // Each KMS key can have multiple aliases. To change the alias of a KMS key, 1370 // use DeleteAlias to delete the current alias and CreateAlias to create a new 1371 // alias. To associate an existing alias with a different KMS key, call UpdateAlias. 1372 // 1373 // Cross-account use: No. You cannot perform this operation on an alias in a 1374 // different Amazon Web Services account. 1375 // 1376 // Required permissions 1377 // 1378 // * kms:DeleteAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 1379 // on the alias (IAM policy). 1380 // 1381 // * kms:DeleteAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 1382 // on the KMS key (key policy). 1383 // 1384 // For details, see Controlling access to aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) 1385 // in the Key Management Service Developer Guide. 1386 // 1387 // Related operations: 1388 // 1389 // * CreateAlias 1390 // 1391 // * ListAliases 1392 // 1393 // * UpdateAlias 1394 // 1395 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1396 // with awserr.Error's Code and Message methods to get detailed information about 1397 // the error. 1398 // 1399 // See the AWS API reference guide for AWS Key Management Service's 1400 // API operation DeleteAlias for usage and error information. 1401 // 1402 // Returned Error Types: 1403 // * DependencyTimeoutException 1404 // The system timed out while trying to fulfill the request. The request can 1405 // be retried. 1406 // 1407 // * NotFoundException 1408 // The request was rejected because the specified entity or resource could not 1409 // be found. 1410 // 1411 // * InternalException 1412 // The request was rejected because an internal exception occurred. The request 1413 // can be retried. 1414 // 1415 // * InvalidStateException 1416 // The request was rejected because the state of the specified resource is not 1417 // valid for this request. 1418 // 1419 // For more information about how key state affects the use of a KMS key, see 1420 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 1421 // in the Key Management Service Developer Guide . 1422 // 1423 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteAlias 1424 func (c *KMS) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error) { 1425 req, out := c.DeleteAliasRequest(input) 1426 return out, req.Send() 1427 } 1428 1429 // DeleteAliasWithContext is the same as DeleteAlias with the addition of 1430 // the ability to pass a context and additional request options. 1431 // 1432 // See DeleteAlias for details on how to use this API operation. 1433 // 1434 // The context must be non-nil and will be used for request cancellation. If 1435 // the context is nil a panic will occur. In the future the SDK may create 1436 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1437 // for more information on using Contexts. 1438 func (c *KMS) DeleteAliasWithContext(ctx aws.Context, input *DeleteAliasInput, opts ...request.Option) (*DeleteAliasOutput, error) { 1439 req, out := c.DeleteAliasRequest(input) 1440 req.SetContext(ctx) 1441 req.ApplyOptions(opts...) 1442 return out, req.Send() 1443 } 1444 1445 const opDeleteCustomKeyStore = "DeleteCustomKeyStore" 1446 1447 // DeleteCustomKeyStoreRequest generates a "aws/request.Request" representing the 1448 // client's request for the DeleteCustomKeyStore operation. The "output" return 1449 // value will be populated with the request's response once the request completes 1450 // successfully. 1451 // 1452 // Use "Send" method on the returned Request to send the API call to the service. 1453 // the "output" return value is not valid until after Send returns without error. 1454 // 1455 // See DeleteCustomKeyStore for more information on using the DeleteCustomKeyStore 1456 // API call, and error handling. 1457 // 1458 // This method is useful when you want to inject custom logic or configuration 1459 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 1460 // 1461 // 1462 // // Example sending a request using the DeleteCustomKeyStoreRequest method. 1463 // req, resp := client.DeleteCustomKeyStoreRequest(params) 1464 // 1465 // err := req.Send() 1466 // if err == nil { // resp is now filled 1467 // fmt.Println(resp) 1468 // } 1469 // 1470 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteCustomKeyStore 1471 func (c *KMS) DeleteCustomKeyStoreRequest(input *DeleteCustomKeyStoreInput) (req *request.Request, output *DeleteCustomKeyStoreOutput) { 1472 op := &request.Operation{ 1473 Name: opDeleteCustomKeyStore, 1474 HTTPMethod: "POST", 1475 HTTPPath: "/", 1476 } 1477 1478 if input == nil { 1479 input = &DeleteCustomKeyStoreInput{} 1480 } 1481 1482 output = &DeleteCustomKeyStoreOutput{} 1483 req = c.newRequest(op, input, output) 1484 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 1485 return 1486 } 1487 1488 // DeleteCustomKeyStore API operation for AWS Key Management Service. 1489 // 1490 // Deletes a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). 1491 // This operation does not delete the CloudHSM cluster that is associated with 1492 // the custom key store, or affect any users or keys in the cluster. 1493 // 1494 // The custom key store that you delete cannot contain any KMS KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys). 1495 // Before deleting the key store, verify that you will never need to use any 1496 // of the KMS keys in the key store for any cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations). 1497 // Then, use ScheduleKeyDeletion to delete the KMS keys from the key store. 1498 // When the scheduled waiting period expires, the ScheduleKeyDeletion operation 1499 // deletes the KMS keys. Then it makes a best effort to delete the key material 1500 // from the associated cluster. However, you might need to manually delete the 1501 // orphaned key material (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-orphaned-key) 1502 // from the cluster and its backups. 1503 // 1504 // After all KMS keys are deleted from KMS, use DisconnectCustomKeyStore to 1505 // disconnect the key store from KMS. Then, you can delete the custom key store. 1506 // 1507 // Instead of deleting the custom key store, consider using DisconnectCustomKeyStore 1508 // to disconnect it from KMS. While the key store is disconnected, you cannot 1509 // create or use the KMS keys in the key store. But, you do not need to delete 1510 // KMS keys and you can reconnect a disconnected custom key store at any time. 1511 // 1512 // If the operation succeeds, it returns a JSON object with no properties. 1513 // 1514 // This operation is part of the Custom Key Store feature (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) 1515 // feature in KMS, which combines the convenience and extensive integration 1516 // of KMS with the isolation and control of a single-tenant key store. 1517 // 1518 // Cross-account use: No. You cannot perform this operation on a custom key 1519 // store in a different Amazon Web Services account. 1520 // 1521 // Required permissions: kms:DeleteCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 1522 // (IAM policy) 1523 // 1524 // Related operations: 1525 // 1526 // * ConnectCustomKeyStore 1527 // 1528 // * CreateCustomKeyStore 1529 // 1530 // * DescribeCustomKeyStores 1531 // 1532 // * DisconnectCustomKeyStore 1533 // 1534 // * UpdateCustomKeyStore 1535 // 1536 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1537 // with awserr.Error's Code and Message methods to get detailed information about 1538 // the error. 1539 // 1540 // See the AWS API reference guide for AWS Key Management Service's 1541 // API operation DeleteCustomKeyStore for usage and error information. 1542 // 1543 // Returned Error Types: 1544 // * CustomKeyStoreHasCMKsException 1545 // The request was rejected because the custom key store contains KMS keys. 1546 // After verifying that you do not need to use the KMS keys, use the ScheduleKeyDeletion 1547 // operation to delete the KMS keys. After they are deleted, you can delete 1548 // the custom key store. 1549 // 1550 // * CustomKeyStoreInvalidStateException 1551 // The request was rejected because of the ConnectionState of the custom key 1552 // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores 1553 // operation. 1554 // 1555 // This exception is thrown under the following conditions: 1556 // 1557 // * You requested the CreateKey or GenerateRandom operation in a custom 1558 // key store that is not connected. These operations are valid only when 1559 // the custom key store ConnectionState is CONNECTED. 1560 // 1561 // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation 1562 // on a custom key store that is not disconnected. This operation is valid 1563 // only when the custom key store ConnectionState is DISCONNECTED. 1564 // 1565 // * You requested the ConnectCustomKeyStore operation on a custom key store 1566 // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid 1567 // for all other ConnectionState values. 1568 // 1569 // * CustomKeyStoreNotFoundException 1570 // The request was rejected because KMS cannot find a custom key store with 1571 // the specified key store name or ID. 1572 // 1573 // * InternalException 1574 // The request was rejected because an internal exception occurred. The request 1575 // can be retried. 1576 // 1577 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteCustomKeyStore 1578 func (c *KMS) DeleteCustomKeyStore(input *DeleteCustomKeyStoreInput) (*DeleteCustomKeyStoreOutput, error) { 1579 req, out := c.DeleteCustomKeyStoreRequest(input) 1580 return out, req.Send() 1581 } 1582 1583 // DeleteCustomKeyStoreWithContext is the same as DeleteCustomKeyStore with the addition of 1584 // the ability to pass a context and additional request options. 1585 // 1586 // See DeleteCustomKeyStore for details on how to use this API operation. 1587 // 1588 // The context must be non-nil and will be used for request cancellation. If 1589 // the context is nil a panic will occur. In the future the SDK may create 1590 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1591 // for more information on using Contexts. 1592 func (c *KMS) DeleteCustomKeyStoreWithContext(ctx aws.Context, input *DeleteCustomKeyStoreInput, opts ...request.Option) (*DeleteCustomKeyStoreOutput, error) { 1593 req, out := c.DeleteCustomKeyStoreRequest(input) 1594 req.SetContext(ctx) 1595 req.ApplyOptions(opts...) 1596 return out, req.Send() 1597 } 1598 1599 const opDeleteImportedKeyMaterial = "DeleteImportedKeyMaterial" 1600 1601 // DeleteImportedKeyMaterialRequest generates a "aws/request.Request" representing the 1602 // client's request for the DeleteImportedKeyMaterial operation. The "output" return 1603 // value will be populated with the request's response once the request completes 1604 // successfully. 1605 // 1606 // Use "Send" method on the returned Request to send the API call to the service. 1607 // the "output" return value is not valid until after Send returns without error. 1608 // 1609 // See DeleteImportedKeyMaterial for more information on using the DeleteImportedKeyMaterial 1610 // API call, and error handling. 1611 // 1612 // This method is useful when you want to inject custom logic or configuration 1613 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 1614 // 1615 // 1616 // // Example sending a request using the DeleteImportedKeyMaterialRequest method. 1617 // req, resp := client.DeleteImportedKeyMaterialRequest(params) 1618 // 1619 // err := req.Send() 1620 // if err == nil { // resp is now filled 1621 // fmt.Println(resp) 1622 // } 1623 // 1624 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteImportedKeyMaterial 1625 func (c *KMS) DeleteImportedKeyMaterialRequest(input *DeleteImportedKeyMaterialInput) (req *request.Request, output *DeleteImportedKeyMaterialOutput) { 1626 op := &request.Operation{ 1627 Name: opDeleteImportedKeyMaterial, 1628 HTTPMethod: "POST", 1629 HTTPPath: "/", 1630 } 1631 1632 if input == nil { 1633 input = &DeleteImportedKeyMaterialInput{} 1634 } 1635 1636 output = &DeleteImportedKeyMaterialOutput{} 1637 req = c.newRequest(op, input, output) 1638 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 1639 return 1640 } 1641 1642 // DeleteImportedKeyMaterial API operation for AWS Key Management Service. 1643 // 1644 // Deletes key material that you previously imported. This operation makes the 1645 // specified KMS key unusable. For more information about importing key material 1646 // into KMS, see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) 1647 // in the Key Management Service Developer Guide. 1648 // 1649 // When the specified KMS key is in the PendingDeletion state, this operation 1650 // does not change the KMS key's state. Otherwise, it changes the KMS key's 1651 // state to PendingImport. 1652 // 1653 // After you delete key material, you can use ImportKeyMaterial to reimport 1654 // the same key material into the KMS key. 1655 // 1656 // The KMS key that you use for this operation must be in a compatible key state. 1657 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 1658 // in the Key Management Service Developer Guide. 1659 // 1660 // Cross-account use: No. You cannot perform this operation on a KMS key in 1661 // a different Amazon Web Services account. 1662 // 1663 // Required permissions: kms:DeleteImportedKeyMaterial (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 1664 // (key policy) 1665 // 1666 // Related operations: 1667 // 1668 // * GetParametersForImport 1669 // 1670 // * ImportKeyMaterial 1671 // 1672 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1673 // with awserr.Error's Code and Message methods to get detailed information about 1674 // the error. 1675 // 1676 // See the AWS API reference guide for AWS Key Management Service's 1677 // API operation DeleteImportedKeyMaterial for usage and error information. 1678 // 1679 // Returned Error Types: 1680 // * InvalidArnException 1681 // The request was rejected because a specified ARN, or an ARN in a key policy, 1682 // is not valid. 1683 // 1684 // * UnsupportedOperationException 1685 // The request was rejected because a specified parameter is not supported or 1686 // a specified resource is not valid for this operation. 1687 // 1688 // * DependencyTimeoutException 1689 // The system timed out while trying to fulfill the request. The request can 1690 // be retried. 1691 // 1692 // * NotFoundException 1693 // The request was rejected because the specified entity or resource could not 1694 // be found. 1695 // 1696 // * InternalException 1697 // The request was rejected because an internal exception occurred. The request 1698 // can be retried. 1699 // 1700 // * InvalidStateException 1701 // The request was rejected because the state of the specified resource is not 1702 // valid for this request. 1703 // 1704 // For more information about how key state affects the use of a KMS key, see 1705 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 1706 // in the Key Management Service Developer Guide . 1707 // 1708 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteImportedKeyMaterial 1709 func (c *KMS) DeleteImportedKeyMaterial(input *DeleteImportedKeyMaterialInput) (*DeleteImportedKeyMaterialOutput, error) { 1710 req, out := c.DeleteImportedKeyMaterialRequest(input) 1711 return out, req.Send() 1712 } 1713 1714 // DeleteImportedKeyMaterialWithContext is the same as DeleteImportedKeyMaterial with the addition of 1715 // the ability to pass a context and additional request options. 1716 // 1717 // See DeleteImportedKeyMaterial for details on how to use this API operation. 1718 // 1719 // The context must be non-nil and will be used for request cancellation. If 1720 // the context is nil a panic will occur. In the future the SDK may create 1721 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1722 // for more information on using Contexts. 1723 func (c *KMS) DeleteImportedKeyMaterialWithContext(ctx aws.Context, input *DeleteImportedKeyMaterialInput, opts ...request.Option) (*DeleteImportedKeyMaterialOutput, error) { 1724 req, out := c.DeleteImportedKeyMaterialRequest(input) 1725 req.SetContext(ctx) 1726 req.ApplyOptions(opts...) 1727 return out, req.Send() 1728 } 1729 1730 const opDescribeCustomKeyStores = "DescribeCustomKeyStores" 1731 1732 // DescribeCustomKeyStoresRequest generates a "aws/request.Request" representing the 1733 // client's request for the DescribeCustomKeyStores operation. The "output" return 1734 // value will be populated with the request's response once the request completes 1735 // successfully. 1736 // 1737 // Use "Send" method on the returned Request to send the API call to the service. 1738 // the "output" return value is not valid until after Send returns without error. 1739 // 1740 // See DescribeCustomKeyStores for more information on using the DescribeCustomKeyStores 1741 // API call, and error handling. 1742 // 1743 // This method is useful when you want to inject custom logic or configuration 1744 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 1745 // 1746 // 1747 // // Example sending a request using the DescribeCustomKeyStoresRequest method. 1748 // req, resp := client.DescribeCustomKeyStoresRequest(params) 1749 // 1750 // err := req.Send() 1751 // if err == nil { // resp is now filled 1752 // fmt.Println(resp) 1753 // } 1754 // 1755 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeCustomKeyStores 1756 func (c *KMS) DescribeCustomKeyStoresRequest(input *DescribeCustomKeyStoresInput) (req *request.Request, output *DescribeCustomKeyStoresOutput) { 1757 op := &request.Operation{ 1758 Name: opDescribeCustomKeyStores, 1759 HTTPMethod: "POST", 1760 HTTPPath: "/", 1761 } 1762 1763 if input == nil { 1764 input = &DescribeCustomKeyStoresInput{} 1765 } 1766 1767 output = &DescribeCustomKeyStoresOutput{} 1768 req = c.newRequest(op, input, output) 1769 return 1770 } 1771 1772 // DescribeCustomKeyStores API operation for AWS Key Management Service. 1773 // 1774 // Gets information about custom key stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) 1775 // in the account and Region. 1776 // 1777 // This operation is part of the Custom Key Store feature (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) 1778 // feature in KMS, which combines the convenience and extensive integration 1779 // of KMS with the isolation and control of a single-tenant key store. 1780 // 1781 // By default, this operation returns information about all custom key stores 1782 // in the account and Region. To get only information about a particular custom 1783 // key store, use either the CustomKeyStoreName or CustomKeyStoreId parameter 1784 // (but not both). 1785 // 1786 // To determine whether the custom key store is connected to its CloudHSM cluster, 1787 // use the ConnectionState element in the response. If an attempt to connect 1788 // the custom key store failed, the ConnectionState value is FAILED and the 1789 // ConnectionErrorCode element in the response indicates the cause of the failure. 1790 // For help interpreting the ConnectionErrorCode, see CustomKeyStoresListEntry. 1791 // 1792 // Custom key stores have a DISCONNECTED connection state if the key store has 1793 // never been connected or you use the DisconnectCustomKeyStore operation to 1794 // disconnect it. If your custom key store state is CONNECTED but you are having 1795 // trouble using it, make sure that its associated CloudHSM cluster is active 1796 // and contains the minimum number of HSMs required for the operation, if any. 1797 // 1798 // For help repairing your custom key store, see the Troubleshooting Custom 1799 // Key Stores (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) 1800 // topic in the Key Management Service Developer Guide. 1801 // 1802 // Cross-account use: No. You cannot perform this operation on a custom key 1803 // store in a different Amazon Web Services account. 1804 // 1805 // Required permissions: kms:DescribeCustomKeyStores (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 1806 // (IAM policy) 1807 // 1808 // Related operations: 1809 // 1810 // * ConnectCustomKeyStore 1811 // 1812 // * CreateCustomKeyStore 1813 // 1814 // * DeleteCustomKeyStore 1815 // 1816 // * DisconnectCustomKeyStore 1817 // 1818 // * UpdateCustomKeyStore 1819 // 1820 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1821 // with awserr.Error's Code and Message methods to get detailed information about 1822 // the error. 1823 // 1824 // See the AWS API reference guide for AWS Key Management Service's 1825 // API operation DescribeCustomKeyStores for usage and error information. 1826 // 1827 // Returned Error Types: 1828 // * CustomKeyStoreNotFoundException 1829 // The request was rejected because KMS cannot find a custom key store with 1830 // the specified key store name or ID. 1831 // 1832 // * InvalidMarkerException 1833 // The request was rejected because the marker that specifies where pagination 1834 // should next begin is not valid. 1835 // 1836 // * InternalException 1837 // The request was rejected because an internal exception occurred. The request 1838 // can be retried. 1839 // 1840 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeCustomKeyStores 1841 func (c *KMS) DescribeCustomKeyStores(input *DescribeCustomKeyStoresInput) (*DescribeCustomKeyStoresOutput, error) { 1842 req, out := c.DescribeCustomKeyStoresRequest(input) 1843 return out, req.Send() 1844 } 1845 1846 // DescribeCustomKeyStoresWithContext is the same as DescribeCustomKeyStores with the addition of 1847 // the ability to pass a context and additional request options. 1848 // 1849 // See DescribeCustomKeyStores for details on how to use this API operation. 1850 // 1851 // The context must be non-nil and will be used for request cancellation. If 1852 // the context is nil a panic will occur. In the future the SDK may create 1853 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1854 // for more information on using Contexts. 1855 func (c *KMS) DescribeCustomKeyStoresWithContext(ctx aws.Context, input *DescribeCustomKeyStoresInput, opts ...request.Option) (*DescribeCustomKeyStoresOutput, error) { 1856 req, out := c.DescribeCustomKeyStoresRequest(input) 1857 req.SetContext(ctx) 1858 req.ApplyOptions(opts...) 1859 return out, req.Send() 1860 } 1861 1862 const opDescribeKey = "DescribeKey" 1863 1864 // DescribeKeyRequest generates a "aws/request.Request" representing the 1865 // client's request for the DescribeKey operation. The "output" return 1866 // value will be populated with the request's response once the request completes 1867 // successfully. 1868 // 1869 // Use "Send" method on the returned Request to send the API call to the service. 1870 // the "output" return value is not valid until after Send returns without error. 1871 // 1872 // See DescribeKey for more information on using the DescribeKey 1873 // API call, and error handling. 1874 // 1875 // This method is useful when you want to inject custom logic or configuration 1876 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 1877 // 1878 // 1879 // // Example sending a request using the DescribeKeyRequest method. 1880 // req, resp := client.DescribeKeyRequest(params) 1881 // 1882 // err := req.Send() 1883 // if err == nil { // resp is now filled 1884 // fmt.Println(resp) 1885 // } 1886 // 1887 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeKey 1888 func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) (req *request.Request, output *DescribeKeyOutput) { 1889 op := &request.Operation{ 1890 Name: opDescribeKey, 1891 HTTPMethod: "POST", 1892 HTTPPath: "/", 1893 } 1894 1895 if input == nil { 1896 input = &DescribeKeyInput{} 1897 } 1898 1899 output = &DescribeKeyOutput{} 1900 req = c.newRequest(op, input, output) 1901 return 1902 } 1903 1904 // DescribeKey API operation for AWS Key Management Service. 1905 // 1906 // Provides detailed information about a KMS key. You can run DescribeKey on 1907 // a customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) 1908 // or an Amazon Web Services managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). 1909 // 1910 // This detailed information includes the key ARN, creation date (and deletion 1911 // date, if applicable), the key state, and the origin and expiration date (if 1912 // any) of the key material. It includes fields, like KeySpec, that help you 1913 // distinguish symmetric from asymmetric KMS keys. It also provides information 1914 // that is particularly important to asymmetric keys, such as the key usage 1915 // (encryption or signing) and the encryption algorithms or signing algorithms 1916 // that the KMS key supports. For KMS keys in custom key stores, it includes 1917 // information about the custom key store, such as the key store ID and the 1918 // CloudHSM cluster ID. For multi-Region keys, it displays the primary key and 1919 // all related replica keys. 1920 // 1921 // DescribeKey does not return the following information: 1922 // 1923 // * Aliases associated with the KMS key. To get this information, use ListAliases. 1924 // 1925 // * Whether automatic key rotation is enabled on the KMS key. To get this 1926 // information, use GetKeyRotationStatus. Also, some key states prevent a 1927 // KMS key from being automatically rotated. For details, see How Automatic 1928 // Key Rotation Works (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotate-keys-how-it-works) 1929 // in Key Management Service Developer Guide. 1930 // 1931 // * Tags on the KMS key. To get this information, use ListResourceTags. 1932 // 1933 // * Key policies and grants on the KMS key. To get this information, use 1934 // GetKeyPolicy and ListGrants. 1935 // 1936 // If you call the DescribeKey operation on a predefined Amazon Web Services 1937 // alias, that is, an Amazon Web Services alias with no key ID, KMS creates 1938 // an Amazon Web Services managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). 1939 // Then, it associates the alias with the new KMS key, and returns the KeyId 1940 // and Arn of the new KMS key in the response. 1941 // 1942 // Cross-account use: Yes. To perform this operation with a KMS key in a different 1943 // Amazon Web Services account, specify the key ARN or alias ARN in the value 1944 // of the KeyId parameter. 1945 // 1946 // Required permissions: kms:DescribeKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 1947 // (key policy) 1948 // 1949 // Related operations: 1950 // 1951 // * GetKeyPolicy 1952 // 1953 // * GetKeyRotationStatus 1954 // 1955 // * ListAliases 1956 // 1957 // * ListGrants 1958 // 1959 // * ListKeys 1960 // 1961 // * ListResourceTags 1962 // 1963 // * ListRetirableGrants 1964 // 1965 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1966 // with awserr.Error's Code and Message methods to get detailed information about 1967 // the error. 1968 // 1969 // See the AWS API reference guide for AWS Key Management Service's 1970 // API operation DescribeKey for usage and error information. 1971 // 1972 // Returned Error Types: 1973 // * NotFoundException 1974 // The request was rejected because the specified entity or resource could not 1975 // be found. 1976 // 1977 // * InvalidArnException 1978 // The request was rejected because a specified ARN, or an ARN in a key policy, 1979 // is not valid. 1980 // 1981 // * DependencyTimeoutException 1982 // The system timed out while trying to fulfill the request. The request can 1983 // be retried. 1984 // 1985 // * InternalException 1986 // The request was rejected because an internal exception occurred. The request 1987 // can be retried. 1988 // 1989 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeKey 1990 func (c *KMS) DescribeKey(input *DescribeKeyInput) (*DescribeKeyOutput, error) { 1991 req, out := c.DescribeKeyRequest(input) 1992 return out, req.Send() 1993 } 1994 1995 // DescribeKeyWithContext is the same as DescribeKey with the addition of 1996 // the ability to pass a context and additional request options. 1997 // 1998 // See DescribeKey for details on how to use this API operation. 1999 // 2000 // The context must be non-nil and will be used for request cancellation. If 2001 // the context is nil a panic will occur. In the future the SDK may create 2002 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2003 // for more information on using Contexts. 2004 func (c *KMS) DescribeKeyWithContext(ctx aws.Context, input *DescribeKeyInput, opts ...request.Option) (*DescribeKeyOutput, error) { 2005 req, out := c.DescribeKeyRequest(input) 2006 req.SetContext(ctx) 2007 req.ApplyOptions(opts...) 2008 return out, req.Send() 2009 } 2010 2011 const opDisableKey = "DisableKey" 2012 2013 // DisableKeyRequest generates a "aws/request.Request" representing the 2014 // client's request for the DisableKey operation. The "output" return 2015 // value will be populated with the request's response once the request completes 2016 // successfully. 2017 // 2018 // Use "Send" method on the returned Request to send the API call to the service. 2019 // the "output" return value is not valid until after Send returns without error. 2020 // 2021 // See DisableKey for more information on using the DisableKey 2022 // API call, and error handling. 2023 // 2024 // This method is useful when you want to inject custom logic or configuration 2025 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 2026 // 2027 // 2028 // // Example sending a request using the DisableKeyRequest method. 2029 // req, resp := client.DisableKeyRequest(params) 2030 // 2031 // err := req.Send() 2032 // if err == nil { // resp is now filled 2033 // fmt.Println(resp) 2034 // } 2035 // 2036 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKey 2037 func (c *KMS) DisableKeyRequest(input *DisableKeyInput) (req *request.Request, output *DisableKeyOutput) { 2038 op := &request.Operation{ 2039 Name: opDisableKey, 2040 HTTPMethod: "POST", 2041 HTTPPath: "/", 2042 } 2043 2044 if input == nil { 2045 input = &DisableKeyInput{} 2046 } 2047 2048 output = &DisableKeyOutput{} 2049 req = c.newRequest(op, input, output) 2050 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 2051 return 2052 } 2053 2054 // DisableKey API operation for AWS Key Management Service. 2055 // 2056 // Sets the state of a KMS key to disabled. This change temporarily prevents 2057 // use of the KMS key for cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations). 2058 // 2059 // For more information about how key state affects the use of a KMS key, see 2060 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 2061 // in the Key Management Service Developer Guide . 2062 // 2063 // The KMS key that you use for this operation must be in a compatible key state. 2064 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 2065 // in the Key Management Service Developer Guide. 2066 // 2067 // Cross-account use: No. You cannot perform this operation on a KMS key in 2068 // a different Amazon Web Services account. 2069 // 2070 // Required permissions: kms:DisableKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 2071 // (key policy) 2072 // 2073 // Related operations: EnableKey 2074 // 2075 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2076 // with awserr.Error's Code and Message methods to get detailed information about 2077 // the error. 2078 // 2079 // See the AWS API reference guide for AWS Key Management Service's 2080 // API operation DisableKey for usage and error information. 2081 // 2082 // Returned Error Types: 2083 // * NotFoundException 2084 // The request was rejected because the specified entity or resource could not 2085 // be found. 2086 // 2087 // * InvalidArnException 2088 // The request was rejected because a specified ARN, or an ARN in a key policy, 2089 // is not valid. 2090 // 2091 // * DependencyTimeoutException 2092 // The system timed out while trying to fulfill the request. The request can 2093 // be retried. 2094 // 2095 // * InternalException 2096 // The request was rejected because an internal exception occurred. The request 2097 // can be retried. 2098 // 2099 // * InvalidStateException 2100 // The request was rejected because the state of the specified resource is not 2101 // valid for this request. 2102 // 2103 // For more information about how key state affects the use of a KMS key, see 2104 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 2105 // in the Key Management Service Developer Guide . 2106 // 2107 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKey 2108 func (c *KMS) DisableKey(input *DisableKeyInput) (*DisableKeyOutput, error) { 2109 req, out := c.DisableKeyRequest(input) 2110 return out, req.Send() 2111 } 2112 2113 // DisableKeyWithContext is the same as DisableKey with the addition of 2114 // the ability to pass a context and additional request options. 2115 // 2116 // See DisableKey for details on how to use this API operation. 2117 // 2118 // The context must be non-nil and will be used for request cancellation. If 2119 // the context is nil a panic will occur. In the future the SDK may create 2120 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2121 // for more information on using Contexts. 2122 func (c *KMS) DisableKeyWithContext(ctx aws.Context, input *DisableKeyInput, opts ...request.Option) (*DisableKeyOutput, error) { 2123 req, out := c.DisableKeyRequest(input) 2124 req.SetContext(ctx) 2125 req.ApplyOptions(opts...) 2126 return out, req.Send() 2127 } 2128 2129 const opDisableKeyRotation = "DisableKeyRotation" 2130 2131 // DisableKeyRotationRequest generates a "aws/request.Request" representing the 2132 // client's request for the DisableKeyRotation operation. The "output" return 2133 // value will be populated with the request's response once the request completes 2134 // successfully. 2135 // 2136 // Use "Send" method on the returned Request to send the API call to the service. 2137 // the "output" return value is not valid until after Send returns without error. 2138 // 2139 // See DisableKeyRotation for more information on using the DisableKeyRotation 2140 // API call, and error handling. 2141 // 2142 // This method is useful when you want to inject custom logic or configuration 2143 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 2144 // 2145 // 2146 // // Example sending a request using the DisableKeyRotationRequest method. 2147 // req, resp := client.DisableKeyRotationRequest(params) 2148 // 2149 // err := req.Send() 2150 // if err == nil { // resp is now filled 2151 // fmt.Println(resp) 2152 // } 2153 // 2154 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKeyRotation 2155 func (c *KMS) DisableKeyRotationRequest(input *DisableKeyRotationInput) (req *request.Request, output *DisableKeyRotationOutput) { 2156 op := &request.Operation{ 2157 Name: opDisableKeyRotation, 2158 HTTPMethod: "POST", 2159 HTTPPath: "/", 2160 } 2161 2162 if input == nil { 2163 input = &DisableKeyRotationInput{} 2164 } 2165 2166 output = &DisableKeyRotationOutput{} 2167 req = c.newRequest(op, input, output) 2168 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 2169 return 2170 } 2171 2172 // DisableKeyRotation API operation for AWS Key Management Service. 2173 // 2174 // Disables automatic rotation of the key material (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) 2175 // for the specified symmetric KMS key. 2176 // 2177 // You cannot enable automatic rotation of asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks), 2178 // KMS keys with imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html), 2179 // or KMS keys in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). 2180 // To enable or disable automatic rotation of a set of related multi-Region 2181 // keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key), 2182 // set the property on the primary key. 2183 // 2184 // The KMS key that you use for this operation must be in a compatible key state. 2185 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 2186 // in the Key Management Service Developer Guide. 2187 // 2188 // Cross-account use: No. You cannot perform this operation on a KMS key in 2189 // a different Amazon Web Services account. 2190 // 2191 // Required permissions: kms:DisableKeyRotation (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 2192 // (key policy) 2193 // 2194 // Related operations: 2195 // 2196 // * EnableKeyRotation 2197 // 2198 // * GetKeyRotationStatus 2199 // 2200 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2201 // with awserr.Error's Code and Message methods to get detailed information about 2202 // the error. 2203 // 2204 // See the AWS API reference guide for AWS Key Management Service's 2205 // API operation DisableKeyRotation for usage and error information. 2206 // 2207 // Returned Error Types: 2208 // * NotFoundException 2209 // The request was rejected because the specified entity or resource could not 2210 // be found. 2211 // 2212 // * DisabledException 2213 // The request was rejected because the specified KMS key is not enabled. 2214 // 2215 // * InvalidArnException 2216 // The request was rejected because a specified ARN, or an ARN in a key policy, 2217 // is not valid. 2218 // 2219 // * DependencyTimeoutException 2220 // The system timed out while trying to fulfill the request. The request can 2221 // be retried. 2222 // 2223 // * InternalException 2224 // The request was rejected because an internal exception occurred. The request 2225 // can be retried. 2226 // 2227 // * InvalidStateException 2228 // The request was rejected because the state of the specified resource is not 2229 // valid for this request. 2230 // 2231 // For more information about how key state affects the use of a KMS key, see 2232 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 2233 // in the Key Management Service Developer Guide . 2234 // 2235 // * UnsupportedOperationException 2236 // The request was rejected because a specified parameter is not supported or 2237 // a specified resource is not valid for this operation. 2238 // 2239 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKeyRotation 2240 func (c *KMS) DisableKeyRotation(input *DisableKeyRotationInput) (*DisableKeyRotationOutput, error) { 2241 req, out := c.DisableKeyRotationRequest(input) 2242 return out, req.Send() 2243 } 2244 2245 // DisableKeyRotationWithContext is the same as DisableKeyRotation with the addition of 2246 // the ability to pass a context and additional request options. 2247 // 2248 // See DisableKeyRotation for details on how to use this API operation. 2249 // 2250 // The context must be non-nil and will be used for request cancellation. If 2251 // the context is nil a panic will occur. In the future the SDK may create 2252 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2253 // for more information on using Contexts. 2254 func (c *KMS) DisableKeyRotationWithContext(ctx aws.Context, input *DisableKeyRotationInput, opts ...request.Option) (*DisableKeyRotationOutput, error) { 2255 req, out := c.DisableKeyRotationRequest(input) 2256 req.SetContext(ctx) 2257 req.ApplyOptions(opts...) 2258 return out, req.Send() 2259 } 2260 2261 const opDisconnectCustomKeyStore = "DisconnectCustomKeyStore" 2262 2263 // DisconnectCustomKeyStoreRequest generates a "aws/request.Request" representing the 2264 // client's request for the DisconnectCustomKeyStore operation. The "output" return 2265 // value will be populated with the request's response once the request completes 2266 // successfully. 2267 // 2268 // Use "Send" method on the returned Request to send the API call to the service. 2269 // the "output" return value is not valid until after Send returns without error. 2270 // 2271 // See DisconnectCustomKeyStore for more information on using the DisconnectCustomKeyStore 2272 // API call, and error handling. 2273 // 2274 // This method is useful when you want to inject custom logic or configuration 2275 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 2276 // 2277 // 2278 // // Example sending a request using the DisconnectCustomKeyStoreRequest method. 2279 // req, resp := client.DisconnectCustomKeyStoreRequest(params) 2280 // 2281 // err := req.Send() 2282 // if err == nil { // resp is now filled 2283 // fmt.Println(resp) 2284 // } 2285 // 2286 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisconnectCustomKeyStore 2287 func (c *KMS) DisconnectCustomKeyStoreRequest(input *DisconnectCustomKeyStoreInput) (req *request.Request, output *DisconnectCustomKeyStoreOutput) { 2288 op := &request.Operation{ 2289 Name: opDisconnectCustomKeyStore, 2290 HTTPMethod: "POST", 2291 HTTPPath: "/", 2292 } 2293 2294 if input == nil { 2295 input = &DisconnectCustomKeyStoreInput{} 2296 } 2297 2298 output = &DisconnectCustomKeyStoreOutput{} 2299 req = c.newRequest(op, input, output) 2300 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 2301 return 2302 } 2303 2304 // DisconnectCustomKeyStore API operation for AWS Key Management Service. 2305 // 2306 // Disconnects the custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) 2307 // from its associated CloudHSM cluster. While a custom key store is disconnected, 2308 // you can manage the custom key store and its KMS keys, but you cannot create 2309 // or use KMS keys in the custom key store. You can reconnect the custom key 2310 // store at any time. 2311 // 2312 // While a custom key store is disconnected, all attempts to create KMS keys 2313 // in the custom key store or to use existing KMS keys in cryptographic operations 2314 // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) 2315 // will fail. This action can prevent users from storing and accessing sensitive 2316 // data. 2317 // 2318 // To find the connection state of a custom key store, use the DescribeCustomKeyStores 2319 // operation. To reconnect a custom key store, use the ConnectCustomKeyStore 2320 // operation. 2321 // 2322 // If the operation succeeds, it returns a JSON object with no properties. 2323 // 2324 // This operation is part of the Custom Key Store feature (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) 2325 // feature in KMS, which combines the convenience and extensive integration 2326 // of KMS with the isolation and control of a single-tenant key store. 2327 // 2328 // Cross-account use: No. You cannot perform this operation on a custom key 2329 // store in a different Amazon Web Services account. 2330 // 2331 // Required permissions: kms:DisconnectCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 2332 // (IAM policy) 2333 // 2334 // Related operations: 2335 // 2336 // * ConnectCustomKeyStore 2337 // 2338 // * CreateCustomKeyStore 2339 // 2340 // * DeleteCustomKeyStore 2341 // 2342 // * DescribeCustomKeyStores 2343 // 2344 // * UpdateCustomKeyStore 2345 // 2346 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2347 // with awserr.Error's Code and Message methods to get detailed information about 2348 // the error. 2349 // 2350 // See the AWS API reference guide for AWS Key Management Service's 2351 // API operation DisconnectCustomKeyStore for usage and error information. 2352 // 2353 // Returned Error Types: 2354 // * CustomKeyStoreInvalidStateException 2355 // The request was rejected because of the ConnectionState of the custom key 2356 // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores 2357 // operation. 2358 // 2359 // This exception is thrown under the following conditions: 2360 // 2361 // * You requested the CreateKey or GenerateRandom operation in a custom 2362 // key store that is not connected. These operations are valid only when 2363 // the custom key store ConnectionState is CONNECTED. 2364 // 2365 // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation 2366 // on a custom key store that is not disconnected. This operation is valid 2367 // only when the custom key store ConnectionState is DISCONNECTED. 2368 // 2369 // * You requested the ConnectCustomKeyStore operation on a custom key store 2370 // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid 2371 // for all other ConnectionState values. 2372 // 2373 // * CustomKeyStoreNotFoundException 2374 // The request was rejected because KMS cannot find a custom key store with 2375 // the specified key store name or ID. 2376 // 2377 // * InternalException 2378 // The request was rejected because an internal exception occurred. The request 2379 // can be retried. 2380 // 2381 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisconnectCustomKeyStore 2382 func (c *KMS) DisconnectCustomKeyStore(input *DisconnectCustomKeyStoreInput) (*DisconnectCustomKeyStoreOutput, error) { 2383 req, out := c.DisconnectCustomKeyStoreRequest(input) 2384 return out, req.Send() 2385 } 2386 2387 // DisconnectCustomKeyStoreWithContext is the same as DisconnectCustomKeyStore with the addition of 2388 // the ability to pass a context and additional request options. 2389 // 2390 // See DisconnectCustomKeyStore for details on how to use this API operation. 2391 // 2392 // The context must be non-nil and will be used for request cancellation. If 2393 // the context is nil a panic will occur. In the future the SDK may create 2394 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2395 // for more information on using Contexts. 2396 func (c *KMS) DisconnectCustomKeyStoreWithContext(ctx aws.Context, input *DisconnectCustomKeyStoreInput, opts ...request.Option) (*DisconnectCustomKeyStoreOutput, error) { 2397 req, out := c.DisconnectCustomKeyStoreRequest(input) 2398 req.SetContext(ctx) 2399 req.ApplyOptions(opts...) 2400 return out, req.Send() 2401 } 2402 2403 const opEnableKey = "EnableKey" 2404 2405 // EnableKeyRequest generates a "aws/request.Request" representing the 2406 // client's request for the EnableKey operation. The "output" return 2407 // value will be populated with the request's response once the request completes 2408 // successfully. 2409 // 2410 // Use "Send" method on the returned Request to send the API call to the service. 2411 // the "output" return value is not valid until after Send returns without error. 2412 // 2413 // See EnableKey for more information on using the EnableKey 2414 // API call, and error handling. 2415 // 2416 // This method is useful when you want to inject custom logic or configuration 2417 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 2418 // 2419 // 2420 // // Example sending a request using the EnableKeyRequest method. 2421 // req, resp := client.EnableKeyRequest(params) 2422 // 2423 // err := req.Send() 2424 // if err == nil { // resp is now filled 2425 // fmt.Println(resp) 2426 // } 2427 // 2428 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKey 2429 func (c *KMS) EnableKeyRequest(input *EnableKeyInput) (req *request.Request, output *EnableKeyOutput) { 2430 op := &request.Operation{ 2431 Name: opEnableKey, 2432 HTTPMethod: "POST", 2433 HTTPPath: "/", 2434 } 2435 2436 if input == nil { 2437 input = &EnableKeyInput{} 2438 } 2439 2440 output = &EnableKeyOutput{} 2441 req = c.newRequest(op, input, output) 2442 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 2443 return 2444 } 2445 2446 // EnableKey API operation for AWS Key Management Service. 2447 // 2448 // Sets the key state of a KMS key to enabled. This allows you to use the KMS 2449 // key for cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations). 2450 // 2451 // The KMS key that you use for this operation must be in a compatible key state. 2452 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 2453 // in the Key Management Service Developer Guide. 2454 // 2455 // Cross-account use: No. You cannot perform this operation on a KMS key in 2456 // a different Amazon Web Services account. 2457 // 2458 // Required permissions: kms:EnableKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 2459 // (key policy) 2460 // 2461 // Related operations: DisableKey 2462 // 2463 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2464 // with awserr.Error's Code and Message methods to get detailed information about 2465 // the error. 2466 // 2467 // See the AWS API reference guide for AWS Key Management Service's 2468 // API operation EnableKey for usage and error information. 2469 // 2470 // Returned Error Types: 2471 // * NotFoundException 2472 // The request was rejected because the specified entity or resource could not 2473 // be found. 2474 // 2475 // * InvalidArnException 2476 // The request was rejected because a specified ARN, or an ARN in a key policy, 2477 // is not valid. 2478 // 2479 // * DependencyTimeoutException 2480 // The system timed out while trying to fulfill the request. The request can 2481 // be retried. 2482 // 2483 // * InternalException 2484 // The request was rejected because an internal exception occurred. The request 2485 // can be retried. 2486 // 2487 // * LimitExceededException 2488 // The request was rejected because a quota was exceeded. For more information, 2489 // see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) 2490 // in the Key Management Service Developer Guide. 2491 // 2492 // * InvalidStateException 2493 // The request was rejected because the state of the specified resource is not 2494 // valid for this request. 2495 // 2496 // For more information about how key state affects the use of a KMS key, see 2497 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 2498 // in the Key Management Service Developer Guide . 2499 // 2500 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKey 2501 func (c *KMS) EnableKey(input *EnableKeyInput) (*EnableKeyOutput, error) { 2502 req, out := c.EnableKeyRequest(input) 2503 return out, req.Send() 2504 } 2505 2506 // EnableKeyWithContext is the same as EnableKey with the addition of 2507 // the ability to pass a context and additional request options. 2508 // 2509 // See EnableKey for details on how to use this API operation. 2510 // 2511 // The context must be non-nil and will be used for request cancellation. If 2512 // the context is nil a panic will occur. In the future the SDK may create 2513 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2514 // for more information on using Contexts. 2515 func (c *KMS) EnableKeyWithContext(ctx aws.Context, input *EnableKeyInput, opts ...request.Option) (*EnableKeyOutput, error) { 2516 req, out := c.EnableKeyRequest(input) 2517 req.SetContext(ctx) 2518 req.ApplyOptions(opts...) 2519 return out, req.Send() 2520 } 2521 2522 const opEnableKeyRotation = "EnableKeyRotation" 2523 2524 // EnableKeyRotationRequest generates a "aws/request.Request" representing the 2525 // client's request for the EnableKeyRotation operation. The "output" return 2526 // value will be populated with the request's response once the request completes 2527 // successfully. 2528 // 2529 // Use "Send" method on the returned Request to send the API call to the service. 2530 // the "output" return value is not valid until after Send returns without error. 2531 // 2532 // See EnableKeyRotation for more information on using the EnableKeyRotation 2533 // API call, and error handling. 2534 // 2535 // This method is useful when you want to inject custom logic or configuration 2536 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 2537 // 2538 // 2539 // // Example sending a request using the EnableKeyRotationRequest method. 2540 // req, resp := client.EnableKeyRotationRequest(params) 2541 // 2542 // err := req.Send() 2543 // if err == nil { // resp is now filled 2544 // fmt.Println(resp) 2545 // } 2546 // 2547 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKeyRotation 2548 func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *request.Request, output *EnableKeyRotationOutput) { 2549 op := &request.Operation{ 2550 Name: opEnableKeyRotation, 2551 HTTPMethod: "POST", 2552 HTTPPath: "/", 2553 } 2554 2555 if input == nil { 2556 input = &EnableKeyRotationInput{} 2557 } 2558 2559 output = &EnableKeyRotationOutput{} 2560 req = c.newRequest(op, input, output) 2561 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 2562 return 2563 } 2564 2565 // EnableKeyRotation API operation for AWS Key Management Service. 2566 // 2567 // Enables automatic rotation of the key material (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) 2568 // for the specified symmetric KMS key. 2569 // 2570 // You cannot enable automatic rotation of asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks), 2571 // KMS keys with imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html), 2572 // or KMS keys in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). 2573 // To enable or disable automatic rotation of a set of related multi-Region 2574 // keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key), 2575 // set the property on the primary key. 2576 // 2577 // The KMS key that you use for this operation must be in a compatible key state. 2578 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 2579 // in the Key Management Service Developer Guide. 2580 // 2581 // Cross-account use: No. You cannot perform this operation on a KMS key in 2582 // a different Amazon Web Services account. 2583 // 2584 // Required permissions: kms:EnableKeyRotation (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 2585 // (key policy) 2586 // 2587 // Related operations: 2588 // 2589 // * DisableKeyRotation 2590 // 2591 // * GetKeyRotationStatus 2592 // 2593 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2594 // with awserr.Error's Code and Message methods to get detailed information about 2595 // the error. 2596 // 2597 // See the AWS API reference guide for AWS Key Management Service's 2598 // API operation EnableKeyRotation for usage and error information. 2599 // 2600 // Returned Error Types: 2601 // * NotFoundException 2602 // The request was rejected because the specified entity or resource could not 2603 // be found. 2604 // 2605 // * DisabledException 2606 // The request was rejected because the specified KMS key is not enabled. 2607 // 2608 // * InvalidArnException 2609 // The request was rejected because a specified ARN, or an ARN in a key policy, 2610 // is not valid. 2611 // 2612 // * DependencyTimeoutException 2613 // The system timed out while trying to fulfill the request. The request can 2614 // be retried. 2615 // 2616 // * InternalException 2617 // The request was rejected because an internal exception occurred. The request 2618 // can be retried. 2619 // 2620 // * InvalidStateException 2621 // The request was rejected because the state of the specified resource is not 2622 // valid for this request. 2623 // 2624 // For more information about how key state affects the use of a KMS key, see 2625 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 2626 // in the Key Management Service Developer Guide . 2627 // 2628 // * UnsupportedOperationException 2629 // The request was rejected because a specified parameter is not supported or 2630 // a specified resource is not valid for this operation. 2631 // 2632 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKeyRotation 2633 func (c *KMS) EnableKeyRotation(input *EnableKeyRotationInput) (*EnableKeyRotationOutput, error) { 2634 req, out := c.EnableKeyRotationRequest(input) 2635 return out, req.Send() 2636 } 2637 2638 // EnableKeyRotationWithContext is the same as EnableKeyRotation with the addition of 2639 // the ability to pass a context and additional request options. 2640 // 2641 // See EnableKeyRotation for details on how to use this API operation. 2642 // 2643 // The context must be non-nil and will be used for request cancellation. If 2644 // the context is nil a panic will occur. In the future the SDK may create 2645 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2646 // for more information on using Contexts. 2647 func (c *KMS) EnableKeyRotationWithContext(ctx aws.Context, input *EnableKeyRotationInput, opts ...request.Option) (*EnableKeyRotationOutput, error) { 2648 req, out := c.EnableKeyRotationRequest(input) 2649 req.SetContext(ctx) 2650 req.ApplyOptions(opts...) 2651 return out, req.Send() 2652 } 2653 2654 const opEncrypt = "Encrypt" 2655 2656 // EncryptRequest generates a "aws/request.Request" representing the 2657 // client's request for the Encrypt operation. The "output" return 2658 // value will be populated with the request's response once the request completes 2659 // successfully. 2660 // 2661 // Use "Send" method on the returned Request to send the API call to the service. 2662 // the "output" return value is not valid until after Send returns without error. 2663 // 2664 // See Encrypt for more information on using the Encrypt 2665 // API call, and error handling. 2666 // 2667 // This method is useful when you want to inject custom logic or configuration 2668 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 2669 // 2670 // 2671 // // Example sending a request using the EncryptRequest method. 2672 // req, resp := client.EncryptRequest(params) 2673 // 2674 // err := req.Send() 2675 // if err == nil { // resp is now filled 2676 // fmt.Println(resp) 2677 // } 2678 // 2679 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Encrypt 2680 func (c *KMS) EncryptRequest(input *EncryptInput) (req *request.Request, output *EncryptOutput) { 2681 op := &request.Operation{ 2682 Name: opEncrypt, 2683 HTTPMethod: "POST", 2684 HTTPPath: "/", 2685 } 2686 2687 if input == nil { 2688 input = &EncryptInput{} 2689 } 2690 2691 output = &EncryptOutput{} 2692 req = c.newRequest(op, input, output) 2693 return 2694 } 2695 2696 // Encrypt API operation for AWS Key Management Service. 2697 // 2698 // Encrypts plaintext into ciphertext by using a KMS key. The Encrypt operation 2699 // has two primary use cases: 2700 // 2701 // * You can encrypt small amounts of arbitrary data, such as a personal 2702 // identifier or database password, or other sensitive information. 2703 // 2704 // * You can use the Encrypt operation to move encrypted data from one Amazon 2705 // Web Services Region to another. For example, in Region A, generate a data 2706 // key and use the plaintext key to encrypt your data. Then, in Region A, 2707 // use the Encrypt operation to encrypt the plaintext data key under a KMS 2708 // key in Region B. Now, you can move the encrypted data and the encrypted 2709 // data key to Region B. When necessary, you can decrypt the encrypted data 2710 // key and the encrypted data entirely within in Region B. 2711 // 2712 // You don't need to use the Encrypt operation to encrypt a data key. The GenerateDataKey 2713 // and GenerateDataKeyPair operations return a plaintext data key and an encrypted 2714 // copy of that data key. 2715 // 2716 // When you encrypt data, you must specify a symmetric or asymmetric KMS key 2717 // to use in the encryption operation. The KMS key must have a KeyUsage value 2718 // of ENCRYPT_DECRYPT. To find the KeyUsage of a KMS key, use the DescribeKey 2719 // operation. 2720 // 2721 // If you use a symmetric KMS key, you can use an encryption context to add 2722 // additional security to your encryption operation. If you specify an EncryptionContext 2723 // when encrypting data, you must specify the same encryption context (a case-sensitive 2724 // exact match) when decrypting the data. Otherwise, the request to decrypt 2725 // fails with an InvalidCiphertextException. For more information, see Encryption 2726 // Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 2727 // in the Key Management Service Developer Guide. 2728 // 2729 // If you specify an asymmetric KMS key, you must also specify the encryption 2730 // algorithm. The algorithm must be compatible with the KMS key type. 2731 // 2732 // When you use an asymmetric KMS key to encrypt or reencrypt data, be sure 2733 // to record the KMS key and encryption algorithm that you choose. You will 2734 // be required to provide the same KMS key and encryption algorithm when you 2735 // decrypt the data. If the KMS key and algorithm do not match the values used 2736 // to encrypt the data, the decrypt operation fails. 2737 // 2738 // You are not required to supply the key ID and encryption algorithm when you 2739 // decrypt with symmetric KMS keys because KMS stores this information in the 2740 // ciphertext blob. KMS cannot store metadata in ciphertext generated with asymmetric 2741 // keys. The standard format for asymmetric key ciphertext does not include 2742 // configurable fields. 2743 // 2744 // The maximum size of the data that you can encrypt varies with the type of 2745 // KMS key and the encryption algorithm that you choose. 2746 // 2747 // * Symmetric KMS keys SYMMETRIC_DEFAULT: 4096 bytes 2748 // 2749 // * RSA_2048 RSAES_OAEP_SHA_1: 214 bytes RSAES_OAEP_SHA_256: 190 bytes 2750 // 2751 // * RSA_3072 RSAES_OAEP_SHA_1: 342 bytes RSAES_OAEP_SHA_256: 318 bytes 2752 // 2753 // * RSA_4096 RSAES_OAEP_SHA_1: 470 bytes RSAES_OAEP_SHA_256: 446 bytes 2754 // 2755 // The KMS key that you use for this operation must be in a compatible key state. 2756 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 2757 // in the Key Management Service Developer Guide. 2758 // 2759 // Cross-account use: Yes. To perform this operation with a KMS key in a different 2760 // Amazon Web Services account, specify the key ARN or alias ARN in the value 2761 // of the KeyId parameter. 2762 // 2763 // Required permissions: kms:Encrypt (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 2764 // (key policy) 2765 // 2766 // Related operations: 2767 // 2768 // * Decrypt 2769 // 2770 // * GenerateDataKey 2771 // 2772 // * GenerateDataKeyPair 2773 // 2774 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2775 // with awserr.Error's Code and Message methods to get detailed information about 2776 // the error. 2777 // 2778 // See the AWS API reference guide for AWS Key Management Service's 2779 // API operation Encrypt for usage and error information. 2780 // 2781 // Returned Error Types: 2782 // * NotFoundException 2783 // The request was rejected because the specified entity or resource could not 2784 // be found. 2785 // 2786 // * DisabledException 2787 // The request was rejected because the specified KMS key is not enabled. 2788 // 2789 // * KeyUnavailableException 2790 // The request was rejected because the specified KMS key was not available. 2791 // You can retry the request. 2792 // 2793 // * DependencyTimeoutException 2794 // The system timed out while trying to fulfill the request. The request can 2795 // be retried. 2796 // 2797 // * InvalidKeyUsageException 2798 // The request was rejected for one of the following reasons: 2799 // 2800 // * The KeyUsage value of the KMS key is incompatible with the API operation. 2801 // 2802 // * The encryption algorithm or signing algorithm specified for the operation 2803 // is incompatible with the type of key material in the KMS key (KeySpec). 2804 // 2805 // For encrypting, decrypting, re-encrypting, and generating data keys, the 2806 // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage 2807 // must be SIGN_VERIFY. To find the KeyUsage of a KMS key, use the DescribeKey 2808 // operation. 2809 // 2810 // To find the encryption or signing algorithms supported for a particular KMS 2811 // key, use the DescribeKey operation. 2812 // 2813 // * InvalidGrantTokenException 2814 // The request was rejected because the specified grant token is not valid. 2815 // 2816 // * InternalException 2817 // The request was rejected because an internal exception occurred. The request 2818 // can be retried. 2819 // 2820 // * InvalidStateException 2821 // The request was rejected because the state of the specified resource is not 2822 // valid for this request. 2823 // 2824 // For more information about how key state affects the use of a KMS key, see 2825 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 2826 // in the Key Management Service Developer Guide . 2827 // 2828 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Encrypt 2829 func (c *KMS) Encrypt(input *EncryptInput) (*EncryptOutput, error) { 2830 req, out := c.EncryptRequest(input) 2831 return out, req.Send() 2832 } 2833 2834 // EncryptWithContext is the same as Encrypt with the addition of 2835 // the ability to pass a context and additional request options. 2836 // 2837 // See Encrypt for details on how to use this API operation. 2838 // 2839 // The context must be non-nil and will be used for request cancellation. If 2840 // the context is nil a panic will occur. In the future the SDK may create 2841 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 2842 // for more information on using Contexts. 2843 func (c *KMS) EncryptWithContext(ctx aws.Context, input *EncryptInput, opts ...request.Option) (*EncryptOutput, error) { 2844 req, out := c.EncryptRequest(input) 2845 req.SetContext(ctx) 2846 req.ApplyOptions(opts...) 2847 return out, req.Send() 2848 } 2849 2850 const opGenerateDataKey = "GenerateDataKey" 2851 2852 // GenerateDataKeyRequest generates a "aws/request.Request" representing the 2853 // client's request for the GenerateDataKey operation. The "output" return 2854 // value will be populated with the request's response once the request completes 2855 // successfully. 2856 // 2857 // Use "Send" method on the returned Request to send the API call to the service. 2858 // the "output" return value is not valid until after Send returns without error. 2859 // 2860 // See GenerateDataKey for more information on using the GenerateDataKey 2861 // API call, and error handling. 2862 // 2863 // This method is useful when you want to inject custom logic or configuration 2864 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 2865 // 2866 // 2867 // // Example sending a request using the GenerateDataKeyRequest method. 2868 // req, resp := client.GenerateDataKeyRequest(params) 2869 // 2870 // err := req.Send() 2871 // if err == nil { // resp is now filled 2872 // fmt.Println(resp) 2873 // } 2874 // 2875 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKey 2876 func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) (req *request.Request, output *GenerateDataKeyOutput) { 2877 op := &request.Operation{ 2878 Name: opGenerateDataKey, 2879 HTTPMethod: "POST", 2880 HTTPPath: "/", 2881 } 2882 2883 if input == nil { 2884 input = &GenerateDataKeyInput{} 2885 } 2886 2887 output = &GenerateDataKeyOutput{} 2888 req = c.newRequest(op, input, output) 2889 return 2890 } 2891 2892 // GenerateDataKey API operation for AWS Key Management Service. 2893 // 2894 // Generates a unique symmetric data key for client-side encryption. This operation 2895 // returns a plaintext copy of the data key and a copy that is encrypted under 2896 // a KMS key that you specify. You can use the plaintext key to encrypt your 2897 // data outside of KMS and store the encrypted data key with the encrypted data. 2898 // 2899 // GenerateDataKey returns a unique data key for each request. The bytes in 2900 // the plaintext key are not related to the caller or the KMS key. 2901 // 2902 // To generate a data key, specify the symmetric KMS key that will be used to 2903 // encrypt the data key. You cannot use an asymmetric KMS key to generate data 2904 // keys. To get the type of your KMS key, use the DescribeKey operation. You 2905 // must also specify the length of the data key. Use either the KeySpec or NumberOfBytes 2906 // parameters (but not both). For 128-bit and 256-bit data keys, use the KeySpec 2907 // parameter. 2908 // 2909 // To get only an encrypted copy of the data key, use GenerateDataKeyWithoutPlaintext. 2910 // To generate an asymmetric data key pair, use the GenerateDataKeyPair or GenerateDataKeyPairWithoutPlaintext 2911 // operation. To get a cryptographically secure random byte string, use GenerateRandom. 2912 // 2913 // You can use the optional encryption context to add additional security to 2914 // the encryption operation. If you specify an EncryptionContext, you must specify 2915 // the same encryption context (a case-sensitive exact match) when decrypting 2916 // the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException. 2917 // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 2918 // in the Key Management Service Developer Guide. 2919 // 2920 // Applications in Amazon Web Services Nitro Enclaves can call this operation 2921 // by using the Amazon Web Services Nitro Enclaves Development Kit (https://github.com/aavshr/aws-nitro-enclaves-sdk-c). 2922 // For information about the supporting parameters, see How Amazon Web Services 2923 // Nitro Enclaves use KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) 2924 // in the Key Management Service Developer Guide. 2925 // 2926 // The KMS key that you use for this operation must be in a compatible key state. 2927 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 2928 // in the Key Management Service Developer Guide. 2929 // 2930 // How to use your data key 2931 // 2932 // We recommend that you use the following pattern to encrypt data locally in 2933 // your application. You can write your own code or use a client-side encryption 2934 // library, such as the Amazon Web Services Encryption SDK (https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/), 2935 // the Amazon DynamoDB Encryption Client (https://docs.aws.amazon.com/dynamodb-encryption-client/latest/devguide/), 2936 // or Amazon S3 client-side encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html) 2937 // to do these tasks for you. 2938 // 2939 // To encrypt data outside of KMS: 2940 // 2941 // Use the GenerateDataKey operation to get a data key. 2942 // 2943 // Use the plaintext data key (in the Plaintext field of the response) to encrypt 2944 // your data outside of KMS. Then erase the plaintext data key from memory. 2945 // 2946 // Store the encrypted data key (in the CiphertextBlob field of the response) 2947 // with the encrypted data. 2948 // 2949 // To decrypt data outside of KMS: 2950 // 2951 // Use the Decrypt operation to decrypt the encrypted data key. The operation 2952 // returns a plaintext copy of the data key. 2953 // 2954 // Use the plaintext data key to decrypt data outside of KMS, then erase the 2955 // plaintext data key from memory. 2956 // 2957 // Cross-account use: Yes. To perform this operation with a KMS key in a different 2958 // Amazon Web Services account, specify the key ARN or alias ARN in the value 2959 // of the KeyId parameter. 2960 // 2961 // Required permissions: kms:GenerateDataKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 2962 // (key policy) 2963 // 2964 // Related operations: 2965 // 2966 // * Decrypt 2967 // 2968 // * Encrypt 2969 // 2970 // * GenerateDataKeyPair 2971 // 2972 // * GenerateDataKeyPairWithoutPlaintext 2973 // 2974 // * GenerateDataKeyWithoutPlaintext 2975 // 2976 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 2977 // with awserr.Error's Code and Message methods to get detailed information about 2978 // the error. 2979 // 2980 // See the AWS API reference guide for AWS Key Management Service's 2981 // API operation GenerateDataKey for usage and error information. 2982 // 2983 // Returned Error Types: 2984 // * NotFoundException 2985 // The request was rejected because the specified entity or resource could not 2986 // be found. 2987 // 2988 // * DisabledException 2989 // The request was rejected because the specified KMS key is not enabled. 2990 // 2991 // * KeyUnavailableException 2992 // The request was rejected because the specified KMS key was not available. 2993 // You can retry the request. 2994 // 2995 // * DependencyTimeoutException 2996 // The system timed out while trying to fulfill the request. The request can 2997 // be retried. 2998 // 2999 // * InvalidKeyUsageException 3000 // The request was rejected for one of the following reasons: 3001 // 3002 // * The KeyUsage value of the KMS key is incompatible with the API operation. 3003 // 3004 // * The encryption algorithm or signing algorithm specified for the operation 3005 // is incompatible with the type of key material in the KMS key (KeySpec). 3006 // 3007 // For encrypting, decrypting, re-encrypting, and generating data keys, the 3008 // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage 3009 // must be SIGN_VERIFY. To find the KeyUsage of a KMS key, use the DescribeKey 3010 // operation. 3011 // 3012 // To find the encryption or signing algorithms supported for a particular KMS 3013 // key, use the DescribeKey operation. 3014 // 3015 // * InvalidGrantTokenException 3016 // The request was rejected because the specified grant token is not valid. 3017 // 3018 // * InternalException 3019 // The request was rejected because an internal exception occurred. The request 3020 // can be retried. 3021 // 3022 // * InvalidStateException 3023 // The request was rejected because the state of the specified resource is not 3024 // valid for this request. 3025 // 3026 // For more information about how key state affects the use of a KMS key, see 3027 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 3028 // in the Key Management Service Developer Guide . 3029 // 3030 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKey 3031 func (c *KMS) GenerateDataKey(input *GenerateDataKeyInput) (*GenerateDataKeyOutput, error) { 3032 req, out := c.GenerateDataKeyRequest(input) 3033 return out, req.Send() 3034 } 3035 3036 // GenerateDataKeyWithContext is the same as GenerateDataKey with the addition of 3037 // the ability to pass a context and additional request options. 3038 // 3039 // See GenerateDataKey for details on how to use this API operation. 3040 // 3041 // The context must be non-nil and will be used for request cancellation. If 3042 // the context is nil a panic will occur. In the future the SDK may create 3043 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 3044 // for more information on using Contexts. 3045 func (c *KMS) GenerateDataKeyWithContext(ctx aws.Context, input *GenerateDataKeyInput, opts ...request.Option) (*GenerateDataKeyOutput, error) { 3046 req, out := c.GenerateDataKeyRequest(input) 3047 req.SetContext(ctx) 3048 req.ApplyOptions(opts...) 3049 return out, req.Send() 3050 } 3051 3052 const opGenerateDataKeyPair = "GenerateDataKeyPair" 3053 3054 // GenerateDataKeyPairRequest generates a "aws/request.Request" representing the 3055 // client's request for the GenerateDataKeyPair operation. The "output" return 3056 // value will be populated with the request's response once the request completes 3057 // successfully. 3058 // 3059 // Use "Send" method on the returned Request to send the API call to the service. 3060 // the "output" return value is not valid until after Send returns without error. 3061 // 3062 // See GenerateDataKeyPair for more information on using the GenerateDataKeyPair 3063 // API call, and error handling. 3064 // 3065 // This method is useful when you want to inject custom logic or configuration 3066 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 3067 // 3068 // 3069 // // Example sending a request using the GenerateDataKeyPairRequest method. 3070 // req, resp := client.GenerateDataKeyPairRequest(params) 3071 // 3072 // err := req.Send() 3073 // if err == nil { // resp is now filled 3074 // fmt.Println(resp) 3075 // } 3076 // 3077 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPair 3078 func (c *KMS) GenerateDataKeyPairRequest(input *GenerateDataKeyPairInput) (req *request.Request, output *GenerateDataKeyPairOutput) { 3079 op := &request.Operation{ 3080 Name: opGenerateDataKeyPair, 3081 HTTPMethod: "POST", 3082 HTTPPath: "/", 3083 } 3084 3085 if input == nil { 3086 input = &GenerateDataKeyPairInput{} 3087 } 3088 3089 output = &GenerateDataKeyPairOutput{} 3090 req = c.newRequest(op, input, output) 3091 return 3092 } 3093 3094 // GenerateDataKeyPair API operation for AWS Key Management Service. 3095 // 3096 // Generates a unique asymmetric data key pair. The GenerateDataKeyPair operation 3097 // returns a plaintext public key, a plaintext private key, and a copy of the 3098 // private key that is encrypted under the symmetric KMS key you specify. You 3099 // can use the data key pair to perform asymmetric cryptography and implement 3100 // digital signatures outside of KMS. 3101 // 3102 // You can use the public key that GenerateDataKeyPair returns to encrypt data 3103 // or verify a signature outside of KMS. Then, store the encrypted private key 3104 // with the data. When you are ready to decrypt data or sign a message, you 3105 // can use the Decrypt operation to decrypt the encrypted private key. 3106 // 3107 // To generate a data key pair, you must specify a symmetric KMS key to encrypt 3108 // the private key in a data key pair. You cannot use an asymmetric KMS key 3109 // or a KMS key in a custom key store. To get the type and origin of your KMS 3110 // key, use the DescribeKey operation. 3111 // 3112 // Use the KeyPairSpec parameter to choose an RSA or Elliptic Curve (ECC) data 3113 // key pair. KMS recommends that your use ECC key pairs for signing, and use 3114 // RSA key pairs for either encryption or signing, but not both. However, KMS 3115 // cannot enforce any restrictions on the use of data key pairs outside of KMS. 3116 // 3117 // If you are using the data key pair to encrypt data, or for any operation 3118 // where you don't immediately need a private key, consider using the GenerateDataKeyPairWithoutPlaintext 3119 // operation. GenerateDataKeyPairWithoutPlaintext returns a plaintext public 3120 // key and an encrypted private key, but omits the plaintext private key that 3121 // you need only to decrypt ciphertext or sign a message. Later, when you need 3122 // to decrypt the data or sign a message, use the Decrypt operation to decrypt 3123 // the encrypted private key in the data key pair. 3124 // 3125 // GenerateDataKeyPair returns a unique data key pair for each request. The 3126 // bytes in the keys are not related to the caller or the KMS key that is used 3127 // to encrypt the private key. The public key is a DER-encoded X.509 SubjectPublicKeyInfo, 3128 // as specified in RFC 5280 (https://tools.ietf.org/html/rfc5280). The private 3129 // key is a DER-encoded PKCS8 PrivateKeyInfo, as specified in RFC 5958 (https://tools.ietf.org/html/rfc5958). 3130 // 3131 // You can use the optional encryption context to add additional security to 3132 // the encryption operation. If you specify an EncryptionContext, you must specify 3133 // the same encryption context (a case-sensitive exact match) when decrypting 3134 // the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException. 3135 // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 3136 // in the Key Management Service Developer Guide. 3137 // 3138 // The KMS key that you use for this operation must be in a compatible key state. 3139 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 3140 // in the Key Management Service Developer Guide. 3141 // 3142 // Cross-account use: Yes. To perform this operation with a KMS key in a different 3143 // Amazon Web Services account, specify the key ARN or alias ARN in the value 3144 // of the KeyId parameter. 3145 // 3146 // Required permissions: kms:GenerateDataKeyPair (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 3147 // (key policy) 3148 // 3149 // Related operations: 3150 // 3151 // * Decrypt 3152 // 3153 // * Encrypt 3154 // 3155 // * GenerateDataKey 3156 // 3157 // * GenerateDataKeyPairWithoutPlaintext 3158 // 3159 // * GenerateDataKeyWithoutPlaintext 3160 // 3161 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 3162 // with awserr.Error's Code and Message methods to get detailed information about 3163 // the error. 3164 // 3165 // See the AWS API reference guide for AWS Key Management Service's 3166 // API operation GenerateDataKeyPair for usage and error information. 3167 // 3168 // Returned Error Types: 3169 // * NotFoundException 3170 // The request was rejected because the specified entity or resource could not 3171 // be found. 3172 // 3173 // * DisabledException 3174 // The request was rejected because the specified KMS key is not enabled. 3175 // 3176 // * KeyUnavailableException 3177 // The request was rejected because the specified KMS key was not available. 3178 // You can retry the request. 3179 // 3180 // * DependencyTimeoutException 3181 // The system timed out while trying to fulfill the request. The request can 3182 // be retried. 3183 // 3184 // * InvalidKeyUsageException 3185 // The request was rejected for one of the following reasons: 3186 // 3187 // * The KeyUsage value of the KMS key is incompatible with the API operation. 3188 // 3189 // * The encryption algorithm or signing algorithm specified for the operation 3190 // is incompatible with the type of key material in the KMS key (KeySpec). 3191 // 3192 // For encrypting, decrypting, re-encrypting, and generating data keys, the 3193 // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage 3194 // must be SIGN_VERIFY. To find the KeyUsage of a KMS key, use the DescribeKey 3195 // operation. 3196 // 3197 // To find the encryption or signing algorithms supported for a particular KMS 3198 // key, use the DescribeKey operation. 3199 // 3200 // * InvalidGrantTokenException 3201 // The request was rejected because the specified grant token is not valid. 3202 // 3203 // * InternalException 3204 // The request was rejected because an internal exception occurred. The request 3205 // can be retried. 3206 // 3207 // * InvalidStateException 3208 // The request was rejected because the state of the specified resource is not 3209 // valid for this request. 3210 // 3211 // For more information about how key state affects the use of a KMS key, see 3212 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 3213 // in the Key Management Service Developer Guide . 3214 // 3215 // * UnsupportedOperationException 3216 // The request was rejected because a specified parameter is not supported or 3217 // a specified resource is not valid for this operation. 3218 // 3219 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPair 3220 func (c *KMS) GenerateDataKeyPair(input *GenerateDataKeyPairInput) (*GenerateDataKeyPairOutput, error) { 3221 req, out := c.GenerateDataKeyPairRequest(input) 3222 return out, req.Send() 3223 } 3224 3225 // GenerateDataKeyPairWithContext is the same as GenerateDataKeyPair with the addition of 3226 // the ability to pass a context and additional request options. 3227 // 3228 // See GenerateDataKeyPair for details on how to use this API operation. 3229 // 3230 // The context must be non-nil and will be used for request cancellation. If 3231 // the context is nil a panic will occur. In the future the SDK may create 3232 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 3233 // for more information on using Contexts. 3234 func (c *KMS) GenerateDataKeyPairWithContext(ctx aws.Context, input *GenerateDataKeyPairInput, opts ...request.Option) (*GenerateDataKeyPairOutput, error) { 3235 req, out := c.GenerateDataKeyPairRequest(input) 3236 req.SetContext(ctx) 3237 req.ApplyOptions(opts...) 3238 return out, req.Send() 3239 } 3240 3241 const opGenerateDataKeyPairWithoutPlaintext = "GenerateDataKeyPairWithoutPlaintext" 3242 3243 // GenerateDataKeyPairWithoutPlaintextRequest generates a "aws/request.Request" representing the 3244 // client's request for the GenerateDataKeyPairWithoutPlaintext operation. The "output" return 3245 // value will be populated with the request's response once the request completes 3246 // successfully. 3247 // 3248 // Use "Send" method on the returned Request to send the API call to the service. 3249 // the "output" return value is not valid until after Send returns without error. 3250 // 3251 // See GenerateDataKeyPairWithoutPlaintext for more information on using the GenerateDataKeyPairWithoutPlaintext 3252 // API call, and error handling. 3253 // 3254 // This method is useful when you want to inject custom logic or configuration 3255 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 3256 // 3257 // 3258 // // Example sending a request using the GenerateDataKeyPairWithoutPlaintextRequest method. 3259 // req, resp := client.GenerateDataKeyPairWithoutPlaintextRequest(params) 3260 // 3261 // err := req.Send() 3262 // if err == nil { // resp is now filled 3263 // fmt.Println(resp) 3264 // } 3265 // 3266 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPairWithoutPlaintext 3267 func (c *KMS) GenerateDataKeyPairWithoutPlaintextRequest(input *GenerateDataKeyPairWithoutPlaintextInput) (req *request.Request, output *GenerateDataKeyPairWithoutPlaintextOutput) { 3268 op := &request.Operation{ 3269 Name: opGenerateDataKeyPairWithoutPlaintext, 3270 HTTPMethod: "POST", 3271 HTTPPath: "/", 3272 } 3273 3274 if input == nil { 3275 input = &GenerateDataKeyPairWithoutPlaintextInput{} 3276 } 3277 3278 output = &GenerateDataKeyPairWithoutPlaintextOutput{} 3279 req = c.newRequest(op, input, output) 3280 return 3281 } 3282 3283 // GenerateDataKeyPairWithoutPlaintext API operation for AWS Key Management Service. 3284 // 3285 // Generates a unique asymmetric data key pair. The GenerateDataKeyPairWithoutPlaintext 3286 // operation returns a plaintext public key and a copy of the private key that 3287 // is encrypted under the symmetric KMS key you specify. Unlike GenerateDataKeyPair, 3288 // this operation does not return a plaintext private key. 3289 // 3290 // You can use the public key that GenerateDataKeyPairWithoutPlaintext returns 3291 // to encrypt data or verify a signature outside of KMS. Then, store the encrypted 3292 // private key with the data. When you are ready to decrypt data or sign a message, 3293 // you can use the Decrypt operation to decrypt the encrypted private key. 3294 // 3295 // To generate a data key pair, you must specify a symmetric KMS key to encrypt 3296 // the private key in a data key pair. You cannot use an asymmetric KMS key 3297 // or a KMS key in a custom key store. To get the type and origin of your KMS 3298 // key, use the DescribeKey operation. 3299 // 3300 // Use the KeyPairSpec parameter to choose an RSA or Elliptic Curve (ECC) data 3301 // key pair. KMS recommends that your use ECC key pairs for signing, and use 3302 // RSA key pairs for either encryption or signing, but not both. However, KMS 3303 // cannot enforce any restrictions on the use of data key pairs outside of KMS. 3304 // 3305 // GenerateDataKeyPairWithoutPlaintext returns a unique data key pair for each 3306 // request. The bytes in the key are not related to the caller or KMS key that 3307 // is used to encrypt the private key. The public key is a DER-encoded X.509 3308 // SubjectPublicKeyInfo, as specified in RFC 5280 (https://tools.ietf.org/html/rfc5280). 3309 // 3310 // You can use the optional encryption context to add additional security to 3311 // the encryption operation. If you specify an EncryptionContext, you must specify 3312 // the same encryption context (a case-sensitive exact match) when decrypting 3313 // the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException. 3314 // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 3315 // in the Key Management Service Developer Guide. 3316 // 3317 // The KMS key that you use for this operation must be in a compatible key state. 3318 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 3319 // in the Key Management Service Developer Guide. 3320 // 3321 // Cross-account use: Yes. To perform this operation with a KMS key in a different 3322 // Amazon Web Services account, specify the key ARN or alias ARN in the value 3323 // of the KeyId parameter. 3324 // 3325 // Required permissions: kms:GenerateDataKeyPairWithoutPlaintext (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 3326 // (key policy) 3327 // 3328 // Related operations: 3329 // 3330 // * Decrypt 3331 // 3332 // * Encrypt 3333 // 3334 // * GenerateDataKey 3335 // 3336 // * GenerateDataKeyPair 3337 // 3338 // * GenerateDataKeyWithoutPlaintext 3339 // 3340 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 3341 // with awserr.Error's Code and Message methods to get detailed information about 3342 // the error. 3343 // 3344 // See the AWS API reference guide for AWS Key Management Service's 3345 // API operation GenerateDataKeyPairWithoutPlaintext for usage and error information. 3346 // 3347 // Returned Error Types: 3348 // * NotFoundException 3349 // The request was rejected because the specified entity or resource could not 3350 // be found. 3351 // 3352 // * DisabledException 3353 // The request was rejected because the specified KMS key is not enabled. 3354 // 3355 // * KeyUnavailableException 3356 // The request was rejected because the specified KMS key was not available. 3357 // You can retry the request. 3358 // 3359 // * DependencyTimeoutException 3360 // The system timed out while trying to fulfill the request. The request can 3361 // be retried. 3362 // 3363 // * InvalidKeyUsageException 3364 // The request was rejected for one of the following reasons: 3365 // 3366 // * The KeyUsage value of the KMS key is incompatible with the API operation. 3367 // 3368 // * The encryption algorithm or signing algorithm specified for the operation 3369 // is incompatible with the type of key material in the KMS key (KeySpec). 3370 // 3371 // For encrypting, decrypting, re-encrypting, and generating data keys, the 3372 // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage 3373 // must be SIGN_VERIFY. To find the KeyUsage of a KMS key, use the DescribeKey 3374 // operation. 3375 // 3376 // To find the encryption or signing algorithms supported for a particular KMS 3377 // key, use the DescribeKey operation. 3378 // 3379 // * InvalidGrantTokenException 3380 // The request was rejected because the specified grant token is not valid. 3381 // 3382 // * InternalException 3383 // The request was rejected because an internal exception occurred. The request 3384 // can be retried. 3385 // 3386 // * InvalidStateException 3387 // The request was rejected because the state of the specified resource is not 3388 // valid for this request. 3389 // 3390 // For more information about how key state affects the use of a KMS key, see 3391 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 3392 // in the Key Management Service Developer Guide . 3393 // 3394 // * UnsupportedOperationException 3395 // The request was rejected because a specified parameter is not supported or 3396 // a specified resource is not valid for this operation. 3397 // 3398 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPairWithoutPlaintext 3399 func (c *KMS) GenerateDataKeyPairWithoutPlaintext(input *GenerateDataKeyPairWithoutPlaintextInput) (*GenerateDataKeyPairWithoutPlaintextOutput, error) { 3400 req, out := c.GenerateDataKeyPairWithoutPlaintextRequest(input) 3401 return out, req.Send() 3402 } 3403 3404 // GenerateDataKeyPairWithoutPlaintextWithContext is the same as GenerateDataKeyPairWithoutPlaintext with the addition of 3405 // the ability to pass a context and additional request options. 3406 // 3407 // See GenerateDataKeyPairWithoutPlaintext for details on how to use this API operation. 3408 // 3409 // The context must be non-nil and will be used for request cancellation. If 3410 // the context is nil a panic will occur. In the future the SDK may create 3411 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 3412 // for more information on using Contexts. 3413 func (c *KMS) GenerateDataKeyPairWithoutPlaintextWithContext(ctx aws.Context, input *GenerateDataKeyPairWithoutPlaintextInput, opts ...request.Option) (*GenerateDataKeyPairWithoutPlaintextOutput, error) { 3414 req, out := c.GenerateDataKeyPairWithoutPlaintextRequest(input) 3415 req.SetContext(ctx) 3416 req.ApplyOptions(opts...) 3417 return out, req.Send() 3418 } 3419 3420 const opGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext" 3421 3422 // GenerateDataKeyWithoutPlaintextRequest generates a "aws/request.Request" representing the 3423 // client's request for the GenerateDataKeyWithoutPlaintext operation. The "output" return 3424 // value will be populated with the request's response once the request completes 3425 // successfully. 3426 // 3427 // Use "Send" method on the returned Request to send the API call to the service. 3428 // the "output" return value is not valid until after Send returns without error. 3429 // 3430 // See GenerateDataKeyWithoutPlaintext for more information on using the GenerateDataKeyWithoutPlaintext 3431 // API call, and error handling. 3432 // 3433 // This method is useful when you want to inject custom logic or configuration 3434 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 3435 // 3436 // 3437 // // Example sending a request using the GenerateDataKeyWithoutPlaintextRequest method. 3438 // req, resp := client.GenerateDataKeyWithoutPlaintextRequest(params) 3439 // 3440 // err := req.Send() 3441 // if err == nil { // resp is now filled 3442 // fmt.Println(resp) 3443 // } 3444 // 3445 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyWithoutPlaintext 3446 func (c *KMS) GenerateDataKeyWithoutPlaintextRequest(input *GenerateDataKeyWithoutPlaintextInput) (req *request.Request, output *GenerateDataKeyWithoutPlaintextOutput) { 3447 op := &request.Operation{ 3448 Name: opGenerateDataKeyWithoutPlaintext, 3449 HTTPMethod: "POST", 3450 HTTPPath: "/", 3451 } 3452 3453 if input == nil { 3454 input = &GenerateDataKeyWithoutPlaintextInput{} 3455 } 3456 3457 output = &GenerateDataKeyWithoutPlaintextOutput{} 3458 req = c.newRequest(op, input, output) 3459 return 3460 } 3461 3462 // GenerateDataKeyWithoutPlaintext API operation for AWS Key Management Service. 3463 // 3464 // Generates a unique symmetric data key. This operation returns a data key 3465 // that is encrypted under a KMS key that you specify. To request an asymmetric 3466 // data key pair, use the GenerateDataKeyPair or GenerateDataKeyPairWithoutPlaintext 3467 // operations. 3468 // 3469 // GenerateDataKeyWithoutPlaintext is identical to the GenerateDataKey operation 3470 // except that returns only the encrypted copy of the data key. This operation 3471 // is useful for systems that need to encrypt data at some point, but not immediately. 3472 // When you need to encrypt the data, you call the Decrypt operation on the 3473 // encrypted copy of the key. 3474 // 3475 // It's also useful in distributed systems with different levels of trust. For 3476 // example, you might store encrypted data in containers. One component of your 3477 // system creates new containers and stores an encrypted data key with each 3478 // container. Then, a different component puts the data into the containers. 3479 // That component first decrypts the data key, uses the plaintext data key to 3480 // encrypt data, puts the encrypted data into the container, and then destroys 3481 // the plaintext data key. In this system, the component that creates the containers 3482 // never sees the plaintext data key. 3483 // 3484 // GenerateDataKeyWithoutPlaintext returns a unique data key for each request. 3485 // The bytes in the keys are not related to the caller or KMS key that is used 3486 // to encrypt the private key. 3487 // 3488 // To generate a data key, you must specify the symmetric KMS key that is used 3489 // to encrypt the data key. You cannot use an asymmetric KMS key to generate 3490 // a data key. To get the type of your KMS key, use the DescribeKey operation. 3491 // 3492 // If the operation succeeds, you will find the encrypted copy of the data key 3493 // in the CiphertextBlob field. 3494 // 3495 // You can use the optional encryption context to add additional security to 3496 // the encryption operation. If you specify an EncryptionContext, you must specify 3497 // the same encryption context (a case-sensitive exact match) when decrypting 3498 // the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException. 3499 // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 3500 // in the Key Management Service Developer Guide. 3501 // 3502 // The KMS key that you use for this operation must be in a compatible key state. 3503 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 3504 // in the Key Management Service Developer Guide. 3505 // 3506 // Cross-account use: Yes. To perform this operation with a KMS key in a different 3507 // Amazon Web Services account, specify the key ARN or alias ARN in the value 3508 // of the KeyId parameter. 3509 // 3510 // Required permissions: kms:GenerateDataKeyWithoutPlaintext (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 3511 // (key policy) 3512 // 3513 // Related operations: 3514 // 3515 // * Decrypt 3516 // 3517 // * Encrypt 3518 // 3519 // * GenerateDataKey 3520 // 3521 // * GenerateDataKeyPair 3522 // 3523 // * GenerateDataKeyPairWithoutPlaintext 3524 // 3525 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 3526 // with awserr.Error's Code and Message methods to get detailed information about 3527 // the error. 3528 // 3529 // See the AWS API reference guide for AWS Key Management Service's 3530 // API operation GenerateDataKeyWithoutPlaintext for usage and error information. 3531 // 3532 // Returned Error Types: 3533 // * NotFoundException 3534 // The request was rejected because the specified entity or resource could not 3535 // be found. 3536 // 3537 // * DisabledException 3538 // The request was rejected because the specified KMS key is not enabled. 3539 // 3540 // * KeyUnavailableException 3541 // The request was rejected because the specified KMS key was not available. 3542 // You can retry the request. 3543 // 3544 // * DependencyTimeoutException 3545 // The system timed out while trying to fulfill the request. The request can 3546 // be retried. 3547 // 3548 // * InvalidKeyUsageException 3549 // The request was rejected for one of the following reasons: 3550 // 3551 // * The KeyUsage value of the KMS key is incompatible with the API operation. 3552 // 3553 // * The encryption algorithm or signing algorithm specified for the operation 3554 // is incompatible with the type of key material in the KMS key (KeySpec). 3555 // 3556 // For encrypting, decrypting, re-encrypting, and generating data keys, the 3557 // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage 3558 // must be SIGN_VERIFY. To find the KeyUsage of a KMS key, use the DescribeKey 3559 // operation. 3560 // 3561 // To find the encryption or signing algorithms supported for a particular KMS 3562 // key, use the DescribeKey operation. 3563 // 3564 // * InvalidGrantTokenException 3565 // The request was rejected because the specified grant token is not valid. 3566 // 3567 // * InternalException 3568 // The request was rejected because an internal exception occurred. The request 3569 // can be retried. 3570 // 3571 // * InvalidStateException 3572 // The request was rejected because the state of the specified resource is not 3573 // valid for this request. 3574 // 3575 // For more information about how key state affects the use of a KMS key, see 3576 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 3577 // in the Key Management Service Developer Guide . 3578 // 3579 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyWithoutPlaintext 3580 func (c *KMS) GenerateDataKeyWithoutPlaintext(input *GenerateDataKeyWithoutPlaintextInput) (*GenerateDataKeyWithoutPlaintextOutput, error) { 3581 req, out := c.GenerateDataKeyWithoutPlaintextRequest(input) 3582 return out, req.Send() 3583 } 3584 3585 // GenerateDataKeyWithoutPlaintextWithContext is the same as GenerateDataKeyWithoutPlaintext with the addition of 3586 // the ability to pass a context and additional request options. 3587 // 3588 // See GenerateDataKeyWithoutPlaintext for details on how to use this API operation. 3589 // 3590 // The context must be non-nil and will be used for request cancellation. If 3591 // the context is nil a panic will occur. In the future the SDK may create 3592 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 3593 // for more information on using Contexts. 3594 func (c *KMS) GenerateDataKeyWithoutPlaintextWithContext(ctx aws.Context, input *GenerateDataKeyWithoutPlaintextInput, opts ...request.Option) (*GenerateDataKeyWithoutPlaintextOutput, error) { 3595 req, out := c.GenerateDataKeyWithoutPlaintextRequest(input) 3596 req.SetContext(ctx) 3597 req.ApplyOptions(opts...) 3598 return out, req.Send() 3599 } 3600 3601 const opGenerateRandom = "GenerateRandom" 3602 3603 // GenerateRandomRequest generates a "aws/request.Request" representing the 3604 // client's request for the GenerateRandom operation. The "output" return 3605 // value will be populated with the request's response once the request completes 3606 // successfully. 3607 // 3608 // Use "Send" method on the returned Request to send the API call to the service. 3609 // the "output" return value is not valid until after Send returns without error. 3610 // 3611 // See GenerateRandom for more information on using the GenerateRandom 3612 // API call, and error handling. 3613 // 3614 // This method is useful when you want to inject custom logic or configuration 3615 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 3616 // 3617 // 3618 // // Example sending a request using the GenerateRandomRequest method. 3619 // req, resp := client.GenerateRandomRequest(params) 3620 // 3621 // err := req.Send() 3622 // if err == nil { // resp is now filled 3623 // fmt.Println(resp) 3624 // } 3625 // 3626 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateRandom 3627 func (c *KMS) GenerateRandomRequest(input *GenerateRandomInput) (req *request.Request, output *GenerateRandomOutput) { 3628 op := &request.Operation{ 3629 Name: opGenerateRandom, 3630 HTTPMethod: "POST", 3631 HTTPPath: "/", 3632 } 3633 3634 if input == nil { 3635 input = &GenerateRandomInput{} 3636 } 3637 3638 output = &GenerateRandomOutput{} 3639 req = c.newRequest(op, input, output) 3640 return 3641 } 3642 3643 // GenerateRandom API operation for AWS Key Management Service. 3644 // 3645 // Returns a random byte string that is cryptographically secure. 3646 // 3647 // By default, the random byte string is generated in KMS. To generate the byte 3648 // string in the CloudHSM cluster that is associated with a custom key store 3649 // (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html), 3650 // specify the custom key store ID. 3651 // 3652 // Applications in Amazon Web Services Nitro Enclaves can call this operation 3653 // by using the Amazon Web Services Nitro Enclaves Development Kit (https://github.com/aavshr/aws-nitro-enclaves-sdk-c). 3654 // For information about the supporting parameters, see How Amazon Web Services 3655 // Nitro Enclaves use KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html) 3656 // in the Key Management Service Developer Guide. 3657 // 3658 // For more information about entropy and random number generation, see Key 3659 // Management Service Cryptographic Details (https://docs.aws.amazon.com/kms/latest/cryptographic-details/). 3660 // 3661 // Required permissions: kms:GenerateRandom (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 3662 // (IAM policy) 3663 // 3664 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 3665 // with awserr.Error's Code and Message methods to get detailed information about 3666 // the error. 3667 // 3668 // See the AWS API reference guide for AWS Key Management Service's 3669 // API operation GenerateRandom for usage and error information. 3670 // 3671 // Returned Error Types: 3672 // * DependencyTimeoutException 3673 // The system timed out while trying to fulfill the request. The request can 3674 // be retried. 3675 // 3676 // * InternalException 3677 // The request was rejected because an internal exception occurred. The request 3678 // can be retried. 3679 // 3680 // * CustomKeyStoreNotFoundException 3681 // The request was rejected because KMS cannot find a custom key store with 3682 // the specified key store name or ID. 3683 // 3684 // * CustomKeyStoreInvalidStateException 3685 // The request was rejected because of the ConnectionState of the custom key 3686 // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores 3687 // operation. 3688 // 3689 // This exception is thrown under the following conditions: 3690 // 3691 // * You requested the CreateKey or GenerateRandom operation in a custom 3692 // key store that is not connected. These operations are valid only when 3693 // the custom key store ConnectionState is CONNECTED. 3694 // 3695 // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation 3696 // on a custom key store that is not disconnected. This operation is valid 3697 // only when the custom key store ConnectionState is DISCONNECTED. 3698 // 3699 // * You requested the ConnectCustomKeyStore operation on a custom key store 3700 // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid 3701 // for all other ConnectionState values. 3702 // 3703 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateRandom 3704 func (c *KMS) GenerateRandom(input *GenerateRandomInput) (*GenerateRandomOutput, error) { 3705 req, out := c.GenerateRandomRequest(input) 3706 return out, req.Send() 3707 } 3708 3709 // GenerateRandomWithContext is the same as GenerateRandom with the addition of 3710 // the ability to pass a context and additional request options. 3711 // 3712 // See GenerateRandom for details on how to use this API operation. 3713 // 3714 // The context must be non-nil and will be used for request cancellation. If 3715 // the context is nil a panic will occur. In the future the SDK may create 3716 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 3717 // for more information on using Contexts. 3718 func (c *KMS) GenerateRandomWithContext(ctx aws.Context, input *GenerateRandomInput, opts ...request.Option) (*GenerateRandomOutput, error) { 3719 req, out := c.GenerateRandomRequest(input) 3720 req.SetContext(ctx) 3721 req.ApplyOptions(opts...) 3722 return out, req.Send() 3723 } 3724 3725 const opGetKeyPolicy = "GetKeyPolicy" 3726 3727 // GetKeyPolicyRequest generates a "aws/request.Request" representing the 3728 // client's request for the GetKeyPolicy operation. The "output" return 3729 // value will be populated with the request's response once the request completes 3730 // successfully. 3731 // 3732 // Use "Send" method on the returned Request to send the API call to the service. 3733 // the "output" return value is not valid until after Send returns without error. 3734 // 3735 // See GetKeyPolicy for more information on using the GetKeyPolicy 3736 // API call, and error handling. 3737 // 3738 // This method is useful when you want to inject custom logic or configuration 3739 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 3740 // 3741 // 3742 // // Example sending a request using the GetKeyPolicyRequest method. 3743 // req, resp := client.GetKeyPolicyRequest(params) 3744 // 3745 // err := req.Send() 3746 // if err == nil { // resp is now filled 3747 // fmt.Println(resp) 3748 // } 3749 // 3750 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyPolicy 3751 func (c *KMS) GetKeyPolicyRequest(input *GetKeyPolicyInput) (req *request.Request, output *GetKeyPolicyOutput) { 3752 op := &request.Operation{ 3753 Name: opGetKeyPolicy, 3754 HTTPMethod: "POST", 3755 HTTPPath: "/", 3756 } 3757 3758 if input == nil { 3759 input = &GetKeyPolicyInput{} 3760 } 3761 3762 output = &GetKeyPolicyOutput{} 3763 req = c.newRequest(op, input, output) 3764 return 3765 } 3766 3767 // GetKeyPolicy API operation for AWS Key Management Service. 3768 // 3769 // Gets a key policy attached to the specified KMS key. 3770 // 3771 // Cross-account use: No. You cannot perform this operation on a KMS key in 3772 // a different Amazon Web Services account. 3773 // 3774 // Required permissions: kms:GetKeyPolicy (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 3775 // (key policy) 3776 // 3777 // Related operations: PutKeyPolicy 3778 // 3779 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 3780 // with awserr.Error's Code and Message methods to get detailed information about 3781 // the error. 3782 // 3783 // See the AWS API reference guide for AWS Key Management Service's 3784 // API operation GetKeyPolicy for usage and error information. 3785 // 3786 // Returned Error Types: 3787 // * NotFoundException 3788 // The request was rejected because the specified entity or resource could not 3789 // be found. 3790 // 3791 // * InvalidArnException 3792 // The request was rejected because a specified ARN, or an ARN in a key policy, 3793 // is not valid. 3794 // 3795 // * DependencyTimeoutException 3796 // The system timed out while trying to fulfill the request. The request can 3797 // be retried. 3798 // 3799 // * InternalException 3800 // The request was rejected because an internal exception occurred. The request 3801 // can be retried. 3802 // 3803 // * InvalidStateException 3804 // The request was rejected because the state of the specified resource is not 3805 // valid for this request. 3806 // 3807 // For more information about how key state affects the use of a KMS key, see 3808 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 3809 // in the Key Management Service Developer Guide . 3810 // 3811 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyPolicy 3812 func (c *KMS) GetKeyPolicy(input *GetKeyPolicyInput) (*GetKeyPolicyOutput, error) { 3813 req, out := c.GetKeyPolicyRequest(input) 3814 return out, req.Send() 3815 } 3816 3817 // GetKeyPolicyWithContext is the same as GetKeyPolicy with the addition of 3818 // the ability to pass a context and additional request options. 3819 // 3820 // See GetKeyPolicy for details on how to use this API operation. 3821 // 3822 // The context must be non-nil and will be used for request cancellation. If 3823 // the context is nil a panic will occur. In the future the SDK may create 3824 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 3825 // for more information on using Contexts. 3826 func (c *KMS) GetKeyPolicyWithContext(ctx aws.Context, input *GetKeyPolicyInput, opts ...request.Option) (*GetKeyPolicyOutput, error) { 3827 req, out := c.GetKeyPolicyRequest(input) 3828 req.SetContext(ctx) 3829 req.ApplyOptions(opts...) 3830 return out, req.Send() 3831 } 3832 3833 const opGetKeyRotationStatus = "GetKeyRotationStatus" 3834 3835 // GetKeyRotationStatusRequest generates a "aws/request.Request" representing the 3836 // client's request for the GetKeyRotationStatus operation. The "output" return 3837 // value will be populated with the request's response once the request completes 3838 // successfully. 3839 // 3840 // Use "Send" method on the returned Request to send the API call to the service. 3841 // the "output" return value is not valid until after Send returns without error. 3842 // 3843 // See GetKeyRotationStatus for more information on using the GetKeyRotationStatus 3844 // API call, and error handling. 3845 // 3846 // This method is useful when you want to inject custom logic or configuration 3847 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 3848 // 3849 // 3850 // // Example sending a request using the GetKeyRotationStatusRequest method. 3851 // req, resp := client.GetKeyRotationStatusRequest(params) 3852 // 3853 // err := req.Send() 3854 // if err == nil { // resp is now filled 3855 // fmt.Println(resp) 3856 // } 3857 // 3858 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyRotationStatus 3859 func (c *KMS) GetKeyRotationStatusRequest(input *GetKeyRotationStatusInput) (req *request.Request, output *GetKeyRotationStatusOutput) { 3860 op := &request.Operation{ 3861 Name: opGetKeyRotationStatus, 3862 HTTPMethod: "POST", 3863 HTTPPath: "/", 3864 } 3865 3866 if input == nil { 3867 input = &GetKeyRotationStatusInput{} 3868 } 3869 3870 output = &GetKeyRotationStatusOutput{} 3871 req = c.newRequest(op, input, output) 3872 return 3873 } 3874 3875 // GetKeyRotationStatus API operation for AWS Key Management Service. 3876 // 3877 // Gets a Boolean value that indicates whether automatic rotation of the key 3878 // material (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) 3879 // is enabled for the specified KMS key. 3880 // 3881 // You cannot enable automatic rotation of asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks), 3882 // KMS keys with imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html), 3883 // or KMS keys in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). 3884 // To enable or disable automatic rotation of a set of related multi-Region 3885 // keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key), 3886 // set the property on the primary key. The key rotation status for these KMS 3887 // keys is always false. 3888 // 3889 // The KMS key that you use for this operation must be in a compatible key state. 3890 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 3891 // in the Key Management Service Developer Guide. 3892 // 3893 // * Disabled: The key rotation status does not change when you disable a 3894 // KMS key. However, while the KMS key is disabled, KMS does not rotate the 3895 // key material. 3896 // 3897 // * Pending deletion: While a KMS key is pending deletion, its key rotation 3898 // status is false and KMS does not rotate the key material. If you cancel 3899 // the deletion, the original key rotation status is restored. 3900 // 3901 // Cross-account use: Yes. To perform this operation on a KMS key in a different 3902 // Amazon Web Services account, specify the key ARN in the value of the KeyId 3903 // parameter. 3904 // 3905 // Required permissions: kms:GetKeyRotationStatus (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 3906 // (key policy) 3907 // 3908 // Related operations: 3909 // 3910 // * DisableKeyRotation 3911 // 3912 // * EnableKeyRotation 3913 // 3914 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 3915 // with awserr.Error's Code and Message methods to get detailed information about 3916 // the error. 3917 // 3918 // See the AWS API reference guide for AWS Key Management Service's 3919 // API operation GetKeyRotationStatus for usage and error information. 3920 // 3921 // Returned Error Types: 3922 // * NotFoundException 3923 // The request was rejected because the specified entity or resource could not 3924 // be found. 3925 // 3926 // * InvalidArnException 3927 // The request was rejected because a specified ARN, or an ARN in a key policy, 3928 // is not valid. 3929 // 3930 // * DependencyTimeoutException 3931 // The system timed out while trying to fulfill the request. The request can 3932 // be retried. 3933 // 3934 // * InternalException 3935 // The request was rejected because an internal exception occurred. The request 3936 // can be retried. 3937 // 3938 // * InvalidStateException 3939 // The request was rejected because the state of the specified resource is not 3940 // valid for this request. 3941 // 3942 // For more information about how key state affects the use of a KMS key, see 3943 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 3944 // in the Key Management Service Developer Guide . 3945 // 3946 // * UnsupportedOperationException 3947 // The request was rejected because a specified parameter is not supported or 3948 // a specified resource is not valid for this operation. 3949 // 3950 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyRotationStatus 3951 func (c *KMS) GetKeyRotationStatus(input *GetKeyRotationStatusInput) (*GetKeyRotationStatusOutput, error) { 3952 req, out := c.GetKeyRotationStatusRequest(input) 3953 return out, req.Send() 3954 } 3955 3956 // GetKeyRotationStatusWithContext is the same as GetKeyRotationStatus with the addition of 3957 // the ability to pass a context and additional request options. 3958 // 3959 // See GetKeyRotationStatus for details on how to use this API operation. 3960 // 3961 // The context must be non-nil and will be used for request cancellation. If 3962 // the context is nil a panic will occur. In the future the SDK may create 3963 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 3964 // for more information on using Contexts. 3965 func (c *KMS) GetKeyRotationStatusWithContext(ctx aws.Context, input *GetKeyRotationStatusInput, opts ...request.Option) (*GetKeyRotationStatusOutput, error) { 3966 req, out := c.GetKeyRotationStatusRequest(input) 3967 req.SetContext(ctx) 3968 req.ApplyOptions(opts...) 3969 return out, req.Send() 3970 } 3971 3972 const opGetParametersForImport = "GetParametersForImport" 3973 3974 // GetParametersForImportRequest generates a "aws/request.Request" representing the 3975 // client's request for the GetParametersForImport operation. The "output" return 3976 // value will be populated with the request's response once the request completes 3977 // successfully. 3978 // 3979 // Use "Send" method on the returned Request to send the API call to the service. 3980 // the "output" return value is not valid until after Send returns without error. 3981 // 3982 // See GetParametersForImport for more information on using the GetParametersForImport 3983 // API call, and error handling. 3984 // 3985 // This method is useful when you want to inject custom logic or configuration 3986 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 3987 // 3988 // 3989 // // Example sending a request using the GetParametersForImportRequest method. 3990 // req, resp := client.GetParametersForImportRequest(params) 3991 // 3992 // err := req.Send() 3993 // if err == nil { // resp is now filled 3994 // fmt.Println(resp) 3995 // } 3996 // 3997 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetParametersForImport 3998 func (c *KMS) GetParametersForImportRequest(input *GetParametersForImportInput) (req *request.Request, output *GetParametersForImportOutput) { 3999 op := &request.Operation{ 4000 Name: opGetParametersForImport, 4001 HTTPMethod: "POST", 4002 HTTPPath: "/", 4003 } 4004 4005 if input == nil { 4006 input = &GetParametersForImportInput{} 4007 } 4008 4009 output = &GetParametersForImportOutput{} 4010 req = c.newRequest(op, input, output) 4011 return 4012 } 4013 4014 // GetParametersForImport API operation for AWS Key Management Service. 4015 // 4016 // Returns the items you need to import key material into a symmetric, customer 4017 // managed KMS key. For more information about importing key material into KMS, 4018 // see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) 4019 // in the Key Management Service Developer Guide. 4020 // 4021 // This operation returns a public key and an import token. Use the public key 4022 // to encrypt the symmetric key material. Store the import token to send with 4023 // a subsequent ImportKeyMaterial request. 4024 // 4025 // You must specify the key ID of the symmetric KMS key into which you will 4026 // import key material. This KMS key's Origin must be EXTERNAL. You must also 4027 // specify the wrapping algorithm and type of wrapping key (public key) that 4028 // you will use to encrypt the key material. You cannot perform this operation 4029 // on an asymmetric KMS key or on any KMS key in a different Amazon Web Services 4030 // account. 4031 // 4032 // To import key material, you must use the public key and import token from 4033 // the same response. These items are valid for 24 hours. The expiration date 4034 // and time appear in the GetParametersForImport response. You cannot use an 4035 // expired token in an ImportKeyMaterial request. If your key and token expire, 4036 // send another GetParametersForImport request. 4037 // 4038 // The KMS key that you use for this operation must be in a compatible key state. 4039 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 4040 // in the Key Management Service Developer Guide. 4041 // 4042 // Cross-account use: No. You cannot perform this operation on a KMS key in 4043 // a different Amazon Web Services account. 4044 // 4045 // Required permissions: kms:GetParametersForImport (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 4046 // (key policy) 4047 // 4048 // Related operations: 4049 // 4050 // * ImportKeyMaterial 4051 // 4052 // * DeleteImportedKeyMaterial 4053 // 4054 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 4055 // with awserr.Error's Code and Message methods to get detailed information about 4056 // the error. 4057 // 4058 // See the AWS API reference guide for AWS Key Management Service's 4059 // API operation GetParametersForImport for usage and error information. 4060 // 4061 // Returned Error Types: 4062 // * InvalidArnException 4063 // The request was rejected because a specified ARN, or an ARN in a key policy, 4064 // is not valid. 4065 // 4066 // * UnsupportedOperationException 4067 // The request was rejected because a specified parameter is not supported or 4068 // a specified resource is not valid for this operation. 4069 // 4070 // * DependencyTimeoutException 4071 // The system timed out while trying to fulfill the request. The request can 4072 // be retried. 4073 // 4074 // * NotFoundException 4075 // The request was rejected because the specified entity or resource could not 4076 // be found. 4077 // 4078 // * InternalException 4079 // The request was rejected because an internal exception occurred. The request 4080 // can be retried. 4081 // 4082 // * InvalidStateException 4083 // The request was rejected because the state of the specified resource is not 4084 // valid for this request. 4085 // 4086 // For more information about how key state affects the use of a KMS key, see 4087 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 4088 // in the Key Management Service Developer Guide . 4089 // 4090 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetParametersForImport 4091 func (c *KMS) GetParametersForImport(input *GetParametersForImportInput) (*GetParametersForImportOutput, error) { 4092 req, out := c.GetParametersForImportRequest(input) 4093 return out, req.Send() 4094 } 4095 4096 // GetParametersForImportWithContext is the same as GetParametersForImport with the addition of 4097 // the ability to pass a context and additional request options. 4098 // 4099 // See GetParametersForImport for details on how to use this API operation. 4100 // 4101 // The context must be non-nil and will be used for request cancellation. If 4102 // the context is nil a panic will occur. In the future the SDK may create 4103 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 4104 // for more information on using Contexts. 4105 func (c *KMS) GetParametersForImportWithContext(ctx aws.Context, input *GetParametersForImportInput, opts ...request.Option) (*GetParametersForImportOutput, error) { 4106 req, out := c.GetParametersForImportRequest(input) 4107 req.SetContext(ctx) 4108 req.ApplyOptions(opts...) 4109 return out, req.Send() 4110 } 4111 4112 const opGetPublicKey = "GetPublicKey" 4113 4114 // GetPublicKeyRequest generates a "aws/request.Request" representing the 4115 // client's request for the GetPublicKey operation. The "output" return 4116 // value will be populated with the request's response once the request completes 4117 // successfully. 4118 // 4119 // Use "Send" method on the returned Request to send the API call to the service. 4120 // the "output" return value is not valid until after Send returns without error. 4121 // 4122 // See GetPublicKey for more information on using the GetPublicKey 4123 // API call, and error handling. 4124 // 4125 // This method is useful when you want to inject custom logic or configuration 4126 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 4127 // 4128 // 4129 // // Example sending a request using the GetPublicKeyRequest method. 4130 // req, resp := client.GetPublicKeyRequest(params) 4131 // 4132 // err := req.Send() 4133 // if err == nil { // resp is now filled 4134 // fmt.Println(resp) 4135 // } 4136 // 4137 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetPublicKey 4138 func (c *KMS) GetPublicKeyRequest(input *GetPublicKeyInput) (req *request.Request, output *GetPublicKeyOutput) { 4139 op := &request.Operation{ 4140 Name: opGetPublicKey, 4141 HTTPMethod: "POST", 4142 HTTPPath: "/", 4143 } 4144 4145 if input == nil { 4146 input = &GetPublicKeyInput{} 4147 } 4148 4149 output = &GetPublicKeyOutput{} 4150 req = c.newRequest(op, input, output) 4151 return 4152 } 4153 4154 // GetPublicKey API operation for AWS Key Management Service. 4155 // 4156 // Returns the public key of an asymmetric KMS key. Unlike the private key of 4157 // a asymmetric KMS key, which never leaves KMS unencrypted, callers with kms:GetPublicKey 4158 // permission can download the public key of an asymmetric KMS key. You can 4159 // share the public key to allow others to encrypt messages and verify signatures 4160 // outside of KMS. For information about symmetric and asymmetric KMS keys, 4161 // see Using Symmetric and Asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) 4162 // in the Key Management Service Developer Guide. 4163 // 4164 // You do not need to download the public key. Instead, you can use the public 4165 // key within KMS by calling the Encrypt, ReEncrypt, or Verify operations with 4166 // the identifier of an asymmetric KMS key. When you use the public key within 4167 // KMS, you benefit from the authentication, authorization, and logging that 4168 // are part of every KMS operation. You also reduce of risk of encrypting data 4169 // that cannot be decrypted. These features are not effective outside of KMS. 4170 // For details, see Special Considerations for Downloading Public Keys (https://docs.aws.amazon.com/kms/latest/developerguide/download-public-key.html#download-public-key-considerations). 4171 // 4172 // To help you use the public key safely outside of KMS, GetPublicKey returns 4173 // important information about the public key in the response, including: 4174 // 4175 // * KeySpec (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-KeySpec): 4176 // The type of key material in the public key, such as RSA_4096 or ECC_NIST_P521. 4177 // 4178 // * KeyUsage (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-KeyUsage): 4179 // Whether the key is used for encryption or signing. 4180 // 4181 // * EncryptionAlgorithms (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-EncryptionAlgorithms) 4182 // or SigningAlgorithms (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-SigningAlgorithms): 4183 // A list of the encryption algorithms or the signing algorithms for the 4184 // key. 4185 // 4186 // Although KMS cannot enforce these restrictions on external operations, it 4187 // is crucial that you use this information to prevent the public key from being 4188 // used improperly. For example, you can prevent a public signing key from being 4189 // used encrypt data, or prevent a public key from being used with an encryption 4190 // algorithm that is not supported by KMS. You can also avoid errors, such as 4191 // using the wrong signing algorithm in a verification operation. 4192 // 4193 // The KMS key that you use for this operation must be in a compatible key state. 4194 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 4195 // in the Key Management Service Developer Guide. 4196 // 4197 // Cross-account use: Yes. To perform this operation with a KMS key in a different 4198 // Amazon Web Services account, specify the key ARN or alias ARN in the value 4199 // of the KeyId parameter. 4200 // 4201 // Required permissions: kms:GetPublicKey (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 4202 // (key policy) 4203 // 4204 // Related operations: CreateKey 4205 // 4206 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 4207 // with awserr.Error's Code and Message methods to get detailed information about 4208 // the error. 4209 // 4210 // See the AWS API reference guide for AWS Key Management Service's 4211 // API operation GetPublicKey for usage and error information. 4212 // 4213 // Returned Error Types: 4214 // * NotFoundException 4215 // The request was rejected because the specified entity or resource could not 4216 // be found. 4217 // 4218 // * DisabledException 4219 // The request was rejected because the specified KMS key is not enabled. 4220 // 4221 // * KeyUnavailableException 4222 // The request was rejected because the specified KMS key was not available. 4223 // You can retry the request. 4224 // 4225 // * DependencyTimeoutException 4226 // The system timed out while trying to fulfill the request. The request can 4227 // be retried. 4228 // 4229 // * UnsupportedOperationException 4230 // The request was rejected because a specified parameter is not supported or 4231 // a specified resource is not valid for this operation. 4232 // 4233 // * InvalidArnException 4234 // The request was rejected because a specified ARN, or an ARN in a key policy, 4235 // is not valid. 4236 // 4237 // * InvalidGrantTokenException 4238 // The request was rejected because the specified grant token is not valid. 4239 // 4240 // * InvalidKeyUsageException 4241 // The request was rejected for one of the following reasons: 4242 // 4243 // * The KeyUsage value of the KMS key is incompatible with the API operation. 4244 // 4245 // * The encryption algorithm or signing algorithm specified for the operation 4246 // is incompatible with the type of key material in the KMS key (KeySpec). 4247 // 4248 // For encrypting, decrypting, re-encrypting, and generating data keys, the 4249 // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage 4250 // must be SIGN_VERIFY. To find the KeyUsage of a KMS key, use the DescribeKey 4251 // operation. 4252 // 4253 // To find the encryption or signing algorithms supported for a particular KMS 4254 // key, use the DescribeKey operation. 4255 // 4256 // * InternalException 4257 // The request was rejected because an internal exception occurred. The request 4258 // can be retried. 4259 // 4260 // * InvalidStateException 4261 // The request was rejected because the state of the specified resource is not 4262 // valid for this request. 4263 // 4264 // For more information about how key state affects the use of a KMS key, see 4265 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 4266 // in the Key Management Service Developer Guide . 4267 // 4268 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetPublicKey 4269 func (c *KMS) GetPublicKey(input *GetPublicKeyInput) (*GetPublicKeyOutput, error) { 4270 req, out := c.GetPublicKeyRequest(input) 4271 return out, req.Send() 4272 } 4273 4274 // GetPublicKeyWithContext is the same as GetPublicKey with the addition of 4275 // the ability to pass a context and additional request options. 4276 // 4277 // See GetPublicKey for details on how to use this API operation. 4278 // 4279 // The context must be non-nil and will be used for request cancellation. If 4280 // the context is nil a panic will occur. In the future the SDK may create 4281 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 4282 // for more information on using Contexts. 4283 func (c *KMS) GetPublicKeyWithContext(ctx aws.Context, input *GetPublicKeyInput, opts ...request.Option) (*GetPublicKeyOutput, error) { 4284 req, out := c.GetPublicKeyRequest(input) 4285 req.SetContext(ctx) 4286 req.ApplyOptions(opts...) 4287 return out, req.Send() 4288 } 4289 4290 const opImportKeyMaterial = "ImportKeyMaterial" 4291 4292 // ImportKeyMaterialRequest generates a "aws/request.Request" representing the 4293 // client's request for the ImportKeyMaterial operation. The "output" return 4294 // value will be populated with the request's response once the request completes 4295 // successfully. 4296 // 4297 // Use "Send" method on the returned Request to send the API call to the service. 4298 // the "output" return value is not valid until after Send returns without error. 4299 // 4300 // See ImportKeyMaterial for more information on using the ImportKeyMaterial 4301 // API call, and error handling. 4302 // 4303 // This method is useful when you want to inject custom logic or configuration 4304 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 4305 // 4306 // 4307 // // Example sending a request using the ImportKeyMaterialRequest method. 4308 // req, resp := client.ImportKeyMaterialRequest(params) 4309 // 4310 // err := req.Send() 4311 // if err == nil { // resp is now filled 4312 // fmt.Println(resp) 4313 // } 4314 // 4315 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ImportKeyMaterial 4316 func (c *KMS) ImportKeyMaterialRequest(input *ImportKeyMaterialInput) (req *request.Request, output *ImportKeyMaterialOutput) { 4317 op := &request.Operation{ 4318 Name: opImportKeyMaterial, 4319 HTTPMethod: "POST", 4320 HTTPPath: "/", 4321 } 4322 4323 if input == nil { 4324 input = &ImportKeyMaterialInput{} 4325 } 4326 4327 output = &ImportKeyMaterialOutput{} 4328 req = c.newRequest(op, input, output) 4329 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 4330 return 4331 } 4332 4333 // ImportKeyMaterial API operation for AWS Key Management Service. 4334 // 4335 // Imports key material into an existing symmetric KMS KMS key that was created 4336 // without key material. After you successfully import key material into a KMS 4337 // key, you can reimport the same key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#reimport-key-material) 4338 // into that KMS key, but you cannot import different key material. 4339 // 4340 // You cannot perform this operation on an asymmetric KMS key or on any KMS 4341 // key in a different Amazon Web Services account. For more information about 4342 // creating KMS keys with no key material and then importing key material, see 4343 // Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) 4344 // in the Key Management Service Developer Guide. 4345 // 4346 // Before using this operation, call GetParametersForImport. Its response includes 4347 // a public key and an import token. Use the public key to encrypt the key material. 4348 // Then, submit the import token from the same GetParametersForImport response. 4349 // 4350 // When calling this operation, you must specify the following values: 4351 // 4352 // * The key ID or key ARN of a KMS key with no key material. Its Origin 4353 // must be EXTERNAL. To create a KMS key with no key material, call CreateKey 4354 // and set the value of its Origin parameter to EXTERNAL. To get the Origin 4355 // of a KMS key, call DescribeKey.) 4356 // 4357 // * The encrypted key material. To get the public key to encrypt the key 4358 // material, call GetParametersForImport. 4359 // 4360 // * The import token that GetParametersForImport returned. You must use 4361 // a public key and token from the same GetParametersForImport response. 4362 // 4363 // * Whether the key material expires and if so, when. If you set an expiration 4364 // date, KMS deletes the key material from the KMS key on the specified date, 4365 // and the KMS key becomes unusable. To use the KMS key again, you must reimport 4366 // the same key material. The only way to change an expiration date is by 4367 // reimporting the same key material and specifying a new expiration date. 4368 // 4369 // When this operation is successful, the key state of the KMS key changes from 4370 // PendingImport to Enabled, and you can use the KMS key. 4371 // 4372 // If this operation fails, use the exception to help determine the problem. 4373 // If the error is related to the key material, the import token, or wrapping 4374 // key, use GetParametersForImport to get a new public key and import token 4375 // for the KMS key and repeat the import procedure. For help, see How To Import 4376 // Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#importing-keys-overview) 4377 // in the Key Management Service Developer Guide. 4378 // 4379 // The KMS key that you use for this operation must be in a compatible key state. 4380 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 4381 // in the Key Management Service Developer Guide. 4382 // 4383 // Cross-account use: No. You cannot perform this operation on a KMS key in 4384 // a different Amazon Web Services account. 4385 // 4386 // Required permissions: kms:ImportKeyMaterial (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 4387 // (key policy) 4388 // 4389 // Related operations: 4390 // 4391 // * DeleteImportedKeyMaterial 4392 // 4393 // * GetParametersForImport 4394 // 4395 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 4396 // with awserr.Error's Code and Message methods to get detailed information about 4397 // the error. 4398 // 4399 // See the AWS API reference guide for AWS Key Management Service's 4400 // API operation ImportKeyMaterial for usage and error information. 4401 // 4402 // Returned Error Types: 4403 // * InvalidArnException 4404 // The request was rejected because a specified ARN, or an ARN in a key policy, 4405 // is not valid. 4406 // 4407 // * UnsupportedOperationException 4408 // The request was rejected because a specified parameter is not supported or 4409 // a specified resource is not valid for this operation. 4410 // 4411 // * DependencyTimeoutException 4412 // The system timed out while trying to fulfill the request. The request can 4413 // be retried. 4414 // 4415 // * NotFoundException 4416 // The request was rejected because the specified entity or resource could not 4417 // be found. 4418 // 4419 // * InternalException 4420 // The request was rejected because an internal exception occurred. The request 4421 // can be retried. 4422 // 4423 // * InvalidStateException 4424 // The request was rejected because the state of the specified resource is not 4425 // valid for this request. 4426 // 4427 // For more information about how key state affects the use of a KMS key, see 4428 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 4429 // in the Key Management Service Developer Guide . 4430 // 4431 // * InvalidCiphertextException 4432 // From the Decrypt or ReEncrypt operation, the request was rejected because 4433 // the specified ciphertext, or additional authenticated data incorporated into 4434 // the ciphertext, such as the encryption context, is corrupted, missing, or 4435 // otherwise invalid. 4436 // 4437 // From the ImportKeyMaterial operation, the request was rejected because KMS 4438 // could not decrypt the encrypted (wrapped) key material. 4439 // 4440 // * IncorrectKeyMaterialException 4441 // The request was rejected because the key material in the request is, expired, 4442 // invalid, or is not the same key material that was previously imported into 4443 // this KMS key. 4444 // 4445 // * ExpiredImportTokenException 4446 // The request was rejected because the specified import token is expired. Use 4447 // GetParametersForImport to get a new import token and public key, use the 4448 // new public key to encrypt the key material, and then try the request again. 4449 // 4450 // * InvalidImportTokenException 4451 // The request was rejected because the provided import token is invalid or 4452 // is associated with a different KMS key. 4453 // 4454 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ImportKeyMaterial 4455 func (c *KMS) ImportKeyMaterial(input *ImportKeyMaterialInput) (*ImportKeyMaterialOutput, error) { 4456 req, out := c.ImportKeyMaterialRequest(input) 4457 return out, req.Send() 4458 } 4459 4460 // ImportKeyMaterialWithContext is the same as ImportKeyMaterial with the addition of 4461 // the ability to pass a context and additional request options. 4462 // 4463 // See ImportKeyMaterial for details on how to use this API operation. 4464 // 4465 // The context must be non-nil and will be used for request cancellation. If 4466 // the context is nil a panic will occur. In the future the SDK may create 4467 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 4468 // for more information on using Contexts. 4469 func (c *KMS) ImportKeyMaterialWithContext(ctx aws.Context, input *ImportKeyMaterialInput, opts ...request.Option) (*ImportKeyMaterialOutput, error) { 4470 req, out := c.ImportKeyMaterialRequest(input) 4471 req.SetContext(ctx) 4472 req.ApplyOptions(opts...) 4473 return out, req.Send() 4474 } 4475 4476 const opListAliases = "ListAliases" 4477 4478 // ListAliasesRequest generates a "aws/request.Request" representing the 4479 // client's request for the ListAliases operation. The "output" return 4480 // value will be populated with the request's response once the request completes 4481 // successfully. 4482 // 4483 // Use "Send" method on the returned Request to send the API call to the service. 4484 // the "output" return value is not valid until after Send returns without error. 4485 // 4486 // See ListAliases for more information on using the ListAliases 4487 // API call, and error handling. 4488 // 4489 // This method is useful when you want to inject custom logic or configuration 4490 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 4491 // 4492 // 4493 // // Example sending a request using the ListAliasesRequest method. 4494 // req, resp := client.ListAliasesRequest(params) 4495 // 4496 // err := req.Send() 4497 // if err == nil { // resp is now filled 4498 // fmt.Println(resp) 4499 // } 4500 // 4501 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListAliases 4502 func (c *KMS) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, output *ListAliasesOutput) { 4503 op := &request.Operation{ 4504 Name: opListAliases, 4505 HTTPMethod: "POST", 4506 HTTPPath: "/", 4507 Paginator: &request.Paginator{ 4508 InputTokens: []string{"Marker"}, 4509 OutputTokens: []string{"NextMarker"}, 4510 LimitToken: "Limit", 4511 TruncationToken: "Truncated", 4512 }, 4513 } 4514 4515 if input == nil { 4516 input = &ListAliasesInput{} 4517 } 4518 4519 output = &ListAliasesOutput{} 4520 req = c.newRequest(op, input, output) 4521 return 4522 } 4523 4524 // ListAliases API operation for AWS Key Management Service. 4525 // 4526 // Gets a list of aliases in the caller's Amazon Web Services account and region. 4527 // For more information about aliases, see CreateAlias. 4528 // 4529 // By default, the ListAliases operation returns all aliases in the account 4530 // and region. To get only the aliases associated with a particular KMS key, 4531 // use the KeyId parameter. 4532 // 4533 // The ListAliases response can include aliases that you created and associated 4534 // with your customer managed keys, and aliases that Amazon Web Services created 4535 // and associated with Amazon Web Services managed keys in your account. You 4536 // can recognize Amazon Web Services aliases because their names have the format 4537 // aws/<service-name>, such as aws/dynamodb. 4538 // 4539 // The response might also include aliases that have no TargetKeyId field. These 4540 // are predefined aliases that Amazon Web Services has created but has not yet 4541 // associated with a KMS key. Aliases that Amazon Web Services creates in your 4542 // account, including predefined aliases, do not count against your KMS aliases 4543 // quota (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html#aliases-limit). 4544 // 4545 // Cross-account use: No. ListAliases does not return aliases in other Amazon 4546 // Web Services accounts. 4547 // 4548 // Required permissions: kms:ListAliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 4549 // (IAM policy) 4550 // 4551 // For details, see Controlling access to aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) 4552 // in the Key Management Service Developer Guide. 4553 // 4554 // Related operations: 4555 // 4556 // * CreateAlias 4557 // 4558 // * DeleteAlias 4559 // 4560 // * UpdateAlias 4561 // 4562 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 4563 // with awserr.Error's Code and Message methods to get detailed information about 4564 // the error. 4565 // 4566 // See the AWS API reference guide for AWS Key Management Service's 4567 // API operation ListAliases for usage and error information. 4568 // 4569 // Returned Error Types: 4570 // * DependencyTimeoutException 4571 // The system timed out while trying to fulfill the request. The request can 4572 // be retried. 4573 // 4574 // * InvalidMarkerException 4575 // The request was rejected because the marker that specifies where pagination 4576 // should next begin is not valid. 4577 // 4578 // * InternalException 4579 // The request was rejected because an internal exception occurred. The request 4580 // can be retried. 4581 // 4582 // * InvalidArnException 4583 // The request was rejected because a specified ARN, or an ARN in a key policy, 4584 // is not valid. 4585 // 4586 // * NotFoundException 4587 // The request was rejected because the specified entity or resource could not 4588 // be found. 4589 // 4590 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListAliases 4591 func (c *KMS) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error) { 4592 req, out := c.ListAliasesRequest(input) 4593 return out, req.Send() 4594 } 4595 4596 // ListAliasesWithContext is the same as ListAliases with the addition of 4597 // the ability to pass a context and additional request options. 4598 // 4599 // See ListAliases for details on how to use this API operation. 4600 // 4601 // The context must be non-nil and will be used for request cancellation. If 4602 // the context is nil a panic will occur. In the future the SDK may create 4603 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 4604 // for more information on using Contexts. 4605 func (c *KMS) ListAliasesWithContext(ctx aws.Context, input *ListAliasesInput, opts ...request.Option) (*ListAliasesOutput, error) { 4606 req, out := c.ListAliasesRequest(input) 4607 req.SetContext(ctx) 4608 req.ApplyOptions(opts...) 4609 return out, req.Send() 4610 } 4611 4612 // ListAliasesPages iterates over the pages of a ListAliases operation, 4613 // calling the "fn" function with the response data for each page. To stop 4614 // iterating, return false from the fn function. 4615 // 4616 // See ListAliases method for more information on how to use this operation. 4617 // 4618 // Note: This operation can generate multiple requests to a service. 4619 // 4620 // // Example iterating over at most 3 pages of a ListAliases operation. 4621 // pageNum := 0 4622 // err := client.ListAliasesPages(params, 4623 // func(page *kms.ListAliasesOutput, lastPage bool) bool { 4624 // pageNum++ 4625 // fmt.Println(page) 4626 // return pageNum <= 3 4627 // }) 4628 // 4629 func (c *KMS) ListAliasesPages(input *ListAliasesInput, fn func(*ListAliasesOutput, bool) bool) error { 4630 return c.ListAliasesPagesWithContext(aws.BackgroundContext(), input, fn) 4631 } 4632 4633 // ListAliasesPagesWithContext same as ListAliasesPages except 4634 // it takes a Context and allows setting request options on the pages. 4635 // 4636 // The context must be non-nil and will be used for request cancellation. If 4637 // the context is nil a panic will occur. In the future the SDK may create 4638 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 4639 // for more information on using Contexts. 4640 func (c *KMS) ListAliasesPagesWithContext(ctx aws.Context, input *ListAliasesInput, fn func(*ListAliasesOutput, bool) bool, opts ...request.Option) error { 4641 p := request.Pagination{ 4642 NewRequest: func() (*request.Request, error) { 4643 var inCpy *ListAliasesInput 4644 if input != nil { 4645 tmp := *input 4646 inCpy = &tmp 4647 } 4648 req, _ := c.ListAliasesRequest(inCpy) 4649 req.SetContext(ctx) 4650 req.ApplyOptions(opts...) 4651 return req, nil 4652 }, 4653 } 4654 4655 for p.Next() { 4656 if !fn(p.Page().(*ListAliasesOutput), !p.HasNextPage()) { 4657 break 4658 } 4659 } 4660 4661 return p.Err() 4662 } 4663 4664 const opListGrants = "ListGrants" 4665 4666 // ListGrantsRequest generates a "aws/request.Request" representing the 4667 // client's request for the ListGrants operation. The "output" return 4668 // value will be populated with the request's response once the request completes 4669 // successfully. 4670 // 4671 // Use "Send" method on the returned Request to send the API call to the service. 4672 // the "output" return value is not valid until after Send returns without error. 4673 // 4674 // See ListGrants for more information on using the ListGrants 4675 // API call, and error handling. 4676 // 4677 // This method is useful when you want to inject custom logic or configuration 4678 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 4679 // 4680 // 4681 // // Example sending a request using the ListGrantsRequest method. 4682 // req, resp := client.ListGrantsRequest(params) 4683 // 4684 // err := req.Send() 4685 // if err == nil { // resp is now filled 4686 // fmt.Println(resp) 4687 // } 4688 // 4689 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListGrants 4690 func (c *KMS) ListGrantsRequest(input *ListGrantsInput) (req *request.Request, output *ListGrantsResponse) { 4691 op := &request.Operation{ 4692 Name: opListGrants, 4693 HTTPMethod: "POST", 4694 HTTPPath: "/", 4695 Paginator: &request.Paginator{ 4696 InputTokens: []string{"Marker"}, 4697 OutputTokens: []string{"NextMarker"}, 4698 LimitToken: "Limit", 4699 TruncationToken: "Truncated", 4700 }, 4701 } 4702 4703 if input == nil { 4704 input = &ListGrantsInput{} 4705 } 4706 4707 output = &ListGrantsResponse{} 4708 req = c.newRequest(op, input, output) 4709 return 4710 } 4711 4712 // ListGrants API operation for AWS Key Management Service. 4713 // 4714 // Gets a list of all grants for the specified KMS key. 4715 // 4716 // You must specify the KMS key in all requests. You can filter the grant list 4717 // by grant ID or grantee principal. 4718 // 4719 // For detailed information about grants, including grant terminology, see Using 4720 // grants (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) 4721 // in the Key Management Service Developer Guide . For examples of working with 4722 // grants in several programming languages, see Programming grants (https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html). 4723 // 4724 // The GranteePrincipal field in the ListGrants response usually contains the 4725 // user or role designated as the grantee principal in the grant. However, when 4726 // the grantee principal in the grant is an Amazon Web Services service, the 4727 // GranteePrincipal field contains the service principal (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services), 4728 // which might represent several different grantee principals. 4729 // 4730 // Cross-account use: Yes. To perform this operation on a KMS key in a different 4731 // Amazon Web Services account, specify the key ARN in the value of the KeyId 4732 // parameter. 4733 // 4734 // Required permissions: kms:ListGrants (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 4735 // (key policy) 4736 // 4737 // Related operations: 4738 // 4739 // * CreateGrant 4740 // 4741 // * ListRetirableGrants 4742 // 4743 // * RetireGrant 4744 // 4745 // * RevokeGrant 4746 // 4747 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 4748 // with awserr.Error's Code and Message methods to get detailed information about 4749 // the error. 4750 // 4751 // See the AWS API reference guide for AWS Key Management Service's 4752 // API operation ListGrants for usage and error information. 4753 // 4754 // Returned Error Types: 4755 // * NotFoundException 4756 // The request was rejected because the specified entity or resource could not 4757 // be found. 4758 // 4759 // * DependencyTimeoutException 4760 // The system timed out while trying to fulfill the request. The request can 4761 // be retried. 4762 // 4763 // * InvalidMarkerException 4764 // The request was rejected because the marker that specifies where pagination 4765 // should next begin is not valid. 4766 // 4767 // * InvalidGrantIdException 4768 // The request was rejected because the specified GrantId is not valid. 4769 // 4770 // * InvalidArnException 4771 // The request was rejected because a specified ARN, or an ARN in a key policy, 4772 // is not valid. 4773 // 4774 // * InternalException 4775 // The request was rejected because an internal exception occurred. The request 4776 // can be retried. 4777 // 4778 // * InvalidStateException 4779 // The request was rejected because the state of the specified resource is not 4780 // valid for this request. 4781 // 4782 // For more information about how key state affects the use of a KMS key, see 4783 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 4784 // in the Key Management Service Developer Guide . 4785 // 4786 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListGrants 4787 func (c *KMS) ListGrants(input *ListGrantsInput) (*ListGrantsResponse, error) { 4788 req, out := c.ListGrantsRequest(input) 4789 return out, req.Send() 4790 } 4791 4792 // ListGrantsWithContext is the same as ListGrants with the addition of 4793 // the ability to pass a context and additional request options. 4794 // 4795 // See ListGrants for details on how to use this API operation. 4796 // 4797 // The context must be non-nil and will be used for request cancellation. If 4798 // the context is nil a panic will occur. In the future the SDK may create 4799 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 4800 // for more information on using Contexts. 4801 func (c *KMS) ListGrantsWithContext(ctx aws.Context, input *ListGrantsInput, opts ...request.Option) (*ListGrantsResponse, error) { 4802 req, out := c.ListGrantsRequest(input) 4803 req.SetContext(ctx) 4804 req.ApplyOptions(opts...) 4805 return out, req.Send() 4806 } 4807 4808 // ListGrantsPages iterates over the pages of a ListGrants operation, 4809 // calling the "fn" function with the response data for each page. To stop 4810 // iterating, return false from the fn function. 4811 // 4812 // See ListGrants method for more information on how to use this operation. 4813 // 4814 // Note: This operation can generate multiple requests to a service. 4815 // 4816 // // Example iterating over at most 3 pages of a ListGrants operation. 4817 // pageNum := 0 4818 // err := client.ListGrantsPages(params, 4819 // func(page *kms.ListGrantsResponse, lastPage bool) bool { 4820 // pageNum++ 4821 // fmt.Println(page) 4822 // return pageNum <= 3 4823 // }) 4824 // 4825 func (c *KMS) ListGrantsPages(input *ListGrantsInput, fn func(*ListGrantsResponse, bool) bool) error { 4826 return c.ListGrantsPagesWithContext(aws.BackgroundContext(), input, fn) 4827 } 4828 4829 // ListGrantsPagesWithContext same as ListGrantsPages except 4830 // it takes a Context and allows setting request options on the pages. 4831 // 4832 // The context must be non-nil and will be used for request cancellation. If 4833 // the context is nil a panic will occur. In the future the SDK may create 4834 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 4835 // for more information on using Contexts. 4836 func (c *KMS) ListGrantsPagesWithContext(ctx aws.Context, input *ListGrantsInput, fn func(*ListGrantsResponse, bool) bool, opts ...request.Option) error { 4837 p := request.Pagination{ 4838 NewRequest: func() (*request.Request, error) { 4839 var inCpy *ListGrantsInput 4840 if input != nil { 4841 tmp := *input 4842 inCpy = &tmp 4843 } 4844 req, _ := c.ListGrantsRequest(inCpy) 4845 req.SetContext(ctx) 4846 req.ApplyOptions(opts...) 4847 return req, nil 4848 }, 4849 } 4850 4851 for p.Next() { 4852 if !fn(p.Page().(*ListGrantsResponse), !p.HasNextPage()) { 4853 break 4854 } 4855 } 4856 4857 return p.Err() 4858 } 4859 4860 const opListKeyPolicies = "ListKeyPolicies" 4861 4862 // ListKeyPoliciesRequest generates a "aws/request.Request" representing the 4863 // client's request for the ListKeyPolicies operation. The "output" return 4864 // value will be populated with the request's response once the request completes 4865 // successfully. 4866 // 4867 // Use "Send" method on the returned Request to send the API call to the service. 4868 // the "output" return value is not valid until after Send returns without error. 4869 // 4870 // See ListKeyPolicies for more information on using the ListKeyPolicies 4871 // API call, and error handling. 4872 // 4873 // This method is useful when you want to inject custom logic or configuration 4874 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 4875 // 4876 // 4877 // // Example sending a request using the ListKeyPoliciesRequest method. 4878 // req, resp := client.ListKeyPoliciesRequest(params) 4879 // 4880 // err := req.Send() 4881 // if err == nil { // resp is now filled 4882 // fmt.Println(resp) 4883 // } 4884 // 4885 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeyPolicies 4886 func (c *KMS) ListKeyPoliciesRequest(input *ListKeyPoliciesInput) (req *request.Request, output *ListKeyPoliciesOutput) { 4887 op := &request.Operation{ 4888 Name: opListKeyPolicies, 4889 HTTPMethod: "POST", 4890 HTTPPath: "/", 4891 Paginator: &request.Paginator{ 4892 InputTokens: []string{"Marker"}, 4893 OutputTokens: []string{"NextMarker"}, 4894 LimitToken: "Limit", 4895 TruncationToken: "Truncated", 4896 }, 4897 } 4898 4899 if input == nil { 4900 input = &ListKeyPoliciesInput{} 4901 } 4902 4903 output = &ListKeyPoliciesOutput{} 4904 req = c.newRequest(op, input, output) 4905 return 4906 } 4907 4908 // ListKeyPolicies API operation for AWS Key Management Service. 4909 // 4910 // Gets the names of the key policies that are attached to a KMS key. This operation 4911 // is designed to get policy names that you can use in a GetKeyPolicy operation. 4912 // However, the only valid policy name is default. 4913 // 4914 // Cross-account use: No. You cannot perform this operation on a KMS key in 4915 // a different Amazon Web Services account. 4916 // 4917 // Required permissions: kms:ListKeyPolicies (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 4918 // (key policy) 4919 // 4920 // Related operations: 4921 // 4922 // * GetKeyPolicy 4923 // 4924 // * PutKeyPolicy 4925 // 4926 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 4927 // with awserr.Error's Code and Message methods to get detailed information about 4928 // the error. 4929 // 4930 // See the AWS API reference guide for AWS Key Management Service's 4931 // API operation ListKeyPolicies for usage and error information. 4932 // 4933 // Returned Error Types: 4934 // * NotFoundException 4935 // The request was rejected because the specified entity or resource could not 4936 // be found. 4937 // 4938 // * InvalidArnException 4939 // The request was rejected because a specified ARN, or an ARN in a key policy, 4940 // is not valid. 4941 // 4942 // * DependencyTimeoutException 4943 // The system timed out while trying to fulfill the request. The request can 4944 // be retried. 4945 // 4946 // * InternalException 4947 // The request was rejected because an internal exception occurred. The request 4948 // can be retried. 4949 // 4950 // * InvalidStateException 4951 // The request was rejected because the state of the specified resource is not 4952 // valid for this request. 4953 // 4954 // For more information about how key state affects the use of a KMS key, see 4955 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 4956 // in the Key Management Service Developer Guide . 4957 // 4958 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeyPolicies 4959 func (c *KMS) ListKeyPolicies(input *ListKeyPoliciesInput) (*ListKeyPoliciesOutput, error) { 4960 req, out := c.ListKeyPoliciesRequest(input) 4961 return out, req.Send() 4962 } 4963 4964 // ListKeyPoliciesWithContext is the same as ListKeyPolicies with the addition of 4965 // the ability to pass a context and additional request options. 4966 // 4967 // See ListKeyPolicies for details on how to use this API operation. 4968 // 4969 // The context must be non-nil and will be used for request cancellation. If 4970 // the context is nil a panic will occur. In the future the SDK may create 4971 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 4972 // for more information on using Contexts. 4973 func (c *KMS) ListKeyPoliciesWithContext(ctx aws.Context, input *ListKeyPoliciesInput, opts ...request.Option) (*ListKeyPoliciesOutput, error) { 4974 req, out := c.ListKeyPoliciesRequest(input) 4975 req.SetContext(ctx) 4976 req.ApplyOptions(opts...) 4977 return out, req.Send() 4978 } 4979 4980 // ListKeyPoliciesPages iterates over the pages of a ListKeyPolicies operation, 4981 // calling the "fn" function with the response data for each page. To stop 4982 // iterating, return false from the fn function. 4983 // 4984 // See ListKeyPolicies method for more information on how to use this operation. 4985 // 4986 // Note: This operation can generate multiple requests to a service. 4987 // 4988 // // Example iterating over at most 3 pages of a ListKeyPolicies operation. 4989 // pageNum := 0 4990 // err := client.ListKeyPoliciesPages(params, 4991 // func(page *kms.ListKeyPoliciesOutput, lastPage bool) bool { 4992 // pageNum++ 4993 // fmt.Println(page) 4994 // return pageNum <= 3 4995 // }) 4996 // 4997 func (c *KMS) ListKeyPoliciesPages(input *ListKeyPoliciesInput, fn func(*ListKeyPoliciesOutput, bool) bool) error { 4998 return c.ListKeyPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) 4999 } 5000 5001 // ListKeyPoliciesPagesWithContext same as ListKeyPoliciesPages except 5002 // it takes a Context and allows setting request options on the pages. 5003 // 5004 // The context must be non-nil and will be used for request cancellation. If 5005 // the context is nil a panic will occur. In the future the SDK may create 5006 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 5007 // for more information on using Contexts. 5008 func (c *KMS) ListKeyPoliciesPagesWithContext(ctx aws.Context, input *ListKeyPoliciesInput, fn func(*ListKeyPoliciesOutput, bool) bool, opts ...request.Option) error { 5009 p := request.Pagination{ 5010 NewRequest: func() (*request.Request, error) { 5011 var inCpy *ListKeyPoliciesInput 5012 if input != nil { 5013 tmp := *input 5014 inCpy = &tmp 5015 } 5016 req, _ := c.ListKeyPoliciesRequest(inCpy) 5017 req.SetContext(ctx) 5018 req.ApplyOptions(opts...) 5019 return req, nil 5020 }, 5021 } 5022 5023 for p.Next() { 5024 if !fn(p.Page().(*ListKeyPoliciesOutput), !p.HasNextPage()) { 5025 break 5026 } 5027 } 5028 5029 return p.Err() 5030 } 5031 5032 const opListKeys = "ListKeys" 5033 5034 // ListKeysRequest generates a "aws/request.Request" representing the 5035 // client's request for the ListKeys operation. The "output" return 5036 // value will be populated with the request's response once the request completes 5037 // successfully. 5038 // 5039 // Use "Send" method on the returned Request to send the API call to the service. 5040 // the "output" return value is not valid until after Send returns without error. 5041 // 5042 // See ListKeys for more information on using the ListKeys 5043 // API call, and error handling. 5044 // 5045 // This method is useful when you want to inject custom logic or configuration 5046 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 5047 // 5048 // 5049 // // Example sending a request using the ListKeysRequest method. 5050 // req, resp := client.ListKeysRequest(params) 5051 // 5052 // err := req.Send() 5053 // if err == nil { // resp is now filled 5054 // fmt.Println(resp) 5055 // } 5056 // 5057 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeys 5058 func (c *KMS) ListKeysRequest(input *ListKeysInput) (req *request.Request, output *ListKeysOutput) { 5059 op := &request.Operation{ 5060 Name: opListKeys, 5061 HTTPMethod: "POST", 5062 HTTPPath: "/", 5063 Paginator: &request.Paginator{ 5064 InputTokens: []string{"Marker"}, 5065 OutputTokens: []string{"NextMarker"}, 5066 LimitToken: "Limit", 5067 TruncationToken: "Truncated", 5068 }, 5069 } 5070 5071 if input == nil { 5072 input = &ListKeysInput{} 5073 } 5074 5075 output = &ListKeysOutput{} 5076 req = c.newRequest(op, input, output) 5077 return 5078 } 5079 5080 // ListKeys API operation for AWS Key Management Service. 5081 // 5082 // Gets a list of all KMS keys in the caller's Amazon Web Services account and 5083 // Region. 5084 // 5085 // Cross-account use: No. You cannot perform this operation on a KMS key in 5086 // a different Amazon Web Services account. 5087 // 5088 // Required permissions: kms:ListKeys (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 5089 // (IAM policy) 5090 // 5091 // Related operations: 5092 // 5093 // * CreateKey 5094 // 5095 // * DescribeKey 5096 // 5097 // * ListAliases 5098 // 5099 // * ListResourceTags 5100 // 5101 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 5102 // with awserr.Error's Code and Message methods to get detailed information about 5103 // the error. 5104 // 5105 // See the AWS API reference guide for AWS Key Management Service's 5106 // API operation ListKeys for usage and error information. 5107 // 5108 // Returned Error Types: 5109 // * DependencyTimeoutException 5110 // The system timed out while trying to fulfill the request. The request can 5111 // be retried. 5112 // 5113 // * InternalException 5114 // The request was rejected because an internal exception occurred. The request 5115 // can be retried. 5116 // 5117 // * InvalidMarkerException 5118 // The request was rejected because the marker that specifies where pagination 5119 // should next begin is not valid. 5120 // 5121 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeys 5122 func (c *KMS) ListKeys(input *ListKeysInput) (*ListKeysOutput, error) { 5123 req, out := c.ListKeysRequest(input) 5124 return out, req.Send() 5125 } 5126 5127 // ListKeysWithContext is the same as ListKeys with the addition of 5128 // the ability to pass a context and additional request options. 5129 // 5130 // See ListKeys for details on how to use this API operation. 5131 // 5132 // The context must be non-nil and will be used for request cancellation. If 5133 // the context is nil a panic will occur. In the future the SDK may create 5134 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 5135 // for more information on using Contexts. 5136 func (c *KMS) ListKeysWithContext(ctx aws.Context, input *ListKeysInput, opts ...request.Option) (*ListKeysOutput, error) { 5137 req, out := c.ListKeysRequest(input) 5138 req.SetContext(ctx) 5139 req.ApplyOptions(opts...) 5140 return out, req.Send() 5141 } 5142 5143 // ListKeysPages iterates over the pages of a ListKeys operation, 5144 // calling the "fn" function with the response data for each page. To stop 5145 // iterating, return false from the fn function. 5146 // 5147 // See ListKeys method for more information on how to use this operation. 5148 // 5149 // Note: This operation can generate multiple requests to a service. 5150 // 5151 // // Example iterating over at most 3 pages of a ListKeys operation. 5152 // pageNum := 0 5153 // err := client.ListKeysPages(params, 5154 // func(page *kms.ListKeysOutput, lastPage bool) bool { 5155 // pageNum++ 5156 // fmt.Println(page) 5157 // return pageNum <= 3 5158 // }) 5159 // 5160 func (c *KMS) ListKeysPages(input *ListKeysInput, fn func(*ListKeysOutput, bool) bool) error { 5161 return c.ListKeysPagesWithContext(aws.BackgroundContext(), input, fn) 5162 } 5163 5164 // ListKeysPagesWithContext same as ListKeysPages except 5165 // it takes a Context and allows setting request options on the pages. 5166 // 5167 // The context must be non-nil and will be used for request cancellation. If 5168 // the context is nil a panic will occur. In the future the SDK may create 5169 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 5170 // for more information on using Contexts. 5171 func (c *KMS) ListKeysPagesWithContext(ctx aws.Context, input *ListKeysInput, fn func(*ListKeysOutput, bool) bool, opts ...request.Option) error { 5172 p := request.Pagination{ 5173 NewRequest: func() (*request.Request, error) { 5174 var inCpy *ListKeysInput 5175 if input != nil { 5176 tmp := *input 5177 inCpy = &tmp 5178 } 5179 req, _ := c.ListKeysRequest(inCpy) 5180 req.SetContext(ctx) 5181 req.ApplyOptions(opts...) 5182 return req, nil 5183 }, 5184 } 5185 5186 for p.Next() { 5187 if !fn(p.Page().(*ListKeysOutput), !p.HasNextPage()) { 5188 break 5189 } 5190 } 5191 5192 return p.Err() 5193 } 5194 5195 const opListResourceTags = "ListResourceTags" 5196 5197 // ListResourceTagsRequest generates a "aws/request.Request" representing the 5198 // client's request for the ListResourceTags operation. The "output" return 5199 // value will be populated with the request's response once the request completes 5200 // successfully. 5201 // 5202 // Use "Send" method on the returned Request to send the API call to the service. 5203 // the "output" return value is not valid until after Send returns without error. 5204 // 5205 // See ListResourceTags for more information on using the ListResourceTags 5206 // API call, and error handling. 5207 // 5208 // This method is useful when you want to inject custom logic or configuration 5209 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 5210 // 5211 // 5212 // // Example sending a request using the ListResourceTagsRequest method. 5213 // req, resp := client.ListResourceTagsRequest(params) 5214 // 5215 // err := req.Send() 5216 // if err == nil { // resp is now filled 5217 // fmt.Println(resp) 5218 // } 5219 // 5220 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListResourceTags 5221 func (c *KMS) ListResourceTagsRequest(input *ListResourceTagsInput) (req *request.Request, output *ListResourceTagsOutput) { 5222 op := &request.Operation{ 5223 Name: opListResourceTags, 5224 HTTPMethod: "POST", 5225 HTTPPath: "/", 5226 } 5227 5228 if input == nil { 5229 input = &ListResourceTagsInput{} 5230 } 5231 5232 output = &ListResourceTagsOutput{} 5233 req = c.newRequest(op, input, output) 5234 return 5235 } 5236 5237 // ListResourceTags API operation for AWS Key Management Service. 5238 // 5239 // Returns all tags on the specified KMS key. 5240 // 5241 // For general information about tags, including the format and syntax, see 5242 // Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) 5243 // in the Amazon Web Services General Reference. For information about using 5244 // tags in KMS, see Tagging keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html). 5245 // 5246 // Cross-account use: No. You cannot perform this operation on a KMS key in 5247 // a different Amazon Web Services account. 5248 // 5249 // Required permissions: kms:ListResourceTags (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 5250 // (key policy) 5251 // 5252 // Related operations: 5253 // 5254 // * CreateKey 5255 // 5256 // * ReplicateKey 5257 // 5258 // * TagResource 5259 // 5260 // * UntagResource 5261 // 5262 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 5263 // with awserr.Error's Code and Message methods to get detailed information about 5264 // the error. 5265 // 5266 // See the AWS API reference guide for AWS Key Management Service's 5267 // API operation ListResourceTags for usage and error information. 5268 // 5269 // Returned Error Types: 5270 // * InternalException 5271 // The request was rejected because an internal exception occurred. The request 5272 // can be retried. 5273 // 5274 // * NotFoundException 5275 // The request was rejected because the specified entity or resource could not 5276 // be found. 5277 // 5278 // * InvalidArnException 5279 // The request was rejected because a specified ARN, or an ARN in a key policy, 5280 // is not valid. 5281 // 5282 // * InvalidMarkerException 5283 // The request was rejected because the marker that specifies where pagination 5284 // should next begin is not valid. 5285 // 5286 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListResourceTags 5287 func (c *KMS) ListResourceTags(input *ListResourceTagsInput) (*ListResourceTagsOutput, error) { 5288 req, out := c.ListResourceTagsRequest(input) 5289 return out, req.Send() 5290 } 5291 5292 // ListResourceTagsWithContext is the same as ListResourceTags with the addition of 5293 // the ability to pass a context and additional request options. 5294 // 5295 // See ListResourceTags for details on how to use this API operation. 5296 // 5297 // The context must be non-nil and will be used for request cancellation. If 5298 // the context is nil a panic will occur. In the future the SDK may create 5299 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 5300 // for more information on using Contexts. 5301 func (c *KMS) ListResourceTagsWithContext(ctx aws.Context, input *ListResourceTagsInput, opts ...request.Option) (*ListResourceTagsOutput, error) { 5302 req, out := c.ListResourceTagsRequest(input) 5303 req.SetContext(ctx) 5304 req.ApplyOptions(opts...) 5305 return out, req.Send() 5306 } 5307 5308 const opListRetirableGrants = "ListRetirableGrants" 5309 5310 // ListRetirableGrantsRequest generates a "aws/request.Request" representing the 5311 // client's request for the ListRetirableGrants operation. The "output" return 5312 // value will be populated with the request's response once the request completes 5313 // successfully. 5314 // 5315 // Use "Send" method on the returned Request to send the API call to the service. 5316 // the "output" return value is not valid until after Send returns without error. 5317 // 5318 // See ListRetirableGrants for more information on using the ListRetirableGrants 5319 // API call, and error handling. 5320 // 5321 // This method is useful when you want to inject custom logic or configuration 5322 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 5323 // 5324 // 5325 // // Example sending a request using the ListRetirableGrantsRequest method. 5326 // req, resp := client.ListRetirableGrantsRequest(params) 5327 // 5328 // err := req.Send() 5329 // if err == nil { // resp is now filled 5330 // fmt.Println(resp) 5331 // } 5332 // 5333 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListRetirableGrants 5334 func (c *KMS) ListRetirableGrantsRequest(input *ListRetirableGrantsInput) (req *request.Request, output *ListGrantsResponse) { 5335 op := &request.Operation{ 5336 Name: opListRetirableGrants, 5337 HTTPMethod: "POST", 5338 HTTPPath: "/", 5339 } 5340 5341 if input == nil { 5342 input = &ListRetirableGrantsInput{} 5343 } 5344 5345 output = &ListGrantsResponse{} 5346 req = c.newRequest(op, input, output) 5347 return 5348 } 5349 5350 // ListRetirableGrants API operation for AWS Key Management Service. 5351 // 5352 // Returns information about all grants in the Amazon Web Services account and 5353 // Region that have the specified retiring principal. 5354 // 5355 // You can specify any principal in your Amazon Web Services account. The grants 5356 // that are returned include grants for KMS keys in your Amazon Web Services 5357 // account and other Amazon Web Services accounts. You might use this operation 5358 // to determine which grants you may retire. To retire a grant, use the RetireGrant 5359 // operation. 5360 // 5361 // For detailed information about grants, including grant terminology, see Using 5362 // grants (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) 5363 // in the Key Management Service Developer Guide . For examples of working with 5364 // grants in several programming languages, see Programming grants (https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html). 5365 // 5366 // Cross-account use: You must specify a principal in your Amazon Web Services 5367 // account. However, this operation can return grants in any Amazon Web Services 5368 // account. You do not need kms:ListRetirableGrants permission (or any other 5369 // additional permission) in any Amazon Web Services account other than your 5370 // own. 5371 // 5372 // Required permissions: kms:ListRetirableGrants (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 5373 // (IAM policy) in your Amazon Web Services account. 5374 // 5375 // Related operations: 5376 // 5377 // * CreateGrant 5378 // 5379 // * ListGrants 5380 // 5381 // * RetireGrant 5382 // 5383 // * RevokeGrant 5384 // 5385 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 5386 // with awserr.Error's Code and Message methods to get detailed information about 5387 // the error. 5388 // 5389 // See the AWS API reference guide for AWS Key Management Service's 5390 // API operation ListRetirableGrants for usage and error information. 5391 // 5392 // Returned Error Types: 5393 // * DependencyTimeoutException 5394 // The system timed out while trying to fulfill the request. The request can 5395 // be retried. 5396 // 5397 // * InvalidMarkerException 5398 // The request was rejected because the marker that specifies where pagination 5399 // should next begin is not valid. 5400 // 5401 // * InvalidArnException 5402 // The request was rejected because a specified ARN, or an ARN in a key policy, 5403 // is not valid. 5404 // 5405 // * NotFoundException 5406 // The request was rejected because the specified entity or resource could not 5407 // be found. 5408 // 5409 // * InternalException 5410 // The request was rejected because an internal exception occurred. The request 5411 // can be retried. 5412 // 5413 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListRetirableGrants 5414 func (c *KMS) ListRetirableGrants(input *ListRetirableGrantsInput) (*ListGrantsResponse, error) { 5415 req, out := c.ListRetirableGrantsRequest(input) 5416 return out, req.Send() 5417 } 5418 5419 // ListRetirableGrantsWithContext is the same as ListRetirableGrants with the addition of 5420 // the ability to pass a context and additional request options. 5421 // 5422 // See ListRetirableGrants for details on how to use this API operation. 5423 // 5424 // The context must be non-nil and will be used for request cancellation. If 5425 // the context is nil a panic will occur. In the future the SDK may create 5426 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 5427 // for more information on using Contexts. 5428 func (c *KMS) ListRetirableGrantsWithContext(ctx aws.Context, input *ListRetirableGrantsInput, opts ...request.Option) (*ListGrantsResponse, error) { 5429 req, out := c.ListRetirableGrantsRequest(input) 5430 req.SetContext(ctx) 5431 req.ApplyOptions(opts...) 5432 return out, req.Send() 5433 } 5434 5435 const opPutKeyPolicy = "PutKeyPolicy" 5436 5437 // PutKeyPolicyRequest generates a "aws/request.Request" representing the 5438 // client's request for the PutKeyPolicy operation. The "output" return 5439 // value will be populated with the request's response once the request completes 5440 // successfully. 5441 // 5442 // Use "Send" method on the returned Request to send the API call to the service. 5443 // the "output" return value is not valid until after Send returns without error. 5444 // 5445 // See PutKeyPolicy for more information on using the PutKeyPolicy 5446 // API call, and error handling. 5447 // 5448 // This method is useful when you want to inject custom logic or configuration 5449 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 5450 // 5451 // 5452 // // Example sending a request using the PutKeyPolicyRequest method. 5453 // req, resp := client.PutKeyPolicyRequest(params) 5454 // 5455 // err := req.Send() 5456 // if err == nil { // resp is now filled 5457 // fmt.Println(resp) 5458 // } 5459 // 5460 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/PutKeyPolicy 5461 func (c *KMS) PutKeyPolicyRequest(input *PutKeyPolicyInput) (req *request.Request, output *PutKeyPolicyOutput) { 5462 op := &request.Operation{ 5463 Name: opPutKeyPolicy, 5464 HTTPMethod: "POST", 5465 HTTPPath: "/", 5466 } 5467 5468 if input == nil { 5469 input = &PutKeyPolicyInput{} 5470 } 5471 5472 output = &PutKeyPolicyOutput{} 5473 req = c.newRequest(op, input, output) 5474 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 5475 return 5476 } 5477 5478 // PutKeyPolicy API operation for AWS Key Management Service. 5479 // 5480 // Attaches a key policy to the specified KMS key. 5481 // 5482 // For more information about key policies, see Key Policies (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) 5483 // in the Key Management Service Developer Guide. For help writing and formatting 5484 // a JSON policy document, see the IAM JSON Policy Reference (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html) 5485 // in the Identity and Access Management User Guide . For examples of adding 5486 // a key policy in multiple programming languages, see Setting a key policy 5487 // (https://docs.aws.amazon.com/kms/latest/developerguide/programming-key-policies.html#put-policy) 5488 // in the Key Management Service Developer Guide. 5489 // 5490 // Cross-account use: No. You cannot perform this operation on a KMS key in 5491 // a different Amazon Web Services account. 5492 // 5493 // Required permissions: kms:PutKeyPolicy (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 5494 // (key policy) 5495 // 5496 // Related operations: GetKeyPolicy 5497 // 5498 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 5499 // with awserr.Error's Code and Message methods to get detailed information about 5500 // the error. 5501 // 5502 // See the AWS API reference guide for AWS Key Management Service's 5503 // API operation PutKeyPolicy for usage and error information. 5504 // 5505 // Returned Error Types: 5506 // * NotFoundException 5507 // The request was rejected because the specified entity or resource could not 5508 // be found. 5509 // 5510 // * InvalidArnException 5511 // The request was rejected because a specified ARN, or an ARN in a key policy, 5512 // is not valid. 5513 // 5514 // * MalformedPolicyDocumentException 5515 // The request was rejected because the specified policy is not syntactically 5516 // or semantically correct. 5517 // 5518 // * DependencyTimeoutException 5519 // The system timed out while trying to fulfill the request. The request can 5520 // be retried. 5521 // 5522 // * UnsupportedOperationException 5523 // The request was rejected because a specified parameter is not supported or 5524 // a specified resource is not valid for this operation. 5525 // 5526 // * InternalException 5527 // The request was rejected because an internal exception occurred. The request 5528 // can be retried. 5529 // 5530 // * LimitExceededException 5531 // The request was rejected because a quota was exceeded. For more information, 5532 // see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) 5533 // in the Key Management Service Developer Guide. 5534 // 5535 // * InvalidStateException 5536 // The request was rejected because the state of the specified resource is not 5537 // valid for this request. 5538 // 5539 // For more information about how key state affects the use of a KMS key, see 5540 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 5541 // in the Key Management Service Developer Guide . 5542 // 5543 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/PutKeyPolicy 5544 func (c *KMS) PutKeyPolicy(input *PutKeyPolicyInput) (*PutKeyPolicyOutput, error) { 5545 req, out := c.PutKeyPolicyRequest(input) 5546 return out, req.Send() 5547 } 5548 5549 // PutKeyPolicyWithContext is the same as PutKeyPolicy with the addition of 5550 // the ability to pass a context and additional request options. 5551 // 5552 // See PutKeyPolicy for details on how to use this API operation. 5553 // 5554 // The context must be non-nil and will be used for request cancellation. If 5555 // the context is nil a panic will occur. In the future the SDK may create 5556 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 5557 // for more information on using Contexts. 5558 func (c *KMS) PutKeyPolicyWithContext(ctx aws.Context, input *PutKeyPolicyInput, opts ...request.Option) (*PutKeyPolicyOutput, error) { 5559 req, out := c.PutKeyPolicyRequest(input) 5560 req.SetContext(ctx) 5561 req.ApplyOptions(opts...) 5562 return out, req.Send() 5563 } 5564 5565 const opReEncrypt = "ReEncrypt" 5566 5567 // ReEncryptRequest generates a "aws/request.Request" representing the 5568 // client's request for the ReEncrypt operation. The "output" return 5569 // value will be populated with the request's response once the request completes 5570 // successfully. 5571 // 5572 // Use "Send" method on the returned Request to send the API call to the service. 5573 // the "output" return value is not valid until after Send returns without error. 5574 // 5575 // See ReEncrypt for more information on using the ReEncrypt 5576 // API call, and error handling. 5577 // 5578 // This method is useful when you want to inject custom logic or configuration 5579 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 5580 // 5581 // 5582 // // Example sending a request using the ReEncryptRequest method. 5583 // req, resp := client.ReEncryptRequest(params) 5584 // 5585 // err := req.Send() 5586 // if err == nil { // resp is now filled 5587 // fmt.Println(resp) 5588 // } 5589 // 5590 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ReEncrypt 5591 func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, output *ReEncryptOutput) { 5592 op := &request.Operation{ 5593 Name: opReEncrypt, 5594 HTTPMethod: "POST", 5595 HTTPPath: "/", 5596 } 5597 5598 if input == nil { 5599 input = &ReEncryptInput{} 5600 } 5601 5602 output = &ReEncryptOutput{} 5603 req = c.newRequest(op, input, output) 5604 return 5605 } 5606 5607 // ReEncrypt API operation for AWS Key Management Service. 5608 // 5609 // Decrypts ciphertext and then reencrypts it entirely within KMS. You can use 5610 // this operation to change the KMS key under which data is encrypted, such 5611 // as when you manually rotate (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotate-keys-manually) 5612 // a KMS key or change the KMS key that protects a ciphertext. You can also 5613 // use it to reencrypt ciphertext under the same KMS key, such as to change 5614 // the encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 5615 // of a ciphertext. 5616 // 5617 // The ReEncrypt operation can decrypt ciphertext that was encrypted by using 5618 // an KMS KMS key in an KMS operation, such as Encrypt or GenerateDataKey. It 5619 // can also decrypt ciphertext that was encrypted by using the public key of 5620 // an asymmetric KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks) 5621 // outside of KMS. However, it cannot decrypt ciphertext produced by other libraries, 5622 // such as the Amazon Web Services Encryption SDK (https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/) 5623 // or Amazon S3 client-side encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html). 5624 // These libraries return a ciphertext format that is incompatible with KMS. 5625 // 5626 // When you use the ReEncrypt operation, you need to provide information for 5627 // the decrypt operation and the subsequent encrypt operation. 5628 // 5629 // * If your ciphertext was encrypted under an asymmetric KMS key, you must 5630 // use the SourceKeyId parameter to identify the KMS key that encrypted the 5631 // ciphertext. You must also supply the encryption algorithm that was used. 5632 // This information is required to decrypt the data. 5633 // 5634 // * If your ciphertext was encrypted under a symmetric KMS key, the SourceKeyId 5635 // parameter is optional. KMS can get this information from metadata that 5636 // it adds to the symmetric ciphertext blob. This feature adds durability 5637 // to your implementation by ensuring that authorized users can decrypt ciphertext 5638 // decades after it was encrypted, even if they've lost track of the key 5639 // ID. However, specifying the source KMS key is always recommended as a 5640 // best practice. When you use the SourceKeyId parameter to specify a KMS 5641 // key, KMS uses only the KMS key you specify. If the ciphertext was encrypted 5642 // under a different KMS key, the ReEncrypt operation fails. This practice 5643 // ensures that you use the KMS key that you intend. 5644 // 5645 // * To reencrypt the data, you must use the DestinationKeyId parameter specify 5646 // the KMS key that re-encrypts the data after it is decrypted. You can select 5647 // a symmetric or asymmetric KMS key. If the destination KMS key is an asymmetric 5648 // KMS key, you must also provide the encryption algorithm. The algorithm 5649 // that you choose must be compatible with the KMS key. When you use an asymmetric 5650 // KMS key to encrypt or reencrypt data, be sure to record the KMS key and 5651 // encryption algorithm that you choose. You will be required to provide 5652 // the same KMS key and encryption algorithm when you decrypt the data. If 5653 // the KMS key and algorithm do not match the values used to encrypt the 5654 // data, the decrypt operation fails. You are not required to supply the 5655 // key ID and encryption algorithm when you decrypt with symmetric KMS keys 5656 // because KMS stores this information in the ciphertext blob. KMS cannot 5657 // store metadata in ciphertext generated with asymmetric keys. The standard 5658 // format for asymmetric key ciphertext does not include configurable fields. 5659 // 5660 // The KMS key that you use for this operation must be in a compatible key state. 5661 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 5662 // in the Key Management Service Developer Guide. 5663 // 5664 // Cross-account use: Yes. The source KMS key and destination KMS key can be 5665 // in different Amazon Web Services accounts. Either or both KMS keys can be 5666 // in a different account than the caller. To specify a KMS key in a different 5667 // account, you must use its key ARN or alias ARN. 5668 // 5669 // Required permissions: 5670 // 5671 // * kms:ReEncryptFrom (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 5672 // permission on the source KMS key (key policy) 5673 // 5674 // * kms:ReEncryptTo (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 5675 // permission on the destination KMS key (key policy) 5676 // 5677 // To permit reencryption from or to a KMS key, include the "kms:ReEncrypt*" 5678 // permission in your key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html). 5679 // This permission is automatically included in the key policy when you use 5680 // the console to create a KMS key. But you must include it manually when you 5681 // create a KMS key programmatically or when you use the PutKeyPolicy operation 5682 // to set a key policy. 5683 // 5684 // Related operations: 5685 // 5686 // * Decrypt 5687 // 5688 // * Encrypt 5689 // 5690 // * GenerateDataKey 5691 // 5692 // * GenerateDataKeyPair 5693 // 5694 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 5695 // with awserr.Error's Code and Message methods to get detailed information about 5696 // the error. 5697 // 5698 // See the AWS API reference guide for AWS Key Management Service's 5699 // API operation ReEncrypt for usage and error information. 5700 // 5701 // Returned Error Types: 5702 // * NotFoundException 5703 // The request was rejected because the specified entity or resource could not 5704 // be found. 5705 // 5706 // * DisabledException 5707 // The request was rejected because the specified KMS key is not enabled. 5708 // 5709 // * InvalidCiphertextException 5710 // From the Decrypt or ReEncrypt operation, the request was rejected because 5711 // the specified ciphertext, or additional authenticated data incorporated into 5712 // the ciphertext, such as the encryption context, is corrupted, missing, or 5713 // otherwise invalid. 5714 // 5715 // From the ImportKeyMaterial operation, the request was rejected because KMS 5716 // could not decrypt the encrypted (wrapped) key material. 5717 // 5718 // * KeyUnavailableException 5719 // The request was rejected because the specified KMS key was not available. 5720 // You can retry the request. 5721 // 5722 // * IncorrectKeyException 5723 // The request was rejected because the specified KMS key cannot decrypt the 5724 // data. The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request 5725 // must identify the same KMS key that was used to encrypt the ciphertext. 5726 // 5727 // * DependencyTimeoutException 5728 // The system timed out while trying to fulfill the request. The request can 5729 // be retried. 5730 // 5731 // * InvalidKeyUsageException 5732 // The request was rejected for one of the following reasons: 5733 // 5734 // * The KeyUsage value of the KMS key is incompatible with the API operation. 5735 // 5736 // * The encryption algorithm or signing algorithm specified for the operation 5737 // is incompatible with the type of key material in the KMS key (KeySpec). 5738 // 5739 // For encrypting, decrypting, re-encrypting, and generating data keys, the 5740 // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage 5741 // must be SIGN_VERIFY. To find the KeyUsage of a KMS key, use the DescribeKey 5742 // operation. 5743 // 5744 // To find the encryption or signing algorithms supported for a particular KMS 5745 // key, use the DescribeKey operation. 5746 // 5747 // * InvalidGrantTokenException 5748 // The request was rejected because the specified grant token is not valid. 5749 // 5750 // * InternalException 5751 // The request was rejected because an internal exception occurred. The request 5752 // can be retried. 5753 // 5754 // * InvalidStateException 5755 // The request was rejected because the state of the specified resource is not 5756 // valid for this request. 5757 // 5758 // For more information about how key state affects the use of a KMS key, see 5759 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 5760 // in the Key Management Service Developer Guide . 5761 // 5762 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ReEncrypt 5763 func (c *KMS) ReEncrypt(input *ReEncryptInput) (*ReEncryptOutput, error) { 5764 req, out := c.ReEncryptRequest(input) 5765 return out, req.Send() 5766 } 5767 5768 // ReEncryptWithContext is the same as ReEncrypt with the addition of 5769 // the ability to pass a context and additional request options. 5770 // 5771 // See ReEncrypt for details on how to use this API operation. 5772 // 5773 // The context must be non-nil and will be used for request cancellation. If 5774 // the context is nil a panic will occur. In the future the SDK may create 5775 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 5776 // for more information on using Contexts. 5777 func (c *KMS) ReEncryptWithContext(ctx aws.Context, input *ReEncryptInput, opts ...request.Option) (*ReEncryptOutput, error) { 5778 req, out := c.ReEncryptRequest(input) 5779 req.SetContext(ctx) 5780 req.ApplyOptions(opts...) 5781 return out, req.Send() 5782 } 5783 5784 const opReplicateKey = "ReplicateKey" 5785 5786 // ReplicateKeyRequest generates a "aws/request.Request" representing the 5787 // client's request for the ReplicateKey operation. The "output" return 5788 // value will be populated with the request's response once the request completes 5789 // successfully. 5790 // 5791 // Use "Send" method on the returned Request to send the API call to the service. 5792 // the "output" return value is not valid until after Send returns without error. 5793 // 5794 // See ReplicateKey for more information on using the ReplicateKey 5795 // API call, and error handling. 5796 // 5797 // This method is useful when you want to inject custom logic or configuration 5798 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 5799 // 5800 // 5801 // // Example sending a request using the ReplicateKeyRequest method. 5802 // req, resp := client.ReplicateKeyRequest(params) 5803 // 5804 // err := req.Send() 5805 // if err == nil { // resp is now filled 5806 // fmt.Println(resp) 5807 // } 5808 // 5809 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ReplicateKey 5810 func (c *KMS) ReplicateKeyRequest(input *ReplicateKeyInput) (req *request.Request, output *ReplicateKeyOutput) { 5811 op := &request.Operation{ 5812 Name: opReplicateKey, 5813 HTTPMethod: "POST", 5814 HTTPPath: "/", 5815 } 5816 5817 if input == nil { 5818 input = &ReplicateKeyInput{} 5819 } 5820 5821 output = &ReplicateKeyOutput{} 5822 req = c.newRequest(op, input, output) 5823 return 5824 } 5825 5826 // ReplicateKey API operation for AWS Key Management Service. 5827 // 5828 // Replicates a multi-Region key into the specified Region. This operation creates 5829 // a multi-Region replica key based on a multi-Region primary key in a different 5830 // Region of the same Amazon Web Services partition. You can create multiple 5831 // replicas of a primary key, but each must be in a different Region. To create 5832 // a multi-Region primary key, use the CreateKey operation. 5833 // 5834 // This operation supports multi-Region keys, an KMS feature that lets you create 5835 // multiple interoperable KMS keys in different Amazon Web Services Regions. 5836 // Because these KMS keys have the same key ID, key material, and other metadata, 5837 // you can use them interchangeably to encrypt data in one Amazon Web Services 5838 // Region and decrypt it in a different Amazon Web Services Region without re-encrypting 5839 // the data or making a cross-Region call. For more information about multi-Region 5840 // keys, see Using multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) 5841 // in the Key Management Service Developer Guide. 5842 // 5843 // A replica key is a fully-functional KMS key that can be used independently 5844 // of its primary and peer replica keys. A primary key and its replica keys 5845 // share properties that make them interoperable. They have the same key ID 5846 // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-id) 5847 // and key material. They also have the same key spec (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-spec), 5848 // key usage (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-usage), 5849 // key material origin (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-origin), 5850 // and automatic key rotation status (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html). 5851 // KMS automatically synchronizes these shared properties among related multi-Region 5852 // keys. All other properties of a replica key can differ, including its key 5853 // policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html), 5854 // tags (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html), 5855 // aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html), 5856 // and key state (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html). 5857 // KMS pricing and quotas for KMS keys apply to each primary key and replica 5858 // key. 5859 // 5860 // When this operation completes, the new replica key has a transient key state 5861 // of Creating. This key state changes to Enabled (or PendingImport) after a 5862 // few seconds when the process of creating the new replica key is complete. 5863 // While the key state is Creating, you can manage key, but you cannot yet use 5864 // it in cryptographic operations. If you are creating and using the replica 5865 // key programmatically, retry on KMSInvalidStateException or call DescribeKey 5866 // to check its KeyState value before using it. For details about the Creating 5867 // key state, see Key state: Effect on your KMS key (kms/latest/developerguide/key-state.html) 5868 // in the Key Management Service Developer Guide. 5869 // 5870 // The CloudTrail log of a ReplicateKey operation records a ReplicateKey operation 5871 // in the primary key's Region and a CreateKey operation in the replica key's 5872 // Region. 5873 // 5874 // If you replicate a multi-Region primary key with imported key material, the 5875 // replica key is created with no key material. You must import the same key 5876 // material that you imported into the primary key. For details, see Importing 5877 // key material into multi-Region keys (kms/latest/developerguide/multi-region-keys-import.html) 5878 // in the Key Management Service Developer Guide. 5879 // 5880 // To convert a replica key to a primary key, use the UpdatePrimaryRegion operation. 5881 // 5882 // ReplicateKey uses different default values for the KeyPolicy and Tags parameters 5883 // than those used in the KMS console. For details, see the parameter descriptions. 5884 // 5885 // Cross-account use: No. You cannot use this operation to create a replica 5886 // key in a different Amazon Web Services account. 5887 // 5888 // Required permissions: 5889 // 5890 // * kms:ReplicateKey on the primary key (in the primary key's Region). Include 5891 // this permission in the primary key's key policy. 5892 // 5893 // * kms:CreateKey in an IAM policy in the replica Region. 5894 // 5895 // * To use the Tags parameter, kms:TagResource in an IAM policy in the replica 5896 // Region. 5897 // 5898 // Related operations 5899 // 5900 // * CreateKey 5901 // 5902 // * UpdatePrimaryRegion 5903 // 5904 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 5905 // with awserr.Error's Code and Message methods to get detailed information about 5906 // the error. 5907 // 5908 // See the AWS API reference guide for AWS Key Management Service's 5909 // API operation ReplicateKey for usage and error information. 5910 // 5911 // Returned Error Types: 5912 // * AlreadyExistsException 5913 // The request was rejected because it attempted to create a resource that already 5914 // exists. 5915 // 5916 // * DisabledException 5917 // The request was rejected because the specified KMS key is not enabled. 5918 // 5919 // * InvalidArnException 5920 // The request was rejected because a specified ARN, or an ARN in a key policy, 5921 // is not valid. 5922 // 5923 // * InvalidStateException 5924 // The request was rejected because the state of the specified resource is not 5925 // valid for this request. 5926 // 5927 // For more information about how key state affects the use of a KMS key, see 5928 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 5929 // in the Key Management Service Developer Guide . 5930 // 5931 // * InternalException 5932 // The request was rejected because an internal exception occurred. The request 5933 // can be retried. 5934 // 5935 // * LimitExceededException 5936 // The request was rejected because a quota was exceeded. For more information, 5937 // see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) 5938 // in the Key Management Service Developer Guide. 5939 // 5940 // * MalformedPolicyDocumentException 5941 // The request was rejected because the specified policy is not syntactically 5942 // or semantically correct. 5943 // 5944 // * NotFoundException 5945 // The request was rejected because the specified entity or resource could not 5946 // be found. 5947 // 5948 // * TagException 5949 // The request was rejected because one or more tags are not valid. 5950 // 5951 // * UnsupportedOperationException 5952 // The request was rejected because a specified parameter is not supported or 5953 // a specified resource is not valid for this operation. 5954 // 5955 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ReplicateKey 5956 func (c *KMS) ReplicateKey(input *ReplicateKeyInput) (*ReplicateKeyOutput, error) { 5957 req, out := c.ReplicateKeyRequest(input) 5958 return out, req.Send() 5959 } 5960 5961 // ReplicateKeyWithContext is the same as ReplicateKey with the addition of 5962 // the ability to pass a context and additional request options. 5963 // 5964 // See ReplicateKey for details on how to use this API operation. 5965 // 5966 // The context must be non-nil and will be used for request cancellation. If 5967 // the context is nil a panic will occur. In the future the SDK may create 5968 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 5969 // for more information on using Contexts. 5970 func (c *KMS) ReplicateKeyWithContext(ctx aws.Context, input *ReplicateKeyInput, opts ...request.Option) (*ReplicateKeyOutput, error) { 5971 req, out := c.ReplicateKeyRequest(input) 5972 req.SetContext(ctx) 5973 req.ApplyOptions(opts...) 5974 return out, req.Send() 5975 } 5976 5977 const opRetireGrant = "RetireGrant" 5978 5979 // RetireGrantRequest generates a "aws/request.Request" representing the 5980 // client's request for the RetireGrant operation. The "output" return 5981 // value will be populated with the request's response once the request completes 5982 // successfully. 5983 // 5984 // Use "Send" method on the returned Request to send the API call to the service. 5985 // the "output" return value is not valid until after Send returns without error. 5986 // 5987 // See RetireGrant for more information on using the RetireGrant 5988 // API call, and error handling. 5989 // 5990 // This method is useful when you want to inject custom logic or configuration 5991 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 5992 // 5993 // 5994 // // Example sending a request using the RetireGrantRequest method. 5995 // req, resp := client.RetireGrantRequest(params) 5996 // 5997 // err := req.Send() 5998 // if err == nil { // resp is now filled 5999 // fmt.Println(resp) 6000 // } 6001 // 6002 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RetireGrant 6003 func (c *KMS) RetireGrantRequest(input *RetireGrantInput) (req *request.Request, output *RetireGrantOutput) { 6004 op := &request.Operation{ 6005 Name: opRetireGrant, 6006 HTTPMethod: "POST", 6007 HTTPPath: "/", 6008 } 6009 6010 if input == nil { 6011 input = &RetireGrantInput{} 6012 } 6013 6014 output = &RetireGrantOutput{} 6015 req = c.newRequest(op, input, output) 6016 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 6017 return 6018 } 6019 6020 // RetireGrant API operation for AWS Key Management Service. 6021 // 6022 // Deletes a grant. Typically, you retire a grant when you no longer need its 6023 // permissions. To identify the grant to retire, use a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token), 6024 // or both the grant ID and a key identifier (key ID or key ARN) of the KMS 6025 // key. The CreateGrant operation returns both values. 6026 // 6027 // This operation can be called by the retiring principal for a grant, by the 6028 // grantee principal if the grant allows the RetireGrant operation, and by the 6029 // Amazon Web Services account (root user) in which the grant is created. It 6030 // can also be called by principals to whom permission for retiring a grant 6031 // is delegated. For details, see Retiring and revoking grants (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete) 6032 // in the Key Management Service Developer Guide. 6033 // 6034 // For detailed information about grants, including grant terminology, see Using 6035 // grants (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) 6036 // in the Key Management Service Developer Guide . For examples of working with 6037 // grants in several programming languages, see Programming grants (https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html). 6038 // 6039 // Cross-account use: Yes. You can retire a grant on a KMS key in a different 6040 // Amazon Web Services account. 6041 // 6042 // Required permissions::Permission to retire a grant is determined primarily 6043 // by the grant. For details, see Retiring and revoking grants (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete) 6044 // in the Key Management Service Developer Guide. 6045 // 6046 // Related operations: 6047 // 6048 // * CreateGrant 6049 // 6050 // * ListGrants 6051 // 6052 // * ListRetirableGrants 6053 // 6054 // * RevokeGrant 6055 // 6056 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 6057 // with awserr.Error's Code and Message methods to get detailed information about 6058 // the error. 6059 // 6060 // See the AWS API reference guide for AWS Key Management Service's 6061 // API operation RetireGrant for usage and error information. 6062 // 6063 // Returned Error Types: 6064 // * InvalidArnException 6065 // The request was rejected because a specified ARN, or an ARN in a key policy, 6066 // is not valid. 6067 // 6068 // * InvalidGrantTokenException 6069 // The request was rejected because the specified grant token is not valid. 6070 // 6071 // * InvalidGrantIdException 6072 // The request was rejected because the specified GrantId is not valid. 6073 // 6074 // * NotFoundException 6075 // The request was rejected because the specified entity or resource could not 6076 // be found. 6077 // 6078 // * DependencyTimeoutException 6079 // The system timed out while trying to fulfill the request. The request can 6080 // be retried. 6081 // 6082 // * InternalException 6083 // The request was rejected because an internal exception occurred. The request 6084 // can be retried. 6085 // 6086 // * InvalidStateException 6087 // The request was rejected because the state of the specified resource is not 6088 // valid for this request. 6089 // 6090 // For more information about how key state affects the use of a KMS key, see 6091 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 6092 // in the Key Management Service Developer Guide . 6093 // 6094 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RetireGrant 6095 func (c *KMS) RetireGrant(input *RetireGrantInput) (*RetireGrantOutput, error) { 6096 req, out := c.RetireGrantRequest(input) 6097 return out, req.Send() 6098 } 6099 6100 // RetireGrantWithContext is the same as RetireGrant with the addition of 6101 // the ability to pass a context and additional request options. 6102 // 6103 // See RetireGrant for details on how to use this API operation. 6104 // 6105 // The context must be non-nil and will be used for request cancellation. If 6106 // the context is nil a panic will occur. In the future the SDK may create 6107 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 6108 // for more information on using Contexts. 6109 func (c *KMS) RetireGrantWithContext(ctx aws.Context, input *RetireGrantInput, opts ...request.Option) (*RetireGrantOutput, error) { 6110 req, out := c.RetireGrantRequest(input) 6111 req.SetContext(ctx) 6112 req.ApplyOptions(opts...) 6113 return out, req.Send() 6114 } 6115 6116 const opRevokeGrant = "RevokeGrant" 6117 6118 // RevokeGrantRequest generates a "aws/request.Request" representing the 6119 // client's request for the RevokeGrant operation. The "output" return 6120 // value will be populated with the request's response once the request completes 6121 // successfully. 6122 // 6123 // Use "Send" method on the returned Request to send the API call to the service. 6124 // the "output" return value is not valid until after Send returns without error. 6125 // 6126 // See RevokeGrant for more information on using the RevokeGrant 6127 // API call, and error handling. 6128 // 6129 // This method is useful when you want to inject custom logic or configuration 6130 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 6131 // 6132 // 6133 // // Example sending a request using the RevokeGrantRequest method. 6134 // req, resp := client.RevokeGrantRequest(params) 6135 // 6136 // err := req.Send() 6137 // if err == nil { // resp is now filled 6138 // fmt.Println(resp) 6139 // } 6140 // 6141 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RevokeGrant 6142 func (c *KMS) RevokeGrantRequest(input *RevokeGrantInput) (req *request.Request, output *RevokeGrantOutput) { 6143 op := &request.Operation{ 6144 Name: opRevokeGrant, 6145 HTTPMethod: "POST", 6146 HTTPPath: "/", 6147 } 6148 6149 if input == nil { 6150 input = &RevokeGrantInput{} 6151 } 6152 6153 output = &RevokeGrantOutput{} 6154 req = c.newRequest(op, input, output) 6155 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 6156 return 6157 } 6158 6159 // RevokeGrant API operation for AWS Key Management Service. 6160 // 6161 // Deletes the specified grant. You revoke a grant to terminate the permissions 6162 // that the grant allows. For more information, see Retiring and revoking grants 6163 // (https://docs.aws.amazon.com/kms/latest/developerguide/managing-grants.html#grant-delete) 6164 // in the Key Management Service Developer Guide . 6165 // 6166 // When you create, retire, or revoke a grant, there might be a brief delay, 6167 // usually less than five minutes, until the grant is available throughout KMS. 6168 // This state is known as eventual consistency. For details, see Eventual consistency 6169 // (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-eventual-consistency) 6170 // in the Key Management Service Developer Guide . 6171 // 6172 // For detailed information about grants, including grant terminology, see Using 6173 // grants (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) 6174 // in the Key Management Service Developer Guide . For examples of working with 6175 // grants in several programming languages, see Programming grants (https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html). 6176 // 6177 // Cross-account use: Yes. To perform this operation on a KMS key in a different 6178 // Amazon Web Services account, specify the key ARN in the value of the KeyId 6179 // parameter. 6180 // 6181 // Required permissions: kms:RevokeGrant (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 6182 // (key policy). 6183 // 6184 // Related operations: 6185 // 6186 // * CreateGrant 6187 // 6188 // * ListGrants 6189 // 6190 // * ListRetirableGrants 6191 // 6192 // * RetireGrant 6193 // 6194 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 6195 // with awserr.Error's Code and Message methods to get detailed information about 6196 // the error. 6197 // 6198 // See the AWS API reference guide for AWS Key Management Service's 6199 // API operation RevokeGrant for usage and error information. 6200 // 6201 // Returned Error Types: 6202 // * NotFoundException 6203 // The request was rejected because the specified entity or resource could not 6204 // be found. 6205 // 6206 // * DependencyTimeoutException 6207 // The system timed out while trying to fulfill the request. The request can 6208 // be retried. 6209 // 6210 // * InvalidArnException 6211 // The request was rejected because a specified ARN, or an ARN in a key policy, 6212 // is not valid. 6213 // 6214 // * InvalidGrantIdException 6215 // The request was rejected because the specified GrantId is not valid. 6216 // 6217 // * InternalException 6218 // The request was rejected because an internal exception occurred. The request 6219 // can be retried. 6220 // 6221 // * InvalidStateException 6222 // The request was rejected because the state of the specified resource is not 6223 // valid for this request. 6224 // 6225 // For more information about how key state affects the use of a KMS key, see 6226 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 6227 // in the Key Management Service Developer Guide . 6228 // 6229 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RevokeGrant 6230 func (c *KMS) RevokeGrant(input *RevokeGrantInput) (*RevokeGrantOutput, error) { 6231 req, out := c.RevokeGrantRequest(input) 6232 return out, req.Send() 6233 } 6234 6235 // RevokeGrantWithContext is the same as RevokeGrant with the addition of 6236 // the ability to pass a context and additional request options. 6237 // 6238 // See RevokeGrant for details on how to use this API operation. 6239 // 6240 // The context must be non-nil and will be used for request cancellation. If 6241 // the context is nil a panic will occur. In the future the SDK may create 6242 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 6243 // for more information on using Contexts. 6244 func (c *KMS) RevokeGrantWithContext(ctx aws.Context, input *RevokeGrantInput, opts ...request.Option) (*RevokeGrantOutput, error) { 6245 req, out := c.RevokeGrantRequest(input) 6246 req.SetContext(ctx) 6247 req.ApplyOptions(opts...) 6248 return out, req.Send() 6249 } 6250 6251 const opScheduleKeyDeletion = "ScheduleKeyDeletion" 6252 6253 // ScheduleKeyDeletionRequest generates a "aws/request.Request" representing the 6254 // client's request for the ScheduleKeyDeletion operation. The "output" return 6255 // value will be populated with the request's response once the request completes 6256 // successfully. 6257 // 6258 // Use "Send" method on the returned Request to send the API call to the service. 6259 // the "output" return value is not valid until after Send returns without error. 6260 // 6261 // See ScheduleKeyDeletion for more information on using the ScheduleKeyDeletion 6262 // API call, and error handling. 6263 // 6264 // This method is useful when you want to inject custom logic or configuration 6265 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 6266 // 6267 // 6268 // // Example sending a request using the ScheduleKeyDeletionRequest method. 6269 // req, resp := client.ScheduleKeyDeletionRequest(params) 6270 // 6271 // err := req.Send() 6272 // if err == nil { // resp is now filled 6273 // fmt.Println(resp) 6274 // } 6275 // 6276 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ScheduleKeyDeletion 6277 func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) (req *request.Request, output *ScheduleKeyDeletionOutput) { 6278 op := &request.Operation{ 6279 Name: opScheduleKeyDeletion, 6280 HTTPMethod: "POST", 6281 HTTPPath: "/", 6282 } 6283 6284 if input == nil { 6285 input = &ScheduleKeyDeletionInput{} 6286 } 6287 6288 output = &ScheduleKeyDeletionOutput{} 6289 req = c.newRequest(op, input, output) 6290 return 6291 } 6292 6293 // ScheduleKeyDeletion API operation for AWS Key Management Service. 6294 // 6295 // Schedules the deletion of a KMS key. By default, KMS applies a waiting period 6296 // of 30 days, but you can specify a waiting period of 7-30 days. When this 6297 // operation is successful, the key state of the KMS key changes to PendingDeletion 6298 // and the key can't be used in any cryptographic operations. It remains in 6299 // this state for the duration of the waiting period. Before the waiting period 6300 // ends, you can use CancelKeyDeletion to cancel the deletion of the KMS key. 6301 // After the waiting period ends, KMS deletes the KMS key, its key material, 6302 // and all KMS data associated with it, including all aliases that refer to 6303 // it. 6304 // 6305 // Deleting a KMS key is a destructive and potentially dangerous operation. 6306 // When a KMS key is deleted, all data that was encrypted under the KMS key 6307 // is unrecoverable. (The only exception is a multi-Region replica key.) To 6308 // prevent the use of a KMS key without deleting it, use DisableKey. 6309 // 6310 // If you schedule deletion of a KMS key from a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html), 6311 // when the waiting period expires, ScheduleKeyDeletion deletes the KMS key 6312 // from KMS. Then KMS makes a best effort to delete the key material from the 6313 // associated CloudHSM cluster. However, you might need to manually delete the 6314 // orphaned key material (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-orphaned-key) 6315 // from the cluster and its backups. 6316 // 6317 // You can schedule the deletion of a multi-Region primary key and its replica 6318 // keys at any time. However, KMS will not delete a multi-Region primary key 6319 // with existing replica keys. If you schedule the deletion of a primary key 6320 // with replicas, its key state changes to PendingReplicaDeletion and it cannot 6321 // be replicated or used in cryptographic operations. This status can continue 6322 // indefinitely. When the last of its replicas keys is deleted (not just scheduled), 6323 // the key state of the primary key changes to PendingDeletion and its waiting 6324 // period (PendingWindowInDays) begins. For details, see Deleting multi-Region 6325 // keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-delete.html) 6326 // in the Key Management Service Developer Guide. 6327 // 6328 // For more information about scheduling a KMS key for deletion, see Deleting 6329 // KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) 6330 // in the Key Management Service Developer Guide. 6331 // 6332 // The KMS key that you use for this operation must be in a compatible key state. 6333 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 6334 // in the Key Management Service Developer Guide. 6335 // 6336 // Cross-account use: No. You cannot perform this operation on a KMS key in 6337 // a different Amazon Web Services account. 6338 // 6339 // Required permissions: kms:ScheduleKeyDeletion (key policy) 6340 // 6341 // Related operations 6342 // 6343 // * CancelKeyDeletion 6344 // 6345 // * DisableKey 6346 // 6347 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 6348 // with awserr.Error's Code and Message methods to get detailed information about 6349 // the error. 6350 // 6351 // See the AWS API reference guide for AWS Key Management Service's 6352 // API operation ScheduleKeyDeletion for usage and error information. 6353 // 6354 // Returned Error Types: 6355 // * NotFoundException 6356 // The request was rejected because the specified entity or resource could not 6357 // be found. 6358 // 6359 // * InvalidArnException 6360 // The request was rejected because a specified ARN, or an ARN in a key policy, 6361 // is not valid. 6362 // 6363 // * DependencyTimeoutException 6364 // The system timed out while trying to fulfill the request. The request can 6365 // be retried. 6366 // 6367 // * InternalException 6368 // The request was rejected because an internal exception occurred. The request 6369 // can be retried. 6370 // 6371 // * InvalidStateException 6372 // The request was rejected because the state of the specified resource is not 6373 // valid for this request. 6374 // 6375 // For more information about how key state affects the use of a KMS key, see 6376 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 6377 // in the Key Management Service Developer Guide . 6378 // 6379 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ScheduleKeyDeletion 6380 func (c *KMS) ScheduleKeyDeletion(input *ScheduleKeyDeletionInput) (*ScheduleKeyDeletionOutput, error) { 6381 req, out := c.ScheduleKeyDeletionRequest(input) 6382 return out, req.Send() 6383 } 6384 6385 // ScheduleKeyDeletionWithContext is the same as ScheduleKeyDeletion with the addition of 6386 // the ability to pass a context and additional request options. 6387 // 6388 // See ScheduleKeyDeletion for details on how to use this API operation. 6389 // 6390 // The context must be non-nil and will be used for request cancellation. If 6391 // the context is nil a panic will occur. In the future the SDK may create 6392 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 6393 // for more information on using Contexts. 6394 func (c *KMS) ScheduleKeyDeletionWithContext(ctx aws.Context, input *ScheduleKeyDeletionInput, opts ...request.Option) (*ScheduleKeyDeletionOutput, error) { 6395 req, out := c.ScheduleKeyDeletionRequest(input) 6396 req.SetContext(ctx) 6397 req.ApplyOptions(opts...) 6398 return out, req.Send() 6399 } 6400 6401 const opSign = "Sign" 6402 6403 // SignRequest generates a "aws/request.Request" representing the 6404 // client's request for the Sign operation. The "output" return 6405 // value will be populated with the request's response once the request completes 6406 // successfully. 6407 // 6408 // Use "Send" method on the returned Request to send the API call to the service. 6409 // the "output" return value is not valid until after Send returns without error. 6410 // 6411 // See Sign for more information on using the Sign 6412 // API call, and error handling. 6413 // 6414 // This method is useful when you want to inject custom logic or configuration 6415 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 6416 // 6417 // 6418 // // Example sending a request using the SignRequest method. 6419 // req, resp := client.SignRequest(params) 6420 // 6421 // err := req.Send() 6422 // if err == nil { // resp is now filled 6423 // fmt.Println(resp) 6424 // } 6425 // 6426 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Sign 6427 func (c *KMS) SignRequest(input *SignInput) (req *request.Request, output *SignOutput) { 6428 op := &request.Operation{ 6429 Name: opSign, 6430 HTTPMethod: "POST", 6431 HTTPPath: "/", 6432 } 6433 6434 if input == nil { 6435 input = &SignInput{} 6436 } 6437 6438 output = &SignOutput{} 6439 req = c.newRequest(op, input, output) 6440 return 6441 } 6442 6443 // Sign API operation for AWS Key Management Service. 6444 // 6445 // Creates a digital signature (https://en.wikipedia.org/wiki/Digital_signature) 6446 // for a message or message digest by using the private key in an asymmetric 6447 // KMS key. To verify the signature, use the Verify operation, or use the public 6448 // key in the same asymmetric KMS key outside of KMS. For information about 6449 // symmetric and asymmetric KMS keys, see Using Symmetric and Asymmetric KMS 6450 // keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) 6451 // in the Key Management Service Developer Guide. 6452 // 6453 // Digital signatures are generated and verified by using asymmetric key pair, 6454 // such as an RSA or ECC pair that is represented by an asymmetric KMS key. 6455 // The key owner (or an authorized user) uses their private key to sign a message. 6456 // Anyone with the public key can verify that the message was signed with that 6457 // particular private key and that the message hasn't changed since it was signed. 6458 // 6459 // To use the Sign operation, provide the following information: 6460 // 6461 // * Use the KeyId parameter to identify an asymmetric KMS key with a KeyUsage 6462 // value of SIGN_VERIFY. To get the KeyUsage value of a KMS key, use the 6463 // DescribeKey operation. The caller must have kms:Sign permission on the 6464 // KMS key. 6465 // 6466 // * Use the Message parameter to specify the message or message digest to 6467 // sign. You can submit messages of up to 4096 bytes. To sign a larger message, 6468 // generate a hash digest of the message, and then provide the hash digest 6469 // in the Message parameter. To indicate whether the message is a full message 6470 // or a digest, use the MessageType parameter. 6471 // 6472 // * Choose a signing algorithm that is compatible with the KMS key. 6473 // 6474 // When signing a message, be sure to record the KMS key and the signing algorithm. 6475 // This information is required to verify the signature. 6476 // 6477 // To verify the signature that this operation generates, use the Verify operation. 6478 // Or use the GetPublicKey operation to download the public key and then use 6479 // the public key to verify the signature outside of KMS. 6480 // 6481 // The KMS key that you use for this operation must be in a compatible key state. 6482 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 6483 // in the Key Management Service Developer Guide. 6484 // 6485 // Cross-account use: Yes. To perform this operation with a KMS key in a different 6486 // Amazon Web Services account, specify the key ARN or alias ARN in the value 6487 // of the KeyId parameter. 6488 // 6489 // Required permissions: kms:Sign (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 6490 // (key policy) 6491 // 6492 // Related operations: Verify 6493 // 6494 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 6495 // with awserr.Error's Code and Message methods to get detailed information about 6496 // the error. 6497 // 6498 // See the AWS API reference guide for AWS Key Management Service's 6499 // API operation Sign for usage and error information. 6500 // 6501 // Returned Error Types: 6502 // * NotFoundException 6503 // The request was rejected because the specified entity or resource could not 6504 // be found. 6505 // 6506 // * DisabledException 6507 // The request was rejected because the specified KMS key is not enabled. 6508 // 6509 // * KeyUnavailableException 6510 // The request was rejected because the specified KMS key was not available. 6511 // You can retry the request. 6512 // 6513 // * DependencyTimeoutException 6514 // The system timed out while trying to fulfill the request. The request can 6515 // be retried. 6516 // 6517 // * InvalidKeyUsageException 6518 // The request was rejected for one of the following reasons: 6519 // 6520 // * The KeyUsage value of the KMS key is incompatible with the API operation. 6521 // 6522 // * The encryption algorithm or signing algorithm specified for the operation 6523 // is incompatible with the type of key material in the KMS key (KeySpec). 6524 // 6525 // For encrypting, decrypting, re-encrypting, and generating data keys, the 6526 // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage 6527 // must be SIGN_VERIFY. To find the KeyUsage of a KMS key, use the DescribeKey 6528 // operation. 6529 // 6530 // To find the encryption or signing algorithms supported for a particular KMS 6531 // key, use the DescribeKey operation. 6532 // 6533 // * InvalidGrantTokenException 6534 // The request was rejected because the specified grant token is not valid. 6535 // 6536 // * InternalException 6537 // The request was rejected because an internal exception occurred. The request 6538 // can be retried. 6539 // 6540 // * InvalidStateException 6541 // The request was rejected because the state of the specified resource is not 6542 // valid for this request. 6543 // 6544 // For more information about how key state affects the use of a KMS key, see 6545 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 6546 // in the Key Management Service Developer Guide . 6547 // 6548 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Sign 6549 func (c *KMS) Sign(input *SignInput) (*SignOutput, error) { 6550 req, out := c.SignRequest(input) 6551 return out, req.Send() 6552 } 6553 6554 // SignWithContext is the same as Sign with the addition of 6555 // the ability to pass a context and additional request options. 6556 // 6557 // See Sign for details on how to use this API operation. 6558 // 6559 // The context must be non-nil and will be used for request cancellation. If 6560 // the context is nil a panic will occur. In the future the SDK may create 6561 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 6562 // for more information on using Contexts. 6563 func (c *KMS) SignWithContext(ctx aws.Context, input *SignInput, opts ...request.Option) (*SignOutput, error) { 6564 req, out := c.SignRequest(input) 6565 req.SetContext(ctx) 6566 req.ApplyOptions(opts...) 6567 return out, req.Send() 6568 } 6569 6570 const opTagResource = "TagResource" 6571 6572 // TagResourceRequest generates a "aws/request.Request" representing the 6573 // client's request for the TagResource operation. The "output" return 6574 // value will be populated with the request's response once the request completes 6575 // successfully. 6576 // 6577 // Use "Send" method on the returned Request to send the API call to the service. 6578 // the "output" return value is not valid until after Send returns without error. 6579 // 6580 // See TagResource for more information on using the TagResource 6581 // API call, and error handling. 6582 // 6583 // This method is useful when you want to inject custom logic or configuration 6584 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 6585 // 6586 // 6587 // // Example sending a request using the TagResourceRequest method. 6588 // req, resp := client.TagResourceRequest(params) 6589 // 6590 // err := req.Send() 6591 // if err == nil { // resp is now filled 6592 // fmt.Println(resp) 6593 // } 6594 // 6595 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/TagResource 6596 func (c *KMS) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { 6597 op := &request.Operation{ 6598 Name: opTagResource, 6599 HTTPMethod: "POST", 6600 HTTPPath: "/", 6601 } 6602 6603 if input == nil { 6604 input = &TagResourceInput{} 6605 } 6606 6607 output = &TagResourceOutput{} 6608 req = c.newRequest(op, input, output) 6609 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 6610 return 6611 } 6612 6613 // TagResource API operation for AWS Key Management Service. 6614 // 6615 // Adds or edits tags on a customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk). 6616 // 6617 // Tagging or untagging a KMS key can allow or deny permission to the KMS key. 6618 // For details, see Using ABAC in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) 6619 // in the Key Management Service Developer Guide. 6620 // 6621 // Each tag consists of a tag key and a tag value, both of which are case-sensitive 6622 // strings. The tag value can be an empty (null) string. To add a tag, specify 6623 // a new tag key and a tag value. To edit a tag, specify an existing tag key 6624 // and a new tag value. 6625 // 6626 // You can use this operation to tag a customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk), 6627 // but you cannot tag an Amazon Web Services managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk), 6628 // an Amazon Web Services owned key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk), 6629 // a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#keystore-concept), 6630 // or an alias (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#alias-concept). 6631 // 6632 // You can also add tags to a KMS key while creating it (CreateKey) or replicating 6633 // it (ReplicateKey). 6634 // 6635 // For information about using tags in KMS, see Tagging keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html). 6636 // For general information about tags, including the format and syntax, see 6637 // Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) 6638 // in the Amazon Web Services General Reference. 6639 // 6640 // The KMS key that you use for this operation must be in a compatible key state. 6641 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 6642 // in the Key Management Service Developer Guide. 6643 // 6644 // Cross-account use: No. You cannot perform this operation on a KMS key in 6645 // a different Amazon Web Services account. 6646 // 6647 // Required permissions: kms:TagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 6648 // (key policy) 6649 // 6650 // Related operations 6651 // 6652 // * CreateKey 6653 // 6654 // * ListResourceTags 6655 // 6656 // * ReplicateKey 6657 // 6658 // * UntagResource 6659 // 6660 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 6661 // with awserr.Error's Code and Message methods to get detailed information about 6662 // the error. 6663 // 6664 // See the AWS API reference guide for AWS Key Management Service's 6665 // API operation TagResource for usage and error information. 6666 // 6667 // Returned Error Types: 6668 // * InternalException 6669 // The request was rejected because an internal exception occurred. The request 6670 // can be retried. 6671 // 6672 // * NotFoundException 6673 // The request was rejected because the specified entity or resource could not 6674 // be found. 6675 // 6676 // * InvalidArnException 6677 // The request was rejected because a specified ARN, or an ARN in a key policy, 6678 // is not valid. 6679 // 6680 // * InvalidStateException 6681 // The request was rejected because the state of the specified resource is not 6682 // valid for this request. 6683 // 6684 // For more information about how key state affects the use of a KMS key, see 6685 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 6686 // in the Key Management Service Developer Guide . 6687 // 6688 // * LimitExceededException 6689 // The request was rejected because a quota was exceeded. For more information, 6690 // see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) 6691 // in the Key Management Service Developer Guide. 6692 // 6693 // * TagException 6694 // The request was rejected because one or more tags are not valid. 6695 // 6696 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/TagResource 6697 func (c *KMS) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { 6698 req, out := c.TagResourceRequest(input) 6699 return out, req.Send() 6700 } 6701 6702 // TagResourceWithContext is the same as TagResource with the addition of 6703 // the ability to pass a context and additional request options. 6704 // 6705 // See TagResource for details on how to use this API operation. 6706 // 6707 // The context must be non-nil and will be used for request cancellation. If 6708 // the context is nil a panic will occur. In the future the SDK may create 6709 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 6710 // for more information on using Contexts. 6711 func (c *KMS) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { 6712 req, out := c.TagResourceRequest(input) 6713 req.SetContext(ctx) 6714 req.ApplyOptions(opts...) 6715 return out, req.Send() 6716 } 6717 6718 const opUntagResource = "UntagResource" 6719 6720 // UntagResourceRequest generates a "aws/request.Request" representing the 6721 // client's request for the UntagResource operation. The "output" return 6722 // value will be populated with the request's response once the request completes 6723 // successfully. 6724 // 6725 // Use "Send" method on the returned Request to send the API call to the service. 6726 // the "output" return value is not valid until after Send returns without error. 6727 // 6728 // See UntagResource for more information on using the UntagResource 6729 // API call, and error handling. 6730 // 6731 // This method is useful when you want to inject custom logic or configuration 6732 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 6733 // 6734 // 6735 // // Example sending a request using the UntagResourceRequest method. 6736 // req, resp := client.UntagResourceRequest(params) 6737 // 6738 // err := req.Send() 6739 // if err == nil { // resp is now filled 6740 // fmt.Println(resp) 6741 // } 6742 // 6743 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UntagResource 6744 func (c *KMS) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { 6745 op := &request.Operation{ 6746 Name: opUntagResource, 6747 HTTPMethod: "POST", 6748 HTTPPath: "/", 6749 } 6750 6751 if input == nil { 6752 input = &UntagResourceInput{} 6753 } 6754 6755 output = &UntagResourceOutput{} 6756 req = c.newRequest(op, input, output) 6757 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 6758 return 6759 } 6760 6761 // UntagResource API operation for AWS Key Management Service. 6762 // 6763 // Deletes tags from a customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk). 6764 // To delete a tag, specify the tag key and the KMS key. 6765 // 6766 // Tagging or untagging a KMS key can allow or deny permission to the KMS key. 6767 // For details, see Using ABAC in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) 6768 // in the Key Management Service Developer Guide. 6769 // 6770 // When it succeeds, the UntagResource operation doesn't return any output. 6771 // Also, if the specified tag key isn't found on the KMS key, it doesn't throw 6772 // an exception or return a response. To confirm that the operation worked, 6773 // use the ListResourceTags operation. 6774 // 6775 // For information about using tags in KMS, see Tagging keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html). 6776 // For general information about tags, including the format and syntax, see 6777 // Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) 6778 // in the Amazon Web Services General Reference. 6779 // 6780 // The KMS key that you use for this operation must be in a compatible key state. 6781 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 6782 // in the Key Management Service Developer Guide. 6783 // 6784 // Cross-account use: No. You cannot perform this operation on a KMS key in 6785 // a different Amazon Web Services account. 6786 // 6787 // Required permissions: kms:UntagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 6788 // (key policy) 6789 // 6790 // Related operations 6791 // 6792 // * CreateKey 6793 // 6794 // * ListResourceTags 6795 // 6796 // * ReplicateKey 6797 // 6798 // * TagResource 6799 // 6800 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 6801 // with awserr.Error's Code and Message methods to get detailed information about 6802 // the error. 6803 // 6804 // See the AWS API reference guide for AWS Key Management Service's 6805 // API operation UntagResource for usage and error information. 6806 // 6807 // Returned Error Types: 6808 // * InternalException 6809 // The request was rejected because an internal exception occurred. The request 6810 // can be retried. 6811 // 6812 // * NotFoundException 6813 // The request was rejected because the specified entity or resource could not 6814 // be found. 6815 // 6816 // * InvalidArnException 6817 // The request was rejected because a specified ARN, or an ARN in a key policy, 6818 // is not valid. 6819 // 6820 // * InvalidStateException 6821 // The request was rejected because the state of the specified resource is not 6822 // valid for this request. 6823 // 6824 // For more information about how key state affects the use of a KMS key, see 6825 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 6826 // in the Key Management Service Developer Guide . 6827 // 6828 // * TagException 6829 // The request was rejected because one or more tags are not valid. 6830 // 6831 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UntagResource 6832 func (c *KMS) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { 6833 req, out := c.UntagResourceRequest(input) 6834 return out, req.Send() 6835 } 6836 6837 // UntagResourceWithContext is the same as UntagResource with the addition of 6838 // the ability to pass a context and additional request options. 6839 // 6840 // See UntagResource for details on how to use this API operation. 6841 // 6842 // The context must be non-nil and will be used for request cancellation. If 6843 // the context is nil a panic will occur. In the future the SDK may create 6844 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 6845 // for more information on using Contexts. 6846 func (c *KMS) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { 6847 req, out := c.UntagResourceRequest(input) 6848 req.SetContext(ctx) 6849 req.ApplyOptions(opts...) 6850 return out, req.Send() 6851 } 6852 6853 const opUpdateAlias = "UpdateAlias" 6854 6855 // UpdateAliasRequest generates a "aws/request.Request" representing the 6856 // client's request for the UpdateAlias operation. The "output" return 6857 // value will be populated with the request's response once the request completes 6858 // successfully. 6859 // 6860 // Use "Send" method on the returned Request to send the API call to the service. 6861 // the "output" return value is not valid until after Send returns without error. 6862 // 6863 // See UpdateAlias for more information on using the UpdateAlias 6864 // API call, and error handling. 6865 // 6866 // This method is useful when you want to inject custom logic or configuration 6867 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 6868 // 6869 // 6870 // // Example sending a request using the UpdateAliasRequest method. 6871 // req, resp := client.UpdateAliasRequest(params) 6872 // 6873 // err := req.Send() 6874 // if err == nil { // resp is now filled 6875 // fmt.Println(resp) 6876 // } 6877 // 6878 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateAlias 6879 func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *UpdateAliasOutput) { 6880 op := &request.Operation{ 6881 Name: opUpdateAlias, 6882 HTTPMethod: "POST", 6883 HTTPPath: "/", 6884 } 6885 6886 if input == nil { 6887 input = &UpdateAliasInput{} 6888 } 6889 6890 output = &UpdateAliasOutput{} 6891 req = c.newRequest(op, input, output) 6892 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 6893 return 6894 } 6895 6896 // UpdateAlias API operation for AWS Key Management Service. 6897 // 6898 // Associates an existing KMS alias with a different KMS key. Each alias is 6899 // associated with only one KMS key at a time, although a KMS key can have multiple 6900 // aliases. The alias and the KMS key must be in the same Amazon Web Services 6901 // account and Region. 6902 // 6903 // Adding, deleting, or updating an alias can allow or deny permission to the 6904 // KMS key. For details, see Using ABAC in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) 6905 // in the Key Management Service Developer Guide. 6906 // 6907 // The current and new KMS key must be the same type (both symmetric or both 6908 // asymmetric), and they must have the same key usage (ENCRYPT_DECRYPT or SIGN_VERIFY). 6909 // This restriction prevents errors in code that uses aliases. If you must assign 6910 // an alias to a different type of KMS key, use DeleteAlias to delete the old 6911 // alias and CreateAlias to create a new alias. 6912 // 6913 // You cannot use UpdateAlias to change an alias name. To change an alias name, 6914 // use DeleteAlias to delete the old alias and CreateAlias to create a new alias. 6915 // 6916 // Because an alias is not a property of a KMS key, you can create, update, 6917 // and delete the aliases of a KMS key without affecting the KMS key. Also, 6918 // aliases do not appear in the response from the DescribeKey operation. To 6919 // get the aliases of all KMS keys in the account, use the ListAliases operation. 6920 // 6921 // The KMS key that you use for this operation must be in a compatible key state. 6922 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 6923 // in the Key Management Service Developer Guide. 6924 // 6925 // Cross-account use: No. You cannot perform this operation on a KMS key in 6926 // a different Amazon Web Services account. 6927 // 6928 // Required permissions 6929 // 6930 // * kms:UpdateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 6931 // on the alias (IAM policy). 6932 // 6933 // * kms:UpdateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 6934 // on the current KMS key (key policy). 6935 // 6936 // * kms:UpdateAlias (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 6937 // on the new KMS key (key policy). 6938 // 6939 // For details, see Controlling access to aliases (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) 6940 // in the Key Management Service Developer Guide. 6941 // 6942 // Related operations: 6943 // 6944 // * CreateAlias 6945 // 6946 // * DeleteAlias 6947 // 6948 // * ListAliases 6949 // 6950 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 6951 // with awserr.Error's Code and Message methods to get detailed information about 6952 // the error. 6953 // 6954 // See the AWS API reference guide for AWS Key Management Service's 6955 // API operation UpdateAlias for usage and error information. 6956 // 6957 // Returned Error Types: 6958 // * DependencyTimeoutException 6959 // The system timed out while trying to fulfill the request. The request can 6960 // be retried. 6961 // 6962 // * NotFoundException 6963 // The request was rejected because the specified entity or resource could not 6964 // be found. 6965 // 6966 // * InternalException 6967 // The request was rejected because an internal exception occurred. The request 6968 // can be retried. 6969 // 6970 // * LimitExceededException 6971 // The request was rejected because a quota was exceeded. For more information, 6972 // see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) 6973 // in the Key Management Service Developer Guide. 6974 // 6975 // * InvalidStateException 6976 // The request was rejected because the state of the specified resource is not 6977 // valid for this request. 6978 // 6979 // For more information about how key state affects the use of a KMS key, see 6980 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 6981 // in the Key Management Service Developer Guide . 6982 // 6983 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateAlias 6984 func (c *KMS) UpdateAlias(input *UpdateAliasInput) (*UpdateAliasOutput, error) { 6985 req, out := c.UpdateAliasRequest(input) 6986 return out, req.Send() 6987 } 6988 6989 // UpdateAliasWithContext is the same as UpdateAlias with the addition of 6990 // the ability to pass a context and additional request options. 6991 // 6992 // See UpdateAlias for details on how to use this API operation. 6993 // 6994 // The context must be non-nil and will be used for request cancellation. If 6995 // the context is nil a panic will occur. In the future the SDK may create 6996 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 6997 // for more information on using Contexts. 6998 func (c *KMS) UpdateAliasWithContext(ctx aws.Context, input *UpdateAliasInput, opts ...request.Option) (*UpdateAliasOutput, error) { 6999 req, out := c.UpdateAliasRequest(input) 7000 req.SetContext(ctx) 7001 req.ApplyOptions(opts...) 7002 return out, req.Send() 7003 } 7004 7005 const opUpdateCustomKeyStore = "UpdateCustomKeyStore" 7006 7007 // UpdateCustomKeyStoreRequest generates a "aws/request.Request" representing the 7008 // client's request for the UpdateCustomKeyStore operation. The "output" return 7009 // value will be populated with the request's response once the request completes 7010 // successfully. 7011 // 7012 // Use "Send" method on the returned Request to send the API call to the service. 7013 // the "output" return value is not valid until after Send returns without error. 7014 // 7015 // See UpdateCustomKeyStore for more information on using the UpdateCustomKeyStore 7016 // API call, and error handling. 7017 // 7018 // This method is useful when you want to inject custom logic or configuration 7019 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 7020 // 7021 // 7022 // // Example sending a request using the UpdateCustomKeyStoreRequest method. 7023 // req, resp := client.UpdateCustomKeyStoreRequest(params) 7024 // 7025 // err := req.Send() 7026 // if err == nil { // resp is now filled 7027 // fmt.Println(resp) 7028 // } 7029 // 7030 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateCustomKeyStore 7031 func (c *KMS) UpdateCustomKeyStoreRequest(input *UpdateCustomKeyStoreInput) (req *request.Request, output *UpdateCustomKeyStoreOutput) { 7032 op := &request.Operation{ 7033 Name: opUpdateCustomKeyStore, 7034 HTTPMethod: "POST", 7035 HTTPPath: "/", 7036 } 7037 7038 if input == nil { 7039 input = &UpdateCustomKeyStoreInput{} 7040 } 7041 7042 output = &UpdateCustomKeyStoreOutput{} 7043 req = c.newRequest(op, input, output) 7044 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 7045 return 7046 } 7047 7048 // UpdateCustomKeyStore API operation for AWS Key Management Service. 7049 // 7050 // Changes the properties of a custom key store. Use the CustomKeyStoreId parameter 7051 // to identify the custom key store you want to edit. Use the remaining parameters 7052 // to change the properties of the custom key store. 7053 // 7054 // You can only update a custom key store that is disconnected. To disconnect 7055 // the custom key store, use DisconnectCustomKeyStore. To reconnect the custom 7056 // key store after the update completes, use ConnectCustomKeyStore. To find 7057 // the connection state of a custom key store, use the DescribeCustomKeyStores 7058 // operation. 7059 // 7060 // The CustomKeyStoreId parameter is required in all commands. Use the other 7061 // parameters of UpdateCustomKeyStore to edit your key store settings. 7062 // 7063 // * Use the NewCustomKeyStoreName parameter to change the friendly name 7064 // of the custom key store to the value that you specify. 7065 // 7066 // * Use the KeyStorePassword parameter tell KMS the current password of 7067 // the kmsuser crypto user (CU) (https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser) 7068 // in the associated CloudHSM cluster. You can use this parameter to fix 7069 // connection failures (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-password) 7070 // that occur when KMS cannot log into the associated cluster because the 7071 // kmsuser password has changed. This value does not change the password 7072 // in the CloudHSM cluster. 7073 // 7074 // * Use the CloudHsmClusterId parameter to associate the custom key store 7075 // with a different, but related, CloudHSM cluster. You can use this parameter 7076 // to repair a custom key store if its CloudHSM cluster becomes corrupted 7077 // or is deleted, or when you need to create or restore a cluster from a 7078 // backup. 7079 // 7080 // If the operation succeeds, it returns a JSON object with no properties. 7081 // 7082 // This operation is part of the Custom Key Store feature (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) 7083 // feature in KMS, which combines the convenience and extensive integration 7084 // of KMS with the isolation and control of a single-tenant key store. 7085 // 7086 // Cross-account use: No. You cannot perform this operation on a custom key 7087 // store in a different Amazon Web Services account. 7088 // 7089 // Required permissions: kms:UpdateCustomKeyStore (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 7090 // (IAM policy) 7091 // 7092 // Related operations: 7093 // 7094 // * ConnectCustomKeyStore 7095 // 7096 // * CreateCustomKeyStore 7097 // 7098 // * DeleteCustomKeyStore 7099 // 7100 // * DescribeCustomKeyStores 7101 // 7102 // * DisconnectCustomKeyStore 7103 // 7104 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 7105 // with awserr.Error's Code and Message methods to get detailed information about 7106 // the error. 7107 // 7108 // See the AWS API reference guide for AWS Key Management Service's 7109 // API operation UpdateCustomKeyStore for usage and error information. 7110 // 7111 // Returned Error Types: 7112 // * CustomKeyStoreNotFoundException 7113 // The request was rejected because KMS cannot find a custom key store with 7114 // the specified key store name or ID. 7115 // 7116 // * CustomKeyStoreNameInUseException 7117 // The request was rejected because the specified custom key store name is already 7118 // assigned to another custom key store in the account. Try again with a custom 7119 // key store name that is unique in the account. 7120 // 7121 // * CloudHsmClusterNotFoundException 7122 // The request was rejected because KMS cannot find the CloudHSM cluster with 7123 // the specified cluster ID. Retry the request with a different cluster ID. 7124 // 7125 // * CloudHsmClusterNotRelatedException 7126 // The request was rejected because the specified CloudHSM cluster has a different 7127 // cluster certificate than the original cluster. You cannot use the operation 7128 // to specify an unrelated cluster. 7129 // 7130 // Specify a cluster that shares a backup history with the original cluster. 7131 // This includes clusters that were created from a backup of the current cluster, 7132 // and clusters that were created from the same backup that produced the current 7133 // cluster. 7134 // 7135 // Clusters that share a backup history have the same cluster certificate. To 7136 // view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) 7137 // operation. 7138 // 7139 // * CustomKeyStoreInvalidStateException 7140 // The request was rejected because of the ConnectionState of the custom key 7141 // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores 7142 // operation. 7143 // 7144 // This exception is thrown under the following conditions: 7145 // 7146 // * You requested the CreateKey or GenerateRandom operation in a custom 7147 // key store that is not connected. These operations are valid only when 7148 // the custom key store ConnectionState is CONNECTED. 7149 // 7150 // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation 7151 // on a custom key store that is not disconnected. This operation is valid 7152 // only when the custom key store ConnectionState is DISCONNECTED. 7153 // 7154 // * You requested the ConnectCustomKeyStore operation on a custom key store 7155 // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid 7156 // for all other ConnectionState values. 7157 // 7158 // * InternalException 7159 // The request was rejected because an internal exception occurred. The request 7160 // can be retried. 7161 // 7162 // * CloudHsmClusterNotActiveException 7163 // The request was rejected because the CloudHSM cluster that is associated 7164 // with the custom key store is not active. Initialize and activate the cluster 7165 // and try the command again. For detailed instructions, see Getting Started 7166 // (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html) 7167 // in the CloudHSM User Guide. 7168 // 7169 // * CloudHsmClusterInvalidConfigurationException 7170 // The request was rejected because the associated CloudHSM cluster did not 7171 // meet the configuration requirements for a custom key store. 7172 // 7173 // * The cluster must be configured with private subnets in at least two 7174 // different Availability Zones in the Region. 7175 // 7176 // * The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html) 7177 // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound 7178 // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound 7179 // rules and the Destination in the outbound rules must match the security 7180 // group ID. These rules are set by default when you create the cluster. 7181 // Do not delete or change them. To get information about a particular security 7182 // group, use the DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) 7183 // operation. 7184 // 7185 // * The cluster must contain at least as many HSMs as the operation requires. 7186 // To add HSMs, use the CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html) 7187 // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey 7188 // operations, the CloudHSM cluster must have at least two active HSMs, each 7189 // in a different Availability Zone. For the ConnectCustomKeyStore operation, 7190 // the CloudHSM must contain at least one active HSM. 7191 // 7192 // For information about the requirements for an CloudHSM cluster that is associated 7193 // with a custom key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore) 7194 // in the Key Management Service Developer Guide. For information about creating 7195 // a private subnet for an CloudHSM cluster, see Create a Private Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html) 7196 // in the CloudHSM User Guide. For information about cluster security groups, 7197 // see Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html) 7198 // in the CloudHSM User Guide . 7199 // 7200 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateCustomKeyStore 7201 func (c *KMS) UpdateCustomKeyStore(input *UpdateCustomKeyStoreInput) (*UpdateCustomKeyStoreOutput, error) { 7202 req, out := c.UpdateCustomKeyStoreRequest(input) 7203 return out, req.Send() 7204 } 7205 7206 // UpdateCustomKeyStoreWithContext is the same as UpdateCustomKeyStore with the addition of 7207 // the ability to pass a context and additional request options. 7208 // 7209 // See UpdateCustomKeyStore for details on how to use this API operation. 7210 // 7211 // The context must be non-nil and will be used for request cancellation. If 7212 // the context is nil a panic will occur. In the future the SDK may create 7213 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 7214 // for more information on using Contexts. 7215 func (c *KMS) UpdateCustomKeyStoreWithContext(ctx aws.Context, input *UpdateCustomKeyStoreInput, opts ...request.Option) (*UpdateCustomKeyStoreOutput, error) { 7216 req, out := c.UpdateCustomKeyStoreRequest(input) 7217 req.SetContext(ctx) 7218 req.ApplyOptions(opts...) 7219 return out, req.Send() 7220 } 7221 7222 const opUpdateKeyDescription = "UpdateKeyDescription" 7223 7224 // UpdateKeyDescriptionRequest generates a "aws/request.Request" representing the 7225 // client's request for the UpdateKeyDescription operation. The "output" return 7226 // value will be populated with the request's response once the request completes 7227 // successfully. 7228 // 7229 // Use "Send" method on the returned Request to send the API call to the service. 7230 // the "output" return value is not valid until after Send returns without error. 7231 // 7232 // See UpdateKeyDescription for more information on using the UpdateKeyDescription 7233 // API call, and error handling. 7234 // 7235 // This method is useful when you want to inject custom logic or configuration 7236 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 7237 // 7238 // 7239 // // Example sending a request using the UpdateKeyDescriptionRequest method. 7240 // req, resp := client.UpdateKeyDescriptionRequest(params) 7241 // 7242 // err := req.Send() 7243 // if err == nil { // resp is now filled 7244 // fmt.Println(resp) 7245 // } 7246 // 7247 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateKeyDescription 7248 func (c *KMS) UpdateKeyDescriptionRequest(input *UpdateKeyDescriptionInput) (req *request.Request, output *UpdateKeyDescriptionOutput) { 7249 op := &request.Operation{ 7250 Name: opUpdateKeyDescription, 7251 HTTPMethod: "POST", 7252 HTTPPath: "/", 7253 } 7254 7255 if input == nil { 7256 input = &UpdateKeyDescriptionInput{} 7257 } 7258 7259 output = &UpdateKeyDescriptionOutput{} 7260 req = c.newRequest(op, input, output) 7261 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 7262 return 7263 } 7264 7265 // UpdateKeyDescription API operation for AWS Key Management Service. 7266 // 7267 // Updates the description of a KMS key. To see the description of a KMS key, 7268 // use DescribeKey. 7269 // 7270 // The KMS key that you use for this operation must be in a compatible key state. 7271 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 7272 // in the Key Management Service Developer Guide. 7273 // 7274 // Cross-account use: No. You cannot perform this operation on a KMS key in 7275 // a different Amazon Web Services account. 7276 // 7277 // Required permissions: kms:UpdateKeyDescription (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 7278 // (key policy) 7279 // 7280 // Related operations 7281 // 7282 // * CreateKey 7283 // 7284 // * DescribeKey 7285 // 7286 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 7287 // with awserr.Error's Code and Message methods to get detailed information about 7288 // the error. 7289 // 7290 // See the AWS API reference guide for AWS Key Management Service's 7291 // API operation UpdateKeyDescription for usage and error information. 7292 // 7293 // Returned Error Types: 7294 // * NotFoundException 7295 // The request was rejected because the specified entity or resource could not 7296 // be found. 7297 // 7298 // * InvalidArnException 7299 // The request was rejected because a specified ARN, or an ARN in a key policy, 7300 // is not valid. 7301 // 7302 // * DependencyTimeoutException 7303 // The system timed out while trying to fulfill the request. The request can 7304 // be retried. 7305 // 7306 // * InternalException 7307 // The request was rejected because an internal exception occurred. The request 7308 // can be retried. 7309 // 7310 // * InvalidStateException 7311 // The request was rejected because the state of the specified resource is not 7312 // valid for this request. 7313 // 7314 // For more information about how key state affects the use of a KMS key, see 7315 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 7316 // in the Key Management Service Developer Guide . 7317 // 7318 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateKeyDescription 7319 func (c *KMS) UpdateKeyDescription(input *UpdateKeyDescriptionInput) (*UpdateKeyDescriptionOutput, error) { 7320 req, out := c.UpdateKeyDescriptionRequest(input) 7321 return out, req.Send() 7322 } 7323 7324 // UpdateKeyDescriptionWithContext is the same as UpdateKeyDescription with the addition of 7325 // the ability to pass a context and additional request options. 7326 // 7327 // See UpdateKeyDescription for details on how to use this API operation. 7328 // 7329 // The context must be non-nil and will be used for request cancellation. If 7330 // the context is nil a panic will occur. In the future the SDK may create 7331 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 7332 // for more information on using Contexts. 7333 func (c *KMS) UpdateKeyDescriptionWithContext(ctx aws.Context, input *UpdateKeyDescriptionInput, opts ...request.Option) (*UpdateKeyDescriptionOutput, error) { 7334 req, out := c.UpdateKeyDescriptionRequest(input) 7335 req.SetContext(ctx) 7336 req.ApplyOptions(opts...) 7337 return out, req.Send() 7338 } 7339 7340 const opUpdatePrimaryRegion = "UpdatePrimaryRegion" 7341 7342 // UpdatePrimaryRegionRequest generates a "aws/request.Request" representing the 7343 // client's request for the UpdatePrimaryRegion operation. The "output" return 7344 // value will be populated with the request's response once the request completes 7345 // successfully. 7346 // 7347 // Use "Send" method on the returned Request to send the API call to the service. 7348 // the "output" return value is not valid until after Send returns without error. 7349 // 7350 // See UpdatePrimaryRegion for more information on using the UpdatePrimaryRegion 7351 // API call, and error handling. 7352 // 7353 // This method is useful when you want to inject custom logic or configuration 7354 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 7355 // 7356 // 7357 // // Example sending a request using the UpdatePrimaryRegionRequest method. 7358 // req, resp := client.UpdatePrimaryRegionRequest(params) 7359 // 7360 // err := req.Send() 7361 // if err == nil { // resp is now filled 7362 // fmt.Println(resp) 7363 // } 7364 // 7365 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdatePrimaryRegion 7366 func (c *KMS) UpdatePrimaryRegionRequest(input *UpdatePrimaryRegionInput) (req *request.Request, output *UpdatePrimaryRegionOutput) { 7367 op := &request.Operation{ 7368 Name: opUpdatePrimaryRegion, 7369 HTTPMethod: "POST", 7370 HTTPPath: "/", 7371 } 7372 7373 if input == nil { 7374 input = &UpdatePrimaryRegionInput{} 7375 } 7376 7377 output = &UpdatePrimaryRegionOutput{} 7378 req = c.newRequest(op, input, output) 7379 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 7380 return 7381 } 7382 7383 // UpdatePrimaryRegion API operation for AWS Key Management Service. 7384 // 7385 // Changes the primary key of a multi-Region key. 7386 // 7387 // This operation changes the replica key in the specified Region to a primary 7388 // key and changes the former primary key to a replica key. For example, suppose 7389 // you have a primary key in us-east-1 and a replica key in eu-west-2. If you 7390 // run UpdatePrimaryRegion with a PrimaryRegion value of eu-west-2, the primary 7391 // key is now the key in eu-west-2, and the key in us-east-1 becomes a replica 7392 // key. For details, see Updating the primary Region (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-update) 7393 // in the Key Management Service Developer Guide. 7394 // 7395 // This operation supports multi-Region keys, an KMS feature that lets you create 7396 // multiple interoperable KMS keys in different Amazon Web Services Regions. 7397 // Because these KMS keys have the same key ID, key material, and other metadata, 7398 // you can use them interchangeably to encrypt data in one Amazon Web Services 7399 // Region and decrypt it in a different Amazon Web Services Region without re-encrypting 7400 // the data or making a cross-Region call. For more information about multi-Region 7401 // keys, see Using multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) 7402 // in the Key Management Service Developer Guide. 7403 // 7404 // The primary key of a multi-Region key is the source for properties that are 7405 // always shared by primary and replica keys, including the key material, key 7406 // ID (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-id), 7407 // key spec (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-spec), 7408 // key usage (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-usage), 7409 // key material origin (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-origin), 7410 // and automatic key rotation (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html). 7411 // It's the only key that can be replicated. You cannot delete the primary key 7412 // (https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html) 7413 // until all replica keys are deleted. 7414 // 7415 // The key ID and primary Region that you specify uniquely identify the replica 7416 // key that will become the primary key. The primary Region must already have 7417 // a replica key. This operation does not create a KMS key in the specified 7418 // Region. To find the replica keys, use the DescribeKey operation on the primary 7419 // key or any replica key. To create a replica key, use the ReplicateKey operation. 7420 // 7421 // You can run this operation while using the affected multi-Region keys in 7422 // cryptographic operations. This operation should not delay, interrupt, or 7423 // cause failures in cryptographic operations. 7424 // 7425 // Even after this operation completes, the process of updating the primary 7426 // Region might still be in progress for a few more seconds. Operations such 7427 // as DescribeKey might display both the old and new primary keys as replicas. 7428 // The old and new primary keys have a transient key state of Updating. The 7429 // original key state is restored when the update is complete. While the key 7430 // state is Updating, you can use the keys in cryptographic operations, but 7431 // you cannot replicate the new primary key or perform certain management operations, 7432 // such as enabling or disabling these keys. For details about the Updating 7433 // key state, see Key state: Effect on your KMS key (kms/latest/developerguide/key-state.html) 7434 // in the Key Management Service Developer Guide. 7435 // 7436 // This operation does not return any output. To verify that primary key is 7437 // changed, use the DescribeKey operation. 7438 // 7439 // Cross-account use: No. You cannot use this operation in a different Amazon 7440 // Web Services account. 7441 // 7442 // Required permissions: 7443 // 7444 // * kms:UpdatePrimaryRegion on the current primary key (in the primary key's 7445 // Region). Include this permission primary key's key policy. 7446 // 7447 // * kms:UpdatePrimaryRegion on the current replica key (in the replica key's 7448 // Region). Include this permission in the replica key's key policy. 7449 // 7450 // Related operations 7451 // 7452 // * CreateKey 7453 // 7454 // * ReplicateKey 7455 // 7456 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 7457 // with awserr.Error's Code and Message methods to get detailed information about 7458 // the error. 7459 // 7460 // See the AWS API reference guide for AWS Key Management Service's 7461 // API operation UpdatePrimaryRegion for usage and error information. 7462 // 7463 // Returned Error Types: 7464 // * DisabledException 7465 // The request was rejected because the specified KMS key is not enabled. 7466 // 7467 // * InvalidArnException 7468 // The request was rejected because a specified ARN, or an ARN in a key policy, 7469 // is not valid. 7470 // 7471 // * InvalidStateException 7472 // The request was rejected because the state of the specified resource is not 7473 // valid for this request. 7474 // 7475 // For more information about how key state affects the use of a KMS key, see 7476 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 7477 // in the Key Management Service Developer Guide . 7478 // 7479 // * InternalException 7480 // The request was rejected because an internal exception occurred. The request 7481 // can be retried. 7482 // 7483 // * NotFoundException 7484 // The request was rejected because the specified entity or resource could not 7485 // be found. 7486 // 7487 // * UnsupportedOperationException 7488 // The request was rejected because a specified parameter is not supported or 7489 // a specified resource is not valid for this operation. 7490 // 7491 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdatePrimaryRegion 7492 func (c *KMS) UpdatePrimaryRegion(input *UpdatePrimaryRegionInput) (*UpdatePrimaryRegionOutput, error) { 7493 req, out := c.UpdatePrimaryRegionRequest(input) 7494 return out, req.Send() 7495 } 7496 7497 // UpdatePrimaryRegionWithContext is the same as UpdatePrimaryRegion with the addition of 7498 // the ability to pass a context and additional request options. 7499 // 7500 // See UpdatePrimaryRegion for details on how to use this API operation. 7501 // 7502 // The context must be non-nil and will be used for request cancellation. If 7503 // the context is nil a panic will occur. In the future the SDK may create 7504 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 7505 // for more information on using Contexts. 7506 func (c *KMS) UpdatePrimaryRegionWithContext(ctx aws.Context, input *UpdatePrimaryRegionInput, opts ...request.Option) (*UpdatePrimaryRegionOutput, error) { 7507 req, out := c.UpdatePrimaryRegionRequest(input) 7508 req.SetContext(ctx) 7509 req.ApplyOptions(opts...) 7510 return out, req.Send() 7511 } 7512 7513 const opVerify = "Verify" 7514 7515 // VerifyRequest generates a "aws/request.Request" representing the 7516 // client's request for the Verify operation. The "output" return 7517 // value will be populated with the request's response once the request completes 7518 // successfully. 7519 // 7520 // Use "Send" method on the returned Request to send the API call to the service. 7521 // the "output" return value is not valid until after Send returns without error. 7522 // 7523 // See Verify for more information on using the Verify 7524 // API call, and error handling. 7525 // 7526 // This method is useful when you want to inject custom logic or configuration 7527 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 7528 // 7529 // 7530 // // Example sending a request using the VerifyRequest method. 7531 // req, resp := client.VerifyRequest(params) 7532 // 7533 // err := req.Send() 7534 // if err == nil { // resp is now filled 7535 // fmt.Println(resp) 7536 // } 7537 // 7538 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Verify 7539 func (c *KMS) VerifyRequest(input *VerifyInput) (req *request.Request, output *VerifyOutput) { 7540 op := &request.Operation{ 7541 Name: opVerify, 7542 HTTPMethod: "POST", 7543 HTTPPath: "/", 7544 } 7545 7546 if input == nil { 7547 input = &VerifyInput{} 7548 } 7549 7550 output = &VerifyOutput{} 7551 req = c.newRequest(op, input, output) 7552 return 7553 } 7554 7555 // Verify API operation for AWS Key Management Service. 7556 // 7557 // Verifies a digital signature that was generated by the Sign operation. 7558 // 7559 // Verification confirms that an authorized user signed the message with the 7560 // specified KMS key and signing algorithm, and the message hasn't changed since 7561 // it was signed. If the signature is verified, the value of the SignatureValid 7562 // field in the response is True. If the signature verification fails, the Verify 7563 // operation fails with an KMSInvalidSignatureException exception. 7564 // 7565 // A digital signature is generated by using the private key in an asymmetric 7566 // KMS key. The signature is verified by using the public key in the same asymmetric 7567 // KMS key. For information about symmetric and asymmetric KMS keys, see Using 7568 // Symmetric and Asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) 7569 // in the Key Management Service Developer Guide. 7570 // 7571 // To verify a digital signature, you can use the Verify operation. Specify 7572 // the same asymmetric KMS key, message, and signing algorithm that were used 7573 // to produce the signature. 7574 // 7575 // You can also verify the digital signature by using the public key of the 7576 // KMS key outside of KMS. Use the GetPublicKey operation to download the public 7577 // key in the asymmetric KMS key and then use the public key to verify the signature 7578 // outside of KMS. The advantage of using the Verify operation is that it is 7579 // performed within KMS. As a result, it's easy to call, the operation is performed 7580 // within the FIPS boundary, it is logged in CloudTrail, and you can use key 7581 // policy and IAM policy to determine who is authorized to use the KMS key to 7582 // verify signatures. 7583 // 7584 // The KMS key that you use for this operation must be in a compatible key state. 7585 // For details, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 7586 // in the Key Management Service Developer Guide. 7587 // 7588 // Cross-account use: Yes. To perform this operation with a KMS key in a different 7589 // Amazon Web Services account, specify the key ARN or alias ARN in the value 7590 // of the KeyId parameter. 7591 // 7592 // Required permissions: kms:Verify (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 7593 // (key policy) 7594 // 7595 // Related operations: Sign 7596 // 7597 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 7598 // with awserr.Error's Code and Message methods to get detailed information about 7599 // the error. 7600 // 7601 // See the AWS API reference guide for AWS Key Management Service's 7602 // API operation Verify for usage and error information. 7603 // 7604 // Returned Error Types: 7605 // * NotFoundException 7606 // The request was rejected because the specified entity or resource could not 7607 // be found. 7608 // 7609 // * DisabledException 7610 // The request was rejected because the specified KMS key is not enabled. 7611 // 7612 // * KeyUnavailableException 7613 // The request was rejected because the specified KMS key was not available. 7614 // You can retry the request. 7615 // 7616 // * DependencyTimeoutException 7617 // The system timed out while trying to fulfill the request. The request can 7618 // be retried. 7619 // 7620 // * InvalidKeyUsageException 7621 // The request was rejected for one of the following reasons: 7622 // 7623 // * The KeyUsage value of the KMS key is incompatible with the API operation. 7624 // 7625 // * The encryption algorithm or signing algorithm specified for the operation 7626 // is incompatible with the type of key material in the KMS key (KeySpec). 7627 // 7628 // For encrypting, decrypting, re-encrypting, and generating data keys, the 7629 // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage 7630 // must be SIGN_VERIFY. To find the KeyUsage of a KMS key, use the DescribeKey 7631 // operation. 7632 // 7633 // To find the encryption or signing algorithms supported for a particular KMS 7634 // key, use the DescribeKey operation. 7635 // 7636 // * InvalidGrantTokenException 7637 // The request was rejected because the specified grant token is not valid. 7638 // 7639 // * InternalException 7640 // The request was rejected because an internal exception occurred. The request 7641 // can be retried. 7642 // 7643 // * InvalidStateException 7644 // The request was rejected because the state of the specified resource is not 7645 // valid for this request. 7646 // 7647 // For more information about how key state affects the use of a KMS key, see 7648 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 7649 // in the Key Management Service Developer Guide . 7650 // 7651 // * KMSInvalidSignatureException 7652 // The request was rejected because the signature verification failed. Signature 7653 // verification fails when it cannot confirm that signature was produced by 7654 // signing the specified message with the specified KMS key and signing algorithm. 7655 // 7656 // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Verify 7657 func (c *KMS) Verify(input *VerifyInput) (*VerifyOutput, error) { 7658 req, out := c.VerifyRequest(input) 7659 return out, req.Send() 7660 } 7661 7662 // VerifyWithContext is the same as Verify with the addition of 7663 // the ability to pass a context and additional request options. 7664 // 7665 // See Verify for details on how to use this API operation. 7666 // 7667 // The context must be non-nil and will be used for request cancellation. If 7668 // the context is nil a panic will occur. In the future the SDK may create 7669 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 7670 // for more information on using Contexts. 7671 func (c *KMS) VerifyWithContext(ctx aws.Context, input *VerifyInput, opts ...request.Option) (*VerifyOutput, error) { 7672 req, out := c.VerifyRequest(input) 7673 req.SetContext(ctx) 7674 req.ApplyOptions(opts...) 7675 return out, req.Send() 7676 } 7677 7678 // Contains information about an alias. 7679 type AliasListEntry struct { 7680 _ struct{} `type:"structure"` 7681 7682 // String that contains the key ARN. 7683 AliasArn *string `min:"20" type:"string"` 7684 7685 // String that contains the alias. This value begins with alias/. 7686 AliasName *string `min:"1" type:"string"` 7687 7688 // Date and time that the alias was most recently created in the account and 7689 // Region. Formatted as Unix time. 7690 CreationDate *time.Time `type:"timestamp"` 7691 7692 // Date and time that the alias was most recently associated with a KMS key 7693 // in the account and Region. Formatted as Unix time. 7694 LastUpdatedDate *time.Time `type:"timestamp"` 7695 7696 // String that contains the key identifier of the KMS key associated with the 7697 // alias. 7698 TargetKeyId *string `min:"1" type:"string"` 7699 } 7700 7701 // String returns the string representation. 7702 // 7703 // API parameter values that are decorated as "sensitive" in the API will not 7704 // be included in the string output. The member name will be present, but the 7705 // value will be replaced with "sensitive". 7706 func (s AliasListEntry) String() string { 7707 return awsutil.Prettify(s) 7708 } 7709 7710 // GoString returns the string representation. 7711 // 7712 // API parameter values that are decorated as "sensitive" in the API will not 7713 // be included in the string output. The member name will be present, but the 7714 // value will be replaced with "sensitive". 7715 func (s AliasListEntry) GoString() string { 7716 return s.String() 7717 } 7718 7719 // SetAliasArn sets the AliasArn field's value. 7720 func (s *AliasListEntry) SetAliasArn(v string) *AliasListEntry { 7721 s.AliasArn = &v 7722 return s 7723 } 7724 7725 // SetAliasName sets the AliasName field's value. 7726 func (s *AliasListEntry) SetAliasName(v string) *AliasListEntry { 7727 s.AliasName = &v 7728 return s 7729 } 7730 7731 // SetCreationDate sets the CreationDate field's value. 7732 func (s *AliasListEntry) SetCreationDate(v time.Time) *AliasListEntry { 7733 s.CreationDate = &v 7734 return s 7735 } 7736 7737 // SetLastUpdatedDate sets the LastUpdatedDate field's value. 7738 func (s *AliasListEntry) SetLastUpdatedDate(v time.Time) *AliasListEntry { 7739 s.LastUpdatedDate = &v 7740 return s 7741 } 7742 7743 // SetTargetKeyId sets the TargetKeyId field's value. 7744 func (s *AliasListEntry) SetTargetKeyId(v string) *AliasListEntry { 7745 s.TargetKeyId = &v 7746 return s 7747 } 7748 7749 // The request was rejected because it attempted to create a resource that already 7750 // exists. 7751 type AlreadyExistsException struct { 7752 _ struct{} `type:"structure"` 7753 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 7754 7755 Message_ *string `locationName:"message" type:"string"` 7756 } 7757 7758 // String returns the string representation. 7759 // 7760 // API parameter values that are decorated as "sensitive" in the API will not 7761 // be included in the string output. The member name will be present, but the 7762 // value will be replaced with "sensitive". 7763 func (s AlreadyExistsException) String() string { 7764 return awsutil.Prettify(s) 7765 } 7766 7767 // GoString returns the string representation. 7768 // 7769 // API parameter values that are decorated as "sensitive" in the API will not 7770 // be included in the string output. The member name will be present, but the 7771 // value will be replaced with "sensitive". 7772 func (s AlreadyExistsException) GoString() string { 7773 return s.String() 7774 } 7775 7776 func newErrorAlreadyExistsException(v protocol.ResponseMetadata) error { 7777 return &AlreadyExistsException{ 7778 RespMetadata: v, 7779 } 7780 } 7781 7782 // Code returns the exception type name. 7783 func (s *AlreadyExistsException) Code() string { 7784 return "AlreadyExistsException" 7785 } 7786 7787 // Message returns the exception's message. 7788 func (s *AlreadyExistsException) Message() string { 7789 if s.Message_ != nil { 7790 return *s.Message_ 7791 } 7792 return "" 7793 } 7794 7795 // OrigErr always returns nil, satisfies awserr.Error interface. 7796 func (s *AlreadyExistsException) OrigErr() error { 7797 return nil 7798 } 7799 7800 func (s *AlreadyExistsException) Error() string { 7801 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 7802 } 7803 7804 // Status code returns the HTTP status code for the request's response error. 7805 func (s *AlreadyExistsException) StatusCode() int { 7806 return s.RespMetadata.StatusCode 7807 } 7808 7809 // RequestID returns the service's response RequestID for request. 7810 func (s *AlreadyExistsException) RequestID() string { 7811 return s.RespMetadata.RequestID 7812 } 7813 7814 type CancelKeyDeletionInput struct { 7815 _ struct{} `type:"structure"` 7816 7817 // Identifies the KMS key whose deletion is being canceled. 7818 // 7819 // Specify the key ID or key ARN of the KMS key. 7820 // 7821 // For example: 7822 // 7823 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 7824 // 7825 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 7826 // 7827 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 7828 // 7829 // KeyId is a required field 7830 KeyId *string `min:"1" type:"string" required:"true"` 7831 } 7832 7833 // String returns the string representation. 7834 // 7835 // API parameter values that are decorated as "sensitive" in the API will not 7836 // be included in the string output. The member name will be present, but the 7837 // value will be replaced with "sensitive". 7838 func (s CancelKeyDeletionInput) String() string { 7839 return awsutil.Prettify(s) 7840 } 7841 7842 // GoString returns the string representation. 7843 // 7844 // API parameter values that are decorated as "sensitive" in the API will not 7845 // be included in the string output. The member name will be present, but the 7846 // value will be replaced with "sensitive". 7847 func (s CancelKeyDeletionInput) GoString() string { 7848 return s.String() 7849 } 7850 7851 // Validate inspects the fields of the type to determine if they are valid. 7852 func (s *CancelKeyDeletionInput) Validate() error { 7853 invalidParams := request.ErrInvalidParams{Context: "CancelKeyDeletionInput"} 7854 if s.KeyId == nil { 7855 invalidParams.Add(request.NewErrParamRequired("KeyId")) 7856 } 7857 if s.KeyId != nil && len(*s.KeyId) < 1 { 7858 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 7859 } 7860 7861 if invalidParams.Len() > 0 { 7862 return invalidParams 7863 } 7864 return nil 7865 } 7866 7867 // SetKeyId sets the KeyId field's value. 7868 func (s *CancelKeyDeletionInput) SetKeyId(v string) *CancelKeyDeletionInput { 7869 s.KeyId = &v 7870 return s 7871 } 7872 7873 type CancelKeyDeletionOutput struct { 7874 _ struct{} `type:"structure"` 7875 7876 // The Amazon Resource Name (key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN)) 7877 // of the KMS key whose deletion is canceled. 7878 KeyId *string `min:"1" type:"string"` 7879 } 7880 7881 // String returns the string representation. 7882 // 7883 // API parameter values that are decorated as "sensitive" in the API will not 7884 // be included in the string output. The member name will be present, but the 7885 // value will be replaced with "sensitive". 7886 func (s CancelKeyDeletionOutput) String() string { 7887 return awsutil.Prettify(s) 7888 } 7889 7890 // GoString returns the string representation. 7891 // 7892 // API parameter values that are decorated as "sensitive" in the API will not 7893 // be included in the string output. The member name will be present, but the 7894 // value will be replaced with "sensitive". 7895 func (s CancelKeyDeletionOutput) GoString() string { 7896 return s.String() 7897 } 7898 7899 // SetKeyId sets the KeyId field's value. 7900 func (s *CancelKeyDeletionOutput) SetKeyId(v string) *CancelKeyDeletionOutput { 7901 s.KeyId = &v 7902 return s 7903 } 7904 7905 // The request was rejected because the specified CloudHSM cluster is already 7906 // associated with a custom key store or it shares a backup history with a cluster 7907 // that is associated with a custom key store. Each custom key store must be 7908 // associated with a different CloudHSM cluster. 7909 // 7910 // Clusters that share a backup history have the same cluster certificate. To 7911 // view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) 7912 // operation. 7913 type CloudHsmClusterInUseException struct { 7914 _ struct{} `type:"structure"` 7915 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 7916 7917 Message_ *string `locationName:"message" type:"string"` 7918 } 7919 7920 // String returns the string representation. 7921 // 7922 // API parameter values that are decorated as "sensitive" in the API will not 7923 // be included in the string output. The member name will be present, but the 7924 // value will be replaced with "sensitive". 7925 func (s CloudHsmClusterInUseException) String() string { 7926 return awsutil.Prettify(s) 7927 } 7928 7929 // GoString returns the string representation. 7930 // 7931 // API parameter values that are decorated as "sensitive" in the API will not 7932 // be included in the string output. The member name will be present, but the 7933 // value will be replaced with "sensitive". 7934 func (s CloudHsmClusterInUseException) GoString() string { 7935 return s.String() 7936 } 7937 7938 func newErrorCloudHsmClusterInUseException(v protocol.ResponseMetadata) error { 7939 return &CloudHsmClusterInUseException{ 7940 RespMetadata: v, 7941 } 7942 } 7943 7944 // Code returns the exception type name. 7945 func (s *CloudHsmClusterInUseException) Code() string { 7946 return "CloudHsmClusterInUseException" 7947 } 7948 7949 // Message returns the exception's message. 7950 func (s *CloudHsmClusterInUseException) Message() string { 7951 if s.Message_ != nil { 7952 return *s.Message_ 7953 } 7954 return "" 7955 } 7956 7957 // OrigErr always returns nil, satisfies awserr.Error interface. 7958 func (s *CloudHsmClusterInUseException) OrigErr() error { 7959 return nil 7960 } 7961 7962 func (s *CloudHsmClusterInUseException) Error() string { 7963 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 7964 } 7965 7966 // Status code returns the HTTP status code for the request's response error. 7967 func (s *CloudHsmClusterInUseException) StatusCode() int { 7968 return s.RespMetadata.StatusCode 7969 } 7970 7971 // RequestID returns the service's response RequestID for request. 7972 func (s *CloudHsmClusterInUseException) RequestID() string { 7973 return s.RespMetadata.RequestID 7974 } 7975 7976 // The request was rejected because the associated CloudHSM cluster did not 7977 // meet the configuration requirements for a custom key store. 7978 // 7979 // * The cluster must be configured with private subnets in at least two 7980 // different Availability Zones in the Region. 7981 // 7982 // * The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html) 7983 // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound 7984 // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound 7985 // rules and the Destination in the outbound rules must match the security 7986 // group ID. These rules are set by default when you create the cluster. 7987 // Do not delete or change them. To get information about a particular security 7988 // group, use the DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) 7989 // operation. 7990 // 7991 // * The cluster must contain at least as many HSMs as the operation requires. 7992 // To add HSMs, use the CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html) 7993 // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey 7994 // operations, the CloudHSM cluster must have at least two active HSMs, each 7995 // in a different Availability Zone. For the ConnectCustomKeyStore operation, 7996 // the CloudHSM must contain at least one active HSM. 7997 // 7998 // For information about the requirements for an CloudHSM cluster that is associated 7999 // with a custom key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore) 8000 // in the Key Management Service Developer Guide. For information about creating 8001 // a private subnet for an CloudHSM cluster, see Create a Private Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html) 8002 // in the CloudHSM User Guide. For information about cluster security groups, 8003 // see Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html) 8004 // in the CloudHSM User Guide . 8005 type CloudHsmClusterInvalidConfigurationException struct { 8006 _ struct{} `type:"structure"` 8007 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 8008 8009 Message_ *string `locationName:"message" type:"string"` 8010 } 8011 8012 // String returns the string representation. 8013 // 8014 // API parameter values that are decorated as "sensitive" in the API will not 8015 // be included in the string output. The member name will be present, but the 8016 // value will be replaced with "sensitive". 8017 func (s CloudHsmClusterInvalidConfigurationException) String() string { 8018 return awsutil.Prettify(s) 8019 } 8020 8021 // GoString returns the string representation. 8022 // 8023 // API parameter values that are decorated as "sensitive" in the API will not 8024 // be included in the string output. The member name will be present, but the 8025 // value will be replaced with "sensitive". 8026 func (s CloudHsmClusterInvalidConfigurationException) GoString() string { 8027 return s.String() 8028 } 8029 8030 func newErrorCloudHsmClusterInvalidConfigurationException(v protocol.ResponseMetadata) error { 8031 return &CloudHsmClusterInvalidConfigurationException{ 8032 RespMetadata: v, 8033 } 8034 } 8035 8036 // Code returns the exception type name. 8037 func (s *CloudHsmClusterInvalidConfigurationException) Code() string { 8038 return "CloudHsmClusterInvalidConfigurationException" 8039 } 8040 8041 // Message returns the exception's message. 8042 func (s *CloudHsmClusterInvalidConfigurationException) Message() string { 8043 if s.Message_ != nil { 8044 return *s.Message_ 8045 } 8046 return "" 8047 } 8048 8049 // OrigErr always returns nil, satisfies awserr.Error interface. 8050 func (s *CloudHsmClusterInvalidConfigurationException) OrigErr() error { 8051 return nil 8052 } 8053 8054 func (s *CloudHsmClusterInvalidConfigurationException) Error() string { 8055 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 8056 } 8057 8058 // Status code returns the HTTP status code for the request's response error. 8059 func (s *CloudHsmClusterInvalidConfigurationException) StatusCode() int { 8060 return s.RespMetadata.StatusCode 8061 } 8062 8063 // RequestID returns the service's response RequestID for request. 8064 func (s *CloudHsmClusterInvalidConfigurationException) RequestID() string { 8065 return s.RespMetadata.RequestID 8066 } 8067 8068 // The request was rejected because the CloudHSM cluster that is associated 8069 // with the custom key store is not active. Initialize and activate the cluster 8070 // and try the command again. For detailed instructions, see Getting Started 8071 // (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html) 8072 // in the CloudHSM User Guide. 8073 type CloudHsmClusterNotActiveException struct { 8074 _ struct{} `type:"structure"` 8075 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 8076 8077 Message_ *string `locationName:"message" type:"string"` 8078 } 8079 8080 // String returns the string representation. 8081 // 8082 // API parameter values that are decorated as "sensitive" in the API will not 8083 // be included in the string output. The member name will be present, but the 8084 // value will be replaced with "sensitive". 8085 func (s CloudHsmClusterNotActiveException) String() string { 8086 return awsutil.Prettify(s) 8087 } 8088 8089 // GoString returns the string representation. 8090 // 8091 // API parameter values that are decorated as "sensitive" in the API will not 8092 // be included in the string output. The member name will be present, but the 8093 // value will be replaced with "sensitive". 8094 func (s CloudHsmClusterNotActiveException) GoString() string { 8095 return s.String() 8096 } 8097 8098 func newErrorCloudHsmClusterNotActiveException(v protocol.ResponseMetadata) error { 8099 return &CloudHsmClusterNotActiveException{ 8100 RespMetadata: v, 8101 } 8102 } 8103 8104 // Code returns the exception type name. 8105 func (s *CloudHsmClusterNotActiveException) Code() string { 8106 return "CloudHsmClusterNotActiveException" 8107 } 8108 8109 // Message returns the exception's message. 8110 func (s *CloudHsmClusterNotActiveException) Message() string { 8111 if s.Message_ != nil { 8112 return *s.Message_ 8113 } 8114 return "" 8115 } 8116 8117 // OrigErr always returns nil, satisfies awserr.Error interface. 8118 func (s *CloudHsmClusterNotActiveException) OrigErr() error { 8119 return nil 8120 } 8121 8122 func (s *CloudHsmClusterNotActiveException) Error() string { 8123 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 8124 } 8125 8126 // Status code returns the HTTP status code for the request's response error. 8127 func (s *CloudHsmClusterNotActiveException) StatusCode() int { 8128 return s.RespMetadata.StatusCode 8129 } 8130 8131 // RequestID returns the service's response RequestID for request. 8132 func (s *CloudHsmClusterNotActiveException) RequestID() string { 8133 return s.RespMetadata.RequestID 8134 } 8135 8136 // The request was rejected because KMS cannot find the CloudHSM cluster with 8137 // the specified cluster ID. Retry the request with a different cluster ID. 8138 type CloudHsmClusterNotFoundException struct { 8139 _ struct{} `type:"structure"` 8140 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 8141 8142 Message_ *string `locationName:"message" type:"string"` 8143 } 8144 8145 // String returns the string representation. 8146 // 8147 // API parameter values that are decorated as "sensitive" in the API will not 8148 // be included in the string output. The member name will be present, but the 8149 // value will be replaced with "sensitive". 8150 func (s CloudHsmClusterNotFoundException) String() string { 8151 return awsutil.Prettify(s) 8152 } 8153 8154 // GoString returns the string representation. 8155 // 8156 // API parameter values that are decorated as "sensitive" in the API will not 8157 // be included in the string output. The member name will be present, but the 8158 // value will be replaced with "sensitive". 8159 func (s CloudHsmClusterNotFoundException) GoString() string { 8160 return s.String() 8161 } 8162 8163 func newErrorCloudHsmClusterNotFoundException(v protocol.ResponseMetadata) error { 8164 return &CloudHsmClusterNotFoundException{ 8165 RespMetadata: v, 8166 } 8167 } 8168 8169 // Code returns the exception type name. 8170 func (s *CloudHsmClusterNotFoundException) Code() string { 8171 return "CloudHsmClusterNotFoundException" 8172 } 8173 8174 // Message returns the exception's message. 8175 func (s *CloudHsmClusterNotFoundException) Message() string { 8176 if s.Message_ != nil { 8177 return *s.Message_ 8178 } 8179 return "" 8180 } 8181 8182 // OrigErr always returns nil, satisfies awserr.Error interface. 8183 func (s *CloudHsmClusterNotFoundException) OrigErr() error { 8184 return nil 8185 } 8186 8187 func (s *CloudHsmClusterNotFoundException) Error() string { 8188 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 8189 } 8190 8191 // Status code returns the HTTP status code for the request's response error. 8192 func (s *CloudHsmClusterNotFoundException) StatusCode() int { 8193 return s.RespMetadata.StatusCode 8194 } 8195 8196 // RequestID returns the service's response RequestID for request. 8197 func (s *CloudHsmClusterNotFoundException) RequestID() string { 8198 return s.RespMetadata.RequestID 8199 } 8200 8201 // The request was rejected because the specified CloudHSM cluster has a different 8202 // cluster certificate than the original cluster. You cannot use the operation 8203 // to specify an unrelated cluster. 8204 // 8205 // Specify a cluster that shares a backup history with the original cluster. 8206 // This includes clusters that were created from a backup of the current cluster, 8207 // and clusters that were created from the same backup that produced the current 8208 // cluster. 8209 // 8210 // Clusters that share a backup history have the same cluster certificate. To 8211 // view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) 8212 // operation. 8213 type CloudHsmClusterNotRelatedException struct { 8214 _ struct{} `type:"structure"` 8215 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 8216 8217 Message_ *string `locationName:"message" type:"string"` 8218 } 8219 8220 // String returns the string representation. 8221 // 8222 // API parameter values that are decorated as "sensitive" in the API will not 8223 // be included in the string output. The member name will be present, but the 8224 // value will be replaced with "sensitive". 8225 func (s CloudHsmClusterNotRelatedException) String() string { 8226 return awsutil.Prettify(s) 8227 } 8228 8229 // GoString returns the string representation. 8230 // 8231 // API parameter values that are decorated as "sensitive" in the API will not 8232 // be included in the string output. The member name will be present, but the 8233 // value will be replaced with "sensitive". 8234 func (s CloudHsmClusterNotRelatedException) GoString() string { 8235 return s.String() 8236 } 8237 8238 func newErrorCloudHsmClusterNotRelatedException(v protocol.ResponseMetadata) error { 8239 return &CloudHsmClusterNotRelatedException{ 8240 RespMetadata: v, 8241 } 8242 } 8243 8244 // Code returns the exception type name. 8245 func (s *CloudHsmClusterNotRelatedException) Code() string { 8246 return "CloudHsmClusterNotRelatedException" 8247 } 8248 8249 // Message returns the exception's message. 8250 func (s *CloudHsmClusterNotRelatedException) Message() string { 8251 if s.Message_ != nil { 8252 return *s.Message_ 8253 } 8254 return "" 8255 } 8256 8257 // OrigErr always returns nil, satisfies awserr.Error interface. 8258 func (s *CloudHsmClusterNotRelatedException) OrigErr() error { 8259 return nil 8260 } 8261 8262 func (s *CloudHsmClusterNotRelatedException) Error() string { 8263 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 8264 } 8265 8266 // Status code returns the HTTP status code for the request's response error. 8267 func (s *CloudHsmClusterNotRelatedException) StatusCode() int { 8268 return s.RespMetadata.StatusCode 8269 } 8270 8271 // RequestID returns the service's response RequestID for request. 8272 func (s *CloudHsmClusterNotRelatedException) RequestID() string { 8273 return s.RespMetadata.RequestID 8274 } 8275 8276 type ConnectCustomKeyStoreInput struct { 8277 _ struct{} `type:"structure"` 8278 8279 // Enter the key store ID of the custom key store that you want to connect. 8280 // To find the ID of a custom key store, use the DescribeCustomKeyStores operation. 8281 // 8282 // CustomKeyStoreId is a required field 8283 CustomKeyStoreId *string `min:"1" type:"string" required:"true"` 8284 } 8285 8286 // String returns the string representation. 8287 // 8288 // API parameter values that are decorated as "sensitive" in the API will not 8289 // be included in the string output. The member name will be present, but the 8290 // value will be replaced with "sensitive". 8291 func (s ConnectCustomKeyStoreInput) String() string { 8292 return awsutil.Prettify(s) 8293 } 8294 8295 // GoString returns the string representation. 8296 // 8297 // API parameter values that are decorated as "sensitive" in the API will not 8298 // be included in the string output. The member name will be present, but the 8299 // value will be replaced with "sensitive". 8300 func (s ConnectCustomKeyStoreInput) GoString() string { 8301 return s.String() 8302 } 8303 8304 // Validate inspects the fields of the type to determine if they are valid. 8305 func (s *ConnectCustomKeyStoreInput) Validate() error { 8306 invalidParams := request.ErrInvalidParams{Context: "ConnectCustomKeyStoreInput"} 8307 if s.CustomKeyStoreId == nil { 8308 invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreId")) 8309 } 8310 if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { 8311 invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) 8312 } 8313 8314 if invalidParams.Len() > 0 { 8315 return invalidParams 8316 } 8317 return nil 8318 } 8319 8320 // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. 8321 func (s *ConnectCustomKeyStoreInput) SetCustomKeyStoreId(v string) *ConnectCustomKeyStoreInput { 8322 s.CustomKeyStoreId = &v 8323 return s 8324 } 8325 8326 type ConnectCustomKeyStoreOutput struct { 8327 _ struct{} `type:"structure"` 8328 } 8329 8330 // String returns the string representation. 8331 // 8332 // API parameter values that are decorated as "sensitive" in the API will not 8333 // be included in the string output. The member name will be present, but the 8334 // value will be replaced with "sensitive". 8335 func (s ConnectCustomKeyStoreOutput) String() string { 8336 return awsutil.Prettify(s) 8337 } 8338 8339 // GoString returns the string representation. 8340 // 8341 // API parameter values that are decorated as "sensitive" in the API will not 8342 // be included in the string output. The member name will be present, but the 8343 // value will be replaced with "sensitive". 8344 func (s ConnectCustomKeyStoreOutput) GoString() string { 8345 return s.String() 8346 } 8347 8348 type CreateAliasInput struct { 8349 _ struct{} `type:"structure"` 8350 8351 // Specifies the alias name. This value must begin with alias/ followed by a 8352 // name, such as alias/ExampleAlias. 8353 // 8354 // The AliasName value must be string of 1-256 characters. It can contain only 8355 // alphanumeric characters, forward slashes (/), underscores (_), and dashes 8356 // (-). The alias name cannot begin with alias/aws/. The alias/aws/ prefix is 8357 // reserved for Amazon Web Services managed keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). 8358 // 8359 // AliasName is a required field 8360 AliasName *string `min:"1" type:"string" required:"true"` 8361 8362 // Associates the alias with the specified customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk). 8363 // The KMS key must be in the same Amazon Web Services Region. 8364 // 8365 // A valid key ID is required. If you supply a null or empty string value, this 8366 // operation returns an error. 8367 // 8368 // For help finding the key ID and ARN, see Finding the Key ID and ARN (https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn) 8369 // in the Key Management Service Developer Guide . 8370 // 8371 // Specify the key ID or key ARN of the KMS key. 8372 // 8373 // For example: 8374 // 8375 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 8376 // 8377 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 8378 // 8379 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 8380 // 8381 // TargetKeyId is a required field 8382 TargetKeyId *string `min:"1" type:"string" required:"true"` 8383 } 8384 8385 // String returns the string representation. 8386 // 8387 // API parameter values that are decorated as "sensitive" in the API will not 8388 // be included in the string output. The member name will be present, but the 8389 // value will be replaced with "sensitive". 8390 func (s CreateAliasInput) String() string { 8391 return awsutil.Prettify(s) 8392 } 8393 8394 // GoString returns the string representation. 8395 // 8396 // API parameter values that are decorated as "sensitive" in the API will not 8397 // be included in the string output. The member name will be present, but the 8398 // value will be replaced with "sensitive". 8399 func (s CreateAliasInput) GoString() string { 8400 return s.String() 8401 } 8402 8403 // Validate inspects the fields of the type to determine if they are valid. 8404 func (s *CreateAliasInput) Validate() error { 8405 invalidParams := request.ErrInvalidParams{Context: "CreateAliasInput"} 8406 if s.AliasName == nil { 8407 invalidParams.Add(request.NewErrParamRequired("AliasName")) 8408 } 8409 if s.AliasName != nil && len(*s.AliasName) < 1 { 8410 invalidParams.Add(request.NewErrParamMinLen("AliasName", 1)) 8411 } 8412 if s.TargetKeyId == nil { 8413 invalidParams.Add(request.NewErrParamRequired("TargetKeyId")) 8414 } 8415 if s.TargetKeyId != nil && len(*s.TargetKeyId) < 1 { 8416 invalidParams.Add(request.NewErrParamMinLen("TargetKeyId", 1)) 8417 } 8418 8419 if invalidParams.Len() > 0 { 8420 return invalidParams 8421 } 8422 return nil 8423 } 8424 8425 // SetAliasName sets the AliasName field's value. 8426 func (s *CreateAliasInput) SetAliasName(v string) *CreateAliasInput { 8427 s.AliasName = &v 8428 return s 8429 } 8430 8431 // SetTargetKeyId sets the TargetKeyId field's value. 8432 func (s *CreateAliasInput) SetTargetKeyId(v string) *CreateAliasInput { 8433 s.TargetKeyId = &v 8434 return s 8435 } 8436 8437 type CreateAliasOutput struct { 8438 _ struct{} `type:"structure"` 8439 } 8440 8441 // String returns the string representation. 8442 // 8443 // API parameter values that are decorated as "sensitive" in the API will not 8444 // be included in the string output. The member name will be present, but the 8445 // value will be replaced with "sensitive". 8446 func (s CreateAliasOutput) String() string { 8447 return awsutil.Prettify(s) 8448 } 8449 8450 // GoString returns the string representation. 8451 // 8452 // API parameter values that are decorated as "sensitive" in the API will not 8453 // be included in the string output. The member name will be present, but the 8454 // value will be replaced with "sensitive". 8455 func (s CreateAliasOutput) GoString() string { 8456 return s.String() 8457 } 8458 8459 type CreateCustomKeyStoreInput struct { 8460 _ struct{} `type:"structure"` 8461 8462 // Identifies the CloudHSM cluster for the custom key store. Enter the cluster 8463 // ID of any active CloudHSM cluster that is not already associated with a custom 8464 // key store. To find the cluster ID, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) 8465 // operation. 8466 // 8467 // CloudHsmClusterId is a required field 8468 CloudHsmClusterId *string `min:"19" type:"string" required:"true"` 8469 8470 // Specifies a friendly name for the custom key store. The name must be unique 8471 // in your Amazon Web Services account. 8472 // 8473 // CustomKeyStoreName is a required field 8474 CustomKeyStoreName *string `min:"1" type:"string" required:"true"` 8475 8476 // Enter the password of the kmsuser crypto user (CU) account (https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser) 8477 // in the specified CloudHSM cluster. KMS logs into the cluster as this user 8478 // to manage key material on your behalf. 8479 // 8480 // The password must be a string of 7 to 32 characters. Its value is case sensitive. 8481 // 8482 // This parameter tells KMS the kmsuser account password; it does not change 8483 // the password in the CloudHSM cluster. 8484 // 8485 // KeyStorePassword is a sensitive parameter and its value will be 8486 // replaced with "sensitive" in string returned by CreateCustomKeyStoreInput's 8487 // String and GoString methods. 8488 // 8489 // KeyStorePassword is a required field 8490 KeyStorePassword *string `min:"7" type:"string" required:"true" sensitive:"true"` 8491 8492 // Enter the content of the trust anchor certificate for the cluster. This is 8493 // the content of the customerCA.crt file that you created when you initialized 8494 // the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html). 8495 // 8496 // TrustAnchorCertificate is a required field 8497 TrustAnchorCertificate *string `min:"1" type:"string" required:"true"` 8498 } 8499 8500 // String returns the string representation. 8501 // 8502 // API parameter values that are decorated as "sensitive" in the API will not 8503 // be included in the string output. The member name will be present, but the 8504 // value will be replaced with "sensitive". 8505 func (s CreateCustomKeyStoreInput) String() string { 8506 return awsutil.Prettify(s) 8507 } 8508 8509 // GoString returns the string representation. 8510 // 8511 // API parameter values that are decorated as "sensitive" in the API will not 8512 // be included in the string output. The member name will be present, but the 8513 // value will be replaced with "sensitive". 8514 func (s CreateCustomKeyStoreInput) GoString() string { 8515 return s.String() 8516 } 8517 8518 // Validate inspects the fields of the type to determine if they are valid. 8519 func (s *CreateCustomKeyStoreInput) Validate() error { 8520 invalidParams := request.ErrInvalidParams{Context: "CreateCustomKeyStoreInput"} 8521 if s.CloudHsmClusterId == nil { 8522 invalidParams.Add(request.NewErrParamRequired("CloudHsmClusterId")) 8523 } 8524 if s.CloudHsmClusterId != nil && len(*s.CloudHsmClusterId) < 19 { 8525 invalidParams.Add(request.NewErrParamMinLen("CloudHsmClusterId", 19)) 8526 } 8527 if s.CustomKeyStoreName == nil { 8528 invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreName")) 8529 } 8530 if s.CustomKeyStoreName != nil && len(*s.CustomKeyStoreName) < 1 { 8531 invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreName", 1)) 8532 } 8533 if s.KeyStorePassword == nil { 8534 invalidParams.Add(request.NewErrParamRequired("KeyStorePassword")) 8535 } 8536 if s.KeyStorePassword != nil && len(*s.KeyStorePassword) < 7 { 8537 invalidParams.Add(request.NewErrParamMinLen("KeyStorePassword", 7)) 8538 } 8539 if s.TrustAnchorCertificate == nil { 8540 invalidParams.Add(request.NewErrParamRequired("TrustAnchorCertificate")) 8541 } 8542 if s.TrustAnchorCertificate != nil && len(*s.TrustAnchorCertificate) < 1 { 8543 invalidParams.Add(request.NewErrParamMinLen("TrustAnchorCertificate", 1)) 8544 } 8545 8546 if invalidParams.Len() > 0 { 8547 return invalidParams 8548 } 8549 return nil 8550 } 8551 8552 // SetCloudHsmClusterId sets the CloudHsmClusterId field's value. 8553 func (s *CreateCustomKeyStoreInput) SetCloudHsmClusterId(v string) *CreateCustomKeyStoreInput { 8554 s.CloudHsmClusterId = &v 8555 return s 8556 } 8557 8558 // SetCustomKeyStoreName sets the CustomKeyStoreName field's value. 8559 func (s *CreateCustomKeyStoreInput) SetCustomKeyStoreName(v string) *CreateCustomKeyStoreInput { 8560 s.CustomKeyStoreName = &v 8561 return s 8562 } 8563 8564 // SetKeyStorePassword sets the KeyStorePassword field's value. 8565 func (s *CreateCustomKeyStoreInput) SetKeyStorePassword(v string) *CreateCustomKeyStoreInput { 8566 s.KeyStorePassword = &v 8567 return s 8568 } 8569 8570 // SetTrustAnchorCertificate sets the TrustAnchorCertificate field's value. 8571 func (s *CreateCustomKeyStoreInput) SetTrustAnchorCertificate(v string) *CreateCustomKeyStoreInput { 8572 s.TrustAnchorCertificate = &v 8573 return s 8574 } 8575 8576 type CreateCustomKeyStoreOutput struct { 8577 _ struct{} `type:"structure"` 8578 8579 // A unique identifier for the new custom key store. 8580 CustomKeyStoreId *string `min:"1" type:"string"` 8581 } 8582 8583 // String returns the string representation. 8584 // 8585 // API parameter values that are decorated as "sensitive" in the API will not 8586 // be included in the string output. The member name will be present, but the 8587 // value will be replaced with "sensitive". 8588 func (s CreateCustomKeyStoreOutput) String() string { 8589 return awsutil.Prettify(s) 8590 } 8591 8592 // GoString returns the string representation. 8593 // 8594 // API parameter values that are decorated as "sensitive" in the API will not 8595 // be included in the string output. The member name will be present, but the 8596 // value will be replaced with "sensitive". 8597 func (s CreateCustomKeyStoreOutput) GoString() string { 8598 return s.String() 8599 } 8600 8601 // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. 8602 func (s *CreateCustomKeyStoreOutput) SetCustomKeyStoreId(v string) *CreateCustomKeyStoreOutput { 8603 s.CustomKeyStoreId = &v 8604 return s 8605 } 8606 8607 type CreateGrantInput struct { 8608 _ struct{} `type:"structure"` 8609 8610 // Specifies a grant constraint. 8611 // 8612 // KMS supports the EncryptionContextEquals and EncryptionContextSubset grant 8613 // constraints. Each constraint value can include up to 8 encryption context 8614 // pairs. The encryption context value in each constraint cannot exceed 384 8615 // characters. 8616 // 8617 // These grant constraints allow the permissions in the grant only when the 8618 // encryption context in the request matches (EncryptionContextEquals) or includes 8619 // (EncryptionContextSubset) the encryption context specified in this structure. 8620 // For information about grant constraints, see Using grant constraints (https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints) 8621 // in the Key Management Service Developer Guide. For more information about 8622 // encryption context, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 8623 // in the Key Management Service Developer Guide . 8624 // 8625 // The encryption context grant constraints are supported only on operations 8626 // that include an encryption context. You cannot use an encryption context 8627 // grant constraint for cryptographic operations with asymmetric KMS keys or 8628 // for management operations, such as DescribeKey or RetireGrant. 8629 Constraints *GrantConstraints `type:"structure"` 8630 8631 // A list of grant tokens. 8632 // 8633 // Use a grant token when your permission to call this operation comes from 8634 // a new grant that has not yet achieved eventual consistency. For more information, 8635 // see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) 8636 // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) 8637 // in the Key Management Service Developer Guide. 8638 GrantTokens []*string `type:"list"` 8639 8640 // The identity that gets the permissions specified in the grant. 8641 // 8642 // To specify the principal, use the Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) 8643 // of an Amazon Web Services principal. Valid Amazon Web Services principals 8644 // include Amazon Web Services accounts (root), IAM users, IAM roles, federated 8645 // users, and assumed role users. For examples of the ARN syntax to use for 8646 // specifying a principal, see Amazon Web Services Identity and Access Management 8647 // (IAM) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam) 8648 // in the Example ARNs section of the Amazon Web Services General Reference. 8649 // 8650 // GranteePrincipal is a required field 8651 GranteePrincipal *string `min:"1" type:"string" required:"true"` 8652 8653 // Identifies the KMS key for the grant. The grant gives principals permission 8654 // to use this KMS key. 8655 // 8656 // Specify the key ID or key ARN of the KMS key. To specify a KMS key in a different 8657 // Amazon Web Services account, you must use the key ARN. 8658 // 8659 // For example: 8660 // 8661 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 8662 // 8663 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 8664 // 8665 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 8666 // 8667 // KeyId is a required field 8668 KeyId *string `min:"1" type:"string" required:"true"` 8669 8670 // A friendly name for the grant. Use this value to prevent the unintended creation 8671 // of duplicate grants when retrying this request. 8672 // 8673 // When this value is absent, all CreateGrant requests result in a new grant 8674 // with a unique GrantId even if all the supplied parameters are identical. 8675 // This can result in unintended duplicates when you retry the CreateGrant request. 8676 // 8677 // When this value is present, you can retry a CreateGrant request with identical 8678 // parameters; if the grant already exists, the original GrantId is returned 8679 // without creating a new grant. Note that the returned grant token is unique 8680 // with every CreateGrant request, even when a duplicate GrantId is returned. 8681 // All grant tokens for the same grant ID can be used interchangeably. 8682 Name *string `min:"1" type:"string"` 8683 8684 // A list of operations that the grant permits. 8685 // 8686 // The operation must be supported on the KMS key. For example, you cannot create 8687 // a grant for a symmetric KMS key that allows the Sign operation, or a grant 8688 // for an asymmetric KMS key that allows the GenerateDataKey operation. If you 8689 // try, KMS returns a ValidationError exception. For details, see Grant operations 8690 // (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations) 8691 // in the Key Management Service Developer Guide. 8692 // 8693 // Operations is a required field 8694 Operations []*string `type:"list" required:"true"` 8695 8696 // The principal that has permission to use the RetireGrant operation to retire 8697 // the grant. 8698 // 8699 // To specify the principal, use the Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) 8700 // of an Amazon Web Services principal. Valid Amazon Web Services principals 8701 // include Amazon Web Services accounts (root), IAM users, federated users, 8702 // and assumed role users. For examples of the ARN syntax to use for specifying 8703 // a principal, see Amazon Web Services Identity and Access Management (IAM) 8704 // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam) 8705 // in the Example ARNs section of the Amazon Web Services General Reference. 8706 // 8707 // The grant determines the retiring principal. Other principals might have 8708 // permission to retire the grant or revoke the grant. For details, see RevokeGrant 8709 // and Retiring and revoking grants (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete) 8710 // in the Key Management Service Developer Guide. 8711 RetiringPrincipal *string `min:"1" type:"string"` 8712 } 8713 8714 // String returns the string representation. 8715 // 8716 // API parameter values that are decorated as "sensitive" in the API will not 8717 // be included in the string output. The member name will be present, but the 8718 // value will be replaced with "sensitive". 8719 func (s CreateGrantInput) String() string { 8720 return awsutil.Prettify(s) 8721 } 8722 8723 // GoString returns the string representation. 8724 // 8725 // API parameter values that are decorated as "sensitive" in the API will not 8726 // be included in the string output. The member name will be present, but the 8727 // value will be replaced with "sensitive". 8728 func (s CreateGrantInput) GoString() string { 8729 return s.String() 8730 } 8731 8732 // Validate inspects the fields of the type to determine if they are valid. 8733 func (s *CreateGrantInput) Validate() error { 8734 invalidParams := request.ErrInvalidParams{Context: "CreateGrantInput"} 8735 if s.GranteePrincipal == nil { 8736 invalidParams.Add(request.NewErrParamRequired("GranteePrincipal")) 8737 } 8738 if s.GranteePrincipal != nil && len(*s.GranteePrincipal) < 1 { 8739 invalidParams.Add(request.NewErrParamMinLen("GranteePrincipal", 1)) 8740 } 8741 if s.KeyId == nil { 8742 invalidParams.Add(request.NewErrParamRequired("KeyId")) 8743 } 8744 if s.KeyId != nil && len(*s.KeyId) < 1 { 8745 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 8746 } 8747 if s.Name != nil && len(*s.Name) < 1 { 8748 invalidParams.Add(request.NewErrParamMinLen("Name", 1)) 8749 } 8750 if s.Operations == nil { 8751 invalidParams.Add(request.NewErrParamRequired("Operations")) 8752 } 8753 if s.RetiringPrincipal != nil && len(*s.RetiringPrincipal) < 1 { 8754 invalidParams.Add(request.NewErrParamMinLen("RetiringPrincipal", 1)) 8755 } 8756 8757 if invalidParams.Len() > 0 { 8758 return invalidParams 8759 } 8760 return nil 8761 } 8762 8763 // SetConstraints sets the Constraints field's value. 8764 func (s *CreateGrantInput) SetConstraints(v *GrantConstraints) *CreateGrantInput { 8765 s.Constraints = v 8766 return s 8767 } 8768 8769 // SetGrantTokens sets the GrantTokens field's value. 8770 func (s *CreateGrantInput) SetGrantTokens(v []*string) *CreateGrantInput { 8771 s.GrantTokens = v 8772 return s 8773 } 8774 8775 // SetGranteePrincipal sets the GranteePrincipal field's value. 8776 func (s *CreateGrantInput) SetGranteePrincipal(v string) *CreateGrantInput { 8777 s.GranteePrincipal = &v 8778 return s 8779 } 8780 8781 // SetKeyId sets the KeyId field's value. 8782 func (s *CreateGrantInput) SetKeyId(v string) *CreateGrantInput { 8783 s.KeyId = &v 8784 return s 8785 } 8786 8787 // SetName sets the Name field's value. 8788 func (s *CreateGrantInput) SetName(v string) *CreateGrantInput { 8789 s.Name = &v 8790 return s 8791 } 8792 8793 // SetOperations sets the Operations field's value. 8794 func (s *CreateGrantInput) SetOperations(v []*string) *CreateGrantInput { 8795 s.Operations = v 8796 return s 8797 } 8798 8799 // SetRetiringPrincipal sets the RetiringPrincipal field's value. 8800 func (s *CreateGrantInput) SetRetiringPrincipal(v string) *CreateGrantInput { 8801 s.RetiringPrincipal = &v 8802 return s 8803 } 8804 8805 type CreateGrantOutput struct { 8806 _ struct{} `type:"structure"` 8807 8808 // The unique identifier for the grant. 8809 // 8810 // You can use the GrantId in a ListGrants, RetireGrant, or RevokeGrant operation. 8811 GrantId *string `min:"1" type:"string"` 8812 8813 // The grant token. 8814 // 8815 // Use a grant token when your permission to call this operation comes from 8816 // a new grant that has not yet achieved eventual consistency. For more information, 8817 // see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) 8818 // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) 8819 // in the Key Management Service Developer Guide. 8820 GrantToken *string `min:"1" type:"string"` 8821 } 8822 8823 // String returns the string representation. 8824 // 8825 // API parameter values that are decorated as "sensitive" in the API will not 8826 // be included in the string output. The member name will be present, but the 8827 // value will be replaced with "sensitive". 8828 func (s CreateGrantOutput) String() string { 8829 return awsutil.Prettify(s) 8830 } 8831 8832 // GoString returns the string representation. 8833 // 8834 // API parameter values that are decorated as "sensitive" in the API will not 8835 // be included in the string output. The member name will be present, but the 8836 // value will be replaced with "sensitive". 8837 func (s CreateGrantOutput) GoString() string { 8838 return s.String() 8839 } 8840 8841 // SetGrantId sets the GrantId field's value. 8842 func (s *CreateGrantOutput) SetGrantId(v string) *CreateGrantOutput { 8843 s.GrantId = &v 8844 return s 8845 } 8846 8847 // SetGrantToken sets the GrantToken field's value. 8848 func (s *CreateGrantOutput) SetGrantToken(v string) *CreateGrantOutput { 8849 s.GrantToken = &v 8850 return s 8851 } 8852 8853 type CreateKeyInput struct { 8854 _ struct{} `type:"structure"` 8855 8856 // A flag to indicate whether to bypass the key policy lockout safety check. 8857 // 8858 // Setting this value to true increases the risk that the KMS key becomes unmanageable. 8859 // Do not set this value to true indiscriminately. 8860 // 8861 // For more information, refer to the scenario in the Default Key Policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) 8862 // section in the Key Management Service Developer Guide . 8863 // 8864 // Use this parameter only when you include a policy in the request and you 8865 // intend to prevent the principal that is making the request from making a 8866 // subsequent PutKeyPolicy request on the KMS key. 8867 // 8868 // The default value is false. 8869 BypassPolicyLockoutSafetyCheck *bool `type:"boolean"` 8870 8871 // Creates the KMS key in the specified custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) 8872 // and the key material in its associated CloudHSM cluster. To create a KMS 8873 // key in a custom key store, you must also specify the Origin parameter with 8874 // a value of AWS_CLOUDHSM. The CloudHSM cluster that is associated with the 8875 // custom key store must have at least two active HSMs, each in a different 8876 // Availability Zone in the Region. 8877 // 8878 // This parameter is valid only for symmetric KMS keys and regional KMS keys. 8879 // You cannot create an asymmetric KMS key or a multi-Region key in a custom 8880 // key store. 8881 // 8882 // To find the ID of a custom key store, use the DescribeCustomKeyStores operation. 8883 // 8884 // The response includes the custom key store ID and the ID of the CloudHSM 8885 // cluster. 8886 // 8887 // This operation is part of the Custom Key Store feature (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) 8888 // feature in KMS, which combines the convenience and extensive integration 8889 // of KMS with the isolation and control of a single-tenant key store. 8890 CustomKeyStoreId *string `min:"1" type:"string"` 8891 8892 // Instead, use the KeySpec parameter. 8893 // 8894 // The KeySpec and CustomerMasterKeySpec parameters work the same way. Only 8895 // the names differ. We recommend that you use KeySpec parameter in your code. 8896 // However, to avoid breaking changes, KMS will support both parameters. 8897 // 8898 // Deprecated: This parameter has been deprecated. Instead, use the KeySpec parameter. 8899 CustomerMasterKeySpec *string `deprecated:"true" type:"string" enum:"CustomerMasterKeySpec"` 8900 8901 // A description of the KMS key. 8902 // 8903 // Use a description that helps you decide whether the KMS key is appropriate 8904 // for a task. The default value is an empty string (no description). 8905 // 8906 // To set or change the description after the key is created, use UpdateKeyDescription. 8907 Description *string `type:"string"` 8908 8909 // Specifies the type of KMS key to create. The default value, SYMMETRIC_DEFAULT, 8910 // creates a KMS key with a 256-bit symmetric key for encryption and decryption. 8911 // For help choosing a key spec for your KMS key, see How to Choose Your KMS 8912 // key Configuration (https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html) 8913 // in the Key Management Service Developer Guide . 8914 // 8915 // The KeySpec determines whether the KMS key contains a symmetric key or an 8916 // asymmetric key pair. It also determines the encryption algorithms or signing 8917 // algorithms that the KMS key supports. You can't change the KeySpec after 8918 // the KMS key is created. To further restrict the algorithms that can be used 8919 // with the KMS key, use a condition key in its key policy or IAM policy. For 8920 // more information, see kms:EncryptionAlgorithm (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-algorithm) 8921 // or kms:Signing Algorithm (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-signing-algorithm) 8922 // in the Key Management Service Developer Guide . 8923 // 8924 // Amazon Web Services services that are integrated with KMS (http://aws.amazon.com/kms/features/#AWS_Service_Integration) 8925 // use symmetric KMS keys to protect your data. These services do not support 8926 // asymmetric KMS keys. For help determining whether a KMS key is symmetric 8927 // or asymmetric, see Identifying Symmetric and Asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/find-symm-asymm.html) 8928 // in the Key Management Service Developer Guide. 8929 // 8930 // KMS supports the following key specs for KMS keys: 8931 // 8932 // * Symmetric key (default) SYMMETRIC_DEFAULT (AES-256-GCM) 8933 // 8934 // * Asymmetric RSA key pairs RSA_2048 RSA_3072 RSA_4096 8935 // 8936 // * Asymmetric NIST-recommended elliptic curve key pairs ECC_NIST_P256 (secp256r1) 8937 // ECC_NIST_P384 (secp384r1) ECC_NIST_P521 (secp521r1) 8938 // 8939 // * Other asymmetric elliptic curve key pairs ECC_SECG_P256K1 (secp256k1), 8940 // commonly used for cryptocurrencies. 8941 KeySpec *string `type:"string" enum:"KeySpec"` 8942 8943 // Determines the cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) 8944 // for which you can use the KMS key. The default value is ENCRYPT_DECRYPT. 8945 // This parameter is required only for asymmetric KMS keys. You can't change 8946 // the KeyUsage value after the KMS key is created. 8947 // 8948 // Select only one valid value. 8949 // 8950 // * For symmetric KMS keys, omit the parameter or specify ENCRYPT_DECRYPT. 8951 // 8952 // * For asymmetric KMS keys with RSA key material, specify ENCRYPT_DECRYPT 8953 // or SIGN_VERIFY. 8954 // 8955 // * For asymmetric KMS keys with ECC key material, specify SIGN_VERIFY. 8956 KeyUsage *string `type:"string" enum:"KeyUsageType"` 8957 8958 // Creates a multi-Region primary key that you can replicate into other Amazon 8959 // Web Services Regions. You cannot change this value after you create the KMS 8960 // key. 8961 // 8962 // For a multi-Region key, set this parameter to True. For a single-Region KMS 8963 // key, omit this parameter or set it to False. The default value is False. 8964 // 8965 // This operation supports multi-Region keys, an KMS feature that lets you create 8966 // multiple interoperable KMS keys in different Amazon Web Services Regions. 8967 // Because these KMS keys have the same key ID, key material, and other metadata, 8968 // you can use them interchangeably to encrypt data in one Amazon Web Services 8969 // Region and decrypt it in a different Amazon Web Services Region without re-encrypting 8970 // the data or making a cross-Region call. For more information about multi-Region 8971 // keys, see Using multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) 8972 // in the Key Management Service Developer Guide. 8973 // 8974 // This value creates a primary key, not a replica. To create a replica key, 8975 // use the ReplicateKey operation. 8976 // 8977 // You can create a symmetric or asymmetric multi-Region key, and you can create 8978 // a multi-Region key with imported key material. However, you cannot create 8979 // a multi-Region key in a custom key store. 8980 MultiRegion *bool `type:"boolean"` 8981 8982 // The source of the key material for the KMS key. You cannot change the origin 8983 // after you create the KMS key. The default is AWS_KMS, which means that KMS 8984 // creates the key material. 8985 // 8986 // To create a KMS key with no key material (for imported key material), set 8987 // the value to EXTERNAL. For more information about importing key material 8988 // into KMS, see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) 8989 // in the Key Management Service Developer Guide. This value is valid only for 8990 // symmetric KMS keys. 8991 // 8992 // To create a KMS key in an KMS custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) 8993 // and create its key material in the associated CloudHSM cluster, set this 8994 // value to AWS_CLOUDHSM. You must also use the CustomKeyStoreId parameter to 8995 // identify the custom key store. This value is valid only for symmetric KMS 8996 // keys. 8997 Origin *string `type:"string" enum:"OriginType"` 8998 8999 // The key policy to attach to the KMS key. 9000 // 9001 // If you provide a key policy, it must meet the following criteria: 9002 // 9003 // * If you don't set BypassPolicyLockoutSafetyCheck to true, the key policy 9004 // must allow the principal that is making the CreateKey request to make 9005 // a subsequent PutKeyPolicy request on the KMS key. This reduces the risk 9006 // that the KMS key becomes unmanageable. For more information, refer to 9007 // the scenario in the Default Key Policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) 9008 // section of the Key Management Service Developer Guide . 9009 // 9010 // * Each statement in the key policy must contain one or more principals. 9011 // The principals in the key policy must exist and be visible to KMS. When 9012 // you create a new Amazon Web Services principal (for example, an IAM user 9013 // or role), you might need to enforce a delay before including the new principal 9014 // in a key policy because the new principal might not be immediately visible 9015 // to KMS. For more information, see Changes that I make are not always immediately 9016 // visible (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) 9017 // in the Amazon Web Services Identity and Access Management User Guide. 9018 // 9019 // If you do not provide a key policy, KMS attaches a default key policy to 9020 // the KMS key. For more information, see Default Key Policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) 9021 // in the Key Management Service Developer Guide. 9022 // 9023 // The key policy size quota is 32 kilobytes (32768 bytes). 9024 // 9025 // For help writing and formatting a JSON policy document, see the IAM JSON 9026 // Policy Reference (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html) 9027 // in the Identity and Access Management User Guide . 9028 Policy *string `min:"1" type:"string"` 9029 9030 // Assigns one or more tags to the KMS key. Use this parameter to tag the KMS 9031 // key when it is created. To tag an existing KMS key, use the TagResource operation. 9032 // 9033 // Tagging or untagging a KMS key can allow or deny permission to the KMS key. 9034 // For details, see Using ABAC in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) 9035 // in the Key Management Service Developer Guide. 9036 // 9037 // To use this parameter, you must have kms:TagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 9038 // permission in an IAM policy. 9039 // 9040 // Each tag consists of a tag key and a tag value. Both the tag key and the 9041 // tag value are required, but the tag value can be an empty (null) string. 9042 // You cannot have more than one tag on a KMS key with the same tag key. If 9043 // you specify an existing tag key with a different tag value, KMS replaces 9044 // the current tag value with the specified one. 9045 // 9046 // When you add tags to an Amazon Web Services resource, Amazon Web Services 9047 // generates a cost allocation report with usage and costs aggregated by tags. 9048 // Tags can also be used to control access to a KMS key. For details, see Tagging 9049 // Keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html). 9050 Tags []*Tag `type:"list"` 9051 } 9052 9053 // String returns the string representation. 9054 // 9055 // API parameter values that are decorated as "sensitive" in the API will not 9056 // be included in the string output. The member name will be present, but the 9057 // value will be replaced with "sensitive". 9058 func (s CreateKeyInput) String() string { 9059 return awsutil.Prettify(s) 9060 } 9061 9062 // GoString returns the string representation. 9063 // 9064 // API parameter values that are decorated as "sensitive" in the API will not 9065 // be included in the string output. The member name will be present, but the 9066 // value will be replaced with "sensitive". 9067 func (s CreateKeyInput) GoString() string { 9068 return s.String() 9069 } 9070 9071 // Validate inspects the fields of the type to determine if they are valid. 9072 func (s *CreateKeyInput) Validate() error { 9073 invalidParams := request.ErrInvalidParams{Context: "CreateKeyInput"} 9074 if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { 9075 invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) 9076 } 9077 if s.Policy != nil && len(*s.Policy) < 1 { 9078 invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) 9079 } 9080 if s.Tags != nil { 9081 for i, v := range s.Tags { 9082 if v == nil { 9083 continue 9084 } 9085 if err := v.Validate(); err != nil { 9086 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) 9087 } 9088 } 9089 } 9090 9091 if invalidParams.Len() > 0 { 9092 return invalidParams 9093 } 9094 return nil 9095 } 9096 9097 // SetBypassPolicyLockoutSafetyCheck sets the BypassPolicyLockoutSafetyCheck field's value. 9098 func (s *CreateKeyInput) SetBypassPolicyLockoutSafetyCheck(v bool) *CreateKeyInput { 9099 s.BypassPolicyLockoutSafetyCheck = &v 9100 return s 9101 } 9102 9103 // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. 9104 func (s *CreateKeyInput) SetCustomKeyStoreId(v string) *CreateKeyInput { 9105 s.CustomKeyStoreId = &v 9106 return s 9107 } 9108 9109 // SetCustomerMasterKeySpec sets the CustomerMasterKeySpec field's value. 9110 func (s *CreateKeyInput) SetCustomerMasterKeySpec(v string) *CreateKeyInput { 9111 s.CustomerMasterKeySpec = &v 9112 return s 9113 } 9114 9115 // SetDescription sets the Description field's value. 9116 func (s *CreateKeyInput) SetDescription(v string) *CreateKeyInput { 9117 s.Description = &v 9118 return s 9119 } 9120 9121 // SetKeySpec sets the KeySpec field's value. 9122 func (s *CreateKeyInput) SetKeySpec(v string) *CreateKeyInput { 9123 s.KeySpec = &v 9124 return s 9125 } 9126 9127 // SetKeyUsage sets the KeyUsage field's value. 9128 func (s *CreateKeyInput) SetKeyUsage(v string) *CreateKeyInput { 9129 s.KeyUsage = &v 9130 return s 9131 } 9132 9133 // SetMultiRegion sets the MultiRegion field's value. 9134 func (s *CreateKeyInput) SetMultiRegion(v bool) *CreateKeyInput { 9135 s.MultiRegion = &v 9136 return s 9137 } 9138 9139 // SetOrigin sets the Origin field's value. 9140 func (s *CreateKeyInput) SetOrigin(v string) *CreateKeyInput { 9141 s.Origin = &v 9142 return s 9143 } 9144 9145 // SetPolicy sets the Policy field's value. 9146 func (s *CreateKeyInput) SetPolicy(v string) *CreateKeyInput { 9147 s.Policy = &v 9148 return s 9149 } 9150 9151 // SetTags sets the Tags field's value. 9152 func (s *CreateKeyInput) SetTags(v []*Tag) *CreateKeyInput { 9153 s.Tags = v 9154 return s 9155 } 9156 9157 type CreateKeyOutput struct { 9158 _ struct{} `type:"structure"` 9159 9160 // Metadata associated with the KMS key. 9161 KeyMetadata *KeyMetadata `type:"structure"` 9162 } 9163 9164 // String returns the string representation. 9165 // 9166 // API parameter values that are decorated as "sensitive" in the API will not 9167 // be included in the string output. The member name will be present, but the 9168 // value will be replaced with "sensitive". 9169 func (s CreateKeyOutput) String() string { 9170 return awsutil.Prettify(s) 9171 } 9172 9173 // GoString returns the string representation. 9174 // 9175 // API parameter values that are decorated as "sensitive" in the API will not 9176 // be included in the string output. The member name will be present, but the 9177 // value will be replaced with "sensitive". 9178 func (s CreateKeyOutput) GoString() string { 9179 return s.String() 9180 } 9181 9182 // SetKeyMetadata sets the KeyMetadata field's value. 9183 func (s *CreateKeyOutput) SetKeyMetadata(v *KeyMetadata) *CreateKeyOutput { 9184 s.KeyMetadata = v 9185 return s 9186 } 9187 9188 // The request was rejected because the custom key store contains KMS keys. 9189 // After verifying that you do not need to use the KMS keys, use the ScheduleKeyDeletion 9190 // operation to delete the KMS keys. After they are deleted, you can delete 9191 // the custom key store. 9192 type CustomKeyStoreHasCMKsException struct { 9193 _ struct{} `type:"structure"` 9194 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 9195 9196 Message_ *string `locationName:"message" type:"string"` 9197 } 9198 9199 // String returns the string representation. 9200 // 9201 // API parameter values that are decorated as "sensitive" in the API will not 9202 // be included in the string output. The member name will be present, but the 9203 // value will be replaced with "sensitive". 9204 func (s CustomKeyStoreHasCMKsException) String() string { 9205 return awsutil.Prettify(s) 9206 } 9207 9208 // GoString returns the string representation. 9209 // 9210 // API parameter values that are decorated as "sensitive" in the API will not 9211 // be included in the string output. The member name will be present, but the 9212 // value will be replaced with "sensitive". 9213 func (s CustomKeyStoreHasCMKsException) GoString() string { 9214 return s.String() 9215 } 9216 9217 func newErrorCustomKeyStoreHasCMKsException(v protocol.ResponseMetadata) error { 9218 return &CustomKeyStoreHasCMKsException{ 9219 RespMetadata: v, 9220 } 9221 } 9222 9223 // Code returns the exception type name. 9224 func (s *CustomKeyStoreHasCMKsException) Code() string { 9225 return "CustomKeyStoreHasCMKsException" 9226 } 9227 9228 // Message returns the exception's message. 9229 func (s *CustomKeyStoreHasCMKsException) Message() string { 9230 if s.Message_ != nil { 9231 return *s.Message_ 9232 } 9233 return "" 9234 } 9235 9236 // OrigErr always returns nil, satisfies awserr.Error interface. 9237 func (s *CustomKeyStoreHasCMKsException) OrigErr() error { 9238 return nil 9239 } 9240 9241 func (s *CustomKeyStoreHasCMKsException) Error() string { 9242 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 9243 } 9244 9245 // Status code returns the HTTP status code for the request's response error. 9246 func (s *CustomKeyStoreHasCMKsException) StatusCode() int { 9247 return s.RespMetadata.StatusCode 9248 } 9249 9250 // RequestID returns the service's response RequestID for request. 9251 func (s *CustomKeyStoreHasCMKsException) RequestID() string { 9252 return s.RespMetadata.RequestID 9253 } 9254 9255 // The request was rejected because of the ConnectionState of the custom key 9256 // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores 9257 // operation. 9258 // 9259 // This exception is thrown under the following conditions: 9260 // 9261 // * You requested the CreateKey or GenerateRandom operation in a custom 9262 // key store that is not connected. These operations are valid only when 9263 // the custom key store ConnectionState is CONNECTED. 9264 // 9265 // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation 9266 // on a custom key store that is not disconnected. This operation is valid 9267 // only when the custom key store ConnectionState is DISCONNECTED. 9268 // 9269 // * You requested the ConnectCustomKeyStore operation on a custom key store 9270 // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid 9271 // for all other ConnectionState values. 9272 type CustomKeyStoreInvalidStateException struct { 9273 _ struct{} `type:"structure"` 9274 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 9275 9276 Message_ *string `locationName:"message" type:"string"` 9277 } 9278 9279 // String returns the string representation. 9280 // 9281 // API parameter values that are decorated as "sensitive" in the API will not 9282 // be included in the string output. The member name will be present, but the 9283 // value will be replaced with "sensitive". 9284 func (s CustomKeyStoreInvalidStateException) String() string { 9285 return awsutil.Prettify(s) 9286 } 9287 9288 // GoString returns the string representation. 9289 // 9290 // API parameter values that are decorated as "sensitive" in the API will not 9291 // be included in the string output. The member name will be present, but the 9292 // value will be replaced with "sensitive". 9293 func (s CustomKeyStoreInvalidStateException) GoString() string { 9294 return s.String() 9295 } 9296 9297 func newErrorCustomKeyStoreInvalidStateException(v protocol.ResponseMetadata) error { 9298 return &CustomKeyStoreInvalidStateException{ 9299 RespMetadata: v, 9300 } 9301 } 9302 9303 // Code returns the exception type name. 9304 func (s *CustomKeyStoreInvalidStateException) Code() string { 9305 return "CustomKeyStoreInvalidStateException" 9306 } 9307 9308 // Message returns the exception's message. 9309 func (s *CustomKeyStoreInvalidStateException) Message() string { 9310 if s.Message_ != nil { 9311 return *s.Message_ 9312 } 9313 return "" 9314 } 9315 9316 // OrigErr always returns nil, satisfies awserr.Error interface. 9317 func (s *CustomKeyStoreInvalidStateException) OrigErr() error { 9318 return nil 9319 } 9320 9321 func (s *CustomKeyStoreInvalidStateException) Error() string { 9322 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 9323 } 9324 9325 // Status code returns the HTTP status code for the request's response error. 9326 func (s *CustomKeyStoreInvalidStateException) StatusCode() int { 9327 return s.RespMetadata.StatusCode 9328 } 9329 9330 // RequestID returns the service's response RequestID for request. 9331 func (s *CustomKeyStoreInvalidStateException) RequestID() string { 9332 return s.RespMetadata.RequestID 9333 } 9334 9335 // The request was rejected because the specified custom key store name is already 9336 // assigned to another custom key store in the account. Try again with a custom 9337 // key store name that is unique in the account. 9338 type CustomKeyStoreNameInUseException struct { 9339 _ struct{} `type:"structure"` 9340 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 9341 9342 Message_ *string `locationName:"message" type:"string"` 9343 } 9344 9345 // String returns the string representation. 9346 // 9347 // API parameter values that are decorated as "sensitive" in the API will not 9348 // be included in the string output. The member name will be present, but the 9349 // value will be replaced with "sensitive". 9350 func (s CustomKeyStoreNameInUseException) String() string { 9351 return awsutil.Prettify(s) 9352 } 9353 9354 // GoString returns the string representation. 9355 // 9356 // API parameter values that are decorated as "sensitive" in the API will not 9357 // be included in the string output. The member name will be present, but the 9358 // value will be replaced with "sensitive". 9359 func (s CustomKeyStoreNameInUseException) GoString() string { 9360 return s.String() 9361 } 9362 9363 func newErrorCustomKeyStoreNameInUseException(v protocol.ResponseMetadata) error { 9364 return &CustomKeyStoreNameInUseException{ 9365 RespMetadata: v, 9366 } 9367 } 9368 9369 // Code returns the exception type name. 9370 func (s *CustomKeyStoreNameInUseException) Code() string { 9371 return "CustomKeyStoreNameInUseException" 9372 } 9373 9374 // Message returns the exception's message. 9375 func (s *CustomKeyStoreNameInUseException) Message() string { 9376 if s.Message_ != nil { 9377 return *s.Message_ 9378 } 9379 return "" 9380 } 9381 9382 // OrigErr always returns nil, satisfies awserr.Error interface. 9383 func (s *CustomKeyStoreNameInUseException) OrigErr() error { 9384 return nil 9385 } 9386 9387 func (s *CustomKeyStoreNameInUseException) Error() string { 9388 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 9389 } 9390 9391 // Status code returns the HTTP status code for the request's response error. 9392 func (s *CustomKeyStoreNameInUseException) StatusCode() int { 9393 return s.RespMetadata.StatusCode 9394 } 9395 9396 // RequestID returns the service's response RequestID for request. 9397 func (s *CustomKeyStoreNameInUseException) RequestID() string { 9398 return s.RespMetadata.RequestID 9399 } 9400 9401 // The request was rejected because KMS cannot find a custom key store with 9402 // the specified key store name or ID. 9403 type CustomKeyStoreNotFoundException struct { 9404 _ struct{} `type:"structure"` 9405 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 9406 9407 Message_ *string `locationName:"message" type:"string"` 9408 } 9409 9410 // String returns the string representation. 9411 // 9412 // API parameter values that are decorated as "sensitive" in the API will not 9413 // be included in the string output. The member name will be present, but the 9414 // value will be replaced with "sensitive". 9415 func (s CustomKeyStoreNotFoundException) String() string { 9416 return awsutil.Prettify(s) 9417 } 9418 9419 // GoString returns the string representation. 9420 // 9421 // API parameter values that are decorated as "sensitive" in the API will not 9422 // be included in the string output. The member name will be present, but the 9423 // value will be replaced with "sensitive". 9424 func (s CustomKeyStoreNotFoundException) GoString() string { 9425 return s.String() 9426 } 9427 9428 func newErrorCustomKeyStoreNotFoundException(v protocol.ResponseMetadata) error { 9429 return &CustomKeyStoreNotFoundException{ 9430 RespMetadata: v, 9431 } 9432 } 9433 9434 // Code returns the exception type name. 9435 func (s *CustomKeyStoreNotFoundException) Code() string { 9436 return "CustomKeyStoreNotFoundException" 9437 } 9438 9439 // Message returns the exception's message. 9440 func (s *CustomKeyStoreNotFoundException) Message() string { 9441 if s.Message_ != nil { 9442 return *s.Message_ 9443 } 9444 return "" 9445 } 9446 9447 // OrigErr always returns nil, satisfies awserr.Error interface. 9448 func (s *CustomKeyStoreNotFoundException) OrigErr() error { 9449 return nil 9450 } 9451 9452 func (s *CustomKeyStoreNotFoundException) Error() string { 9453 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 9454 } 9455 9456 // Status code returns the HTTP status code for the request's response error. 9457 func (s *CustomKeyStoreNotFoundException) StatusCode() int { 9458 return s.RespMetadata.StatusCode 9459 } 9460 9461 // RequestID returns the service's response RequestID for request. 9462 func (s *CustomKeyStoreNotFoundException) RequestID() string { 9463 return s.RespMetadata.RequestID 9464 } 9465 9466 // Contains information about each custom key store in the custom key store 9467 // list. 9468 type CustomKeyStoresListEntry struct { 9469 _ struct{} `type:"structure"` 9470 9471 // A unique identifier for the CloudHSM cluster that is associated with the 9472 // custom key store. 9473 CloudHsmClusterId *string `min:"19" type:"string"` 9474 9475 // Describes the connection error. This field appears in the response only when 9476 // the ConnectionState is FAILED. For help resolving these errors, see How to 9477 // Fix a Connection Failure (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-failed) 9478 // in Key Management Service Developer Guide. 9479 // 9480 // Valid values are: 9481 // 9482 // * CLUSTER_NOT_FOUND - KMS cannot find the CloudHSM cluster with the specified 9483 // cluster ID. 9484 // 9485 // * INSUFFICIENT_CLOUDHSM_HSMS - The associated CloudHSM cluster does not 9486 // contain any active HSMs. To connect a custom key store to its CloudHSM 9487 // cluster, the cluster must contain at least one active HSM. 9488 // 9489 // * INTERNAL_ERROR - KMS could not complete the request due to an internal 9490 // error. Retry the request. For ConnectCustomKeyStore requests, disconnect 9491 // the custom key store before trying to connect again. 9492 // 9493 // * INVALID_CREDENTIALS - KMS does not have the correct password for the 9494 // kmsuser crypto user in the CloudHSM cluster. Before you can connect your 9495 // custom key store to its CloudHSM cluster, you must change the kmsuser 9496 // account password and update the key store password value for the custom 9497 // key store. 9498 // 9499 // * NETWORK_ERRORS - Network errors are preventing KMS from connecting to 9500 // the custom key store. 9501 // 9502 // * SUBNET_NOT_FOUND - A subnet in the CloudHSM cluster configuration was 9503 // deleted. If KMS cannot find all of the subnets in the cluster configuration, 9504 // attempts to connect the custom key store to the CloudHSM cluster fail. 9505 // To fix this error, create a cluster from a recent backup and associate 9506 // it with your custom key store. (This process creates a new cluster configuration 9507 // with a VPC and private subnets.) For details, see How to Fix a Connection 9508 // Failure (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-failed) 9509 // in the Key Management Service Developer Guide. 9510 // 9511 // * USER_LOCKED_OUT - The kmsuser CU account is locked out of the associated 9512 // CloudHSM cluster due to too many failed password attempts. Before you 9513 // can connect your custom key store to its CloudHSM cluster, you must change 9514 // the kmsuser account password and update the key store password value for 9515 // the custom key store. 9516 // 9517 // * USER_LOGGED_IN - The kmsuser CU account is logged into the the associated 9518 // CloudHSM cluster. This prevents KMS from rotating the kmsuser account 9519 // password and logging into the cluster. Before you can connect your custom 9520 // key store to its CloudHSM cluster, you must log the kmsuser CU out of 9521 // the cluster. If you changed the kmsuser password to log into the cluster, 9522 // you must also and update the key store password value for the custom key 9523 // store. For help, see How to Log Out and Reconnect (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#login-kmsuser-2) 9524 // in the Key Management Service Developer Guide. 9525 // 9526 // * USER_NOT_FOUND - KMS cannot find a kmsuser CU account in the associated 9527 // CloudHSM cluster. Before you can connect your custom key store to its 9528 // CloudHSM cluster, you must create a kmsuser CU account in the cluster, 9529 // and then update the key store password value for the custom key store. 9530 ConnectionErrorCode *string `type:"string" enum:"ConnectionErrorCodeType"` 9531 9532 // Indicates whether the custom key store is connected to its CloudHSM cluster. 9533 // 9534 // You can create and use KMS keys in your custom key stores only when its connection 9535 // state is CONNECTED. 9536 // 9537 // The value is DISCONNECTED if the key store has never been connected or you 9538 // use the DisconnectCustomKeyStore operation to disconnect it. If the value 9539 // is CONNECTED but you are having trouble using the custom key store, make 9540 // sure that its associated CloudHSM cluster is active and contains at least 9541 // one active HSM. 9542 // 9543 // A value of FAILED indicates that an attempt to connect was unsuccessful. 9544 // The ConnectionErrorCode field in the response indicates the cause of the 9545 // failure. For help resolving a connection failure, see Troubleshooting a Custom 9546 // Key Store (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) 9547 // in the Key Management Service Developer Guide. 9548 ConnectionState *string `type:"string" enum:"ConnectionStateType"` 9549 9550 // The date and time when the custom key store was created. 9551 CreationDate *time.Time `type:"timestamp"` 9552 9553 // A unique identifier for the custom key store. 9554 CustomKeyStoreId *string `min:"1" type:"string"` 9555 9556 // The user-specified friendly name for the custom key store. 9557 CustomKeyStoreName *string `min:"1" type:"string"` 9558 9559 // The trust anchor certificate of the associated CloudHSM cluster. When you 9560 // initialize the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr), 9561 // you create this certificate and save it in the customerCA.crt file. 9562 TrustAnchorCertificate *string `min:"1" type:"string"` 9563 } 9564 9565 // String returns the string representation. 9566 // 9567 // API parameter values that are decorated as "sensitive" in the API will not 9568 // be included in the string output. The member name will be present, but the 9569 // value will be replaced with "sensitive". 9570 func (s CustomKeyStoresListEntry) String() string { 9571 return awsutil.Prettify(s) 9572 } 9573 9574 // GoString returns the string representation. 9575 // 9576 // API parameter values that are decorated as "sensitive" in the API will not 9577 // be included in the string output. The member name will be present, but the 9578 // value will be replaced with "sensitive". 9579 func (s CustomKeyStoresListEntry) GoString() string { 9580 return s.String() 9581 } 9582 9583 // SetCloudHsmClusterId sets the CloudHsmClusterId field's value. 9584 func (s *CustomKeyStoresListEntry) SetCloudHsmClusterId(v string) *CustomKeyStoresListEntry { 9585 s.CloudHsmClusterId = &v 9586 return s 9587 } 9588 9589 // SetConnectionErrorCode sets the ConnectionErrorCode field's value. 9590 func (s *CustomKeyStoresListEntry) SetConnectionErrorCode(v string) *CustomKeyStoresListEntry { 9591 s.ConnectionErrorCode = &v 9592 return s 9593 } 9594 9595 // SetConnectionState sets the ConnectionState field's value. 9596 func (s *CustomKeyStoresListEntry) SetConnectionState(v string) *CustomKeyStoresListEntry { 9597 s.ConnectionState = &v 9598 return s 9599 } 9600 9601 // SetCreationDate sets the CreationDate field's value. 9602 func (s *CustomKeyStoresListEntry) SetCreationDate(v time.Time) *CustomKeyStoresListEntry { 9603 s.CreationDate = &v 9604 return s 9605 } 9606 9607 // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. 9608 func (s *CustomKeyStoresListEntry) SetCustomKeyStoreId(v string) *CustomKeyStoresListEntry { 9609 s.CustomKeyStoreId = &v 9610 return s 9611 } 9612 9613 // SetCustomKeyStoreName sets the CustomKeyStoreName field's value. 9614 func (s *CustomKeyStoresListEntry) SetCustomKeyStoreName(v string) *CustomKeyStoresListEntry { 9615 s.CustomKeyStoreName = &v 9616 return s 9617 } 9618 9619 // SetTrustAnchorCertificate sets the TrustAnchorCertificate field's value. 9620 func (s *CustomKeyStoresListEntry) SetTrustAnchorCertificate(v string) *CustomKeyStoresListEntry { 9621 s.TrustAnchorCertificate = &v 9622 return s 9623 } 9624 9625 type DecryptInput struct { 9626 _ struct{} `type:"structure"` 9627 9628 // Ciphertext to be decrypted. The blob includes metadata. 9629 // CiphertextBlob is automatically base64 encoded/decoded by the SDK. 9630 // 9631 // CiphertextBlob is a required field 9632 CiphertextBlob []byte `min:"1" type:"blob" required:"true"` 9633 9634 // Specifies the encryption algorithm that will be used to decrypt the ciphertext. 9635 // Specify the same algorithm that was used to encrypt the data. If you specify 9636 // a different algorithm, the Decrypt operation fails. 9637 // 9638 // This parameter is required only when the ciphertext was encrypted under an 9639 // asymmetric KMS key. The default value, SYMMETRIC_DEFAULT, represents the 9640 // only supported algorithm that is valid for symmetric KMS keys. 9641 EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` 9642 9643 // Specifies the encryption context to use when decrypting the data. An encryption 9644 // context is valid only for cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) 9645 // with a symmetric KMS key. The standard asymmetric encryption algorithms that 9646 // KMS uses do not support an encryption context. 9647 // 9648 // An encryption context is a collection of non-secret key-value pairs that 9649 // represents additional authenticated data. When you use an encryption context 9650 // to encrypt data, you must specify the same (an exact case-sensitive match) 9651 // encryption context to decrypt the data. An encryption context is optional 9652 // when encrypting with a symmetric KMS key, but it is highly recommended. 9653 // 9654 // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 9655 // in the Key Management Service Developer Guide. 9656 EncryptionContext map[string]*string `type:"map"` 9657 9658 // A list of grant tokens. 9659 // 9660 // Use a grant token when your permission to call this operation comes from 9661 // a new grant that has not yet achieved eventual consistency. For more information, 9662 // see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) 9663 // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) 9664 // in the Key Management Service Developer Guide. 9665 GrantTokens []*string `type:"list"` 9666 9667 // Specifies the KMS key that KMS uses to decrypt the ciphertext. Enter a key 9668 // ID of the KMS key that was used to encrypt the ciphertext. 9669 // 9670 // This parameter is required only when the ciphertext was encrypted under an 9671 // asymmetric KMS key. If you used a symmetric KMS key, KMS can get the KMS 9672 // key from metadata that it adds to the symmetric ciphertext blob. However, 9673 // it is always recommended as a best practice. This practice ensures that you 9674 // use the KMS key that you intend. 9675 // 9676 // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. 9677 // When using an alias name, prefix it with "alias/". To specify a KMS key in 9678 // a different Amazon Web Services account, you must use the key ARN or alias 9679 // ARN. 9680 // 9681 // For example: 9682 // 9683 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 9684 // 9685 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 9686 // 9687 // * Alias name: alias/ExampleAlias 9688 // 9689 // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias 9690 // 9691 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 9692 // To get the alias name and alias ARN, use ListAliases. 9693 KeyId *string `min:"1" type:"string"` 9694 } 9695 9696 // String returns the string representation. 9697 // 9698 // API parameter values that are decorated as "sensitive" in the API will not 9699 // be included in the string output. The member name will be present, but the 9700 // value will be replaced with "sensitive". 9701 func (s DecryptInput) String() string { 9702 return awsutil.Prettify(s) 9703 } 9704 9705 // GoString returns the string representation. 9706 // 9707 // API parameter values that are decorated as "sensitive" in the API will not 9708 // be included in the string output. The member name will be present, but the 9709 // value will be replaced with "sensitive". 9710 func (s DecryptInput) GoString() string { 9711 return s.String() 9712 } 9713 9714 // Validate inspects the fields of the type to determine if they are valid. 9715 func (s *DecryptInput) Validate() error { 9716 invalidParams := request.ErrInvalidParams{Context: "DecryptInput"} 9717 if s.CiphertextBlob == nil { 9718 invalidParams.Add(request.NewErrParamRequired("CiphertextBlob")) 9719 } 9720 if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 { 9721 invalidParams.Add(request.NewErrParamMinLen("CiphertextBlob", 1)) 9722 } 9723 if s.KeyId != nil && len(*s.KeyId) < 1 { 9724 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 9725 } 9726 9727 if invalidParams.Len() > 0 { 9728 return invalidParams 9729 } 9730 return nil 9731 } 9732 9733 // SetCiphertextBlob sets the CiphertextBlob field's value. 9734 func (s *DecryptInput) SetCiphertextBlob(v []byte) *DecryptInput { 9735 s.CiphertextBlob = v 9736 return s 9737 } 9738 9739 // SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value. 9740 func (s *DecryptInput) SetEncryptionAlgorithm(v string) *DecryptInput { 9741 s.EncryptionAlgorithm = &v 9742 return s 9743 } 9744 9745 // SetEncryptionContext sets the EncryptionContext field's value. 9746 func (s *DecryptInput) SetEncryptionContext(v map[string]*string) *DecryptInput { 9747 s.EncryptionContext = v 9748 return s 9749 } 9750 9751 // SetGrantTokens sets the GrantTokens field's value. 9752 func (s *DecryptInput) SetGrantTokens(v []*string) *DecryptInput { 9753 s.GrantTokens = v 9754 return s 9755 } 9756 9757 // SetKeyId sets the KeyId field's value. 9758 func (s *DecryptInput) SetKeyId(v string) *DecryptInput { 9759 s.KeyId = &v 9760 return s 9761 } 9762 9763 type DecryptOutput struct { 9764 _ struct{} `type:"structure"` 9765 9766 // The encryption algorithm that was used to decrypt the ciphertext. 9767 EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` 9768 9769 // The Amazon Resource Name (key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN)) 9770 // of the KMS key that was used to decrypt the ciphertext. 9771 KeyId *string `min:"1" type:"string"` 9772 9773 // Decrypted plaintext data. When you use the HTTP API or the Amazon Web Services 9774 // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. 9775 // 9776 // Plaintext is a sensitive parameter and its value will be 9777 // replaced with "sensitive" in string returned by DecryptOutput's 9778 // String and GoString methods. 9779 // 9780 // Plaintext is automatically base64 encoded/decoded by the SDK. 9781 Plaintext []byte `min:"1" type:"blob" sensitive:"true"` 9782 } 9783 9784 // String returns the string representation. 9785 // 9786 // API parameter values that are decorated as "sensitive" in the API will not 9787 // be included in the string output. The member name will be present, but the 9788 // value will be replaced with "sensitive". 9789 func (s DecryptOutput) String() string { 9790 return awsutil.Prettify(s) 9791 } 9792 9793 // GoString returns the string representation. 9794 // 9795 // API parameter values that are decorated as "sensitive" in the API will not 9796 // be included in the string output. The member name will be present, but the 9797 // value will be replaced with "sensitive". 9798 func (s DecryptOutput) GoString() string { 9799 return s.String() 9800 } 9801 9802 // SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value. 9803 func (s *DecryptOutput) SetEncryptionAlgorithm(v string) *DecryptOutput { 9804 s.EncryptionAlgorithm = &v 9805 return s 9806 } 9807 9808 // SetKeyId sets the KeyId field's value. 9809 func (s *DecryptOutput) SetKeyId(v string) *DecryptOutput { 9810 s.KeyId = &v 9811 return s 9812 } 9813 9814 // SetPlaintext sets the Plaintext field's value. 9815 func (s *DecryptOutput) SetPlaintext(v []byte) *DecryptOutput { 9816 s.Plaintext = v 9817 return s 9818 } 9819 9820 type DeleteAliasInput struct { 9821 _ struct{} `type:"structure"` 9822 9823 // The alias to be deleted. The alias name must begin with alias/ followed by 9824 // the alias name, such as alias/ExampleAlias. 9825 // 9826 // AliasName is a required field 9827 AliasName *string `min:"1" type:"string" required:"true"` 9828 } 9829 9830 // String returns the string representation. 9831 // 9832 // API parameter values that are decorated as "sensitive" in the API will not 9833 // be included in the string output. The member name will be present, but the 9834 // value will be replaced with "sensitive". 9835 func (s DeleteAliasInput) String() string { 9836 return awsutil.Prettify(s) 9837 } 9838 9839 // GoString returns the string representation. 9840 // 9841 // API parameter values that are decorated as "sensitive" in the API will not 9842 // be included in the string output. The member name will be present, but the 9843 // value will be replaced with "sensitive". 9844 func (s DeleteAliasInput) GoString() string { 9845 return s.String() 9846 } 9847 9848 // Validate inspects the fields of the type to determine if they are valid. 9849 func (s *DeleteAliasInput) Validate() error { 9850 invalidParams := request.ErrInvalidParams{Context: "DeleteAliasInput"} 9851 if s.AliasName == nil { 9852 invalidParams.Add(request.NewErrParamRequired("AliasName")) 9853 } 9854 if s.AliasName != nil && len(*s.AliasName) < 1 { 9855 invalidParams.Add(request.NewErrParamMinLen("AliasName", 1)) 9856 } 9857 9858 if invalidParams.Len() > 0 { 9859 return invalidParams 9860 } 9861 return nil 9862 } 9863 9864 // SetAliasName sets the AliasName field's value. 9865 func (s *DeleteAliasInput) SetAliasName(v string) *DeleteAliasInput { 9866 s.AliasName = &v 9867 return s 9868 } 9869 9870 type DeleteAliasOutput struct { 9871 _ struct{} `type:"structure"` 9872 } 9873 9874 // String returns the string representation. 9875 // 9876 // API parameter values that are decorated as "sensitive" in the API will not 9877 // be included in the string output. The member name will be present, but the 9878 // value will be replaced with "sensitive". 9879 func (s DeleteAliasOutput) String() string { 9880 return awsutil.Prettify(s) 9881 } 9882 9883 // GoString returns the string representation. 9884 // 9885 // API parameter values that are decorated as "sensitive" in the API will not 9886 // be included in the string output. The member name will be present, but the 9887 // value will be replaced with "sensitive". 9888 func (s DeleteAliasOutput) GoString() string { 9889 return s.String() 9890 } 9891 9892 type DeleteCustomKeyStoreInput struct { 9893 _ struct{} `type:"structure"` 9894 9895 // Enter the ID of the custom key store you want to delete. To find the ID of 9896 // a custom key store, use the DescribeCustomKeyStores operation. 9897 // 9898 // CustomKeyStoreId is a required field 9899 CustomKeyStoreId *string `min:"1" type:"string" required:"true"` 9900 } 9901 9902 // String returns the string representation. 9903 // 9904 // API parameter values that are decorated as "sensitive" in the API will not 9905 // be included in the string output. The member name will be present, but the 9906 // value will be replaced with "sensitive". 9907 func (s DeleteCustomKeyStoreInput) String() string { 9908 return awsutil.Prettify(s) 9909 } 9910 9911 // GoString returns the string representation. 9912 // 9913 // API parameter values that are decorated as "sensitive" in the API will not 9914 // be included in the string output. The member name will be present, but the 9915 // value will be replaced with "sensitive". 9916 func (s DeleteCustomKeyStoreInput) GoString() string { 9917 return s.String() 9918 } 9919 9920 // Validate inspects the fields of the type to determine if they are valid. 9921 func (s *DeleteCustomKeyStoreInput) Validate() error { 9922 invalidParams := request.ErrInvalidParams{Context: "DeleteCustomKeyStoreInput"} 9923 if s.CustomKeyStoreId == nil { 9924 invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreId")) 9925 } 9926 if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { 9927 invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) 9928 } 9929 9930 if invalidParams.Len() > 0 { 9931 return invalidParams 9932 } 9933 return nil 9934 } 9935 9936 // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. 9937 func (s *DeleteCustomKeyStoreInput) SetCustomKeyStoreId(v string) *DeleteCustomKeyStoreInput { 9938 s.CustomKeyStoreId = &v 9939 return s 9940 } 9941 9942 type DeleteCustomKeyStoreOutput struct { 9943 _ struct{} `type:"structure"` 9944 } 9945 9946 // String returns the string representation. 9947 // 9948 // API parameter values that are decorated as "sensitive" in the API will not 9949 // be included in the string output. The member name will be present, but the 9950 // value will be replaced with "sensitive". 9951 func (s DeleteCustomKeyStoreOutput) String() string { 9952 return awsutil.Prettify(s) 9953 } 9954 9955 // GoString returns the string representation. 9956 // 9957 // API parameter values that are decorated as "sensitive" in the API will not 9958 // be included in the string output. The member name will be present, but the 9959 // value will be replaced with "sensitive". 9960 func (s DeleteCustomKeyStoreOutput) GoString() string { 9961 return s.String() 9962 } 9963 9964 type DeleteImportedKeyMaterialInput struct { 9965 _ struct{} `type:"structure"` 9966 9967 // Identifies the KMS key from which you are deleting imported key material. 9968 // The Origin of the KMS key must be EXTERNAL. 9969 // 9970 // Specify the key ID or key ARN of the KMS key. 9971 // 9972 // For example: 9973 // 9974 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 9975 // 9976 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 9977 // 9978 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 9979 // 9980 // KeyId is a required field 9981 KeyId *string `min:"1" type:"string" required:"true"` 9982 } 9983 9984 // String returns the string representation. 9985 // 9986 // API parameter values that are decorated as "sensitive" in the API will not 9987 // be included in the string output. The member name will be present, but the 9988 // value will be replaced with "sensitive". 9989 func (s DeleteImportedKeyMaterialInput) String() string { 9990 return awsutil.Prettify(s) 9991 } 9992 9993 // GoString returns the string representation. 9994 // 9995 // API parameter values that are decorated as "sensitive" in the API will not 9996 // be included in the string output. The member name will be present, but the 9997 // value will be replaced with "sensitive". 9998 func (s DeleteImportedKeyMaterialInput) GoString() string { 9999 return s.String() 10000 } 10001 10002 // Validate inspects the fields of the type to determine if they are valid. 10003 func (s *DeleteImportedKeyMaterialInput) Validate() error { 10004 invalidParams := request.ErrInvalidParams{Context: "DeleteImportedKeyMaterialInput"} 10005 if s.KeyId == nil { 10006 invalidParams.Add(request.NewErrParamRequired("KeyId")) 10007 } 10008 if s.KeyId != nil && len(*s.KeyId) < 1 { 10009 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 10010 } 10011 10012 if invalidParams.Len() > 0 { 10013 return invalidParams 10014 } 10015 return nil 10016 } 10017 10018 // SetKeyId sets the KeyId field's value. 10019 func (s *DeleteImportedKeyMaterialInput) SetKeyId(v string) *DeleteImportedKeyMaterialInput { 10020 s.KeyId = &v 10021 return s 10022 } 10023 10024 type DeleteImportedKeyMaterialOutput struct { 10025 _ struct{} `type:"structure"` 10026 } 10027 10028 // String returns the string representation. 10029 // 10030 // API parameter values that are decorated as "sensitive" in the API will not 10031 // be included in the string output. The member name will be present, but the 10032 // value will be replaced with "sensitive". 10033 func (s DeleteImportedKeyMaterialOutput) String() string { 10034 return awsutil.Prettify(s) 10035 } 10036 10037 // GoString returns the string representation. 10038 // 10039 // API parameter values that are decorated as "sensitive" in the API will not 10040 // be included in the string output. The member name will be present, but the 10041 // value will be replaced with "sensitive". 10042 func (s DeleteImportedKeyMaterialOutput) GoString() string { 10043 return s.String() 10044 } 10045 10046 // The system timed out while trying to fulfill the request. The request can 10047 // be retried. 10048 type DependencyTimeoutException struct { 10049 _ struct{} `type:"structure"` 10050 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 10051 10052 Message_ *string `locationName:"message" type:"string"` 10053 } 10054 10055 // String returns the string representation. 10056 // 10057 // API parameter values that are decorated as "sensitive" in the API will not 10058 // be included in the string output. The member name will be present, but the 10059 // value will be replaced with "sensitive". 10060 func (s DependencyTimeoutException) String() string { 10061 return awsutil.Prettify(s) 10062 } 10063 10064 // GoString returns the string representation. 10065 // 10066 // API parameter values that are decorated as "sensitive" in the API will not 10067 // be included in the string output. The member name will be present, but the 10068 // value will be replaced with "sensitive". 10069 func (s DependencyTimeoutException) GoString() string { 10070 return s.String() 10071 } 10072 10073 func newErrorDependencyTimeoutException(v protocol.ResponseMetadata) error { 10074 return &DependencyTimeoutException{ 10075 RespMetadata: v, 10076 } 10077 } 10078 10079 // Code returns the exception type name. 10080 func (s *DependencyTimeoutException) Code() string { 10081 return "DependencyTimeoutException" 10082 } 10083 10084 // Message returns the exception's message. 10085 func (s *DependencyTimeoutException) Message() string { 10086 if s.Message_ != nil { 10087 return *s.Message_ 10088 } 10089 return "" 10090 } 10091 10092 // OrigErr always returns nil, satisfies awserr.Error interface. 10093 func (s *DependencyTimeoutException) OrigErr() error { 10094 return nil 10095 } 10096 10097 func (s *DependencyTimeoutException) Error() string { 10098 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 10099 } 10100 10101 // Status code returns the HTTP status code for the request's response error. 10102 func (s *DependencyTimeoutException) StatusCode() int { 10103 return s.RespMetadata.StatusCode 10104 } 10105 10106 // RequestID returns the service's response RequestID for request. 10107 func (s *DependencyTimeoutException) RequestID() string { 10108 return s.RespMetadata.RequestID 10109 } 10110 10111 type DescribeCustomKeyStoresInput struct { 10112 _ struct{} `type:"structure"` 10113 10114 // Gets only information about the specified custom key store. Enter the key 10115 // store ID. 10116 // 10117 // By default, this operation gets information about all custom key stores in 10118 // the account and Region. To limit the output to a particular custom key store, 10119 // you can use either the CustomKeyStoreId or CustomKeyStoreName parameter, 10120 // but not both. 10121 CustomKeyStoreId *string `min:"1" type:"string"` 10122 10123 // Gets only information about the specified custom key store. Enter the friendly 10124 // name of the custom key store. 10125 // 10126 // By default, this operation gets information about all custom key stores in 10127 // the account and Region. To limit the output to a particular custom key store, 10128 // you can use either the CustomKeyStoreId or CustomKeyStoreName parameter, 10129 // but not both. 10130 CustomKeyStoreName *string `min:"1" type:"string"` 10131 10132 // Use this parameter to specify the maximum number of items to return. When 10133 // this value is present, KMS does not return more than the specified number 10134 // of items, but it might return fewer. 10135 Limit *int64 `min:"1" type:"integer"` 10136 10137 // Use this parameter in a subsequent request after you receive a response with 10138 // truncated results. Set it to the value of NextMarker from the truncated response 10139 // you just received. 10140 Marker *string `min:"1" type:"string"` 10141 } 10142 10143 // String returns the string representation. 10144 // 10145 // API parameter values that are decorated as "sensitive" in the API will not 10146 // be included in the string output. The member name will be present, but the 10147 // value will be replaced with "sensitive". 10148 func (s DescribeCustomKeyStoresInput) String() string { 10149 return awsutil.Prettify(s) 10150 } 10151 10152 // GoString returns the string representation. 10153 // 10154 // API parameter values that are decorated as "sensitive" in the API will not 10155 // be included in the string output. The member name will be present, but the 10156 // value will be replaced with "sensitive". 10157 func (s DescribeCustomKeyStoresInput) GoString() string { 10158 return s.String() 10159 } 10160 10161 // Validate inspects the fields of the type to determine if they are valid. 10162 func (s *DescribeCustomKeyStoresInput) Validate() error { 10163 invalidParams := request.ErrInvalidParams{Context: "DescribeCustomKeyStoresInput"} 10164 if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { 10165 invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) 10166 } 10167 if s.CustomKeyStoreName != nil && len(*s.CustomKeyStoreName) < 1 { 10168 invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreName", 1)) 10169 } 10170 if s.Limit != nil && *s.Limit < 1 { 10171 invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) 10172 } 10173 if s.Marker != nil && len(*s.Marker) < 1 { 10174 invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) 10175 } 10176 10177 if invalidParams.Len() > 0 { 10178 return invalidParams 10179 } 10180 return nil 10181 } 10182 10183 // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. 10184 func (s *DescribeCustomKeyStoresInput) SetCustomKeyStoreId(v string) *DescribeCustomKeyStoresInput { 10185 s.CustomKeyStoreId = &v 10186 return s 10187 } 10188 10189 // SetCustomKeyStoreName sets the CustomKeyStoreName field's value. 10190 func (s *DescribeCustomKeyStoresInput) SetCustomKeyStoreName(v string) *DescribeCustomKeyStoresInput { 10191 s.CustomKeyStoreName = &v 10192 return s 10193 } 10194 10195 // SetLimit sets the Limit field's value. 10196 func (s *DescribeCustomKeyStoresInput) SetLimit(v int64) *DescribeCustomKeyStoresInput { 10197 s.Limit = &v 10198 return s 10199 } 10200 10201 // SetMarker sets the Marker field's value. 10202 func (s *DescribeCustomKeyStoresInput) SetMarker(v string) *DescribeCustomKeyStoresInput { 10203 s.Marker = &v 10204 return s 10205 } 10206 10207 type DescribeCustomKeyStoresOutput struct { 10208 _ struct{} `type:"structure"` 10209 10210 // Contains metadata about each custom key store. 10211 CustomKeyStores []*CustomKeyStoresListEntry `type:"list"` 10212 10213 // When Truncated is true, this element is present and contains the value to 10214 // use for the Marker parameter in a subsequent request. 10215 NextMarker *string `min:"1" type:"string"` 10216 10217 // A flag that indicates whether there are more items in the list. When this 10218 // value is true, the list in this response is truncated. To get more items, 10219 // pass the value of the NextMarker element in thisresponse to the Marker parameter 10220 // in a subsequent request. 10221 Truncated *bool `type:"boolean"` 10222 } 10223 10224 // String returns the string representation. 10225 // 10226 // API parameter values that are decorated as "sensitive" in the API will not 10227 // be included in the string output. The member name will be present, but the 10228 // value will be replaced with "sensitive". 10229 func (s DescribeCustomKeyStoresOutput) String() string { 10230 return awsutil.Prettify(s) 10231 } 10232 10233 // GoString returns the string representation. 10234 // 10235 // API parameter values that are decorated as "sensitive" in the API will not 10236 // be included in the string output. The member name will be present, but the 10237 // value will be replaced with "sensitive". 10238 func (s DescribeCustomKeyStoresOutput) GoString() string { 10239 return s.String() 10240 } 10241 10242 // SetCustomKeyStores sets the CustomKeyStores field's value. 10243 func (s *DescribeCustomKeyStoresOutput) SetCustomKeyStores(v []*CustomKeyStoresListEntry) *DescribeCustomKeyStoresOutput { 10244 s.CustomKeyStores = v 10245 return s 10246 } 10247 10248 // SetNextMarker sets the NextMarker field's value. 10249 func (s *DescribeCustomKeyStoresOutput) SetNextMarker(v string) *DescribeCustomKeyStoresOutput { 10250 s.NextMarker = &v 10251 return s 10252 } 10253 10254 // SetTruncated sets the Truncated field's value. 10255 func (s *DescribeCustomKeyStoresOutput) SetTruncated(v bool) *DescribeCustomKeyStoresOutput { 10256 s.Truncated = &v 10257 return s 10258 } 10259 10260 type DescribeKeyInput struct { 10261 _ struct{} `type:"structure"` 10262 10263 // A list of grant tokens. 10264 // 10265 // Use a grant token when your permission to call this operation comes from 10266 // a new grant that has not yet achieved eventual consistency. For more information, 10267 // see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) 10268 // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) 10269 // in the Key Management Service Developer Guide. 10270 GrantTokens []*string `type:"list"` 10271 10272 // Describes the specified KMS key. 10273 // 10274 // If you specify a predefined Amazon Web Services alias (an Amazon Web Services 10275 // alias with no key ID), KMS associates the alias with an Amazon Web Services 10276 // managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html##aws-managed-cmk) 10277 // and returns its KeyId and Arn in the response. 10278 // 10279 // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. 10280 // When using an alias name, prefix it with "alias/". To specify a KMS key in 10281 // a different Amazon Web Services account, you must use the key ARN or alias 10282 // ARN. 10283 // 10284 // For example: 10285 // 10286 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 10287 // 10288 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 10289 // 10290 // * Alias name: alias/ExampleAlias 10291 // 10292 // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias 10293 // 10294 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 10295 // To get the alias name and alias ARN, use ListAliases. 10296 // 10297 // KeyId is a required field 10298 KeyId *string `min:"1" type:"string" required:"true"` 10299 } 10300 10301 // String returns the string representation. 10302 // 10303 // API parameter values that are decorated as "sensitive" in the API will not 10304 // be included in the string output. The member name will be present, but the 10305 // value will be replaced with "sensitive". 10306 func (s DescribeKeyInput) String() string { 10307 return awsutil.Prettify(s) 10308 } 10309 10310 // GoString returns the string representation. 10311 // 10312 // API parameter values that are decorated as "sensitive" in the API will not 10313 // be included in the string output. The member name will be present, but the 10314 // value will be replaced with "sensitive". 10315 func (s DescribeKeyInput) GoString() string { 10316 return s.String() 10317 } 10318 10319 // Validate inspects the fields of the type to determine if they are valid. 10320 func (s *DescribeKeyInput) Validate() error { 10321 invalidParams := request.ErrInvalidParams{Context: "DescribeKeyInput"} 10322 if s.KeyId == nil { 10323 invalidParams.Add(request.NewErrParamRequired("KeyId")) 10324 } 10325 if s.KeyId != nil && len(*s.KeyId) < 1 { 10326 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 10327 } 10328 10329 if invalidParams.Len() > 0 { 10330 return invalidParams 10331 } 10332 return nil 10333 } 10334 10335 // SetGrantTokens sets the GrantTokens field's value. 10336 func (s *DescribeKeyInput) SetGrantTokens(v []*string) *DescribeKeyInput { 10337 s.GrantTokens = v 10338 return s 10339 } 10340 10341 // SetKeyId sets the KeyId field's value. 10342 func (s *DescribeKeyInput) SetKeyId(v string) *DescribeKeyInput { 10343 s.KeyId = &v 10344 return s 10345 } 10346 10347 type DescribeKeyOutput struct { 10348 _ struct{} `type:"structure"` 10349 10350 // Metadata associated with the key. 10351 KeyMetadata *KeyMetadata `type:"structure"` 10352 } 10353 10354 // String returns the string representation. 10355 // 10356 // API parameter values that are decorated as "sensitive" in the API will not 10357 // be included in the string output. The member name will be present, but the 10358 // value will be replaced with "sensitive". 10359 func (s DescribeKeyOutput) String() string { 10360 return awsutil.Prettify(s) 10361 } 10362 10363 // GoString returns the string representation. 10364 // 10365 // API parameter values that are decorated as "sensitive" in the API will not 10366 // be included in the string output. The member name will be present, but the 10367 // value will be replaced with "sensitive". 10368 func (s DescribeKeyOutput) GoString() string { 10369 return s.String() 10370 } 10371 10372 // SetKeyMetadata sets the KeyMetadata field's value. 10373 func (s *DescribeKeyOutput) SetKeyMetadata(v *KeyMetadata) *DescribeKeyOutput { 10374 s.KeyMetadata = v 10375 return s 10376 } 10377 10378 type DisableKeyInput struct { 10379 _ struct{} `type:"structure"` 10380 10381 // Identifies the KMS key to disable. 10382 // 10383 // Specify the key ID or key ARN of the KMS key. 10384 // 10385 // For example: 10386 // 10387 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 10388 // 10389 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 10390 // 10391 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 10392 // 10393 // KeyId is a required field 10394 KeyId *string `min:"1" type:"string" required:"true"` 10395 } 10396 10397 // String returns the string representation. 10398 // 10399 // API parameter values that are decorated as "sensitive" in the API will not 10400 // be included in the string output. The member name will be present, but the 10401 // value will be replaced with "sensitive". 10402 func (s DisableKeyInput) String() string { 10403 return awsutil.Prettify(s) 10404 } 10405 10406 // GoString returns the string representation. 10407 // 10408 // API parameter values that are decorated as "sensitive" in the API will not 10409 // be included in the string output. The member name will be present, but the 10410 // value will be replaced with "sensitive". 10411 func (s DisableKeyInput) GoString() string { 10412 return s.String() 10413 } 10414 10415 // Validate inspects the fields of the type to determine if they are valid. 10416 func (s *DisableKeyInput) Validate() error { 10417 invalidParams := request.ErrInvalidParams{Context: "DisableKeyInput"} 10418 if s.KeyId == nil { 10419 invalidParams.Add(request.NewErrParamRequired("KeyId")) 10420 } 10421 if s.KeyId != nil && len(*s.KeyId) < 1 { 10422 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 10423 } 10424 10425 if invalidParams.Len() > 0 { 10426 return invalidParams 10427 } 10428 return nil 10429 } 10430 10431 // SetKeyId sets the KeyId field's value. 10432 func (s *DisableKeyInput) SetKeyId(v string) *DisableKeyInput { 10433 s.KeyId = &v 10434 return s 10435 } 10436 10437 type DisableKeyOutput struct { 10438 _ struct{} `type:"structure"` 10439 } 10440 10441 // String returns the string representation. 10442 // 10443 // API parameter values that are decorated as "sensitive" in the API will not 10444 // be included in the string output. The member name will be present, but the 10445 // value will be replaced with "sensitive". 10446 func (s DisableKeyOutput) String() string { 10447 return awsutil.Prettify(s) 10448 } 10449 10450 // GoString returns the string representation. 10451 // 10452 // API parameter values that are decorated as "sensitive" in the API will not 10453 // be included in the string output. The member name will be present, but the 10454 // value will be replaced with "sensitive". 10455 func (s DisableKeyOutput) GoString() string { 10456 return s.String() 10457 } 10458 10459 type DisableKeyRotationInput struct { 10460 _ struct{} `type:"structure"` 10461 10462 // Identifies a symmetric KMS key. You cannot enable or disable automatic rotation 10463 // of asymmetric KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html#asymmetric-cmks), 10464 // KMS keys with imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html), 10465 // or KMS keys in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). 10466 // 10467 // Specify the key ID or key ARN of the KMS key. 10468 // 10469 // For example: 10470 // 10471 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 10472 // 10473 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 10474 // 10475 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 10476 // 10477 // KeyId is a required field 10478 KeyId *string `min:"1" type:"string" required:"true"` 10479 } 10480 10481 // String returns the string representation. 10482 // 10483 // API parameter values that are decorated as "sensitive" in the API will not 10484 // be included in the string output. The member name will be present, but the 10485 // value will be replaced with "sensitive". 10486 func (s DisableKeyRotationInput) String() string { 10487 return awsutil.Prettify(s) 10488 } 10489 10490 // GoString returns the string representation. 10491 // 10492 // API parameter values that are decorated as "sensitive" in the API will not 10493 // be included in the string output. The member name will be present, but the 10494 // value will be replaced with "sensitive". 10495 func (s DisableKeyRotationInput) GoString() string { 10496 return s.String() 10497 } 10498 10499 // Validate inspects the fields of the type to determine if they are valid. 10500 func (s *DisableKeyRotationInput) Validate() error { 10501 invalidParams := request.ErrInvalidParams{Context: "DisableKeyRotationInput"} 10502 if s.KeyId == nil { 10503 invalidParams.Add(request.NewErrParamRequired("KeyId")) 10504 } 10505 if s.KeyId != nil && len(*s.KeyId) < 1 { 10506 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 10507 } 10508 10509 if invalidParams.Len() > 0 { 10510 return invalidParams 10511 } 10512 return nil 10513 } 10514 10515 // SetKeyId sets the KeyId field's value. 10516 func (s *DisableKeyRotationInput) SetKeyId(v string) *DisableKeyRotationInput { 10517 s.KeyId = &v 10518 return s 10519 } 10520 10521 type DisableKeyRotationOutput struct { 10522 _ struct{} `type:"structure"` 10523 } 10524 10525 // String returns the string representation. 10526 // 10527 // API parameter values that are decorated as "sensitive" in the API will not 10528 // be included in the string output. The member name will be present, but the 10529 // value will be replaced with "sensitive". 10530 func (s DisableKeyRotationOutput) String() string { 10531 return awsutil.Prettify(s) 10532 } 10533 10534 // GoString returns the string representation. 10535 // 10536 // API parameter values that are decorated as "sensitive" in the API will not 10537 // be included in the string output. The member name will be present, but the 10538 // value will be replaced with "sensitive". 10539 func (s DisableKeyRotationOutput) GoString() string { 10540 return s.String() 10541 } 10542 10543 // The request was rejected because the specified KMS key is not enabled. 10544 type DisabledException struct { 10545 _ struct{} `type:"structure"` 10546 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 10547 10548 Message_ *string `locationName:"message" type:"string"` 10549 } 10550 10551 // String returns the string representation. 10552 // 10553 // API parameter values that are decorated as "sensitive" in the API will not 10554 // be included in the string output. The member name will be present, but the 10555 // value will be replaced with "sensitive". 10556 func (s DisabledException) String() string { 10557 return awsutil.Prettify(s) 10558 } 10559 10560 // GoString returns the string representation. 10561 // 10562 // API parameter values that are decorated as "sensitive" in the API will not 10563 // be included in the string output. The member name will be present, but the 10564 // value will be replaced with "sensitive". 10565 func (s DisabledException) GoString() string { 10566 return s.String() 10567 } 10568 10569 func newErrorDisabledException(v protocol.ResponseMetadata) error { 10570 return &DisabledException{ 10571 RespMetadata: v, 10572 } 10573 } 10574 10575 // Code returns the exception type name. 10576 func (s *DisabledException) Code() string { 10577 return "DisabledException" 10578 } 10579 10580 // Message returns the exception's message. 10581 func (s *DisabledException) Message() string { 10582 if s.Message_ != nil { 10583 return *s.Message_ 10584 } 10585 return "" 10586 } 10587 10588 // OrigErr always returns nil, satisfies awserr.Error interface. 10589 func (s *DisabledException) OrigErr() error { 10590 return nil 10591 } 10592 10593 func (s *DisabledException) Error() string { 10594 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 10595 } 10596 10597 // Status code returns the HTTP status code for the request's response error. 10598 func (s *DisabledException) StatusCode() int { 10599 return s.RespMetadata.StatusCode 10600 } 10601 10602 // RequestID returns the service's response RequestID for request. 10603 func (s *DisabledException) RequestID() string { 10604 return s.RespMetadata.RequestID 10605 } 10606 10607 type DisconnectCustomKeyStoreInput struct { 10608 _ struct{} `type:"structure"` 10609 10610 // Enter the ID of the custom key store you want to disconnect. To find the 10611 // ID of a custom key store, use the DescribeCustomKeyStores operation. 10612 // 10613 // CustomKeyStoreId is a required field 10614 CustomKeyStoreId *string `min:"1" type:"string" required:"true"` 10615 } 10616 10617 // String returns the string representation. 10618 // 10619 // API parameter values that are decorated as "sensitive" in the API will not 10620 // be included in the string output. The member name will be present, but the 10621 // value will be replaced with "sensitive". 10622 func (s DisconnectCustomKeyStoreInput) String() string { 10623 return awsutil.Prettify(s) 10624 } 10625 10626 // GoString returns the string representation. 10627 // 10628 // API parameter values that are decorated as "sensitive" in the API will not 10629 // be included in the string output. The member name will be present, but the 10630 // value will be replaced with "sensitive". 10631 func (s DisconnectCustomKeyStoreInput) GoString() string { 10632 return s.String() 10633 } 10634 10635 // Validate inspects the fields of the type to determine if they are valid. 10636 func (s *DisconnectCustomKeyStoreInput) Validate() error { 10637 invalidParams := request.ErrInvalidParams{Context: "DisconnectCustomKeyStoreInput"} 10638 if s.CustomKeyStoreId == nil { 10639 invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreId")) 10640 } 10641 if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { 10642 invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) 10643 } 10644 10645 if invalidParams.Len() > 0 { 10646 return invalidParams 10647 } 10648 return nil 10649 } 10650 10651 // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. 10652 func (s *DisconnectCustomKeyStoreInput) SetCustomKeyStoreId(v string) *DisconnectCustomKeyStoreInput { 10653 s.CustomKeyStoreId = &v 10654 return s 10655 } 10656 10657 type DisconnectCustomKeyStoreOutput struct { 10658 _ struct{} `type:"structure"` 10659 } 10660 10661 // String returns the string representation. 10662 // 10663 // API parameter values that are decorated as "sensitive" in the API will not 10664 // be included in the string output. The member name will be present, but the 10665 // value will be replaced with "sensitive". 10666 func (s DisconnectCustomKeyStoreOutput) String() string { 10667 return awsutil.Prettify(s) 10668 } 10669 10670 // GoString returns the string representation. 10671 // 10672 // API parameter values that are decorated as "sensitive" in the API will not 10673 // be included in the string output. The member name will be present, but the 10674 // value will be replaced with "sensitive". 10675 func (s DisconnectCustomKeyStoreOutput) GoString() string { 10676 return s.String() 10677 } 10678 10679 type EnableKeyInput struct { 10680 _ struct{} `type:"structure"` 10681 10682 // Identifies the KMS key to enable. 10683 // 10684 // Specify the key ID or key ARN of the KMS key. 10685 // 10686 // For example: 10687 // 10688 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 10689 // 10690 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 10691 // 10692 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 10693 // 10694 // KeyId is a required field 10695 KeyId *string `min:"1" type:"string" required:"true"` 10696 } 10697 10698 // String returns the string representation. 10699 // 10700 // API parameter values that are decorated as "sensitive" in the API will not 10701 // be included in the string output. The member name will be present, but the 10702 // value will be replaced with "sensitive". 10703 func (s EnableKeyInput) String() string { 10704 return awsutil.Prettify(s) 10705 } 10706 10707 // GoString returns the string representation. 10708 // 10709 // API parameter values that are decorated as "sensitive" in the API will not 10710 // be included in the string output. The member name will be present, but the 10711 // value will be replaced with "sensitive". 10712 func (s EnableKeyInput) GoString() string { 10713 return s.String() 10714 } 10715 10716 // Validate inspects the fields of the type to determine if they are valid. 10717 func (s *EnableKeyInput) Validate() error { 10718 invalidParams := request.ErrInvalidParams{Context: "EnableKeyInput"} 10719 if s.KeyId == nil { 10720 invalidParams.Add(request.NewErrParamRequired("KeyId")) 10721 } 10722 if s.KeyId != nil && len(*s.KeyId) < 1 { 10723 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 10724 } 10725 10726 if invalidParams.Len() > 0 { 10727 return invalidParams 10728 } 10729 return nil 10730 } 10731 10732 // SetKeyId sets the KeyId field's value. 10733 func (s *EnableKeyInput) SetKeyId(v string) *EnableKeyInput { 10734 s.KeyId = &v 10735 return s 10736 } 10737 10738 type EnableKeyOutput struct { 10739 _ struct{} `type:"structure"` 10740 } 10741 10742 // String returns the string representation. 10743 // 10744 // API parameter values that are decorated as "sensitive" in the API will not 10745 // be included in the string output. The member name will be present, but the 10746 // value will be replaced with "sensitive". 10747 func (s EnableKeyOutput) String() string { 10748 return awsutil.Prettify(s) 10749 } 10750 10751 // GoString returns the string representation. 10752 // 10753 // API parameter values that are decorated as "sensitive" in the API will not 10754 // be included in the string output. The member name will be present, but the 10755 // value will be replaced with "sensitive". 10756 func (s EnableKeyOutput) GoString() string { 10757 return s.String() 10758 } 10759 10760 type EnableKeyRotationInput struct { 10761 _ struct{} `type:"structure"` 10762 10763 // Identifies a symmetric KMS key. You cannot enable automatic rotation of asymmetric 10764 // KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks), 10765 // KMS keys with imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html), 10766 // or KMS keys in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). 10767 // To enable or disable automatic rotation of a set of related multi-Region 10768 // keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key), 10769 // set the property on the primary key. 10770 // 10771 // Specify the key ID or key ARN of the KMS key. 10772 // 10773 // For example: 10774 // 10775 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 10776 // 10777 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 10778 // 10779 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 10780 // 10781 // KeyId is a required field 10782 KeyId *string `min:"1" type:"string" required:"true"` 10783 } 10784 10785 // String returns the string representation. 10786 // 10787 // API parameter values that are decorated as "sensitive" in the API will not 10788 // be included in the string output. The member name will be present, but the 10789 // value will be replaced with "sensitive". 10790 func (s EnableKeyRotationInput) String() string { 10791 return awsutil.Prettify(s) 10792 } 10793 10794 // GoString returns the string representation. 10795 // 10796 // API parameter values that are decorated as "sensitive" in the API will not 10797 // be included in the string output. The member name will be present, but the 10798 // value will be replaced with "sensitive". 10799 func (s EnableKeyRotationInput) GoString() string { 10800 return s.String() 10801 } 10802 10803 // Validate inspects the fields of the type to determine if they are valid. 10804 func (s *EnableKeyRotationInput) Validate() error { 10805 invalidParams := request.ErrInvalidParams{Context: "EnableKeyRotationInput"} 10806 if s.KeyId == nil { 10807 invalidParams.Add(request.NewErrParamRequired("KeyId")) 10808 } 10809 if s.KeyId != nil && len(*s.KeyId) < 1 { 10810 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 10811 } 10812 10813 if invalidParams.Len() > 0 { 10814 return invalidParams 10815 } 10816 return nil 10817 } 10818 10819 // SetKeyId sets the KeyId field's value. 10820 func (s *EnableKeyRotationInput) SetKeyId(v string) *EnableKeyRotationInput { 10821 s.KeyId = &v 10822 return s 10823 } 10824 10825 type EnableKeyRotationOutput struct { 10826 _ struct{} `type:"structure"` 10827 } 10828 10829 // String returns the string representation. 10830 // 10831 // API parameter values that are decorated as "sensitive" in the API will not 10832 // be included in the string output. The member name will be present, but the 10833 // value will be replaced with "sensitive". 10834 func (s EnableKeyRotationOutput) String() string { 10835 return awsutil.Prettify(s) 10836 } 10837 10838 // GoString returns the string representation. 10839 // 10840 // API parameter values that are decorated as "sensitive" in the API will not 10841 // be included in the string output. The member name will be present, but the 10842 // value will be replaced with "sensitive". 10843 func (s EnableKeyRotationOutput) GoString() string { 10844 return s.String() 10845 } 10846 10847 type EncryptInput struct { 10848 _ struct{} `type:"structure"` 10849 10850 // Specifies the encryption algorithm that KMS will use to encrypt the plaintext 10851 // message. The algorithm must be compatible with the KMS key that you specify. 10852 // 10853 // This parameter is required only for asymmetric KMS keys. The default value, 10854 // SYMMETRIC_DEFAULT, is the algorithm used for symmetric KMS keys. If you are 10855 // using an asymmetric KMS key, we recommend RSAES_OAEP_SHA_256. 10856 EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` 10857 10858 // Specifies the encryption context that will be used to encrypt the data. An 10859 // encryption context is valid only for cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) 10860 // with a symmetric KMS key. The standard asymmetric encryption algorithms that 10861 // KMS uses do not support an encryption context. 10862 // 10863 // An encryption context is a collection of non-secret key-value pairs that 10864 // represents additional authenticated data. When you use an encryption context 10865 // to encrypt data, you must specify the same (an exact case-sensitive match) 10866 // encryption context to decrypt the data. An encryption context is optional 10867 // when encrypting with a symmetric KMS key, but it is highly recommended. 10868 // 10869 // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 10870 // in the Key Management Service Developer Guide. 10871 EncryptionContext map[string]*string `type:"map"` 10872 10873 // A list of grant tokens. 10874 // 10875 // Use a grant token when your permission to call this operation comes from 10876 // a new grant that has not yet achieved eventual consistency. For more information, 10877 // see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) 10878 // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) 10879 // in the Key Management Service Developer Guide. 10880 GrantTokens []*string `type:"list"` 10881 10882 // Identifies the KMS key to use in the encryption operation. 10883 // 10884 // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. 10885 // When using an alias name, prefix it with "alias/". To specify a KMS key in 10886 // a different Amazon Web Services account, you must use the key ARN or alias 10887 // ARN. 10888 // 10889 // For example: 10890 // 10891 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 10892 // 10893 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 10894 // 10895 // * Alias name: alias/ExampleAlias 10896 // 10897 // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias 10898 // 10899 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 10900 // To get the alias name and alias ARN, use ListAliases. 10901 // 10902 // KeyId is a required field 10903 KeyId *string `min:"1" type:"string" required:"true"` 10904 10905 // Data to be encrypted. 10906 // 10907 // Plaintext is a sensitive parameter and its value will be 10908 // replaced with "sensitive" in string returned by EncryptInput's 10909 // String and GoString methods. 10910 // 10911 // Plaintext is automatically base64 encoded/decoded by the SDK. 10912 // 10913 // Plaintext is a required field 10914 Plaintext []byte `min:"1" type:"blob" required:"true" sensitive:"true"` 10915 } 10916 10917 // String returns the string representation. 10918 // 10919 // API parameter values that are decorated as "sensitive" in the API will not 10920 // be included in the string output. The member name will be present, but the 10921 // value will be replaced with "sensitive". 10922 func (s EncryptInput) String() string { 10923 return awsutil.Prettify(s) 10924 } 10925 10926 // GoString returns the string representation. 10927 // 10928 // API parameter values that are decorated as "sensitive" in the API will not 10929 // be included in the string output. The member name will be present, but the 10930 // value will be replaced with "sensitive". 10931 func (s EncryptInput) GoString() string { 10932 return s.String() 10933 } 10934 10935 // Validate inspects the fields of the type to determine if they are valid. 10936 func (s *EncryptInput) Validate() error { 10937 invalidParams := request.ErrInvalidParams{Context: "EncryptInput"} 10938 if s.KeyId == nil { 10939 invalidParams.Add(request.NewErrParamRequired("KeyId")) 10940 } 10941 if s.KeyId != nil && len(*s.KeyId) < 1 { 10942 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 10943 } 10944 if s.Plaintext == nil { 10945 invalidParams.Add(request.NewErrParamRequired("Plaintext")) 10946 } 10947 if s.Plaintext != nil && len(s.Plaintext) < 1 { 10948 invalidParams.Add(request.NewErrParamMinLen("Plaintext", 1)) 10949 } 10950 10951 if invalidParams.Len() > 0 { 10952 return invalidParams 10953 } 10954 return nil 10955 } 10956 10957 // SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value. 10958 func (s *EncryptInput) SetEncryptionAlgorithm(v string) *EncryptInput { 10959 s.EncryptionAlgorithm = &v 10960 return s 10961 } 10962 10963 // SetEncryptionContext sets the EncryptionContext field's value. 10964 func (s *EncryptInput) SetEncryptionContext(v map[string]*string) *EncryptInput { 10965 s.EncryptionContext = v 10966 return s 10967 } 10968 10969 // SetGrantTokens sets the GrantTokens field's value. 10970 func (s *EncryptInput) SetGrantTokens(v []*string) *EncryptInput { 10971 s.GrantTokens = v 10972 return s 10973 } 10974 10975 // SetKeyId sets the KeyId field's value. 10976 func (s *EncryptInput) SetKeyId(v string) *EncryptInput { 10977 s.KeyId = &v 10978 return s 10979 } 10980 10981 // SetPlaintext sets the Plaintext field's value. 10982 func (s *EncryptInput) SetPlaintext(v []byte) *EncryptInput { 10983 s.Plaintext = v 10984 return s 10985 } 10986 10987 type EncryptOutput struct { 10988 _ struct{} `type:"structure"` 10989 10990 // The encrypted plaintext. When you use the HTTP API or the Amazon Web Services 10991 // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. 10992 // CiphertextBlob is automatically base64 encoded/decoded by the SDK. 10993 CiphertextBlob []byte `min:"1" type:"blob"` 10994 10995 // The encryption algorithm that was used to encrypt the plaintext. 10996 EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` 10997 10998 // The Amazon Resource Name (key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN)) 10999 // of the KMS key that was used to encrypt the plaintext. 11000 KeyId *string `min:"1" type:"string"` 11001 } 11002 11003 // String returns the string representation. 11004 // 11005 // API parameter values that are decorated as "sensitive" in the API will not 11006 // be included in the string output. The member name will be present, but the 11007 // value will be replaced with "sensitive". 11008 func (s EncryptOutput) String() string { 11009 return awsutil.Prettify(s) 11010 } 11011 11012 // GoString returns the string representation. 11013 // 11014 // API parameter values that are decorated as "sensitive" in the API will not 11015 // be included in the string output. The member name will be present, but the 11016 // value will be replaced with "sensitive". 11017 func (s EncryptOutput) GoString() string { 11018 return s.String() 11019 } 11020 11021 // SetCiphertextBlob sets the CiphertextBlob field's value. 11022 func (s *EncryptOutput) SetCiphertextBlob(v []byte) *EncryptOutput { 11023 s.CiphertextBlob = v 11024 return s 11025 } 11026 11027 // SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value. 11028 func (s *EncryptOutput) SetEncryptionAlgorithm(v string) *EncryptOutput { 11029 s.EncryptionAlgorithm = &v 11030 return s 11031 } 11032 11033 // SetKeyId sets the KeyId field's value. 11034 func (s *EncryptOutput) SetKeyId(v string) *EncryptOutput { 11035 s.KeyId = &v 11036 return s 11037 } 11038 11039 // The request was rejected because the specified import token is expired. Use 11040 // GetParametersForImport to get a new import token and public key, use the 11041 // new public key to encrypt the key material, and then try the request again. 11042 type ExpiredImportTokenException struct { 11043 _ struct{} `type:"structure"` 11044 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 11045 11046 Message_ *string `locationName:"message" type:"string"` 11047 } 11048 11049 // String returns the string representation. 11050 // 11051 // API parameter values that are decorated as "sensitive" in the API will not 11052 // be included in the string output. The member name will be present, but the 11053 // value will be replaced with "sensitive". 11054 func (s ExpiredImportTokenException) String() string { 11055 return awsutil.Prettify(s) 11056 } 11057 11058 // GoString returns the string representation. 11059 // 11060 // API parameter values that are decorated as "sensitive" in the API will not 11061 // be included in the string output. The member name will be present, but the 11062 // value will be replaced with "sensitive". 11063 func (s ExpiredImportTokenException) GoString() string { 11064 return s.String() 11065 } 11066 11067 func newErrorExpiredImportTokenException(v protocol.ResponseMetadata) error { 11068 return &ExpiredImportTokenException{ 11069 RespMetadata: v, 11070 } 11071 } 11072 11073 // Code returns the exception type name. 11074 func (s *ExpiredImportTokenException) Code() string { 11075 return "ExpiredImportTokenException" 11076 } 11077 11078 // Message returns the exception's message. 11079 func (s *ExpiredImportTokenException) Message() string { 11080 if s.Message_ != nil { 11081 return *s.Message_ 11082 } 11083 return "" 11084 } 11085 11086 // OrigErr always returns nil, satisfies awserr.Error interface. 11087 func (s *ExpiredImportTokenException) OrigErr() error { 11088 return nil 11089 } 11090 11091 func (s *ExpiredImportTokenException) Error() string { 11092 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 11093 } 11094 11095 // Status code returns the HTTP status code for the request's response error. 11096 func (s *ExpiredImportTokenException) StatusCode() int { 11097 return s.RespMetadata.StatusCode 11098 } 11099 11100 // RequestID returns the service's response RequestID for request. 11101 func (s *ExpiredImportTokenException) RequestID() string { 11102 return s.RespMetadata.RequestID 11103 } 11104 11105 type GenerateDataKeyInput struct { 11106 _ struct{} `type:"structure"` 11107 11108 // Specifies the encryption context that will be used when encrypting the data 11109 // key. 11110 // 11111 // An encryption context is a collection of non-secret key-value pairs that 11112 // represents additional authenticated data. When you use an encryption context 11113 // to encrypt data, you must specify the same (an exact case-sensitive match) 11114 // encryption context to decrypt the data. An encryption context is optional 11115 // when encrypting with a symmetric KMS key, but it is highly recommended. 11116 // 11117 // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 11118 // in the Key Management Service Developer Guide. 11119 EncryptionContext map[string]*string `type:"map"` 11120 11121 // A list of grant tokens. 11122 // 11123 // Use a grant token when your permission to call this operation comes from 11124 // a new grant that has not yet achieved eventual consistency. For more information, 11125 // see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) 11126 // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) 11127 // in the Key Management Service Developer Guide. 11128 GrantTokens []*string `type:"list"` 11129 11130 // Identifies the symmetric KMS key that encrypts the data key. 11131 // 11132 // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. 11133 // When using an alias name, prefix it with "alias/". To specify a KMS key in 11134 // a different Amazon Web Services account, you must use the key ARN or alias 11135 // ARN. 11136 // 11137 // For example: 11138 // 11139 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 11140 // 11141 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 11142 // 11143 // * Alias name: alias/ExampleAlias 11144 // 11145 // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias 11146 // 11147 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 11148 // To get the alias name and alias ARN, use ListAliases. 11149 // 11150 // KeyId is a required field 11151 KeyId *string `min:"1" type:"string" required:"true"` 11152 11153 // Specifies the length of the data key. Use AES_128 to generate a 128-bit symmetric 11154 // key, or AES_256 to generate a 256-bit symmetric key. 11155 // 11156 // You must specify either the KeySpec or the NumberOfBytes parameter (but not 11157 // both) in every GenerateDataKey request. 11158 KeySpec *string `type:"string" enum:"DataKeySpec"` 11159 11160 // Specifies the length of the data key in bytes. For example, use the value 11161 // 64 to generate a 512-bit data key (64 bytes is 512 bits). For 128-bit (16-byte) 11162 // and 256-bit (32-byte) data keys, use the KeySpec parameter. 11163 // 11164 // You must specify either the KeySpec or the NumberOfBytes parameter (but not 11165 // both) in every GenerateDataKey request. 11166 NumberOfBytes *int64 `min:"1" type:"integer"` 11167 } 11168 11169 // String returns the string representation. 11170 // 11171 // API parameter values that are decorated as "sensitive" in the API will not 11172 // be included in the string output. The member name will be present, but the 11173 // value will be replaced with "sensitive". 11174 func (s GenerateDataKeyInput) String() string { 11175 return awsutil.Prettify(s) 11176 } 11177 11178 // GoString returns the string representation. 11179 // 11180 // API parameter values that are decorated as "sensitive" in the API will not 11181 // be included in the string output. The member name will be present, but the 11182 // value will be replaced with "sensitive". 11183 func (s GenerateDataKeyInput) GoString() string { 11184 return s.String() 11185 } 11186 11187 // Validate inspects the fields of the type to determine if they are valid. 11188 func (s *GenerateDataKeyInput) Validate() error { 11189 invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyInput"} 11190 if s.KeyId == nil { 11191 invalidParams.Add(request.NewErrParamRequired("KeyId")) 11192 } 11193 if s.KeyId != nil && len(*s.KeyId) < 1 { 11194 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 11195 } 11196 if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 { 11197 invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1)) 11198 } 11199 11200 if invalidParams.Len() > 0 { 11201 return invalidParams 11202 } 11203 return nil 11204 } 11205 11206 // SetEncryptionContext sets the EncryptionContext field's value. 11207 func (s *GenerateDataKeyInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyInput { 11208 s.EncryptionContext = v 11209 return s 11210 } 11211 11212 // SetGrantTokens sets the GrantTokens field's value. 11213 func (s *GenerateDataKeyInput) SetGrantTokens(v []*string) *GenerateDataKeyInput { 11214 s.GrantTokens = v 11215 return s 11216 } 11217 11218 // SetKeyId sets the KeyId field's value. 11219 func (s *GenerateDataKeyInput) SetKeyId(v string) *GenerateDataKeyInput { 11220 s.KeyId = &v 11221 return s 11222 } 11223 11224 // SetKeySpec sets the KeySpec field's value. 11225 func (s *GenerateDataKeyInput) SetKeySpec(v string) *GenerateDataKeyInput { 11226 s.KeySpec = &v 11227 return s 11228 } 11229 11230 // SetNumberOfBytes sets the NumberOfBytes field's value. 11231 func (s *GenerateDataKeyInput) SetNumberOfBytes(v int64) *GenerateDataKeyInput { 11232 s.NumberOfBytes = &v 11233 return s 11234 } 11235 11236 type GenerateDataKeyOutput struct { 11237 _ struct{} `type:"structure"` 11238 11239 // The encrypted copy of the data key. When you use the HTTP API or the Amazon 11240 // Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. 11241 // CiphertextBlob is automatically base64 encoded/decoded by the SDK. 11242 CiphertextBlob []byte `min:"1" type:"blob"` 11243 11244 // The Amazon Resource Name (key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN)) 11245 // of the KMS key that encrypted the data key. 11246 KeyId *string `min:"1" type:"string"` 11247 11248 // The plaintext data key. When you use the HTTP API or the Amazon Web Services 11249 // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. Use 11250 // this data key to encrypt your data outside of KMS. Then, remove it from memory 11251 // as soon as possible. 11252 // 11253 // Plaintext is a sensitive parameter and its value will be 11254 // replaced with "sensitive" in string returned by GenerateDataKeyOutput's 11255 // String and GoString methods. 11256 // 11257 // Plaintext is automatically base64 encoded/decoded by the SDK. 11258 Plaintext []byte `min:"1" type:"blob" sensitive:"true"` 11259 } 11260 11261 // String returns the string representation. 11262 // 11263 // API parameter values that are decorated as "sensitive" in the API will not 11264 // be included in the string output. The member name will be present, but the 11265 // value will be replaced with "sensitive". 11266 func (s GenerateDataKeyOutput) String() string { 11267 return awsutil.Prettify(s) 11268 } 11269 11270 // GoString returns the string representation. 11271 // 11272 // API parameter values that are decorated as "sensitive" in the API will not 11273 // be included in the string output. The member name will be present, but the 11274 // value will be replaced with "sensitive". 11275 func (s GenerateDataKeyOutput) GoString() string { 11276 return s.String() 11277 } 11278 11279 // SetCiphertextBlob sets the CiphertextBlob field's value. 11280 func (s *GenerateDataKeyOutput) SetCiphertextBlob(v []byte) *GenerateDataKeyOutput { 11281 s.CiphertextBlob = v 11282 return s 11283 } 11284 11285 // SetKeyId sets the KeyId field's value. 11286 func (s *GenerateDataKeyOutput) SetKeyId(v string) *GenerateDataKeyOutput { 11287 s.KeyId = &v 11288 return s 11289 } 11290 11291 // SetPlaintext sets the Plaintext field's value. 11292 func (s *GenerateDataKeyOutput) SetPlaintext(v []byte) *GenerateDataKeyOutput { 11293 s.Plaintext = v 11294 return s 11295 } 11296 11297 type GenerateDataKeyPairInput struct { 11298 _ struct{} `type:"structure"` 11299 11300 // Specifies the encryption context that will be used when encrypting the private 11301 // key in the data key pair. 11302 // 11303 // An encryption context is a collection of non-secret key-value pairs that 11304 // represents additional authenticated data. When you use an encryption context 11305 // to encrypt data, you must specify the same (an exact case-sensitive match) 11306 // encryption context to decrypt the data. An encryption context is optional 11307 // when encrypting with a symmetric KMS key, but it is highly recommended. 11308 // 11309 // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 11310 // in the Key Management Service Developer Guide. 11311 EncryptionContext map[string]*string `type:"map"` 11312 11313 // A list of grant tokens. 11314 // 11315 // Use a grant token when your permission to call this operation comes from 11316 // a new grant that has not yet achieved eventual consistency. For more information, 11317 // see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) 11318 // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) 11319 // in the Key Management Service Developer Guide. 11320 GrantTokens []*string `type:"list"` 11321 11322 // Specifies the symmetric KMS key that encrypts the private key in the data 11323 // key pair. You cannot specify an asymmetric KMS key or a KMS key in a custom 11324 // key store. To get the type and origin of your KMS key, use the DescribeKey 11325 // operation. 11326 // 11327 // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. 11328 // When using an alias name, prefix it with "alias/". To specify a KMS key in 11329 // a different Amazon Web Services account, you must use the key ARN or alias 11330 // ARN. 11331 // 11332 // For example: 11333 // 11334 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 11335 // 11336 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 11337 // 11338 // * Alias name: alias/ExampleAlias 11339 // 11340 // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias 11341 // 11342 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 11343 // To get the alias name and alias ARN, use ListAliases. 11344 // 11345 // KeyId is a required field 11346 KeyId *string `min:"1" type:"string" required:"true"` 11347 11348 // Determines the type of data key pair that is generated. 11349 // 11350 // The KMS rule that restricts the use of asymmetric RSA KMS keys to encrypt 11351 // and decrypt or to sign and verify (but not both), and the rule that permits 11352 // you to use ECC KMS keys only to sign and verify, are not effective on data 11353 // key pairs, which are used outside of KMS. 11354 // 11355 // KeyPairSpec is a required field 11356 KeyPairSpec *string `type:"string" required:"true" enum:"DataKeyPairSpec"` 11357 } 11358 11359 // String returns the string representation. 11360 // 11361 // API parameter values that are decorated as "sensitive" in the API will not 11362 // be included in the string output. The member name will be present, but the 11363 // value will be replaced with "sensitive". 11364 func (s GenerateDataKeyPairInput) String() string { 11365 return awsutil.Prettify(s) 11366 } 11367 11368 // GoString returns the string representation. 11369 // 11370 // API parameter values that are decorated as "sensitive" in the API will not 11371 // be included in the string output. The member name will be present, but the 11372 // value will be replaced with "sensitive". 11373 func (s GenerateDataKeyPairInput) GoString() string { 11374 return s.String() 11375 } 11376 11377 // Validate inspects the fields of the type to determine if they are valid. 11378 func (s *GenerateDataKeyPairInput) Validate() error { 11379 invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyPairInput"} 11380 if s.KeyId == nil { 11381 invalidParams.Add(request.NewErrParamRequired("KeyId")) 11382 } 11383 if s.KeyId != nil && len(*s.KeyId) < 1 { 11384 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 11385 } 11386 if s.KeyPairSpec == nil { 11387 invalidParams.Add(request.NewErrParamRequired("KeyPairSpec")) 11388 } 11389 11390 if invalidParams.Len() > 0 { 11391 return invalidParams 11392 } 11393 return nil 11394 } 11395 11396 // SetEncryptionContext sets the EncryptionContext field's value. 11397 func (s *GenerateDataKeyPairInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyPairInput { 11398 s.EncryptionContext = v 11399 return s 11400 } 11401 11402 // SetGrantTokens sets the GrantTokens field's value. 11403 func (s *GenerateDataKeyPairInput) SetGrantTokens(v []*string) *GenerateDataKeyPairInput { 11404 s.GrantTokens = v 11405 return s 11406 } 11407 11408 // SetKeyId sets the KeyId field's value. 11409 func (s *GenerateDataKeyPairInput) SetKeyId(v string) *GenerateDataKeyPairInput { 11410 s.KeyId = &v 11411 return s 11412 } 11413 11414 // SetKeyPairSpec sets the KeyPairSpec field's value. 11415 func (s *GenerateDataKeyPairInput) SetKeyPairSpec(v string) *GenerateDataKeyPairInput { 11416 s.KeyPairSpec = &v 11417 return s 11418 } 11419 11420 type GenerateDataKeyPairOutput struct { 11421 _ struct{} `type:"structure"` 11422 11423 // The Amazon Resource Name (key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN)) 11424 // of the KMS key that encrypted the private key. 11425 KeyId *string `min:"1" type:"string"` 11426 11427 // The type of data key pair that was generated. 11428 KeyPairSpec *string `type:"string" enum:"DataKeyPairSpec"` 11429 11430 // The encrypted copy of the private key. When you use the HTTP API or the Amazon 11431 // Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. 11432 // PrivateKeyCiphertextBlob is automatically base64 encoded/decoded by the SDK. 11433 PrivateKeyCiphertextBlob []byte `min:"1" type:"blob"` 11434 11435 // The plaintext copy of the private key. When you use the HTTP API or the Amazon 11436 // Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. 11437 // 11438 // PrivateKeyPlaintext is a sensitive parameter and its value will be 11439 // replaced with "sensitive" in string returned by GenerateDataKeyPairOutput's 11440 // String and GoString methods. 11441 // 11442 // PrivateKeyPlaintext is automatically base64 encoded/decoded by the SDK. 11443 PrivateKeyPlaintext []byte `min:"1" type:"blob" sensitive:"true"` 11444 11445 // The public key (in plaintext). 11446 // PublicKey is automatically base64 encoded/decoded by the SDK. 11447 PublicKey []byte `min:"1" type:"blob"` 11448 } 11449 11450 // String returns the string representation. 11451 // 11452 // API parameter values that are decorated as "sensitive" in the API will not 11453 // be included in the string output. The member name will be present, but the 11454 // value will be replaced with "sensitive". 11455 func (s GenerateDataKeyPairOutput) String() string { 11456 return awsutil.Prettify(s) 11457 } 11458 11459 // GoString returns the string representation. 11460 // 11461 // API parameter values that are decorated as "sensitive" in the API will not 11462 // be included in the string output. The member name will be present, but the 11463 // value will be replaced with "sensitive". 11464 func (s GenerateDataKeyPairOutput) GoString() string { 11465 return s.String() 11466 } 11467 11468 // SetKeyId sets the KeyId field's value. 11469 func (s *GenerateDataKeyPairOutput) SetKeyId(v string) *GenerateDataKeyPairOutput { 11470 s.KeyId = &v 11471 return s 11472 } 11473 11474 // SetKeyPairSpec sets the KeyPairSpec field's value. 11475 func (s *GenerateDataKeyPairOutput) SetKeyPairSpec(v string) *GenerateDataKeyPairOutput { 11476 s.KeyPairSpec = &v 11477 return s 11478 } 11479 11480 // SetPrivateKeyCiphertextBlob sets the PrivateKeyCiphertextBlob field's value. 11481 func (s *GenerateDataKeyPairOutput) SetPrivateKeyCiphertextBlob(v []byte) *GenerateDataKeyPairOutput { 11482 s.PrivateKeyCiphertextBlob = v 11483 return s 11484 } 11485 11486 // SetPrivateKeyPlaintext sets the PrivateKeyPlaintext field's value. 11487 func (s *GenerateDataKeyPairOutput) SetPrivateKeyPlaintext(v []byte) *GenerateDataKeyPairOutput { 11488 s.PrivateKeyPlaintext = v 11489 return s 11490 } 11491 11492 // SetPublicKey sets the PublicKey field's value. 11493 func (s *GenerateDataKeyPairOutput) SetPublicKey(v []byte) *GenerateDataKeyPairOutput { 11494 s.PublicKey = v 11495 return s 11496 } 11497 11498 type GenerateDataKeyPairWithoutPlaintextInput struct { 11499 _ struct{} `type:"structure"` 11500 11501 // Specifies the encryption context that will be used when encrypting the private 11502 // key in the data key pair. 11503 // 11504 // An encryption context is a collection of non-secret key-value pairs that 11505 // represents additional authenticated data. When you use an encryption context 11506 // to encrypt data, you must specify the same (an exact case-sensitive match) 11507 // encryption context to decrypt the data. An encryption context is optional 11508 // when encrypting with a symmetric KMS key, but it is highly recommended. 11509 // 11510 // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 11511 // in the Key Management Service Developer Guide. 11512 EncryptionContext map[string]*string `type:"map"` 11513 11514 // A list of grant tokens. 11515 // 11516 // Use a grant token when your permission to call this operation comes from 11517 // a new grant that has not yet achieved eventual consistency. For more information, 11518 // see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) 11519 // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) 11520 // in the Key Management Service Developer Guide. 11521 GrantTokens []*string `type:"list"` 11522 11523 // Specifies the KMS key that encrypts the private key in the data key pair. 11524 // You must specify a symmetric KMS key. You cannot use an asymmetric KMS key 11525 // or a KMS key in a custom key store. To get the type and origin of your KMS 11526 // key, use the DescribeKey operation. 11527 // 11528 // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. 11529 // When using an alias name, prefix it with "alias/". To specify a KMS key in 11530 // a different Amazon Web Services account, you must use the key ARN or alias 11531 // ARN. 11532 // 11533 // For example: 11534 // 11535 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 11536 // 11537 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 11538 // 11539 // * Alias name: alias/ExampleAlias 11540 // 11541 // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias 11542 // 11543 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 11544 // To get the alias name and alias ARN, use ListAliases. 11545 // 11546 // KeyId is a required field 11547 KeyId *string `min:"1" type:"string" required:"true"` 11548 11549 // Determines the type of data key pair that is generated. 11550 // 11551 // The KMS rule that restricts the use of asymmetric RSA KMS keys to encrypt 11552 // and decrypt or to sign and verify (but not both), and the rule that permits 11553 // you to use ECC KMS keys only to sign and verify, are not effective on data 11554 // key pairs, which are used outside of KMS. 11555 // 11556 // KeyPairSpec is a required field 11557 KeyPairSpec *string `type:"string" required:"true" enum:"DataKeyPairSpec"` 11558 } 11559 11560 // String returns the string representation. 11561 // 11562 // API parameter values that are decorated as "sensitive" in the API will not 11563 // be included in the string output. The member name will be present, but the 11564 // value will be replaced with "sensitive". 11565 func (s GenerateDataKeyPairWithoutPlaintextInput) String() string { 11566 return awsutil.Prettify(s) 11567 } 11568 11569 // GoString returns the string representation. 11570 // 11571 // API parameter values that are decorated as "sensitive" in the API will not 11572 // be included in the string output. The member name will be present, but the 11573 // value will be replaced with "sensitive". 11574 func (s GenerateDataKeyPairWithoutPlaintextInput) GoString() string { 11575 return s.String() 11576 } 11577 11578 // Validate inspects the fields of the type to determine if they are valid. 11579 func (s *GenerateDataKeyPairWithoutPlaintextInput) Validate() error { 11580 invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyPairWithoutPlaintextInput"} 11581 if s.KeyId == nil { 11582 invalidParams.Add(request.NewErrParamRequired("KeyId")) 11583 } 11584 if s.KeyId != nil && len(*s.KeyId) < 1 { 11585 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 11586 } 11587 if s.KeyPairSpec == nil { 11588 invalidParams.Add(request.NewErrParamRequired("KeyPairSpec")) 11589 } 11590 11591 if invalidParams.Len() > 0 { 11592 return invalidParams 11593 } 11594 return nil 11595 } 11596 11597 // SetEncryptionContext sets the EncryptionContext field's value. 11598 func (s *GenerateDataKeyPairWithoutPlaintextInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyPairWithoutPlaintextInput { 11599 s.EncryptionContext = v 11600 return s 11601 } 11602 11603 // SetGrantTokens sets the GrantTokens field's value. 11604 func (s *GenerateDataKeyPairWithoutPlaintextInput) SetGrantTokens(v []*string) *GenerateDataKeyPairWithoutPlaintextInput { 11605 s.GrantTokens = v 11606 return s 11607 } 11608 11609 // SetKeyId sets the KeyId field's value. 11610 func (s *GenerateDataKeyPairWithoutPlaintextInput) SetKeyId(v string) *GenerateDataKeyPairWithoutPlaintextInput { 11611 s.KeyId = &v 11612 return s 11613 } 11614 11615 // SetKeyPairSpec sets the KeyPairSpec field's value. 11616 func (s *GenerateDataKeyPairWithoutPlaintextInput) SetKeyPairSpec(v string) *GenerateDataKeyPairWithoutPlaintextInput { 11617 s.KeyPairSpec = &v 11618 return s 11619 } 11620 11621 type GenerateDataKeyPairWithoutPlaintextOutput struct { 11622 _ struct{} `type:"structure"` 11623 11624 // The Amazon Resource Name (key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN)) 11625 // of the KMS key that encrypted the private key. 11626 KeyId *string `min:"1" type:"string"` 11627 11628 // The type of data key pair that was generated. 11629 KeyPairSpec *string `type:"string" enum:"DataKeyPairSpec"` 11630 11631 // The encrypted copy of the private key. When you use the HTTP API or the Amazon 11632 // Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. 11633 // PrivateKeyCiphertextBlob is automatically base64 encoded/decoded by the SDK. 11634 PrivateKeyCiphertextBlob []byte `min:"1" type:"blob"` 11635 11636 // The public key (in plaintext). 11637 // PublicKey is automatically base64 encoded/decoded by the SDK. 11638 PublicKey []byte `min:"1" type:"blob"` 11639 } 11640 11641 // String returns the string representation. 11642 // 11643 // API parameter values that are decorated as "sensitive" in the API will not 11644 // be included in the string output. The member name will be present, but the 11645 // value will be replaced with "sensitive". 11646 func (s GenerateDataKeyPairWithoutPlaintextOutput) String() string { 11647 return awsutil.Prettify(s) 11648 } 11649 11650 // GoString returns the string representation. 11651 // 11652 // API parameter values that are decorated as "sensitive" in the API will not 11653 // be included in the string output. The member name will be present, but the 11654 // value will be replaced with "sensitive". 11655 func (s GenerateDataKeyPairWithoutPlaintextOutput) GoString() string { 11656 return s.String() 11657 } 11658 11659 // SetKeyId sets the KeyId field's value. 11660 func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetKeyId(v string) *GenerateDataKeyPairWithoutPlaintextOutput { 11661 s.KeyId = &v 11662 return s 11663 } 11664 11665 // SetKeyPairSpec sets the KeyPairSpec field's value. 11666 func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetKeyPairSpec(v string) *GenerateDataKeyPairWithoutPlaintextOutput { 11667 s.KeyPairSpec = &v 11668 return s 11669 } 11670 11671 // SetPrivateKeyCiphertextBlob sets the PrivateKeyCiphertextBlob field's value. 11672 func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetPrivateKeyCiphertextBlob(v []byte) *GenerateDataKeyPairWithoutPlaintextOutput { 11673 s.PrivateKeyCiphertextBlob = v 11674 return s 11675 } 11676 11677 // SetPublicKey sets the PublicKey field's value. 11678 func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetPublicKey(v []byte) *GenerateDataKeyPairWithoutPlaintextOutput { 11679 s.PublicKey = v 11680 return s 11681 } 11682 11683 type GenerateDataKeyWithoutPlaintextInput struct { 11684 _ struct{} `type:"structure"` 11685 11686 // Specifies the encryption context that will be used when encrypting the data 11687 // key. 11688 // 11689 // An encryption context is a collection of non-secret key-value pairs that 11690 // represents additional authenticated data. When you use an encryption context 11691 // to encrypt data, you must specify the same (an exact case-sensitive match) 11692 // encryption context to decrypt the data. An encryption context is optional 11693 // when encrypting with a symmetric KMS key, but it is highly recommended. 11694 // 11695 // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 11696 // in the Key Management Service Developer Guide. 11697 EncryptionContext map[string]*string `type:"map"` 11698 11699 // A list of grant tokens. 11700 // 11701 // Use a grant token when your permission to call this operation comes from 11702 // a new grant that has not yet achieved eventual consistency. For more information, 11703 // see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) 11704 // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) 11705 // in the Key Management Service Developer Guide. 11706 GrantTokens []*string `type:"list"` 11707 11708 // The identifier of the symmetric KMS key that encrypts the data key. 11709 // 11710 // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. 11711 // When using an alias name, prefix it with "alias/". To specify a KMS key in 11712 // a different Amazon Web Services account, you must use the key ARN or alias 11713 // ARN. 11714 // 11715 // For example: 11716 // 11717 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 11718 // 11719 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 11720 // 11721 // * Alias name: alias/ExampleAlias 11722 // 11723 // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias 11724 // 11725 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 11726 // To get the alias name and alias ARN, use ListAliases. 11727 // 11728 // KeyId is a required field 11729 KeyId *string `min:"1" type:"string" required:"true"` 11730 11731 // The length of the data key. Use AES_128 to generate a 128-bit symmetric key, 11732 // or AES_256 to generate a 256-bit symmetric key. 11733 KeySpec *string `type:"string" enum:"DataKeySpec"` 11734 11735 // The length of the data key in bytes. For example, use the value 64 to generate 11736 // a 512-bit data key (64 bytes is 512 bits). For common key lengths (128-bit 11737 // and 256-bit symmetric keys), we recommend that you use the KeySpec field 11738 // instead of this one. 11739 NumberOfBytes *int64 `min:"1" type:"integer"` 11740 } 11741 11742 // String returns the string representation. 11743 // 11744 // API parameter values that are decorated as "sensitive" in the API will not 11745 // be included in the string output. The member name will be present, but the 11746 // value will be replaced with "sensitive". 11747 func (s GenerateDataKeyWithoutPlaintextInput) String() string { 11748 return awsutil.Prettify(s) 11749 } 11750 11751 // GoString returns the string representation. 11752 // 11753 // API parameter values that are decorated as "sensitive" in the API will not 11754 // be included in the string output. The member name will be present, but the 11755 // value will be replaced with "sensitive". 11756 func (s GenerateDataKeyWithoutPlaintextInput) GoString() string { 11757 return s.String() 11758 } 11759 11760 // Validate inspects the fields of the type to determine if they are valid. 11761 func (s *GenerateDataKeyWithoutPlaintextInput) Validate() error { 11762 invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyWithoutPlaintextInput"} 11763 if s.KeyId == nil { 11764 invalidParams.Add(request.NewErrParamRequired("KeyId")) 11765 } 11766 if s.KeyId != nil && len(*s.KeyId) < 1 { 11767 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 11768 } 11769 if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 { 11770 invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1)) 11771 } 11772 11773 if invalidParams.Len() > 0 { 11774 return invalidParams 11775 } 11776 return nil 11777 } 11778 11779 // SetEncryptionContext sets the EncryptionContext field's value. 11780 func (s *GenerateDataKeyWithoutPlaintextInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyWithoutPlaintextInput { 11781 s.EncryptionContext = v 11782 return s 11783 } 11784 11785 // SetGrantTokens sets the GrantTokens field's value. 11786 func (s *GenerateDataKeyWithoutPlaintextInput) SetGrantTokens(v []*string) *GenerateDataKeyWithoutPlaintextInput { 11787 s.GrantTokens = v 11788 return s 11789 } 11790 11791 // SetKeyId sets the KeyId field's value. 11792 func (s *GenerateDataKeyWithoutPlaintextInput) SetKeyId(v string) *GenerateDataKeyWithoutPlaintextInput { 11793 s.KeyId = &v 11794 return s 11795 } 11796 11797 // SetKeySpec sets the KeySpec field's value. 11798 func (s *GenerateDataKeyWithoutPlaintextInput) SetKeySpec(v string) *GenerateDataKeyWithoutPlaintextInput { 11799 s.KeySpec = &v 11800 return s 11801 } 11802 11803 // SetNumberOfBytes sets the NumberOfBytes field's value. 11804 func (s *GenerateDataKeyWithoutPlaintextInput) SetNumberOfBytes(v int64) *GenerateDataKeyWithoutPlaintextInput { 11805 s.NumberOfBytes = &v 11806 return s 11807 } 11808 11809 type GenerateDataKeyWithoutPlaintextOutput struct { 11810 _ struct{} `type:"structure"` 11811 11812 // The encrypted data key. When you use the HTTP API or the Amazon Web Services 11813 // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. 11814 // CiphertextBlob is automatically base64 encoded/decoded by the SDK. 11815 CiphertextBlob []byte `min:"1" type:"blob"` 11816 11817 // The Amazon Resource Name (key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN)) 11818 // of the KMS key that encrypted the data key. 11819 KeyId *string `min:"1" type:"string"` 11820 } 11821 11822 // String returns the string representation. 11823 // 11824 // API parameter values that are decorated as "sensitive" in the API will not 11825 // be included in the string output. The member name will be present, but the 11826 // value will be replaced with "sensitive". 11827 func (s GenerateDataKeyWithoutPlaintextOutput) String() string { 11828 return awsutil.Prettify(s) 11829 } 11830 11831 // GoString returns the string representation. 11832 // 11833 // API parameter values that are decorated as "sensitive" in the API will not 11834 // be included in the string output. The member name will be present, but the 11835 // value will be replaced with "sensitive". 11836 func (s GenerateDataKeyWithoutPlaintextOutput) GoString() string { 11837 return s.String() 11838 } 11839 11840 // SetCiphertextBlob sets the CiphertextBlob field's value. 11841 func (s *GenerateDataKeyWithoutPlaintextOutput) SetCiphertextBlob(v []byte) *GenerateDataKeyWithoutPlaintextOutput { 11842 s.CiphertextBlob = v 11843 return s 11844 } 11845 11846 // SetKeyId sets the KeyId field's value. 11847 func (s *GenerateDataKeyWithoutPlaintextOutput) SetKeyId(v string) *GenerateDataKeyWithoutPlaintextOutput { 11848 s.KeyId = &v 11849 return s 11850 } 11851 11852 type GenerateRandomInput struct { 11853 _ struct{} `type:"structure"` 11854 11855 // Generates the random byte string in the CloudHSM cluster that is associated 11856 // with the specified custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). 11857 // To find the ID of a custom key store, use the DescribeCustomKeyStores operation. 11858 CustomKeyStoreId *string `min:"1" type:"string"` 11859 11860 // The length of the byte string. 11861 NumberOfBytes *int64 `min:"1" type:"integer"` 11862 } 11863 11864 // String returns the string representation. 11865 // 11866 // API parameter values that are decorated as "sensitive" in the API will not 11867 // be included in the string output. The member name will be present, but the 11868 // value will be replaced with "sensitive". 11869 func (s GenerateRandomInput) String() string { 11870 return awsutil.Prettify(s) 11871 } 11872 11873 // GoString returns the string representation. 11874 // 11875 // API parameter values that are decorated as "sensitive" in the API will not 11876 // be included in the string output. The member name will be present, but the 11877 // value will be replaced with "sensitive". 11878 func (s GenerateRandomInput) GoString() string { 11879 return s.String() 11880 } 11881 11882 // Validate inspects the fields of the type to determine if they are valid. 11883 func (s *GenerateRandomInput) Validate() error { 11884 invalidParams := request.ErrInvalidParams{Context: "GenerateRandomInput"} 11885 if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { 11886 invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) 11887 } 11888 if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 { 11889 invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1)) 11890 } 11891 11892 if invalidParams.Len() > 0 { 11893 return invalidParams 11894 } 11895 return nil 11896 } 11897 11898 // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. 11899 func (s *GenerateRandomInput) SetCustomKeyStoreId(v string) *GenerateRandomInput { 11900 s.CustomKeyStoreId = &v 11901 return s 11902 } 11903 11904 // SetNumberOfBytes sets the NumberOfBytes field's value. 11905 func (s *GenerateRandomInput) SetNumberOfBytes(v int64) *GenerateRandomInput { 11906 s.NumberOfBytes = &v 11907 return s 11908 } 11909 11910 type GenerateRandomOutput struct { 11911 _ struct{} `type:"structure"` 11912 11913 // The random byte string. When you use the HTTP API or the Amazon Web Services 11914 // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. 11915 // 11916 // Plaintext is a sensitive parameter and its value will be 11917 // replaced with "sensitive" in string returned by GenerateRandomOutput's 11918 // String and GoString methods. 11919 // 11920 // Plaintext is automatically base64 encoded/decoded by the SDK. 11921 Plaintext []byte `min:"1" type:"blob" sensitive:"true"` 11922 } 11923 11924 // String returns the string representation. 11925 // 11926 // API parameter values that are decorated as "sensitive" in the API will not 11927 // be included in the string output. The member name will be present, but the 11928 // value will be replaced with "sensitive". 11929 func (s GenerateRandomOutput) String() string { 11930 return awsutil.Prettify(s) 11931 } 11932 11933 // GoString returns the string representation. 11934 // 11935 // API parameter values that are decorated as "sensitive" in the API will not 11936 // be included in the string output. The member name will be present, but the 11937 // value will be replaced with "sensitive". 11938 func (s GenerateRandomOutput) GoString() string { 11939 return s.String() 11940 } 11941 11942 // SetPlaintext sets the Plaintext field's value. 11943 func (s *GenerateRandomOutput) SetPlaintext(v []byte) *GenerateRandomOutput { 11944 s.Plaintext = v 11945 return s 11946 } 11947 11948 type GetKeyPolicyInput struct { 11949 _ struct{} `type:"structure"` 11950 11951 // Gets the key policy for the specified KMS key. 11952 // 11953 // Specify the key ID or key ARN of the KMS key. 11954 // 11955 // For example: 11956 // 11957 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 11958 // 11959 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 11960 // 11961 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 11962 // 11963 // KeyId is a required field 11964 KeyId *string `min:"1" type:"string" required:"true"` 11965 11966 // Specifies the name of the key policy. The only valid name is default. To 11967 // get the names of key policies, use ListKeyPolicies. 11968 // 11969 // PolicyName is a required field 11970 PolicyName *string `min:"1" type:"string" required:"true"` 11971 } 11972 11973 // String returns the string representation. 11974 // 11975 // API parameter values that are decorated as "sensitive" in the API will not 11976 // be included in the string output. The member name will be present, but the 11977 // value will be replaced with "sensitive". 11978 func (s GetKeyPolicyInput) String() string { 11979 return awsutil.Prettify(s) 11980 } 11981 11982 // GoString returns the string representation. 11983 // 11984 // API parameter values that are decorated as "sensitive" in the API will not 11985 // be included in the string output. The member name will be present, but the 11986 // value will be replaced with "sensitive". 11987 func (s GetKeyPolicyInput) GoString() string { 11988 return s.String() 11989 } 11990 11991 // Validate inspects the fields of the type to determine if they are valid. 11992 func (s *GetKeyPolicyInput) Validate() error { 11993 invalidParams := request.ErrInvalidParams{Context: "GetKeyPolicyInput"} 11994 if s.KeyId == nil { 11995 invalidParams.Add(request.NewErrParamRequired("KeyId")) 11996 } 11997 if s.KeyId != nil && len(*s.KeyId) < 1 { 11998 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 11999 } 12000 if s.PolicyName == nil { 12001 invalidParams.Add(request.NewErrParamRequired("PolicyName")) 12002 } 12003 if s.PolicyName != nil && len(*s.PolicyName) < 1 { 12004 invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) 12005 } 12006 12007 if invalidParams.Len() > 0 { 12008 return invalidParams 12009 } 12010 return nil 12011 } 12012 12013 // SetKeyId sets the KeyId field's value. 12014 func (s *GetKeyPolicyInput) SetKeyId(v string) *GetKeyPolicyInput { 12015 s.KeyId = &v 12016 return s 12017 } 12018 12019 // SetPolicyName sets the PolicyName field's value. 12020 func (s *GetKeyPolicyInput) SetPolicyName(v string) *GetKeyPolicyInput { 12021 s.PolicyName = &v 12022 return s 12023 } 12024 12025 type GetKeyPolicyOutput struct { 12026 _ struct{} `type:"structure"` 12027 12028 // A key policy document in JSON format. 12029 Policy *string `min:"1" type:"string"` 12030 } 12031 12032 // String returns the string representation. 12033 // 12034 // API parameter values that are decorated as "sensitive" in the API will not 12035 // be included in the string output. The member name will be present, but the 12036 // value will be replaced with "sensitive". 12037 func (s GetKeyPolicyOutput) String() string { 12038 return awsutil.Prettify(s) 12039 } 12040 12041 // GoString returns the string representation. 12042 // 12043 // API parameter values that are decorated as "sensitive" in the API will not 12044 // be included in the string output. The member name will be present, but the 12045 // value will be replaced with "sensitive". 12046 func (s GetKeyPolicyOutput) GoString() string { 12047 return s.String() 12048 } 12049 12050 // SetPolicy sets the Policy field's value. 12051 func (s *GetKeyPolicyOutput) SetPolicy(v string) *GetKeyPolicyOutput { 12052 s.Policy = &v 12053 return s 12054 } 12055 12056 type GetKeyRotationStatusInput struct { 12057 _ struct{} `type:"structure"` 12058 12059 // Gets the rotation status for the specified KMS key. 12060 // 12061 // Specify the key ID or key ARN of the KMS key. To specify a KMS key in a different 12062 // Amazon Web Services account, you must use the key ARN. 12063 // 12064 // For example: 12065 // 12066 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 12067 // 12068 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 12069 // 12070 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 12071 // 12072 // KeyId is a required field 12073 KeyId *string `min:"1" type:"string" required:"true"` 12074 } 12075 12076 // String returns the string representation. 12077 // 12078 // API parameter values that are decorated as "sensitive" in the API will not 12079 // be included in the string output. The member name will be present, but the 12080 // value will be replaced with "sensitive". 12081 func (s GetKeyRotationStatusInput) String() string { 12082 return awsutil.Prettify(s) 12083 } 12084 12085 // GoString returns the string representation. 12086 // 12087 // API parameter values that are decorated as "sensitive" in the API will not 12088 // be included in the string output. The member name will be present, but the 12089 // value will be replaced with "sensitive". 12090 func (s GetKeyRotationStatusInput) GoString() string { 12091 return s.String() 12092 } 12093 12094 // Validate inspects the fields of the type to determine if they are valid. 12095 func (s *GetKeyRotationStatusInput) Validate() error { 12096 invalidParams := request.ErrInvalidParams{Context: "GetKeyRotationStatusInput"} 12097 if s.KeyId == nil { 12098 invalidParams.Add(request.NewErrParamRequired("KeyId")) 12099 } 12100 if s.KeyId != nil && len(*s.KeyId) < 1 { 12101 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 12102 } 12103 12104 if invalidParams.Len() > 0 { 12105 return invalidParams 12106 } 12107 return nil 12108 } 12109 12110 // SetKeyId sets the KeyId field's value. 12111 func (s *GetKeyRotationStatusInput) SetKeyId(v string) *GetKeyRotationStatusInput { 12112 s.KeyId = &v 12113 return s 12114 } 12115 12116 type GetKeyRotationStatusOutput struct { 12117 _ struct{} `type:"structure"` 12118 12119 // A Boolean value that specifies whether key rotation is enabled. 12120 KeyRotationEnabled *bool `type:"boolean"` 12121 } 12122 12123 // String returns the string representation. 12124 // 12125 // API parameter values that are decorated as "sensitive" in the API will not 12126 // be included in the string output. The member name will be present, but the 12127 // value will be replaced with "sensitive". 12128 func (s GetKeyRotationStatusOutput) String() string { 12129 return awsutil.Prettify(s) 12130 } 12131 12132 // GoString returns the string representation. 12133 // 12134 // API parameter values that are decorated as "sensitive" in the API will not 12135 // be included in the string output. The member name will be present, but the 12136 // value will be replaced with "sensitive". 12137 func (s GetKeyRotationStatusOutput) GoString() string { 12138 return s.String() 12139 } 12140 12141 // SetKeyRotationEnabled sets the KeyRotationEnabled field's value. 12142 func (s *GetKeyRotationStatusOutput) SetKeyRotationEnabled(v bool) *GetKeyRotationStatusOutput { 12143 s.KeyRotationEnabled = &v 12144 return s 12145 } 12146 12147 type GetParametersForImportInput struct { 12148 _ struct{} `type:"structure"` 12149 12150 // The identifier of the symmetric KMS key into which you will import key material. 12151 // The Origin of the KMS key must be EXTERNAL. 12152 // 12153 // Specify the key ID or key ARN of the KMS key. 12154 // 12155 // For example: 12156 // 12157 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 12158 // 12159 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 12160 // 12161 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 12162 // 12163 // KeyId is a required field 12164 KeyId *string `min:"1" type:"string" required:"true"` 12165 12166 // The algorithm you will use to encrypt the key material before importing it 12167 // with ImportKeyMaterial. For more information, see Encrypt the Key Material 12168 // (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-encrypt-key-material.html) 12169 // in the Key Management Service Developer Guide. 12170 // 12171 // WrappingAlgorithm is a required field 12172 WrappingAlgorithm *string `type:"string" required:"true" enum:"AlgorithmSpec"` 12173 12174 // The type of wrapping key (public key) to return in the response. Only 2048-bit 12175 // RSA public keys are supported. 12176 // 12177 // WrappingKeySpec is a required field 12178 WrappingKeySpec *string `type:"string" required:"true" enum:"WrappingKeySpec"` 12179 } 12180 12181 // String returns the string representation. 12182 // 12183 // API parameter values that are decorated as "sensitive" in the API will not 12184 // be included in the string output. The member name will be present, but the 12185 // value will be replaced with "sensitive". 12186 func (s GetParametersForImportInput) String() string { 12187 return awsutil.Prettify(s) 12188 } 12189 12190 // GoString returns the string representation. 12191 // 12192 // API parameter values that are decorated as "sensitive" in the API will not 12193 // be included in the string output. The member name will be present, but the 12194 // value will be replaced with "sensitive". 12195 func (s GetParametersForImportInput) GoString() string { 12196 return s.String() 12197 } 12198 12199 // Validate inspects the fields of the type to determine if they are valid. 12200 func (s *GetParametersForImportInput) Validate() error { 12201 invalidParams := request.ErrInvalidParams{Context: "GetParametersForImportInput"} 12202 if s.KeyId == nil { 12203 invalidParams.Add(request.NewErrParamRequired("KeyId")) 12204 } 12205 if s.KeyId != nil && len(*s.KeyId) < 1 { 12206 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 12207 } 12208 if s.WrappingAlgorithm == nil { 12209 invalidParams.Add(request.NewErrParamRequired("WrappingAlgorithm")) 12210 } 12211 if s.WrappingKeySpec == nil { 12212 invalidParams.Add(request.NewErrParamRequired("WrappingKeySpec")) 12213 } 12214 12215 if invalidParams.Len() > 0 { 12216 return invalidParams 12217 } 12218 return nil 12219 } 12220 12221 // SetKeyId sets the KeyId field's value. 12222 func (s *GetParametersForImportInput) SetKeyId(v string) *GetParametersForImportInput { 12223 s.KeyId = &v 12224 return s 12225 } 12226 12227 // SetWrappingAlgorithm sets the WrappingAlgorithm field's value. 12228 func (s *GetParametersForImportInput) SetWrappingAlgorithm(v string) *GetParametersForImportInput { 12229 s.WrappingAlgorithm = &v 12230 return s 12231 } 12232 12233 // SetWrappingKeySpec sets the WrappingKeySpec field's value. 12234 func (s *GetParametersForImportInput) SetWrappingKeySpec(v string) *GetParametersForImportInput { 12235 s.WrappingKeySpec = &v 12236 return s 12237 } 12238 12239 type GetParametersForImportOutput struct { 12240 _ struct{} `type:"structure"` 12241 12242 // The import token to send in a subsequent ImportKeyMaterial request. 12243 // ImportToken is automatically base64 encoded/decoded by the SDK. 12244 ImportToken []byte `min:"1" type:"blob"` 12245 12246 // The Amazon Resource Name (key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN)) 12247 // of the KMS key to use in a subsequent ImportKeyMaterial request. This is 12248 // the same KMS key specified in the GetParametersForImport request. 12249 KeyId *string `min:"1" type:"string"` 12250 12251 // The time at which the import token and public key are no longer valid. After 12252 // this time, you cannot use them to make an ImportKeyMaterial request and you 12253 // must send another GetParametersForImport request to get new ones. 12254 ParametersValidTo *time.Time `type:"timestamp"` 12255 12256 // The public key to use to encrypt the key material before importing it with 12257 // ImportKeyMaterial. 12258 // 12259 // PublicKey is a sensitive parameter and its value will be 12260 // replaced with "sensitive" in string returned by GetParametersForImportOutput's 12261 // String and GoString methods. 12262 // 12263 // PublicKey is automatically base64 encoded/decoded by the SDK. 12264 PublicKey []byte `min:"1" type:"blob" sensitive:"true"` 12265 } 12266 12267 // String returns the string representation. 12268 // 12269 // API parameter values that are decorated as "sensitive" in the API will not 12270 // be included in the string output. The member name will be present, but the 12271 // value will be replaced with "sensitive". 12272 func (s GetParametersForImportOutput) String() string { 12273 return awsutil.Prettify(s) 12274 } 12275 12276 // GoString returns the string representation. 12277 // 12278 // API parameter values that are decorated as "sensitive" in the API will not 12279 // be included in the string output. The member name will be present, but the 12280 // value will be replaced with "sensitive". 12281 func (s GetParametersForImportOutput) GoString() string { 12282 return s.String() 12283 } 12284 12285 // SetImportToken sets the ImportToken field's value. 12286 func (s *GetParametersForImportOutput) SetImportToken(v []byte) *GetParametersForImportOutput { 12287 s.ImportToken = v 12288 return s 12289 } 12290 12291 // SetKeyId sets the KeyId field's value. 12292 func (s *GetParametersForImportOutput) SetKeyId(v string) *GetParametersForImportOutput { 12293 s.KeyId = &v 12294 return s 12295 } 12296 12297 // SetParametersValidTo sets the ParametersValidTo field's value. 12298 func (s *GetParametersForImportOutput) SetParametersValidTo(v time.Time) *GetParametersForImportOutput { 12299 s.ParametersValidTo = &v 12300 return s 12301 } 12302 12303 // SetPublicKey sets the PublicKey field's value. 12304 func (s *GetParametersForImportOutput) SetPublicKey(v []byte) *GetParametersForImportOutput { 12305 s.PublicKey = v 12306 return s 12307 } 12308 12309 type GetPublicKeyInput struct { 12310 _ struct{} `type:"structure"` 12311 12312 // A list of grant tokens. 12313 // 12314 // Use a grant token when your permission to call this operation comes from 12315 // a new grant that has not yet achieved eventual consistency. For more information, 12316 // see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) 12317 // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) 12318 // in the Key Management Service Developer Guide. 12319 GrantTokens []*string `type:"list"` 12320 12321 // Identifies the asymmetric KMS key that includes the public key. 12322 // 12323 // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. 12324 // When using an alias name, prefix it with "alias/". To specify a KMS key in 12325 // a different Amazon Web Services account, you must use the key ARN or alias 12326 // ARN. 12327 // 12328 // For example: 12329 // 12330 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 12331 // 12332 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 12333 // 12334 // * Alias name: alias/ExampleAlias 12335 // 12336 // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias 12337 // 12338 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 12339 // To get the alias name and alias ARN, use ListAliases. 12340 // 12341 // KeyId is a required field 12342 KeyId *string `min:"1" type:"string" required:"true"` 12343 } 12344 12345 // String returns the string representation. 12346 // 12347 // API parameter values that are decorated as "sensitive" in the API will not 12348 // be included in the string output. The member name will be present, but the 12349 // value will be replaced with "sensitive". 12350 func (s GetPublicKeyInput) String() string { 12351 return awsutil.Prettify(s) 12352 } 12353 12354 // GoString returns the string representation. 12355 // 12356 // API parameter values that are decorated as "sensitive" in the API will not 12357 // be included in the string output. The member name will be present, but the 12358 // value will be replaced with "sensitive". 12359 func (s GetPublicKeyInput) GoString() string { 12360 return s.String() 12361 } 12362 12363 // Validate inspects the fields of the type to determine if they are valid. 12364 func (s *GetPublicKeyInput) Validate() error { 12365 invalidParams := request.ErrInvalidParams{Context: "GetPublicKeyInput"} 12366 if s.KeyId == nil { 12367 invalidParams.Add(request.NewErrParamRequired("KeyId")) 12368 } 12369 if s.KeyId != nil && len(*s.KeyId) < 1 { 12370 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 12371 } 12372 12373 if invalidParams.Len() > 0 { 12374 return invalidParams 12375 } 12376 return nil 12377 } 12378 12379 // SetGrantTokens sets the GrantTokens field's value. 12380 func (s *GetPublicKeyInput) SetGrantTokens(v []*string) *GetPublicKeyInput { 12381 s.GrantTokens = v 12382 return s 12383 } 12384 12385 // SetKeyId sets the KeyId field's value. 12386 func (s *GetPublicKeyInput) SetKeyId(v string) *GetPublicKeyInput { 12387 s.KeyId = &v 12388 return s 12389 } 12390 12391 type GetPublicKeyOutput struct { 12392 _ struct{} `type:"structure"` 12393 12394 // Instead, use the KeySpec field in the GetPublicKey response. 12395 // 12396 // The KeySpec and CustomerMasterKeySpec fields have the same value. We recommend 12397 // that you use the KeySpec field in your code. However, to avoid breaking changes, 12398 // KMS will support both fields. 12399 // 12400 // Deprecated: This field has been deprecated. Instead, use the KeySpec field. 12401 CustomerMasterKeySpec *string `deprecated:"true" type:"string" enum:"CustomerMasterKeySpec"` 12402 12403 // The encryption algorithms that KMS supports for this key. 12404 // 12405 // This information is critical. If a public key encrypts data outside of KMS 12406 // by using an unsupported encryption algorithm, the ciphertext cannot be decrypted. 12407 // 12408 // This field appears in the response only when the KeyUsage of the public key 12409 // is ENCRYPT_DECRYPT. 12410 EncryptionAlgorithms []*string `type:"list"` 12411 12412 // The Amazon Resource Name (key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN)) 12413 // of the asymmetric KMS key from which the public key was downloaded. 12414 KeyId *string `min:"1" type:"string"` 12415 12416 // The type of the of the public key that was downloaded. 12417 KeySpec *string `type:"string" enum:"KeySpec"` 12418 12419 // The permitted use of the public key. Valid values are ENCRYPT_DECRYPT or 12420 // SIGN_VERIFY. 12421 // 12422 // This information is critical. If a public key with SIGN_VERIFY key usage 12423 // encrypts data outside of KMS, the ciphertext cannot be decrypted. 12424 KeyUsage *string `type:"string" enum:"KeyUsageType"` 12425 12426 // The exported public key. 12427 // 12428 // The value is a DER-encoded X.509 public key, also known as SubjectPublicKeyInfo 12429 // (SPKI), as defined in RFC 5280 (https://tools.ietf.org/html/rfc5280). When 12430 // you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. 12431 // Otherwise, it is not Base64-encoded. 12432 // PublicKey is automatically base64 encoded/decoded by the SDK. 12433 PublicKey []byte `min:"1" type:"blob"` 12434 12435 // The signing algorithms that KMS supports for this key. 12436 // 12437 // This field appears in the response only when the KeyUsage of the public key 12438 // is SIGN_VERIFY. 12439 SigningAlgorithms []*string `type:"list"` 12440 } 12441 12442 // String returns the string representation. 12443 // 12444 // API parameter values that are decorated as "sensitive" in the API will not 12445 // be included in the string output. The member name will be present, but the 12446 // value will be replaced with "sensitive". 12447 func (s GetPublicKeyOutput) String() string { 12448 return awsutil.Prettify(s) 12449 } 12450 12451 // GoString returns the string representation. 12452 // 12453 // API parameter values that are decorated as "sensitive" in the API will not 12454 // be included in the string output. The member name will be present, but the 12455 // value will be replaced with "sensitive". 12456 func (s GetPublicKeyOutput) GoString() string { 12457 return s.String() 12458 } 12459 12460 // SetCustomerMasterKeySpec sets the CustomerMasterKeySpec field's value. 12461 func (s *GetPublicKeyOutput) SetCustomerMasterKeySpec(v string) *GetPublicKeyOutput { 12462 s.CustomerMasterKeySpec = &v 12463 return s 12464 } 12465 12466 // SetEncryptionAlgorithms sets the EncryptionAlgorithms field's value. 12467 func (s *GetPublicKeyOutput) SetEncryptionAlgorithms(v []*string) *GetPublicKeyOutput { 12468 s.EncryptionAlgorithms = v 12469 return s 12470 } 12471 12472 // SetKeyId sets the KeyId field's value. 12473 func (s *GetPublicKeyOutput) SetKeyId(v string) *GetPublicKeyOutput { 12474 s.KeyId = &v 12475 return s 12476 } 12477 12478 // SetKeySpec sets the KeySpec field's value. 12479 func (s *GetPublicKeyOutput) SetKeySpec(v string) *GetPublicKeyOutput { 12480 s.KeySpec = &v 12481 return s 12482 } 12483 12484 // SetKeyUsage sets the KeyUsage field's value. 12485 func (s *GetPublicKeyOutput) SetKeyUsage(v string) *GetPublicKeyOutput { 12486 s.KeyUsage = &v 12487 return s 12488 } 12489 12490 // SetPublicKey sets the PublicKey field's value. 12491 func (s *GetPublicKeyOutput) SetPublicKey(v []byte) *GetPublicKeyOutput { 12492 s.PublicKey = v 12493 return s 12494 } 12495 12496 // SetSigningAlgorithms sets the SigningAlgorithms field's value. 12497 func (s *GetPublicKeyOutput) SetSigningAlgorithms(v []*string) *GetPublicKeyOutput { 12498 s.SigningAlgorithms = v 12499 return s 12500 } 12501 12502 // Use this structure to allow cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) 12503 // in the grant only when the operation request includes the specified encryption 12504 // context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context). 12505 // 12506 // KMS applies the grant constraints only to cryptographic operations that support 12507 // an encryption context, that is, all cryptographic operations with a symmetric 12508 // KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#symmetric-cmks). 12509 // Grant constraints are not applied to operations that do not support an encryption 12510 // context, such as cryptographic operations with asymmetric KMS keys and management 12511 // operations, such as DescribeKey or RetireGrant. 12512 // 12513 // In a cryptographic operation, the encryption context in the decryption operation 12514 // must be an exact, case-sensitive match for the keys and values in the encryption 12515 // context of the encryption operation. Only the order of the pairs can vary. 12516 // 12517 // However, in a grant constraint, the key in each key-value pair is not case 12518 // sensitive, but the value is case sensitive. 12519 // 12520 // To avoid confusion, do not use multiple encryption context pairs that differ 12521 // only by case. To require a fully case-sensitive encryption context, use the 12522 // kms:EncryptionContext: and kms:EncryptionContextKeys conditions in an IAM 12523 // or key policy. For details, see kms:EncryptionContext: (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-context) 12524 // in the Key Management Service Developer Guide . 12525 type GrantConstraints struct { 12526 _ struct{} `type:"structure"` 12527 12528 // A list of key-value pairs that must match the encryption context in the cryptographic 12529 // operation (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) 12530 // request. The grant allows the operation only when the encryption context 12531 // in the request is the same as the encryption context specified in this constraint. 12532 EncryptionContextEquals map[string]*string `type:"map"` 12533 12534 // A list of key-value pairs that must be included in the encryption context 12535 // of the cryptographic operation (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) 12536 // request. The grant allows the cryptographic operation only when the encryption 12537 // context in the request includes the key-value pairs specified in this constraint, 12538 // although it can include additional key-value pairs. 12539 EncryptionContextSubset map[string]*string `type:"map"` 12540 } 12541 12542 // String returns the string representation. 12543 // 12544 // API parameter values that are decorated as "sensitive" in the API will not 12545 // be included in the string output. The member name will be present, but the 12546 // value will be replaced with "sensitive". 12547 func (s GrantConstraints) String() string { 12548 return awsutil.Prettify(s) 12549 } 12550 12551 // GoString returns the string representation. 12552 // 12553 // API parameter values that are decorated as "sensitive" in the API will not 12554 // be included in the string output. The member name will be present, but the 12555 // value will be replaced with "sensitive". 12556 func (s GrantConstraints) GoString() string { 12557 return s.String() 12558 } 12559 12560 // SetEncryptionContextEquals sets the EncryptionContextEquals field's value. 12561 func (s *GrantConstraints) SetEncryptionContextEquals(v map[string]*string) *GrantConstraints { 12562 s.EncryptionContextEquals = v 12563 return s 12564 } 12565 12566 // SetEncryptionContextSubset sets the EncryptionContextSubset field's value. 12567 func (s *GrantConstraints) SetEncryptionContextSubset(v map[string]*string) *GrantConstraints { 12568 s.EncryptionContextSubset = v 12569 return s 12570 } 12571 12572 // Contains information about a grant. 12573 type GrantListEntry struct { 12574 _ struct{} `type:"structure"` 12575 12576 // A list of key-value pairs that must be present in the encryption context 12577 // of certain subsequent operations that the grant allows. 12578 Constraints *GrantConstraints `type:"structure"` 12579 12580 // The date and time when the grant was created. 12581 CreationDate *time.Time `type:"timestamp"` 12582 12583 // The unique identifier for the grant. 12584 GrantId *string `min:"1" type:"string"` 12585 12586 // The identity that gets the permissions in the grant. 12587 // 12588 // The GranteePrincipal field in the ListGrants response usually contains the 12589 // user or role designated as the grantee principal in the grant. However, when 12590 // the grantee principal in the grant is an Amazon Web Services service, the 12591 // GranteePrincipal field contains the service principal (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services), 12592 // which might represent several different grantee principals. 12593 GranteePrincipal *string `min:"1" type:"string"` 12594 12595 // The Amazon Web Services account under which the grant was issued. 12596 IssuingAccount *string `min:"1" type:"string"` 12597 12598 // The unique identifier for the KMS key to which the grant applies. 12599 KeyId *string `min:"1" type:"string"` 12600 12601 // The friendly name that identifies the grant. If a name was provided in the 12602 // CreateGrant request, that name is returned. Otherwise this value is null. 12603 Name *string `min:"1" type:"string"` 12604 12605 // The list of operations permitted by the grant. 12606 Operations []*string `type:"list"` 12607 12608 // The principal that can retire the grant. 12609 RetiringPrincipal *string `min:"1" type:"string"` 12610 } 12611 12612 // String returns the string representation. 12613 // 12614 // API parameter values that are decorated as "sensitive" in the API will not 12615 // be included in the string output. The member name will be present, but the 12616 // value will be replaced with "sensitive". 12617 func (s GrantListEntry) String() string { 12618 return awsutil.Prettify(s) 12619 } 12620 12621 // GoString returns the string representation. 12622 // 12623 // API parameter values that are decorated as "sensitive" in the API will not 12624 // be included in the string output. The member name will be present, but the 12625 // value will be replaced with "sensitive". 12626 func (s GrantListEntry) GoString() string { 12627 return s.String() 12628 } 12629 12630 // SetConstraints sets the Constraints field's value. 12631 func (s *GrantListEntry) SetConstraints(v *GrantConstraints) *GrantListEntry { 12632 s.Constraints = v 12633 return s 12634 } 12635 12636 // SetCreationDate sets the CreationDate field's value. 12637 func (s *GrantListEntry) SetCreationDate(v time.Time) *GrantListEntry { 12638 s.CreationDate = &v 12639 return s 12640 } 12641 12642 // SetGrantId sets the GrantId field's value. 12643 func (s *GrantListEntry) SetGrantId(v string) *GrantListEntry { 12644 s.GrantId = &v 12645 return s 12646 } 12647 12648 // SetGranteePrincipal sets the GranteePrincipal field's value. 12649 func (s *GrantListEntry) SetGranteePrincipal(v string) *GrantListEntry { 12650 s.GranteePrincipal = &v 12651 return s 12652 } 12653 12654 // SetIssuingAccount sets the IssuingAccount field's value. 12655 func (s *GrantListEntry) SetIssuingAccount(v string) *GrantListEntry { 12656 s.IssuingAccount = &v 12657 return s 12658 } 12659 12660 // SetKeyId sets the KeyId field's value. 12661 func (s *GrantListEntry) SetKeyId(v string) *GrantListEntry { 12662 s.KeyId = &v 12663 return s 12664 } 12665 12666 // SetName sets the Name field's value. 12667 func (s *GrantListEntry) SetName(v string) *GrantListEntry { 12668 s.Name = &v 12669 return s 12670 } 12671 12672 // SetOperations sets the Operations field's value. 12673 func (s *GrantListEntry) SetOperations(v []*string) *GrantListEntry { 12674 s.Operations = v 12675 return s 12676 } 12677 12678 // SetRetiringPrincipal sets the RetiringPrincipal field's value. 12679 func (s *GrantListEntry) SetRetiringPrincipal(v string) *GrantListEntry { 12680 s.RetiringPrincipal = &v 12681 return s 12682 } 12683 12684 type ImportKeyMaterialInput struct { 12685 _ struct{} `type:"structure"` 12686 12687 // The encrypted key material to import. The key material must be encrypted 12688 // with the public wrapping key that GetParametersForImport returned, using 12689 // the wrapping algorithm that you specified in the same GetParametersForImport 12690 // request. 12691 // EncryptedKeyMaterial is automatically base64 encoded/decoded by the SDK. 12692 // 12693 // EncryptedKeyMaterial is a required field 12694 EncryptedKeyMaterial []byte `min:"1" type:"blob" required:"true"` 12695 12696 // Specifies whether the key material expires. The default is KEY_MATERIAL_EXPIRES, 12697 // in which case you must include the ValidTo parameter. When this parameter 12698 // is set to KEY_MATERIAL_DOES_NOT_EXPIRE, you must omit the ValidTo parameter. 12699 ExpirationModel *string `type:"string" enum:"ExpirationModelType"` 12700 12701 // The import token that you received in the response to a previous GetParametersForImport 12702 // request. It must be from the same response that contained the public key 12703 // that you used to encrypt the key material. 12704 // ImportToken is automatically base64 encoded/decoded by the SDK. 12705 // 12706 // ImportToken is a required field 12707 ImportToken []byte `min:"1" type:"blob" required:"true"` 12708 12709 // The identifier of the symmetric KMS key that receives the imported key material. 12710 // The KMS key's Origin must be EXTERNAL. This must be the same KMS key specified 12711 // in the KeyID parameter of the corresponding GetParametersForImport request. 12712 // 12713 // Specify the key ID or key ARN of the KMS key. 12714 // 12715 // For example: 12716 // 12717 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 12718 // 12719 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 12720 // 12721 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 12722 // 12723 // KeyId is a required field 12724 KeyId *string `min:"1" type:"string" required:"true"` 12725 12726 // The time at which the imported key material expires. When the key material 12727 // expires, KMS deletes the key material and the KMS key becomes unusable. You 12728 // must omit this parameter when the ExpirationModel parameter is set to KEY_MATERIAL_DOES_NOT_EXPIRE. 12729 // Otherwise it is required. 12730 ValidTo *time.Time `type:"timestamp"` 12731 } 12732 12733 // String returns the string representation. 12734 // 12735 // API parameter values that are decorated as "sensitive" in the API will not 12736 // be included in the string output. The member name will be present, but the 12737 // value will be replaced with "sensitive". 12738 func (s ImportKeyMaterialInput) String() string { 12739 return awsutil.Prettify(s) 12740 } 12741 12742 // GoString returns the string representation. 12743 // 12744 // API parameter values that are decorated as "sensitive" in the API will not 12745 // be included in the string output. The member name will be present, but the 12746 // value will be replaced with "sensitive". 12747 func (s ImportKeyMaterialInput) GoString() string { 12748 return s.String() 12749 } 12750 12751 // Validate inspects the fields of the type to determine if they are valid. 12752 func (s *ImportKeyMaterialInput) Validate() error { 12753 invalidParams := request.ErrInvalidParams{Context: "ImportKeyMaterialInput"} 12754 if s.EncryptedKeyMaterial == nil { 12755 invalidParams.Add(request.NewErrParamRequired("EncryptedKeyMaterial")) 12756 } 12757 if s.EncryptedKeyMaterial != nil && len(s.EncryptedKeyMaterial) < 1 { 12758 invalidParams.Add(request.NewErrParamMinLen("EncryptedKeyMaterial", 1)) 12759 } 12760 if s.ImportToken == nil { 12761 invalidParams.Add(request.NewErrParamRequired("ImportToken")) 12762 } 12763 if s.ImportToken != nil && len(s.ImportToken) < 1 { 12764 invalidParams.Add(request.NewErrParamMinLen("ImportToken", 1)) 12765 } 12766 if s.KeyId == nil { 12767 invalidParams.Add(request.NewErrParamRequired("KeyId")) 12768 } 12769 if s.KeyId != nil && len(*s.KeyId) < 1 { 12770 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 12771 } 12772 12773 if invalidParams.Len() > 0 { 12774 return invalidParams 12775 } 12776 return nil 12777 } 12778 12779 // SetEncryptedKeyMaterial sets the EncryptedKeyMaterial field's value. 12780 func (s *ImportKeyMaterialInput) SetEncryptedKeyMaterial(v []byte) *ImportKeyMaterialInput { 12781 s.EncryptedKeyMaterial = v 12782 return s 12783 } 12784 12785 // SetExpirationModel sets the ExpirationModel field's value. 12786 func (s *ImportKeyMaterialInput) SetExpirationModel(v string) *ImportKeyMaterialInput { 12787 s.ExpirationModel = &v 12788 return s 12789 } 12790 12791 // SetImportToken sets the ImportToken field's value. 12792 func (s *ImportKeyMaterialInput) SetImportToken(v []byte) *ImportKeyMaterialInput { 12793 s.ImportToken = v 12794 return s 12795 } 12796 12797 // SetKeyId sets the KeyId field's value. 12798 func (s *ImportKeyMaterialInput) SetKeyId(v string) *ImportKeyMaterialInput { 12799 s.KeyId = &v 12800 return s 12801 } 12802 12803 // SetValidTo sets the ValidTo field's value. 12804 func (s *ImportKeyMaterialInput) SetValidTo(v time.Time) *ImportKeyMaterialInput { 12805 s.ValidTo = &v 12806 return s 12807 } 12808 12809 type ImportKeyMaterialOutput struct { 12810 _ struct{} `type:"structure"` 12811 } 12812 12813 // String returns the string representation. 12814 // 12815 // API parameter values that are decorated as "sensitive" in the API will not 12816 // be included in the string output. The member name will be present, but the 12817 // value will be replaced with "sensitive". 12818 func (s ImportKeyMaterialOutput) String() string { 12819 return awsutil.Prettify(s) 12820 } 12821 12822 // GoString returns the string representation. 12823 // 12824 // API parameter values that are decorated as "sensitive" in the API will not 12825 // be included in the string output. The member name will be present, but the 12826 // value will be replaced with "sensitive". 12827 func (s ImportKeyMaterialOutput) GoString() string { 12828 return s.String() 12829 } 12830 12831 // The request was rejected because the specified KMS key cannot decrypt the 12832 // data. The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request 12833 // must identify the same KMS key that was used to encrypt the ciphertext. 12834 type IncorrectKeyException struct { 12835 _ struct{} `type:"structure"` 12836 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 12837 12838 Message_ *string `locationName:"message" type:"string"` 12839 } 12840 12841 // String returns the string representation. 12842 // 12843 // API parameter values that are decorated as "sensitive" in the API will not 12844 // be included in the string output. The member name will be present, but the 12845 // value will be replaced with "sensitive". 12846 func (s IncorrectKeyException) String() string { 12847 return awsutil.Prettify(s) 12848 } 12849 12850 // GoString returns the string representation. 12851 // 12852 // API parameter values that are decorated as "sensitive" in the API will not 12853 // be included in the string output. The member name will be present, but the 12854 // value will be replaced with "sensitive". 12855 func (s IncorrectKeyException) GoString() string { 12856 return s.String() 12857 } 12858 12859 func newErrorIncorrectKeyException(v protocol.ResponseMetadata) error { 12860 return &IncorrectKeyException{ 12861 RespMetadata: v, 12862 } 12863 } 12864 12865 // Code returns the exception type name. 12866 func (s *IncorrectKeyException) Code() string { 12867 return "IncorrectKeyException" 12868 } 12869 12870 // Message returns the exception's message. 12871 func (s *IncorrectKeyException) Message() string { 12872 if s.Message_ != nil { 12873 return *s.Message_ 12874 } 12875 return "" 12876 } 12877 12878 // OrigErr always returns nil, satisfies awserr.Error interface. 12879 func (s *IncorrectKeyException) OrigErr() error { 12880 return nil 12881 } 12882 12883 func (s *IncorrectKeyException) Error() string { 12884 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 12885 } 12886 12887 // Status code returns the HTTP status code for the request's response error. 12888 func (s *IncorrectKeyException) StatusCode() int { 12889 return s.RespMetadata.StatusCode 12890 } 12891 12892 // RequestID returns the service's response RequestID for request. 12893 func (s *IncorrectKeyException) RequestID() string { 12894 return s.RespMetadata.RequestID 12895 } 12896 12897 // The request was rejected because the key material in the request is, expired, 12898 // invalid, or is not the same key material that was previously imported into 12899 // this KMS key. 12900 type IncorrectKeyMaterialException struct { 12901 _ struct{} `type:"structure"` 12902 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 12903 12904 Message_ *string `locationName:"message" type:"string"` 12905 } 12906 12907 // String returns the string representation. 12908 // 12909 // API parameter values that are decorated as "sensitive" in the API will not 12910 // be included in the string output. The member name will be present, but the 12911 // value will be replaced with "sensitive". 12912 func (s IncorrectKeyMaterialException) String() string { 12913 return awsutil.Prettify(s) 12914 } 12915 12916 // GoString returns the string representation. 12917 // 12918 // API parameter values that are decorated as "sensitive" in the API will not 12919 // be included in the string output. The member name will be present, but the 12920 // value will be replaced with "sensitive". 12921 func (s IncorrectKeyMaterialException) GoString() string { 12922 return s.String() 12923 } 12924 12925 func newErrorIncorrectKeyMaterialException(v protocol.ResponseMetadata) error { 12926 return &IncorrectKeyMaterialException{ 12927 RespMetadata: v, 12928 } 12929 } 12930 12931 // Code returns the exception type name. 12932 func (s *IncorrectKeyMaterialException) Code() string { 12933 return "IncorrectKeyMaterialException" 12934 } 12935 12936 // Message returns the exception's message. 12937 func (s *IncorrectKeyMaterialException) Message() string { 12938 if s.Message_ != nil { 12939 return *s.Message_ 12940 } 12941 return "" 12942 } 12943 12944 // OrigErr always returns nil, satisfies awserr.Error interface. 12945 func (s *IncorrectKeyMaterialException) OrigErr() error { 12946 return nil 12947 } 12948 12949 func (s *IncorrectKeyMaterialException) Error() string { 12950 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 12951 } 12952 12953 // Status code returns the HTTP status code for the request's response error. 12954 func (s *IncorrectKeyMaterialException) StatusCode() int { 12955 return s.RespMetadata.StatusCode 12956 } 12957 12958 // RequestID returns the service's response RequestID for request. 12959 func (s *IncorrectKeyMaterialException) RequestID() string { 12960 return s.RespMetadata.RequestID 12961 } 12962 12963 // The request was rejected because the trust anchor certificate in the request 12964 // is not the trust anchor certificate for the specified CloudHSM cluster. 12965 // 12966 // When you initialize the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr), 12967 // you create the trust anchor certificate and save it in the customerCA.crt 12968 // file. 12969 type IncorrectTrustAnchorException struct { 12970 _ struct{} `type:"structure"` 12971 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 12972 12973 Message_ *string `locationName:"message" type:"string"` 12974 } 12975 12976 // String returns the string representation. 12977 // 12978 // API parameter values that are decorated as "sensitive" in the API will not 12979 // be included in the string output. The member name will be present, but the 12980 // value will be replaced with "sensitive". 12981 func (s IncorrectTrustAnchorException) String() string { 12982 return awsutil.Prettify(s) 12983 } 12984 12985 // GoString returns the string representation. 12986 // 12987 // API parameter values that are decorated as "sensitive" in the API will not 12988 // be included in the string output. The member name will be present, but the 12989 // value will be replaced with "sensitive". 12990 func (s IncorrectTrustAnchorException) GoString() string { 12991 return s.String() 12992 } 12993 12994 func newErrorIncorrectTrustAnchorException(v protocol.ResponseMetadata) error { 12995 return &IncorrectTrustAnchorException{ 12996 RespMetadata: v, 12997 } 12998 } 12999 13000 // Code returns the exception type name. 13001 func (s *IncorrectTrustAnchorException) Code() string { 13002 return "IncorrectTrustAnchorException" 13003 } 13004 13005 // Message returns the exception's message. 13006 func (s *IncorrectTrustAnchorException) Message() string { 13007 if s.Message_ != nil { 13008 return *s.Message_ 13009 } 13010 return "" 13011 } 13012 13013 // OrigErr always returns nil, satisfies awserr.Error interface. 13014 func (s *IncorrectTrustAnchorException) OrigErr() error { 13015 return nil 13016 } 13017 13018 func (s *IncorrectTrustAnchorException) Error() string { 13019 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 13020 } 13021 13022 // Status code returns the HTTP status code for the request's response error. 13023 func (s *IncorrectTrustAnchorException) StatusCode() int { 13024 return s.RespMetadata.StatusCode 13025 } 13026 13027 // RequestID returns the service's response RequestID for request. 13028 func (s *IncorrectTrustAnchorException) RequestID() string { 13029 return s.RespMetadata.RequestID 13030 } 13031 13032 // The request was rejected because an internal exception occurred. The request 13033 // can be retried. 13034 type InternalException struct { 13035 _ struct{} `type:"structure"` 13036 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 13037 13038 Message_ *string `locationName:"message" type:"string"` 13039 } 13040 13041 // String returns the string representation. 13042 // 13043 // API parameter values that are decorated as "sensitive" in the API will not 13044 // be included in the string output. The member name will be present, but the 13045 // value will be replaced with "sensitive". 13046 func (s InternalException) String() string { 13047 return awsutil.Prettify(s) 13048 } 13049 13050 // GoString returns the string representation. 13051 // 13052 // API parameter values that are decorated as "sensitive" in the API will not 13053 // be included in the string output. The member name will be present, but the 13054 // value will be replaced with "sensitive". 13055 func (s InternalException) GoString() string { 13056 return s.String() 13057 } 13058 13059 func newErrorInternalException(v protocol.ResponseMetadata) error { 13060 return &InternalException{ 13061 RespMetadata: v, 13062 } 13063 } 13064 13065 // Code returns the exception type name. 13066 func (s *InternalException) Code() string { 13067 return "KMSInternalException" 13068 } 13069 13070 // Message returns the exception's message. 13071 func (s *InternalException) Message() string { 13072 if s.Message_ != nil { 13073 return *s.Message_ 13074 } 13075 return "" 13076 } 13077 13078 // OrigErr always returns nil, satisfies awserr.Error interface. 13079 func (s *InternalException) OrigErr() error { 13080 return nil 13081 } 13082 13083 func (s *InternalException) Error() string { 13084 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 13085 } 13086 13087 // Status code returns the HTTP status code for the request's response error. 13088 func (s *InternalException) StatusCode() int { 13089 return s.RespMetadata.StatusCode 13090 } 13091 13092 // RequestID returns the service's response RequestID for request. 13093 func (s *InternalException) RequestID() string { 13094 return s.RespMetadata.RequestID 13095 } 13096 13097 // The request was rejected because the specified alias name is not valid. 13098 type InvalidAliasNameException struct { 13099 _ struct{} `type:"structure"` 13100 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 13101 13102 Message_ *string `locationName:"message" type:"string"` 13103 } 13104 13105 // String returns the string representation. 13106 // 13107 // API parameter values that are decorated as "sensitive" in the API will not 13108 // be included in the string output. The member name will be present, but the 13109 // value will be replaced with "sensitive". 13110 func (s InvalidAliasNameException) String() string { 13111 return awsutil.Prettify(s) 13112 } 13113 13114 // GoString returns the string representation. 13115 // 13116 // API parameter values that are decorated as "sensitive" in the API will not 13117 // be included in the string output. The member name will be present, but the 13118 // value will be replaced with "sensitive". 13119 func (s InvalidAliasNameException) GoString() string { 13120 return s.String() 13121 } 13122 13123 func newErrorInvalidAliasNameException(v protocol.ResponseMetadata) error { 13124 return &InvalidAliasNameException{ 13125 RespMetadata: v, 13126 } 13127 } 13128 13129 // Code returns the exception type name. 13130 func (s *InvalidAliasNameException) Code() string { 13131 return "InvalidAliasNameException" 13132 } 13133 13134 // Message returns the exception's message. 13135 func (s *InvalidAliasNameException) Message() string { 13136 if s.Message_ != nil { 13137 return *s.Message_ 13138 } 13139 return "" 13140 } 13141 13142 // OrigErr always returns nil, satisfies awserr.Error interface. 13143 func (s *InvalidAliasNameException) OrigErr() error { 13144 return nil 13145 } 13146 13147 func (s *InvalidAliasNameException) Error() string { 13148 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 13149 } 13150 13151 // Status code returns the HTTP status code for the request's response error. 13152 func (s *InvalidAliasNameException) StatusCode() int { 13153 return s.RespMetadata.StatusCode 13154 } 13155 13156 // RequestID returns the service's response RequestID for request. 13157 func (s *InvalidAliasNameException) RequestID() string { 13158 return s.RespMetadata.RequestID 13159 } 13160 13161 // The request was rejected because a specified ARN, or an ARN in a key policy, 13162 // is not valid. 13163 type InvalidArnException struct { 13164 _ struct{} `type:"structure"` 13165 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 13166 13167 Message_ *string `locationName:"message" type:"string"` 13168 } 13169 13170 // String returns the string representation. 13171 // 13172 // API parameter values that are decorated as "sensitive" in the API will not 13173 // be included in the string output. The member name will be present, but the 13174 // value will be replaced with "sensitive". 13175 func (s InvalidArnException) String() string { 13176 return awsutil.Prettify(s) 13177 } 13178 13179 // GoString returns the string representation. 13180 // 13181 // API parameter values that are decorated as "sensitive" in the API will not 13182 // be included in the string output. The member name will be present, but the 13183 // value will be replaced with "sensitive". 13184 func (s InvalidArnException) GoString() string { 13185 return s.String() 13186 } 13187 13188 func newErrorInvalidArnException(v protocol.ResponseMetadata) error { 13189 return &InvalidArnException{ 13190 RespMetadata: v, 13191 } 13192 } 13193 13194 // Code returns the exception type name. 13195 func (s *InvalidArnException) Code() string { 13196 return "InvalidArnException" 13197 } 13198 13199 // Message returns the exception's message. 13200 func (s *InvalidArnException) Message() string { 13201 if s.Message_ != nil { 13202 return *s.Message_ 13203 } 13204 return "" 13205 } 13206 13207 // OrigErr always returns nil, satisfies awserr.Error interface. 13208 func (s *InvalidArnException) OrigErr() error { 13209 return nil 13210 } 13211 13212 func (s *InvalidArnException) Error() string { 13213 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 13214 } 13215 13216 // Status code returns the HTTP status code for the request's response error. 13217 func (s *InvalidArnException) StatusCode() int { 13218 return s.RespMetadata.StatusCode 13219 } 13220 13221 // RequestID returns the service's response RequestID for request. 13222 func (s *InvalidArnException) RequestID() string { 13223 return s.RespMetadata.RequestID 13224 } 13225 13226 // From the Decrypt or ReEncrypt operation, the request was rejected because 13227 // the specified ciphertext, or additional authenticated data incorporated into 13228 // the ciphertext, such as the encryption context, is corrupted, missing, or 13229 // otherwise invalid. 13230 // 13231 // From the ImportKeyMaterial operation, the request was rejected because KMS 13232 // could not decrypt the encrypted (wrapped) key material. 13233 type InvalidCiphertextException struct { 13234 _ struct{} `type:"structure"` 13235 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 13236 13237 Message_ *string `locationName:"message" type:"string"` 13238 } 13239 13240 // String returns the string representation. 13241 // 13242 // API parameter values that are decorated as "sensitive" in the API will not 13243 // be included in the string output. The member name will be present, but the 13244 // value will be replaced with "sensitive". 13245 func (s InvalidCiphertextException) String() string { 13246 return awsutil.Prettify(s) 13247 } 13248 13249 // GoString returns the string representation. 13250 // 13251 // API parameter values that are decorated as "sensitive" in the API will not 13252 // be included in the string output. The member name will be present, but the 13253 // value will be replaced with "sensitive". 13254 func (s InvalidCiphertextException) GoString() string { 13255 return s.String() 13256 } 13257 13258 func newErrorInvalidCiphertextException(v protocol.ResponseMetadata) error { 13259 return &InvalidCiphertextException{ 13260 RespMetadata: v, 13261 } 13262 } 13263 13264 // Code returns the exception type name. 13265 func (s *InvalidCiphertextException) Code() string { 13266 return "InvalidCiphertextException" 13267 } 13268 13269 // Message returns the exception's message. 13270 func (s *InvalidCiphertextException) Message() string { 13271 if s.Message_ != nil { 13272 return *s.Message_ 13273 } 13274 return "" 13275 } 13276 13277 // OrigErr always returns nil, satisfies awserr.Error interface. 13278 func (s *InvalidCiphertextException) OrigErr() error { 13279 return nil 13280 } 13281 13282 func (s *InvalidCiphertextException) Error() string { 13283 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 13284 } 13285 13286 // Status code returns the HTTP status code for the request's response error. 13287 func (s *InvalidCiphertextException) StatusCode() int { 13288 return s.RespMetadata.StatusCode 13289 } 13290 13291 // RequestID returns the service's response RequestID for request. 13292 func (s *InvalidCiphertextException) RequestID() string { 13293 return s.RespMetadata.RequestID 13294 } 13295 13296 // The request was rejected because the specified GrantId is not valid. 13297 type InvalidGrantIdException struct { 13298 _ struct{} `type:"structure"` 13299 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 13300 13301 Message_ *string `locationName:"message" type:"string"` 13302 } 13303 13304 // String returns the string representation. 13305 // 13306 // API parameter values that are decorated as "sensitive" in the API will not 13307 // be included in the string output. The member name will be present, but the 13308 // value will be replaced with "sensitive". 13309 func (s InvalidGrantIdException) String() string { 13310 return awsutil.Prettify(s) 13311 } 13312 13313 // GoString returns the string representation. 13314 // 13315 // API parameter values that are decorated as "sensitive" in the API will not 13316 // be included in the string output. The member name will be present, but the 13317 // value will be replaced with "sensitive". 13318 func (s InvalidGrantIdException) GoString() string { 13319 return s.String() 13320 } 13321 13322 func newErrorInvalidGrantIdException(v protocol.ResponseMetadata) error { 13323 return &InvalidGrantIdException{ 13324 RespMetadata: v, 13325 } 13326 } 13327 13328 // Code returns the exception type name. 13329 func (s *InvalidGrantIdException) Code() string { 13330 return "InvalidGrantIdException" 13331 } 13332 13333 // Message returns the exception's message. 13334 func (s *InvalidGrantIdException) Message() string { 13335 if s.Message_ != nil { 13336 return *s.Message_ 13337 } 13338 return "" 13339 } 13340 13341 // OrigErr always returns nil, satisfies awserr.Error interface. 13342 func (s *InvalidGrantIdException) OrigErr() error { 13343 return nil 13344 } 13345 13346 func (s *InvalidGrantIdException) Error() string { 13347 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 13348 } 13349 13350 // Status code returns the HTTP status code for the request's response error. 13351 func (s *InvalidGrantIdException) StatusCode() int { 13352 return s.RespMetadata.StatusCode 13353 } 13354 13355 // RequestID returns the service's response RequestID for request. 13356 func (s *InvalidGrantIdException) RequestID() string { 13357 return s.RespMetadata.RequestID 13358 } 13359 13360 // The request was rejected because the specified grant token is not valid. 13361 type InvalidGrantTokenException struct { 13362 _ struct{} `type:"structure"` 13363 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 13364 13365 Message_ *string `locationName:"message" type:"string"` 13366 } 13367 13368 // String returns the string representation. 13369 // 13370 // API parameter values that are decorated as "sensitive" in the API will not 13371 // be included in the string output. The member name will be present, but the 13372 // value will be replaced with "sensitive". 13373 func (s InvalidGrantTokenException) String() string { 13374 return awsutil.Prettify(s) 13375 } 13376 13377 // GoString returns the string representation. 13378 // 13379 // API parameter values that are decorated as "sensitive" in the API will not 13380 // be included in the string output. The member name will be present, but the 13381 // value will be replaced with "sensitive". 13382 func (s InvalidGrantTokenException) GoString() string { 13383 return s.String() 13384 } 13385 13386 func newErrorInvalidGrantTokenException(v protocol.ResponseMetadata) error { 13387 return &InvalidGrantTokenException{ 13388 RespMetadata: v, 13389 } 13390 } 13391 13392 // Code returns the exception type name. 13393 func (s *InvalidGrantTokenException) Code() string { 13394 return "InvalidGrantTokenException" 13395 } 13396 13397 // Message returns the exception's message. 13398 func (s *InvalidGrantTokenException) Message() string { 13399 if s.Message_ != nil { 13400 return *s.Message_ 13401 } 13402 return "" 13403 } 13404 13405 // OrigErr always returns nil, satisfies awserr.Error interface. 13406 func (s *InvalidGrantTokenException) OrigErr() error { 13407 return nil 13408 } 13409 13410 func (s *InvalidGrantTokenException) Error() string { 13411 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 13412 } 13413 13414 // Status code returns the HTTP status code for the request's response error. 13415 func (s *InvalidGrantTokenException) StatusCode() int { 13416 return s.RespMetadata.StatusCode 13417 } 13418 13419 // RequestID returns the service's response RequestID for request. 13420 func (s *InvalidGrantTokenException) RequestID() string { 13421 return s.RespMetadata.RequestID 13422 } 13423 13424 // The request was rejected because the provided import token is invalid or 13425 // is associated with a different KMS key. 13426 type InvalidImportTokenException struct { 13427 _ struct{} `type:"structure"` 13428 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 13429 13430 Message_ *string `locationName:"message" type:"string"` 13431 } 13432 13433 // String returns the string representation. 13434 // 13435 // API parameter values that are decorated as "sensitive" in the API will not 13436 // be included in the string output. The member name will be present, but the 13437 // value will be replaced with "sensitive". 13438 func (s InvalidImportTokenException) String() string { 13439 return awsutil.Prettify(s) 13440 } 13441 13442 // GoString returns the string representation. 13443 // 13444 // API parameter values that are decorated as "sensitive" in the API will not 13445 // be included in the string output. The member name will be present, but the 13446 // value will be replaced with "sensitive". 13447 func (s InvalidImportTokenException) GoString() string { 13448 return s.String() 13449 } 13450 13451 func newErrorInvalidImportTokenException(v protocol.ResponseMetadata) error { 13452 return &InvalidImportTokenException{ 13453 RespMetadata: v, 13454 } 13455 } 13456 13457 // Code returns the exception type name. 13458 func (s *InvalidImportTokenException) Code() string { 13459 return "InvalidImportTokenException" 13460 } 13461 13462 // Message returns the exception's message. 13463 func (s *InvalidImportTokenException) Message() string { 13464 if s.Message_ != nil { 13465 return *s.Message_ 13466 } 13467 return "" 13468 } 13469 13470 // OrigErr always returns nil, satisfies awserr.Error interface. 13471 func (s *InvalidImportTokenException) OrigErr() error { 13472 return nil 13473 } 13474 13475 func (s *InvalidImportTokenException) Error() string { 13476 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 13477 } 13478 13479 // Status code returns the HTTP status code for the request's response error. 13480 func (s *InvalidImportTokenException) StatusCode() int { 13481 return s.RespMetadata.StatusCode 13482 } 13483 13484 // RequestID returns the service's response RequestID for request. 13485 func (s *InvalidImportTokenException) RequestID() string { 13486 return s.RespMetadata.RequestID 13487 } 13488 13489 // The request was rejected for one of the following reasons: 13490 // 13491 // * The KeyUsage value of the KMS key is incompatible with the API operation. 13492 // 13493 // * The encryption algorithm or signing algorithm specified for the operation 13494 // is incompatible with the type of key material in the KMS key (KeySpec). 13495 // 13496 // For encrypting, decrypting, re-encrypting, and generating data keys, the 13497 // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage 13498 // must be SIGN_VERIFY. To find the KeyUsage of a KMS key, use the DescribeKey 13499 // operation. 13500 // 13501 // To find the encryption or signing algorithms supported for a particular KMS 13502 // key, use the DescribeKey operation. 13503 type InvalidKeyUsageException struct { 13504 _ struct{} `type:"structure"` 13505 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 13506 13507 Message_ *string `locationName:"message" type:"string"` 13508 } 13509 13510 // String returns the string representation. 13511 // 13512 // API parameter values that are decorated as "sensitive" in the API will not 13513 // be included in the string output. The member name will be present, but the 13514 // value will be replaced with "sensitive". 13515 func (s InvalidKeyUsageException) String() string { 13516 return awsutil.Prettify(s) 13517 } 13518 13519 // GoString returns the string representation. 13520 // 13521 // API parameter values that are decorated as "sensitive" in the API will not 13522 // be included in the string output. The member name will be present, but the 13523 // value will be replaced with "sensitive". 13524 func (s InvalidKeyUsageException) GoString() string { 13525 return s.String() 13526 } 13527 13528 func newErrorInvalidKeyUsageException(v protocol.ResponseMetadata) error { 13529 return &InvalidKeyUsageException{ 13530 RespMetadata: v, 13531 } 13532 } 13533 13534 // Code returns the exception type name. 13535 func (s *InvalidKeyUsageException) Code() string { 13536 return "InvalidKeyUsageException" 13537 } 13538 13539 // Message returns the exception's message. 13540 func (s *InvalidKeyUsageException) Message() string { 13541 if s.Message_ != nil { 13542 return *s.Message_ 13543 } 13544 return "" 13545 } 13546 13547 // OrigErr always returns nil, satisfies awserr.Error interface. 13548 func (s *InvalidKeyUsageException) OrigErr() error { 13549 return nil 13550 } 13551 13552 func (s *InvalidKeyUsageException) Error() string { 13553 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 13554 } 13555 13556 // Status code returns the HTTP status code for the request's response error. 13557 func (s *InvalidKeyUsageException) StatusCode() int { 13558 return s.RespMetadata.StatusCode 13559 } 13560 13561 // RequestID returns the service's response RequestID for request. 13562 func (s *InvalidKeyUsageException) RequestID() string { 13563 return s.RespMetadata.RequestID 13564 } 13565 13566 // The request was rejected because the marker that specifies where pagination 13567 // should next begin is not valid. 13568 type InvalidMarkerException struct { 13569 _ struct{} `type:"structure"` 13570 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 13571 13572 Message_ *string `locationName:"message" type:"string"` 13573 } 13574 13575 // String returns the string representation. 13576 // 13577 // API parameter values that are decorated as "sensitive" in the API will not 13578 // be included in the string output. The member name will be present, but the 13579 // value will be replaced with "sensitive". 13580 func (s InvalidMarkerException) String() string { 13581 return awsutil.Prettify(s) 13582 } 13583 13584 // GoString returns the string representation. 13585 // 13586 // API parameter values that are decorated as "sensitive" in the API will not 13587 // be included in the string output. The member name will be present, but the 13588 // value will be replaced with "sensitive". 13589 func (s InvalidMarkerException) GoString() string { 13590 return s.String() 13591 } 13592 13593 func newErrorInvalidMarkerException(v protocol.ResponseMetadata) error { 13594 return &InvalidMarkerException{ 13595 RespMetadata: v, 13596 } 13597 } 13598 13599 // Code returns the exception type name. 13600 func (s *InvalidMarkerException) Code() string { 13601 return "InvalidMarkerException" 13602 } 13603 13604 // Message returns the exception's message. 13605 func (s *InvalidMarkerException) Message() string { 13606 if s.Message_ != nil { 13607 return *s.Message_ 13608 } 13609 return "" 13610 } 13611 13612 // OrigErr always returns nil, satisfies awserr.Error interface. 13613 func (s *InvalidMarkerException) OrigErr() error { 13614 return nil 13615 } 13616 13617 func (s *InvalidMarkerException) Error() string { 13618 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 13619 } 13620 13621 // Status code returns the HTTP status code for the request's response error. 13622 func (s *InvalidMarkerException) StatusCode() int { 13623 return s.RespMetadata.StatusCode 13624 } 13625 13626 // RequestID returns the service's response RequestID for request. 13627 func (s *InvalidMarkerException) RequestID() string { 13628 return s.RespMetadata.RequestID 13629 } 13630 13631 // The request was rejected because the state of the specified resource is not 13632 // valid for this request. 13633 // 13634 // For more information about how key state affects the use of a KMS key, see 13635 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 13636 // in the Key Management Service Developer Guide . 13637 type InvalidStateException struct { 13638 _ struct{} `type:"structure"` 13639 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 13640 13641 Message_ *string `locationName:"message" type:"string"` 13642 } 13643 13644 // String returns the string representation. 13645 // 13646 // API parameter values that are decorated as "sensitive" in the API will not 13647 // be included in the string output. The member name will be present, but the 13648 // value will be replaced with "sensitive". 13649 func (s InvalidStateException) String() string { 13650 return awsutil.Prettify(s) 13651 } 13652 13653 // GoString returns the string representation. 13654 // 13655 // API parameter values that are decorated as "sensitive" in the API will not 13656 // be included in the string output. The member name will be present, but the 13657 // value will be replaced with "sensitive". 13658 func (s InvalidStateException) GoString() string { 13659 return s.String() 13660 } 13661 13662 func newErrorInvalidStateException(v protocol.ResponseMetadata) error { 13663 return &InvalidStateException{ 13664 RespMetadata: v, 13665 } 13666 } 13667 13668 // Code returns the exception type name. 13669 func (s *InvalidStateException) Code() string { 13670 return "KMSInvalidStateException" 13671 } 13672 13673 // Message returns the exception's message. 13674 func (s *InvalidStateException) Message() string { 13675 if s.Message_ != nil { 13676 return *s.Message_ 13677 } 13678 return "" 13679 } 13680 13681 // OrigErr always returns nil, satisfies awserr.Error interface. 13682 func (s *InvalidStateException) OrigErr() error { 13683 return nil 13684 } 13685 13686 func (s *InvalidStateException) Error() string { 13687 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 13688 } 13689 13690 // Status code returns the HTTP status code for the request's response error. 13691 func (s *InvalidStateException) StatusCode() int { 13692 return s.RespMetadata.StatusCode 13693 } 13694 13695 // RequestID returns the service's response RequestID for request. 13696 func (s *InvalidStateException) RequestID() string { 13697 return s.RespMetadata.RequestID 13698 } 13699 13700 // The request was rejected because the signature verification failed. Signature 13701 // verification fails when it cannot confirm that signature was produced by 13702 // signing the specified message with the specified KMS key and signing algorithm. 13703 type KMSInvalidSignatureException struct { 13704 _ struct{} `type:"structure"` 13705 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 13706 13707 Message_ *string `locationName:"message" type:"string"` 13708 } 13709 13710 // String returns the string representation. 13711 // 13712 // API parameter values that are decorated as "sensitive" in the API will not 13713 // be included in the string output. The member name will be present, but the 13714 // value will be replaced with "sensitive". 13715 func (s KMSInvalidSignatureException) String() string { 13716 return awsutil.Prettify(s) 13717 } 13718 13719 // GoString returns the string representation. 13720 // 13721 // API parameter values that are decorated as "sensitive" in the API will not 13722 // be included in the string output. The member name will be present, but the 13723 // value will be replaced with "sensitive". 13724 func (s KMSInvalidSignatureException) GoString() string { 13725 return s.String() 13726 } 13727 13728 func newErrorKMSInvalidSignatureException(v protocol.ResponseMetadata) error { 13729 return &KMSInvalidSignatureException{ 13730 RespMetadata: v, 13731 } 13732 } 13733 13734 // Code returns the exception type name. 13735 func (s *KMSInvalidSignatureException) Code() string { 13736 return "KMSInvalidSignatureException" 13737 } 13738 13739 // Message returns the exception's message. 13740 func (s *KMSInvalidSignatureException) Message() string { 13741 if s.Message_ != nil { 13742 return *s.Message_ 13743 } 13744 return "" 13745 } 13746 13747 // OrigErr always returns nil, satisfies awserr.Error interface. 13748 func (s *KMSInvalidSignatureException) OrigErr() error { 13749 return nil 13750 } 13751 13752 func (s *KMSInvalidSignatureException) Error() string { 13753 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 13754 } 13755 13756 // Status code returns the HTTP status code for the request's response error. 13757 func (s *KMSInvalidSignatureException) StatusCode() int { 13758 return s.RespMetadata.StatusCode 13759 } 13760 13761 // RequestID returns the service's response RequestID for request. 13762 func (s *KMSInvalidSignatureException) RequestID() string { 13763 return s.RespMetadata.RequestID 13764 } 13765 13766 // Contains information about each entry in the key list. 13767 type KeyListEntry struct { 13768 _ struct{} `type:"structure"` 13769 13770 // ARN of the key. 13771 KeyArn *string `min:"20" type:"string"` 13772 13773 // Unique identifier of the key. 13774 KeyId *string `min:"1" type:"string"` 13775 } 13776 13777 // String returns the string representation. 13778 // 13779 // API parameter values that are decorated as "sensitive" in the API will not 13780 // be included in the string output. The member name will be present, but the 13781 // value will be replaced with "sensitive". 13782 func (s KeyListEntry) String() string { 13783 return awsutil.Prettify(s) 13784 } 13785 13786 // GoString returns the string representation. 13787 // 13788 // API parameter values that are decorated as "sensitive" in the API will not 13789 // be included in the string output. The member name will be present, but the 13790 // value will be replaced with "sensitive". 13791 func (s KeyListEntry) GoString() string { 13792 return s.String() 13793 } 13794 13795 // SetKeyArn sets the KeyArn field's value. 13796 func (s *KeyListEntry) SetKeyArn(v string) *KeyListEntry { 13797 s.KeyArn = &v 13798 return s 13799 } 13800 13801 // SetKeyId sets the KeyId field's value. 13802 func (s *KeyListEntry) SetKeyId(v string) *KeyListEntry { 13803 s.KeyId = &v 13804 return s 13805 } 13806 13807 // Contains metadata about a KMS key. 13808 // 13809 // This data type is used as a response element for the CreateKey and DescribeKey 13810 // operations. 13811 type KeyMetadata struct { 13812 _ struct{} `type:"structure"` 13813 13814 // The twelve-digit account ID of the Amazon Web Services account that owns 13815 // the KMS key. 13816 AWSAccountId *string `type:"string"` 13817 13818 // The Amazon Resource Name (ARN) of the KMS key. For examples, see Key Management 13819 // Service (KMS) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms) 13820 // in the Example ARNs section of the Amazon Web Services General Reference. 13821 Arn *string `min:"20" type:"string"` 13822 13823 // The cluster ID of the CloudHSM cluster that contains the key material for 13824 // the KMS key. When you create a KMS key in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html), 13825 // KMS creates the key material for the KMS key in the associated CloudHSM cluster. 13826 // This value is present only when the KMS key is created in a custom key store. 13827 CloudHsmClusterId *string `min:"19" type:"string"` 13828 13829 // The date and time when the KMS key was created. 13830 CreationDate *time.Time `type:"timestamp"` 13831 13832 // A unique identifier for the custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) 13833 // that contains the KMS key. This value is present only when the KMS key is 13834 // created in a custom key store. 13835 CustomKeyStoreId *string `min:"1" type:"string"` 13836 13837 // Instead, use the KeySpec field. 13838 // 13839 // The KeySpec and CustomerMasterKeySpec fields have the same value. We recommend 13840 // that you use the KeySpec field in your code. However, to avoid breaking changes, 13841 // KMS will support both fields. 13842 // 13843 // Deprecated: This field has been deprecated. Instead, use the KeySpec field. 13844 CustomerMasterKeySpec *string `deprecated:"true" type:"string" enum:"CustomerMasterKeySpec"` 13845 13846 // The date and time after which KMS deletes this KMS key. This value is present 13847 // only when the KMS key is scheduled for deletion, that is, when its KeyState 13848 // is PendingDeletion. 13849 // 13850 // When the primary key in a multi-Region key is scheduled for deletion but 13851 // still has replica keys, its key state is PendingReplicaDeletion and the length 13852 // of its waiting period is displayed in the PendingDeletionWindowInDays field. 13853 DeletionDate *time.Time `type:"timestamp"` 13854 13855 // The description of the KMS key. 13856 Description *string `type:"string"` 13857 13858 // Specifies whether the KMS key is enabled. When KeyState is Enabled this value 13859 // is true, otherwise it is false. 13860 Enabled *bool `type:"boolean"` 13861 13862 // The encryption algorithms that the KMS key supports. You cannot use the KMS 13863 // key with other encryption algorithms within KMS. 13864 // 13865 // This value is present only when the KeyUsage of the KMS key is ENCRYPT_DECRYPT. 13866 EncryptionAlgorithms []*string `type:"list"` 13867 13868 // Specifies whether the KMS key's key material expires. This value is present 13869 // only when Origin is EXTERNAL, otherwise this value is omitted. 13870 ExpirationModel *string `type:"string" enum:"ExpirationModelType"` 13871 13872 // The globally unique identifier for the KMS key. 13873 // 13874 // KeyId is a required field 13875 KeyId *string `min:"1" type:"string" required:"true"` 13876 13877 // The manager of the KMS key. KMS keys in your Amazon Web Services account 13878 // are either customer managed or Amazon Web Services managed. For more information 13879 // about the difference, see KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys) 13880 // in the Key Management Service Developer Guide. 13881 KeyManager *string `type:"string" enum:"KeyManagerType"` 13882 13883 // Describes the type of key material in the KMS key. 13884 KeySpec *string `type:"string" enum:"KeySpec"` 13885 13886 // The current status of the KMS key. 13887 // 13888 // For more information about how key state affects the use of a KMS key, see 13889 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 13890 // in the Key Management Service Developer Guide. 13891 KeyState *string `type:"string" enum:"KeyState"` 13892 13893 // The cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) 13894 // for which you can use the KMS key. 13895 KeyUsage *string `type:"string" enum:"KeyUsageType"` 13896 13897 // Indicates whether the KMS key is a multi-Region (True) or regional (False) 13898 // key. This value is True for multi-Region primary and replica keys and False 13899 // for regional KMS keys. 13900 // 13901 // For more information about multi-Region keys, see Using multi-Region keys 13902 // (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) 13903 // in the Key Management Service Developer Guide. 13904 MultiRegion *bool `type:"boolean"` 13905 13906 // Lists the primary and replica keys in same multi-Region key. This field is 13907 // present only when the value of the MultiRegion field is True. 13908 // 13909 // For more information about any listed KMS key, use the DescribeKey operation. 13910 // 13911 // * MultiRegionKeyType indicates whether the KMS key is a PRIMARY or REPLICA 13912 // key. 13913 // 13914 // * PrimaryKey displays the key ARN and Region of the primary key. This 13915 // field displays the current KMS key if it is the primary key. 13916 // 13917 // * ReplicaKeys displays the key ARNs and Regions of all replica keys. This 13918 // field includes the current KMS key if it is a replica key. 13919 MultiRegionConfiguration *MultiRegionConfiguration `type:"structure"` 13920 13921 // The source of the key material for the KMS key. When this value is AWS_KMS, 13922 // KMS created the key material. When this value is EXTERNAL, the key material 13923 // was imported or the KMS key doesn't have any key material. When this value 13924 // is AWS_CLOUDHSM, the key material was created in the CloudHSM cluster associated 13925 // with a custom key store. 13926 Origin *string `type:"string" enum:"OriginType"` 13927 13928 // The waiting period before the primary key in a multi-Region key is deleted. 13929 // This waiting period begins when the last of its replica keys is deleted. 13930 // This value is present only when the KeyState of the KMS key is PendingReplicaDeletion. 13931 // That indicates that the KMS key is the primary key in a multi-Region key, 13932 // it is scheduled for deletion, and it still has existing replica keys. 13933 // 13934 // When a single-Region KMS key or a multi-Region replica key is scheduled for 13935 // deletion, its deletion date is displayed in the DeletionDate field. However, 13936 // when the primary key in a multi-Region key is scheduled for deletion, its 13937 // waiting period doesn't begin until all of its replica keys are deleted. This 13938 // value displays that waiting period. When the last replica key in the multi-Region 13939 // key is deleted, the KeyState of the scheduled primary key changes from PendingReplicaDeletion 13940 // to PendingDeletion and the deletion date appears in the DeletionDate field. 13941 PendingDeletionWindowInDays *int64 `min:"1" type:"integer"` 13942 13943 // The signing algorithms that the KMS key supports. You cannot use the KMS 13944 // key with other signing algorithms within KMS. 13945 // 13946 // This field appears only when the KeyUsage of the KMS key is SIGN_VERIFY. 13947 SigningAlgorithms []*string `type:"list"` 13948 13949 // The time at which the imported key material expires. When the key material 13950 // expires, KMS deletes the key material and the KMS key becomes unusable. This 13951 // value is present only for KMS keys whose Origin is EXTERNAL and whose ExpirationModel 13952 // is KEY_MATERIAL_EXPIRES, otherwise this value is omitted. 13953 ValidTo *time.Time `type:"timestamp"` 13954 } 13955 13956 // String returns the string representation. 13957 // 13958 // API parameter values that are decorated as "sensitive" in the API will not 13959 // be included in the string output. The member name will be present, but the 13960 // value will be replaced with "sensitive". 13961 func (s KeyMetadata) String() string { 13962 return awsutil.Prettify(s) 13963 } 13964 13965 // GoString returns the string representation. 13966 // 13967 // API parameter values that are decorated as "sensitive" in the API will not 13968 // be included in the string output. The member name will be present, but the 13969 // value will be replaced with "sensitive". 13970 func (s KeyMetadata) GoString() string { 13971 return s.String() 13972 } 13973 13974 // SetAWSAccountId sets the AWSAccountId field's value. 13975 func (s *KeyMetadata) SetAWSAccountId(v string) *KeyMetadata { 13976 s.AWSAccountId = &v 13977 return s 13978 } 13979 13980 // SetArn sets the Arn field's value. 13981 func (s *KeyMetadata) SetArn(v string) *KeyMetadata { 13982 s.Arn = &v 13983 return s 13984 } 13985 13986 // SetCloudHsmClusterId sets the CloudHsmClusterId field's value. 13987 func (s *KeyMetadata) SetCloudHsmClusterId(v string) *KeyMetadata { 13988 s.CloudHsmClusterId = &v 13989 return s 13990 } 13991 13992 // SetCreationDate sets the CreationDate field's value. 13993 func (s *KeyMetadata) SetCreationDate(v time.Time) *KeyMetadata { 13994 s.CreationDate = &v 13995 return s 13996 } 13997 13998 // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. 13999 func (s *KeyMetadata) SetCustomKeyStoreId(v string) *KeyMetadata { 14000 s.CustomKeyStoreId = &v 14001 return s 14002 } 14003 14004 // SetCustomerMasterKeySpec sets the CustomerMasterKeySpec field's value. 14005 func (s *KeyMetadata) SetCustomerMasterKeySpec(v string) *KeyMetadata { 14006 s.CustomerMasterKeySpec = &v 14007 return s 14008 } 14009 14010 // SetDeletionDate sets the DeletionDate field's value. 14011 func (s *KeyMetadata) SetDeletionDate(v time.Time) *KeyMetadata { 14012 s.DeletionDate = &v 14013 return s 14014 } 14015 14016 // SetDescription sets the Description field's value. 14017 func (s *KeyMetadata) SetDescription(v string) *KeyMetadata { 14018 s.Description = &v 14019 return s 14020 } 14021 14022 // SetEnabled sets the Enabled field's value. 14023 func (s *KeyMetadata) SetEnabled(v bool) *KeyMetadata { 14024 s.Enabled = &v 14025 return s 14026 } 14027 14028 // SetEncryptionAlgorithms sets the EncryptionAlgorithms field's value. 14029 func (s *KeyMetadata) SetEncryptionAlgorithms(v []*string) *KeyMetadata { 14030 s.EncryptionAlgorithms = v 14031 return s 14032 } 14033 14034 // SetExpirationModel sets the ExpirationModel field's value. 14035 func (s *KeyMetadata) SetExpirationModel(v string) *KeyMetadata { 14036 s.ExpirationModel = &v 14037 return s 14038 } 14039 14040 // SetKeyId sets the KeyId field's value. 14041 func (s *KeyMetadata) SetKeyId(v string) *KeyMetadata { 14042 s.KeyId = &v 14043 return s 14044 } 14045 14046 // SetKeyManager sets the KeyManager field's value. 14047 func (s *KeyMetadata) SetKeyManager(v string) *KeyMetadata { 14048 s.KeyManager = &v 14049 return s 14050 } 14051 14052 // SetKeySpec sets the KeySpec field's value. 14053 func (s *KeyMetadata) SetKeySpec(v string) *KeyMetadata { 14054 s.KeySpec = &v 14055 return s 14056 } 14057 14058 // SetKeyState sets the KeyState field's value. 14059 func (s *KeyMetadata) SetKeyState(v string) *KeyMetadata { 14060 s.KeyState = &v 14061 return s 14062 } 14063 14064 // SetKeyUsage sets the KeyUsage field's value. 14065 func (s *KeyMetadata) SetKeyUsage(v string) *KeyMetadata { 14066 s.KeyUsage = &v 14067 return s 14068 } 14069 14070 // SetMultiRegion sets the MultiRegion field's value. 14071 func (s *KeyMetadata) SetMultiRegion(v bool) *KeyMetadata { 14072 s.MultiRegion = &v 14073 return s 14074 } 14075 14076 // SetMultiRegionConfiguration sets the MultiRegionConfiguration field's value. 14077 func (s *KeyMetadata) SetMultiRegionConfiguration(v *MultiRegionConfiguration) *KeyMetadata { 14078 s.MultiRegionConfiguration = v 14079 return s 14080 } 14081 14082 // SetOrigin sets the Origin field's value. 14083 func (s *KeyMetadata) SetOrigin(v string) *KeyMetadata { 14084 s.Origin = &v 14085 return s 14086 } 14087 14088 // SetPendingDeletionWindowInDays sets the PendingDeletionWindowInDays field's value. 14089 func (s *KeyMetadata) SetPendingDeletionWindowInDays(v int64) *KeyMetadata { 14090 s.PendingDeletionWindowInDays = &v 14091 return s 14092 } 14093 14094 // SetSigningAlgorithms sets the SigningAlgorithms field's value. 14095 func (s *KeyMetadata) SetSigningAlgorithms(v []*string) *KeyMetadata { 14096 s.SigningAlgorithms = v 14097 return s 14098 } 14099 14100 // SetValidTo sets the ValidTo field's value. 14101 func (s *KeyMetadata) SetValidTo(v time.Time) *KeyMetadata { 14102 s.ValidTo = &v 14103 return s 14104 } 14105 14106 // The request was rejected because the specified KMS key was not available. 14107 // You can retry the request. 14108 type KeyUnavailableException struct { 14109 _ struct{} `type:"structure"` 14110 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 14111 14112 Message_ *string `locationName:"message" type:"string"` 14113 } 14114 14115 // String returns the string representation. 14116 // 14117 // API parameter values that are decorated as "sensitive" in the API will not 14118 // be included in the string output. The member name will be present, but the 14119 // value will be replaced with "sensitive". 14120 func (s KeyUnavailableException) String() string { 14121 return awsutil.Prettify(s) 14122 } 14123 14124 // GoString returns the string representation. 14125 // 14126 // API parameter values that are decorated as "sensitive" in the API will not 14127 // be included in the string output. The member name will be present, but the 14128 // value will be replaced with "sensitive". 14129 func (s KeyUnavailableException) GoString() string { 14130 return s.String() 14131 } 14132 14133 func newErrorKeyUnavailableException(v protocol.ResponseMetadata) error { 14134 return &KeyUnavailableException{ 14135 RespMetadata: v, 14136 } 14137 } 14138 14139 // Code returns the exception type name. 14140 func (s *KeyUnavailableException) Code() string { 14141 return "KeyUnavailableException" 14142 } 14143 14144 // Message returns the exception's message. 14145 func (s *KeyUnavailableException) Message() string { 14146 if s.Message_ != nil { 14147 return *s.Message_ 14148 } 14149 return "" 14150 } 14151 14152 // OrigErr always returns nil, satisfies awserr.Error interface. 14153 func (s *KeyUnavailableException) OrigErr() error { 14154 return nil 14155 } 14156 14157 func (s *KeyUnavailableException) Error() string { 14158 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 14159 } 14160 14161 // Status code returns the HTTP status code for the request's response error. 14162 func (s *KeyUnavailableException) StatusCode() int { 14163 return s.RespMetadata.StatusCode 14164 } 14165 14166 // RequestID returns the service's response RequestID for request. 14167 func (s *KeyUnavailableException) RequestID() string { 14168 return s.RespMetadata.RequestID 14169 } 14170 14171 // The request was rejected because a quota was exceeded. For more information, 14172 // see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) 14173 // in the Key Management Service Developer Guide. 14174 type LimitExceededException struct { 14175 _ struct{} `type:"structure"` 14176 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 14177 14178 Message_ *string `locationName:"message" type:"string"` 14179 } 14180 14181 // String returns the string representation. 14182 // 14183 // API parameter values that are decorated as "sensitive" in the API will not 14184 // be included in the string output. The member name will be present, but the 14185 // value will be replaced with "sensitive". 14186 func (s LimitExceededException) String() string { 14187 return awsutil.Prettify(s) 14188 } 14189 14190 // GoString returns the string representation. 14191 // 14192 // API parameter values that are decorated as "sensitive" in the API will not 14193 // be included in the string output. The member name will be present, but the 14194 // value will be replaced with "sensitive". 14195 func (s LimitExceededException) GoString() string { 14196 return s.String() 14197 } 14198 14199 func newErrorLimitExceededException(v protocol.ResponseMetadata) error { 14200 return &LimitExceededException{ 14201 RespMetadata: v, 14202 } 14203 } 14204 14205 // Code returns the exception type name. 14206 func (s *LimitExceededException) Code() string { 14207 return "LimitExceededException" 14208 } 14209 14210 // Message returns the exception's message. 14211 func (s *LimitExceededException) Message() string { 14212 if s.Message_ != nil { 14213 return *s.Message_ 14214 } 14215 return "" 14216 } 14217 14218 // OrigErr always returns nil, satisfies awserr.Error interface. 14219 func (s *LimitExceededException) OrigErr() error { 14220 return nil 14221 } 14222 14223 func (s *LimitExceededException) Error() string { 14224 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 14225 } 14226 14227 // Status code returns the HTTP status code for the request's response error. 14228 func (s *LimitExceededException) StatusCode() int { 14229 return s.RespMetadata.StatusCode 14230 } 14231 14232 // RequestID returns the service's response RequestID for request. 14233 func (s *LimitExceededException) RequestID() string { 14234 return s.RespMetadata.RequestID 14235 } 14236 14237 type ListAliasesInput struct { 14238 _ struct{} `type:"structure"` 14239 14240 // Lists only aliases that are associated with the specified KMS key. Enter 14241 // a KMS key in your Amazon Web Services account. 14242 // 14243 // This parameter is optional. If you omit it, ListAliases returns all aliases 14244 // in the account and Region. 14245 // 14246 // Specify the key ID or key ARN of the KMS key. 14247 // 14248 // For example: 14249 // 14250 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 14251 // 14252 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 14253 // 14254 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 14255 KeyId *string `min:"1" type:"string"` 14256 14257 // Use this parameter to specify the maximum number of items to return. When 14258 // this value is present, KMS does not return more than the specified number 14259 // of items, but it might return fewer. 14260 // 14261 // This value is optional. If you include a value, it must be between 1 and 14262 // 100, inclusive. If you do not include a value, it defaults to 50. 14263 Limit *int64 `min:"1" type:"integer"` 14264 14265 // Use this parameter in a subsequent request after you receive a response with 14266 // truncated results. Set it to the value of NextMarker from the truncated response 14267 // you just received. 14268 Marker *string `min:"1" type:"string"` 14269 } 14270 14271 // String returns the string representation. 14272 // 14273 // API parameter values that are decorated as "sensitive" in the API will not 14274 // be included in the string output. The member name will be present, but the 14275 // value will be replaced with "sensitive". 14276 func (s ListAliasesInput) String() string { 14277 return awsutil.Prettify(s) 14278 } 14279 14280 // GoString returns the string representation. 14281 // 14282 // API parameter values that are decorated as "sensitive" in the API will not 14283 // be included in the string output. The member name will be present, but the 14284 // value will be replaced with "sensitive". 14285 func (s ListAliasesInput) GoString() string { 14286 return s.String() 14287 } 14288 14289 // Validate inspects the fields of the type to determine if they are valid. 14290 func (s *ListAliasesInput) Validate() error { 14291 invalidParams := request.ErrInvalidParams{Context: "ListAliasesInput"} 14292 if s.KeyId != nil && len(*s.KeyId) < 1 { 14293 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 14294 } 14295 if s.Limit != nil && *s.Limit < 1 { 14296 invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) 14297 } 14298 if s.Marker != nil && len(*s.Marker) < 1 { 14299 invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) 14300 } 14301 14302 if invalidParams.Len() > 0 { 14303 return invalidParams 14304 } 14305 return nil 14306 } 14307 14308 // SetKeyId sets the KeyId field's value. 14309 func (s *ListAliasesInput) SetKeyId(v string) *ListAliasesInput { 14310 s.KeyId = &v 14311 return s 14312 } 14313 14314 // SetLimit sets the Limit field's value. 14315 func (s *ListAliasesInput) SetLimit(v int64) *ListAliasesInput { 14316 s.Limit = &v 14317 return s 14318 } 14319 14320 // SetMarker sets the Marker field's value. 14321 func (s *ListAliasesInput) SetMarker(v string) *ListAliasesInput { 14322 s.Marker = &v 14323 return s 14324 } 14325 14326 type ListAliasesOutput struct { 14327 _ struct{} `type:"structure"` 14328 14329 // A list of aliases. 14330 Aliases []*AliasListEntry `type:"list"` 14331 14332 // When Truncated is true, this element is present and contains the value to 14333 // use for the Marker parameter in a subsequent request. 14334 NextMarker *string `min:"1" type:"string"` 14335 14336 // A flag that indicates whether there are more items in the list. When this 14337 // value is true, the list in this response is truncated. To get more items, 14338 // pass the value of the NextMarker element in thisresponse to the Marker parameter 14339 // in a subsequent request. 14340 Truncated *bool `type:"boolean"` 14341 } 14342 14343 // String returns the string representation. 14344 // 14345 // API parameter values that are decorated as "sensitive" in the API will not 14346 // be included in the string output. The member name will be present, but the 14347 // value will be replaced with "sensitive". 14348 func (s ListAliasesOutput) String() string { 14349 return awsutil.Prettify(s) 14350 } 14351 14352 // GoString returns the string representation. 14353 // 14354 // API parameter values that are decorated as "sensitive" in the API will not 14355 // be included in the string output. The member name will be present, but the 14356 // value will be replaced with "sensitive". 14357 func (s ListAliasesOutput) GoString() string { 14358 return s.String() 14359 } 14360 14361 // SetAliases sets the Aliases field's value. 14362 func (s *ListAliasesOutput) SetAliases(v []*AliasListEntry) *ListAliasesOutput { 14363 s.Aliases = v 14364 return s 14365 } 14366 14367 // SetNextMarker sets the NextMarker field's value. 14368 func (s *ListAliasesOutput) SetNextMarker(v string) *ListAliasesOutput { 14369 s.NextMarker = &v 14370 return s 14371 } 14372 14373 // SetTruncated sets the Truncated field's value. 14374 func (s *ListAliasesOutput) SetTruncated(v bool) *ListAliasesOutput { 14375 s.Truncated = &v 14376 return s 14377 } 14378 14379 type ListGrantsInput struct { 14380 _ struct{} `type:"structure"` 14381 14382 // Returns only the grant with the specified grant ID. The grant ID uniquely 14383 // identifies the grant. 14384 GrantId *string `min:"1" type:"string"` 14385 14386 // Returns only grants where the specified principal is the grantee principal 14387 // for the grant. 14388 GranteePrincipal *string `min:"1" type:"string"` 14389 14390 // Returns only grants for the specified KMS key. This parameter is required. 14391 // 14392 // Specify the key ID or key ARN of the KMS key. To specify a KMS key in a different 14393 // Amazon Web Services account, you must use the key ARN. 14394 // 14395 // For example: 14396 // 14397 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 14398 // 14399 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 14400 // 14401 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 14402 // 14403 // KeyId is a required field 14404 KeyId *string `min:"1" type:"string" required:"true"` 14405 14406 // Use this parameter to specify the maximum number of items to return. When 14407 // this value is present, KMS does not return more than the specified number 14408 // of items, but it might return fewer. 14409 // 14410 // This value is optional. If you include a value, it must be between 1 and 14411 // 100, inclusive. If you do not include a value, it defaults to 50. 14412 Limit *int64 `min:"1" type:"integer"` 14413 14414 // Use this parameter in a subsequent request after you receive a response with 14415 // truncated results. Set it to the value of NextMarker from the truncated response 14416 // you just received. 14417 Marker *string `min:"1" type:"string"` 14418 } 14419 14420 // String returns the string representation. 14421 // 14422 // API parameter values that are decorated as "sensitive" in the API will not 14423 // be included in the string output. The member name will be present, but the 14424 // value will be replaced with "sensitive". 14425 func (s ListGrantsInput) String() string { 14426 return awsutil.Prettify(s) 14427 } 14428 14429 // GoString returns the string representation. 14430 // 14431 // API parameter values that are decorated as "sensitive" in the API will not 14432 // be included in the string output. The member name will be present, but the 14433 // value will be replaced with "sensitive". 14434 func (s ListGrantsInput) GoString() string { 14435 return s.String() 14436 } 14437 14438 // Validate inspects the fields of the type to determine if they are valid. 14439 func (s *ListGrantsInput) Validate() error { 14440 invalidParams := request.ErrInvalidParams{Context: "ListGrantsInput"} 14441 if s.GrantId != nil && len(*s.GrantId) < 1 { 14442 invalidParams.Add(request.NewErrParamMinLen("GrantId", 1)) 14443 } 14444 if s.GranteePrincipal != nil && len(*s.GranteePrincipal) < 1 { 14445 invalidParams.Add(request.NewErrParamMinLen("GranteePrincipal", 1)) 14446 } 14447 if s.KeyId == nil { 14448 invalidParams.Add(request.NewErrParamRequired("KeyId")) 14449 } 14450 if s.KeyId != nil && len(*s.KeyId) < 1 { 14451 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 14452 } 14453 if s.Limit != nil && *s.Limit < 1 { 14454 invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) 14455 } 14456 if s.Marker != nil && len(*s.Marker) < 1 { 14457 invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) 14458 } 14459 14460 if invalidParams.Len() > 0 { 14461 return invalidParams 14462 } 14463 return nil 14464 } 14465 14466 // SetGrantId sets the GrantId field's value. 14467 func (s *ListGrantsInput) SetGrantId(v string) *ListGrantsInput { 14468 s.GrantId = &v 14469 return s 14470 } 14471 14472 // SetGranteePrincipal sets the GranteePrincipal field's value. 14473 func (s *ListGrantsInput) SetGranteePrincipal(v string) *ListGrantsInput { 14474 s.GranteePrincipal = &v 14475 return s 14476 } 14477 14478 // SetKeyId sets the KeyId field's value. 14479 func (s *ListGrantsInput) SetKeyId(v string) *ListGrantsInput { 14480 s.KeyId = &v 14481 return s 14482 } 14483 14484 // SetLimit sets the Limit field's value. 14485 func (s *ListGrantsInput) SetLimit(v int64) *ListGrantsInput { 14486 s.Limit = &v 14487 return s 14488 } 14489 14490 // SetMarker sets the Marker field's value. 14491 func (s *ListGrantsInput) SetMarker(v string) *ListGrantsInput { 14492 s.Marker = &v 14493 return s 14494 } 14495 14496 type ListGrantsResponse struct { 14497 _ struct{} `type:"structure"` 14498 14499 // A list of grants. 14500 Grants []*GrantListEntry `type:"list"` 14501 14502 // When Truncated is true, this element is present and contains the value to 14503 // use for the Marker parameter in a subsequent request. 14504 NextMarker *string `min:"1" type:"string"` 14505 14506 // A flag that indicates whether there are more items in the list. When this 14507 // value is true, the list in this response is truncated. To get more items, 14508 // pass the value of the NextMarker element in thisresponse to the Marker parameter 14509 // in a subsequent request. 14510 Truncated *bool `type:"boolean"` 14511 } 14512 14513 // String returns the string representation. 14514 // 14515 // API parameter values that are decorated as "sensitive" in the API will not 14516 // be included in the string output. The member name will be present, but the 14517 // value will be replaced with "sensitive". 14518 func (s ListGrantsResponse) String() string { 14519 return awsutil.Prettify(s) 14520 } 14521 14522 // GoString returns the string representation. 14523 // 14524 // API parameter values that are decorated as "sensitive" in the API will not 14525 // be included in the string output. The member name will be present, but the 14526 // value will be replaced with "sensitive". 14527 func (s ListGrantsResponse) GoString() string { 14528 return s.String() 14529 } 14530 14531 // SetGrants sets the Grants field's value. 14532 func (s *ListGrantsResponse) SetGrants(v []*GrantListEntry) *ListGrantsResponse { 14533 s.Grants = v 14534 return s 14535 } 14536 14537 // SetNextMarker sets the NextMarker field's value. 14538 func (s *ListGrantsResponse) SetNextMarker(v string) *ListGrantsResponse { 14539 s.NextMarker = &v 14540 return s 14541 } 14542 14543 // SetTruncated sets the Truncated field's value. 14544 func (s *ListGrantsResponse) SetTruncated(v bool) *ListGrantsResponse { 14545 s.Truncated = &v 14546 return s 14547 } 14548 14549 type ListKeyPoliciesInput struct { 14550 _ struct{} `type:"structure"` 14551 14552 // Gets the names of key policies for the specified KMS key. 14553 // 14554 // Specify the key ID or key ARN of the KMS key. 14555 // 14556 // For example: 14557 // 14558 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 14559 // 14560 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 14561 // 14562 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 14563 // 14564 // KeyId is a required field 14565 KeyId *string `min:"1" type:"string" required:"true"` 14566 14567 // Use this parameter to specify the maximum number of items to return. When 14568 // this value is present, KMS does not return more than the specified number 14569 // of items, but it might return fewer. 14570 // 14571 // This value is optional. If you include a value, it must be between 1 and 14572 // 1000, inclusive. If you do not include a value, it defaults to 100. 14573 // 14574 // Only one policy can be attached to a key. 14575 Limit *int64 `min:"1" type:"integer"` 14576 14577 // Use this parameter in a subsequent request after you receive a response with 14578 // truncated results. Set it to the value of NextMarker from the truncated response 14579 // you just received. 14580 Marker *string `min:"1" type:"string"` 14581 } 14582 14583 // String returns the string representation. 14584 // 14585 // API parameter values that are decorated as "sensitive" in the API will not 14586 // be included in the string output. The member name will be present, but the 14587 // value will be replaced with "sensitive". 14588 func (s ListKeyPoliciesInput) String() string { 14589 return awsutil.Prettify(s) 14590 } 14591 14592 // GoString returns the string representation. 14593 // 14594 // API parameter values that are decorated as "sensitive" in the API will not 14595 // be included in the string output. The member name will be present, but the 14596 // value will be replaced with "sensitive". 14597 func (s ListKeyPoliciesInput) GoString() string { 14598 return s.String() 14599 } 14600 14601 // Validate inspects the fields of the type to determine if they are valid. 14602 func (s *ListKeyPoliciesInput) Validate() error { 14603 invalidParams := request.ErrInvalidParams{Context: "ListKeyPoliciesInput"} 14604 if s.KeyId == nil { 14605 invalidParams.Add(request.NewErrParamRequired("KeyId")) 14606 } 14607 if s.KeyId != nil && len(*s.KeyId) < 1 { 14608 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 14609 } 14610 if s.Limit != nil && *s.Limit < 1 { 14611 invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) 14612 } 14613 if s.Marker != nil && len(*s.Marker) < 1 { 14614 invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) 14615 } 14616 14617 if invalidParams.Len() > 0 { 14618 return invalidParams 14619 } 14620 return nil 14621 } 14622 14623 // SetKeyId sets the KeyId field's value. 14624 func (s *ListKeyPoliciesInput) SetKeyId(v string) *ListKeyPoliciesInput { 14625 s.KeyId = &v 14626 return s 14627 } 14628 14629 // SetLimit sets the Limit field's value. 14630 func (s *ListKeyPoliciesInput) SetLimit(v int64) *ListKeyPoliciesInput { 14631 s.Limit = &v 14632 return s 14633 } 14634 14635 // SetMarker sets the Marker field's value. 14636 func (s *ListKeyPoliciesInput) SetMarker(v string) *ListKeyPoliciesInput { 14637 s.Marker = &v 14638 return s 14639 } 14640 14641 type ListKeyPoliciesOutput struct { 14642 _ struct{} `type:"structure"` 14643 14644 // When Truncated is true, this element is present and contains the value to 14645 // use for the Marker parameter in a subsequent request. 14646 NextMarker *string `min:"1" type:"string"` 14647 14648 // A list of key policy names. The only valid value is default. 14649 PolicyNames []*string `type:"list"` 14650 14651 // A flag that indicates whether there are more items in the list. When this 14652 // value is true, the list in this response is truncated. To get more items, 14653 // pass the value of the NextMarker element in thisresponse to the Marker parameter 14654 // in a subsequent request. 14655 Truncated *bool `type:"boolean"` 14656 } 14657 14658 // String returns the string representation. 14659 // 14660 // API parameter values that are decorated as "sensitive" in the API will not 14661 // be included in the string output. The member name will be present, but the 14662 // value will be replaced with "sensitive". 14663 func (s ListKeyPoliciesOutput) String() string { 14664 return awsutil.Prettify(s) 14665 } 14666 14667 // GoString returns the string representation. 14668 // 14669 // API parameter values that are decorated as "sensitive" in the API will not 14670 // be included in the string output. The member name will be present, but the 14671 // value will be replaced with "sensitive". 14672 func (s ListKeyPoliciesOutput) GoString() string { 14673 return s.String() 14674 } 14675 14676 // SetNextMarker sets the NextMarker field's value. 14677 func (s *ListKeyPoliciesOutput) SetNextMarker(v string) *ListKeyPoliciesOutput { 14678 s.NextMarker = &v 14679 return s 14680 } 14681 14682 // SetPolicyNames sets the PolicyNames field's value. 14683 func (s *ListKeyPoliciesOutput) SetPolicyNames(v []*string) *ListKeyPoliciesOutput { 14684 s.PolicyNames = v 14685 return s 14686 } 14687 14688 // SetTruncated sets the Truncated field's value. 14689 func (s *ListKeyPoliciesOutput) SetTruncated(v bool) *ListKeyPoliciesOutput { 14690 s.Truncated = &v 14691 return s 14692 } 14693 14694 type ListKeysInput struct { 14695 _ struct{} `type:"structure"` 14696 14697 // Use this parameter to specify the maximum number of items to return. When 14698 // this value is present, KMS does not return more than the specified number 14699 // of items, but it might return fewer. 14700 // 14701 // This value is optional. If you include a value, it must be between 1 and 14702 // 1000, inclusive. If you do not include a value, it defaults to 100. 14703 Limit *int64 `min:"1" type:"integer"` 14704 14705 // Use this parameter in a subsequent request after you receive a response with 14706 // truncated results. Set it to the value of NextMarker from the truncated response 14707 // you just received. 14708 Marker *string `min:"1" type:"string"` 14709 } 14710 14711 // String returns the string representation. 14712 // 14713 // API parameter values that are decorated as "sensitive" in the API will not 14714 // be included in the string output. The member name will be present, but the 14715 // value will be replaced with "sensitive". 14716 func (s ListKeysInput) String() string { 14717 return awsutil.Prettify(s) 14718 } 14719 14720 // GoString returns the string representation. 14721 // 14722 // API parameter values that are decorated as "sensitive" in the API will not 14723 // be included in the string output. The member name will be present, but the 14724 // value will be replaced with "sensitive". 14725 func (s ListKeysInput) GoString() string { 14726 return s.String() 14727 } 14728 14729 // Validate inspects the fields of the type to determine if they are valid. 14730 func (s *ListKeysInput) Validate() error { 14731 invalidParams := request.ErrInvalidParams{Context: "ListKeysInput"} 14732 if s.Limit != nil && *s.Limit < 1 { 14733 invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) 14734 } 14735 if s.Marker != nil && len(*s.Marker) < 1 { 14736 invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) 14737 } 14738 14739 if invalidParams.Len() > 0 { 14740 return invalidParams 14741 } 14742 return nil 14743 } 14744 14745 // SetLimit sets the Limit field's value. 14746 func (s *ListKeysInput) SetLimit(v int64) *ListKeysInput { 14747 s.Limit = &v 14748 return s 14749 } 14750 14751 // SetMarker sets the Marker field's value. 14752 func (s *ListKeysInput) SetMarker(v string) *ListKeysInput { 14753 s.Marker = &v 14754 return s 14755 } 14756 14757 type ListKeysOutput struct { 14758 _ struct{} `type:"structure"` 14759 14760 // A list of KMS keys. 14761 Keys []*KeyListEntry `type:"list"` 14762 14763 // When Truncated is true, this element is present and contains the value to 14764 // use for the Marker parameter in a subsequent request. 14765 NextMarker *string `min:"1" type:"string"` 14766 14767 // A flag that indicates whether there are more items in the list. When this 14768 // value is true, the list in this response is truncated. To get more items, 14769 // pass the value of the NextMarker element in thisresponse to the Marker parameter 14770 // in a subsequent request. 14771 Truncated *bool `type:"boolean"` 14772 } 14773 14774 // String returns the string representation. 14775 // 14776 // API parameter values that are decorated as "sensitive" in the API will not 14777 // be included in the string output. The member name will be present, but the 14778 // value will be replaced with "sensitive". 14779 func (s ListKeysOutput) String() string { 14780 return awsutil.Prettify(s) 14781 } 14782 14783 // GoString returns the string representation. 14784 // 14785 // API parameter values that are decorated as "sensitive" in the API will not 14786 // be included in the string output. The member name will be present, but the 14787 // value will be replaced with "sensitive". 14788 func (s ListKeysOutput) GoString() string { 14789 return s.String() 14790 } 14791 14792 // SetKeys sets the Keys field's value. 14793 func (s *ListKeysOutput) SetKeys(v []*KeyListEntry) *ListKeysOutput { 14794 s.Keys = v 14795 return s 14796 } 14797 14798 // SetNextMarker sets the NextMarker field's value. 14799 func (s *ListKeysOutput) SetNextMarker(v string) *ListKeysOutput { 14800 s.NextMarker = &v 14801 return s 14802 } 14803 14804 // SetTruncated sets the Truncated field's value. 14805 func (s *ListKeysOutput) SetTruncated(v bool) *ListKeysOutput { 14806 s.Truncated = &v 14807 return s 14808 } 14809 14810 type ListResourceTagsInput struct { 14811 _ struct{} `type:"structure"` 14812 14813 // Gets tags on the specified KMS key. 14814 // 14815 // Specify the key ID or key ARN of the KMS key. 14816 // 14817 // For example: 14818 // 14819 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 14820 // 14821 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 14822 // 14823 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 14824 // 14825 // KeyId is a required field 14826 KeyId *string `min:"1" type:"string" required:"true"` 14827 14828 // Use this parameter to specify the maximum number of items to return. When 14829 // this value is present, KMS does not return more than the specified number 14830 // of items, but it might return fewer. 14831 // 14832 // This value is optional. If you include a value, it must be between 1 and 14833 // 50, inclusive. If you do not include a value, it defaults to 50. 14834 Limit *int64 `min:"1" type:"integer"` 14835 14836 // Use this parameter in a subsequent request after you receive a response with 14837 // truncated results. Set it to the value of NextMarker from the truncated response 14838 // you just received. 14839 // 14840 // Do not attempt to construct this value. Use only the value of NextMarker 14841 // from the truncated response you just received. 14842 Marker *string `min:"1" type:"string"` 14843 } 14844 14845 // String returns the string representation. 14846 // 14847 // API parameter values that are decorated as "sensitive" in the API will not 14848 // be included in the string output. The member name will be present, but the 14849 // value will be replaced with "sensitive". 14850 func (s ListResourceTagsInput) String() string { 14851 return awsutil.Prettify(s) 14852 } 14853 14854 // GoString returns the string representation. 14855 // 14856 // API parameter values that are decorated as "sensitive" in the API will not 14857 // be included in the string output. The member name will be present, but the 14858 // value will be replaced with "sensitive". 14859 func (s ListResourceTagsInput) GoString() string { 14860 return s.String() 14861 } 14862 14863 // Validate inspects the fields of the type to determine if they are valid. 14864 func (s *ListResourceTagsInput) Validate() error { 14865 invalidParams := request.ErrInvalidParams{Context: "ListResourceTagsInput"} 14866 if s.KeyId == nil { 14867 invalidParams.Add(request.NewErrParamRequired("KeyId")) 14868 } 14869 if s.KeyId != nil && len(*s.KeyId) < 1 { 14870 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 14871 } 14872 if s.Limit != nil && *s.Limit < 1 { 14873 invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) 14874 } 14875 if s.Marker != nil && len(*s.Marker) < 1 { 14876 invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) 14877 } 14878 14879 if invalidParams.Len() > 0 { 14880 return invalidParams 14881 } 14882 return nil 14883 } 14884 14885 // SetKeyId sets the KeyId field's value. 14886 func (s *ListResourceTagsInput) SetKeyId(v string) *ListResourceTagsInput { 14887 s.KeyId = &v 14888 return s 14889 } 14890 14891 // SetLimit sets the Limit field's value. 14892 func (s *ListResourceTagsInput) SetLimit(v int64) *ListResourceTagsInput { 14893 s.Limit = &v 14894 return s 14895 } 14896 14897 // SetMarker sets the Marker field's value. 14898 func (s *ListResourceTagsInput) SetMarker(v string) *ListResourceTagsInput { 14899 s.Marker = &v 14900 return s 14901 } 14902 14903 type ListResourceTagsOutput struct { 14904 _ struct{} `type:"structure"` 14905 14906 // When Truncated is true, this element is present and contains the value to 14907 // use for the Marker parameter in a subsequent request. 14908 // 14909 // Do not assume or infer any information from this value. 14910 NextMarker *string `min:"1" type:"string"` 14911 14912 // A list of tags. Each tag consists of a tag key and a tag value. 14913 // 14914 // Tagging or untagging a KMS key can allow or deny permission to the KMS key. 14915 // For details, see Using ABAC in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) 14916 // in the Key Management Service Developer Guide. 14917 Tags []*Tag `type:"list"` 14918 14919 // A flag that indicates whether there are more items in the list. When this 14920 // value is true, the list in this response is truncated. To get more items, 14921 // pass the value of the NextMarker element in thisresponse to the Marker parameter 14922 // in a subsequent request. 14923 Truncated *bool `type:"boolean"` 14924 } 14925 14926 // String returns the string representation. 14927 // 14928 // API parameter values that are decorated as "sensitive" in the API will not 14929 // be included in the string output. The member name will be present, but the 14930 // value will be replaced with "sensitive". 14931 func (s ListResourceTagsOutput) String() string { 14932 return awsutil.Prettify(s) 14933 } 14934 14935 // GoString returns the string representation. 14936 // 14937 // API parameter values that are decorated as "sensitive" in the API will not 14938 // be included in the string output. The member name will be present, but the 14939 // value will be replaced with "sensitive". 14940 func (s ListResourceTagsOutput) GoString() string { 14941 return s.String() 14942 } 14943 14944 // SetNextMarker sets the NextMarker field's value. 14945 func (s *ListResourceTagsOutput) SetNextMarker(v string) *ListResourceTagsOutput { 14946 s.NextMarker = &v 14947 return s 14948 } 14949 14950 // SetTags sets the Tags field's value. 14951 func (s *ListResourceTagsOutput) SetTags(v []*Tag) *ListResourceTagsOutput { 14952 s.Tags = v 14953 return s 14954 } 14955 14956 // SetTruncated sets the Truncated field's value. 14957 func (s *ListResourceTagsOutput) SetTruncated(v bool) *ListResourceTagsOutput { 14958 s.Truncated = &v 14959 return s 14960 } 14961 14962 type ListRetirableGrantsInput struct { 14963 _ struct{} `type:"structure"` 14964 14965 // Use this parameter to specify the maximum number of items to return. When 14966 // this value is present, KMS does not return more than the specified number 14967 // of items, but it might return fewer. 14968 // 14969 // This value is optional. If you include a value, it must be between 1 and 14970 // 100, inclusive. If you do not include a value, it defaults to 50. 14971 Limit *int64 `min:"1" type:"integer"` 14972 14973 // Use this parameter in a subsequent request after you receive a response with 14974 // truncated results. Set it to the value of NextMarker from the truncated response 14975 // you just received. 14976 Marker *string `min:"1" type:"string"` 14977 14978 // The retiring principal for which to list grants. Enter a principal in your 14979 // Amazon Web Services account. 14980 // 14981 // To specify the retiring principal, use the Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) 14982 // of an Amazon Web Services principal. Valid Amazon Web Services principals 14983 // include Amazon Web Services accounts (root), IAM users, federated users, 14984 // and assumed role users. For examples of the ARN syntax for specifying a principal, 14985 // see Amazon Web Services Identity and Access Management (IAM) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam) 14986 // in the Example ARNs section of the Amazon Web Services General Reference. 14987 // 14988 // RetiringPrincipal is a required field 14989 RetiringPrincipal *string `min:"1" type:"string" required:"true"` 14990 } 14991 14992 // String returns the string representation. 14993 // 14994 // API parameter values that are decorated as "sensitive" in the API will not 14995 // be included in the string output. The member name will be present, but the 14996 // value will be replaced with "sensitive". 14997 func (s ListRetirableGrantsInput) String() string { 14998 return awsutil.Prettify(s) 14999 } 15000 15001 // GoString returns the string representation. 15002 // 15003 // API parameter values that are decorated as "sensitive" in the API will not 15004 // be included in the string output. The member name will be present, but the 15005 // value will be replaced with "sensitive". 15006 func (s ListRetirableGrantsInput) GoString() string { 15007 return s.String() 15008 } 15009 15010 // Validate inspects the fields of the type to determine if they are valid. 15011 func (s *ListRetirableGrantsInput) Validate() error { 15012 invalidParams := request.ErrInvalidParams{Context: "ListRetirableGrantsInput"} 15013 if s.Limit != nil && *s.Limit < 1 { 15014 invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) 15015 } 15016 if s.Marker != nil && len(*s.Marker) < 1 { 15017 invalidParams.Add(request.NewErrParamMinLen("Marker", 1)) 15018 } 15019 if s.RetiringPrincipal == nil { 15020 invalidParams.Add(request.NewErrParamRequired("RetiringPrincipal")) 15021 } 15022 if s.RetiringPrincipal != nil && len(*s.RetiringPrincipal) < 1 { 15023 invalidParams.Add(request.NewErrParamMinLen("RetiringPrincipal", 1)) 15024 } 15025 15026 if invalidParams.Len() > 0 { 15027 return invalidParams 15028 } 15029 return nil 15030 } 15031 15032 // SetLimit sets the Limit field's value. 15033 func (s *ListRetirableGrantsInput) SetLimit(v int64) *ListRetirableGrantsInput { 15034 s.Limit = &v 15035 return s 15036 } 15037 15038 // SetMarker sets the Marker field's value. 15039 func (s *ListRetirableGrantsInput) SetMarker(v string) *ListRetirableGrantsInput { 15040 s.Marker = &v 15041 return s 15042 } 15043 15044 // SetRetiringPrincipal sets the RetiringPrincipal field's value. 15045 func (s *ListRetirableGrantsInput) SetRetiringPrincipal(v string) *ListRetirableGrantsInput { 15046 s.RetiringPrincipal = &v 15047 return s 15048 } 15049 15050 // The request was rejected because the specified policy is not syntactically 15051 // or semantically correct. 15052 type MalformedPolicyDocumentException struct { 15053 _ struct{} `type:"structure"` 15054 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 15055 15056 Message_ *string `locationName:"message" type:"string"` 15057 } 15058 15059 // String returns the string representation. 15060 // 15061 // API parameter values that are decorated as "sensitive" in the API will not 15062 // be included in the string output. The member name will be present, but the 15063 // value will be replaced with "sensitive". 15064 func (s MalformedPolicyDocumentException) String() string { 15065 return awsutil.Prettify(s) 15066 } 15067 15068 // GoString returns the string representation. 15069 // 15070 // API parameter values that are decorated as "sensitive" in the API will not 15071 // be included in the string output. The member name will be present, but the 15072 // value will be replaced with "sensitive". 15073 func (s MalformedPolicyDocumentException) GoString() string { 15074 return s.String() 15075 } 15076 15077 func newErrorMalformedPolicyDocumentException(v protocol.ResponseMetadata) error { 15078 return &MalformedPolicyDocumentException{ 15079 RespMetadata: v, 15080 } 15081 } 15082 15083 // Code returns the exception type name. 15084 func (s *MalformedPolicyDocumentException) Code() string { 15085 return "MalformedPolicyDocumentException" 15086 } 15087 15088 // Message returns the exception's message. 15089 func (s *MalformedPolicyDocumentException) Message() string { 15090 if s.Message_ != nil { 15091 return *s.Message_ 15092 } 15093 return "" 15094 } 15095 15096 // OrigErr always returns nil, satisfies awserr.Error interface. 15097 func (s *MalformedPolicyDocumentException) OrigErr() error { 15098 return nil 15099 } 15100 15101 func (s *MalformedPolicyDocumentException) Error() string { 15102 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 15103 } 15104 15105 // Status code returns the HTTP status code for the request's response error. 15106 func (s *MalformedPolicyDocumentException) StatusCode() int { 15107 return s.RespMetadata.StatusCode 15108 } 15109 15110 // RequestID returns the service's response RequestID for request. 15111 func (s *MalformedPolicyDocumentException) RequestID() string { 15112 return s.RespMetadata.RequestID 15113 } 15114 15115 // Describes the configuration of this multi-Region key. This field appears 15116 // only when the KMS key is a primary or replica of a multi-Region key. 15117 // 15118 // For more information about any listed KMS key, use the DescribeKey operation. 15119 type MultiRegionConfiguration struct { 15120 _ struct{} `type:"structure"` 15121 15122 // Indicates whether the KMS key is a PRIMARY or REPLICA key. 15123 MultiRegionKeyType *string `type:"string" enum:"MultiRegionKeyType"` 15124 15125 // Displays the key ARN and Region of the primary key. This field includes the 15126 // current KMS key if it is the primary key. 15127 PrimaryKey *MultiRegionKey `type:"structure"` 15128 15129 // displays the key ARNs and Regions of all replica keys. This field includes 15130 // the current KMS key if it is a replica key. 15131 ReplicaKeys []*MultiRegionKey `type:"list"` 15132 } 15133 15134 // String returns the string representation. 15135 // 15136 // API parameter values that are decorated as "sensitive" in the API will not 15137 // be included in the string output. The member name will be present, but the 15138 // value will be replaced with "sensitive". 15139 func (s MultiRegionConfiguration) String() string { 15140 return awsutil.Prettify(s) 15141 } 15142 15143 // GoString returns the string representation. 15144 // 15145 // API parameter values that are decorated as "sensitive" in the API will not 15146 // be included in the string output. The member name will be present, but the 15147 // value will be replaced with "sensitive". 15148 func (s MultiRegionConfiguration) GoString() string { 15149 return s.String() 15150 } 15151 15152 // SetMultiRegionKeyType sets the MultiRegionKeyType field's value. 15153 func (s *MultiRegionConfiguration) SetMultiRegionKeyType(v string) *MultiRegionConfiguration { 15154 s.MultiRegionKeyType = &v 15155 return s 15156 } 15157 15158 // SetPrimaryKey sets the PrimaryKey field's value. 15159 func (s *MultiRegionConfiguration) SetPrimaryKey(v *MultiRegionKey) *MultiRegionConfiguration { 15160 s.PrimaryKey = v 15161 return s 15162 } 15163 15164 // SetReplicaKeys sets the ReplicaKeys field's value. 15165 func (s *MultiRegionConfiguration) SetReplicaKeys(v []*MultiRegionKey) *MultiRegionConfiguration { 15166 s.ReplicaKeys = v 15167 return s 15168 } 15169 15170 // Describes the primary or replica key in a multi-Region key. 15171 type MultiRegionKey struct { 15172 _ struct{} `type:"structure"` 15173 15174 // Displays the key ARN of a primary or replica key of a multi-Region key. 15175 Arn *string `min:"20" type:"string"` 15176 15177 // Displays the Amazon Web Services Region of a primary or replica key in a 15178 // multi-Region key. 15179 Region *string `min:"1" type:"string"` 15180 } 15181 15182 // String returns the string representation. 15183 // 15184 // API parameter values that are decorated as "sensitive" in the API will not 15185 // be included in the string output. The member name will be present, but the 15186 // value will be replaced with "sensitive". 15187 func (s MultiRegionKey) String() string { 15188 return awsutil.Prettify(s) 15189 } 15190 15191 // GoString returns the string representation. 15192 // 15193 // API parameter values that are decorated as "sensitive" in the API will not 15194 // be included in the string output. The member name will be present, but the 15195 // value will be replaced with "sensitive". 15196 func (s MultiRegionKey) GoString() string { 15197 return s.String() 15198 } 15199 15200 // SetArn sets the Arn field's value. 15201 func (s *MultiRegionKey) SetArn(v string) *MultiRegionKey { 15202 s.Arn = &v 15203 return s 15204 } 15205 15206 // SetRegion sets the Region field's value. 15207 func (s *MultiRegionKey) SetRegion(v string) *MultiRegionKey { 15208 s.Region = &v 15209 return s 15210 } 15211 15212 // The request was rejected because the specified entity or resource could not 15213 // be found. 15214 type NotFoundException struct { 15215 _ struct{} `type:"structure"` 15216 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 15217 15218 Message_ *string `locationName:"message" type:"string"` 15219 } 15220 15221 // String returns the string representation. 15222 // 15223 // API parameter values that are decorated as "sensitive" in the API will not 15224 // be included in the string output. The member name will be present, but the 15225 // value will be replaced with "sensitive". 15226 func (s NotFoundException) String() string { 15227 return awsutil.Prettify(s) 15228 } 15229 15230 // GoString returns the string representation. 15231 // 15232 // API parameter values that are decorated as "sensitive" in the API will not 15233 // be included in the string output. The member name will be present, but the 15234 // value will be replaced with "sensitive". 15235 func (s NotFoundException) GoString() string { 15236 return s.String() 15237 } 15238 15239 func newErrorNotFoundException(v protocol.ResponseMetadata) error { 15240 return &NotFoundException{ 15241 RespMetadata: v, 15242 } 15243 } 15244 15245 // Code returns the exception type name. 15246 func (s *NotFoundException) Code() string { 15247 return "NotFoundException" 15248 } 15249 15250 // Message returns the exception's message. 15251 func (s *NotFoundException) Message() string { 15252 if s.Message_ != nil { 15253 return *s.Message_ 15254 } 15255 return "" 15256 } 15257 15258 // OrigErr always returns nil, satisfies awserr.Error interface. 15259 func (s *NotFoundException) OrigErr() error { 15260 return nil 15261 } 15262 15263 func (s *NotFoundException) Error() string { 15264 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 15265 } 15266 15267 // Status code returns the HTTP status code for the request's response error. 15268 func (s *NotFoundException) StatusCode() int { 15269 return s.RespMetadata.StatusCode 15270 } 15271 15272 // RequestID returns the service's response RequestID for request. 15273 func (s *NotFoundException) RequestID() string { 15274 return s.RespMetadata.RequestID 15275 } 15276 15277 type PutKeyPolicyInput struct { 15278 _ struct{} `type:"structure"` 15279 15280 // A flag to indicate whether to bypass the key policy lockout safety check. 15281 // 15282 // Setting this value to true increases the risk that the KMS key becomes unmanageable. 15283 // Do not set this value to true indiscriminately. 15284 // 15285 // For more information, refer to the scenario in the Default Key Policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) 15286 // section in the Key Management Service Developer Guide. 15287 // 15288 // Use this parameter only when you intend to prevent the principal that is 15289 // making the request from making a subsequent PutKeyPolicy request on the KMS 15290 // key. 15291 // 15292 // The default value is false. 15293 BypassPolicyLockoutSafetyCheck *bool `type:"boolean"` 15294 15295 // Sets the key policy on the specified KMS key. 15296 // 15297 // Specify the key ID or key ARN of the KMS key. 15298 // 15299 // For example: 15300 // 15301 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 15302 // 15303 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 15304 // 15305 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 15306 // 15307 // KeyId is a required field 15308 KeyId *string `min:"1" type:"string" required:"true"` 15309 15310 // The key policy to attach to the KMS key. 15311 // 15312 // The key policy must meet the following criteria: 15313 // 15314 // * If you don't set BypassPolicyLockoutSafetyCheck to true, the key policy 15315 // must allow the principal that is making the PutKeyPolicy request to make 15316 // a subsequent PutKeyPolicy request on the KMS key. This reduces the risk 15317 // that the KMS key becomes unmanageable. For more information, refer to 15318 // the scenario in the Default Key Policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) 15319 // section of the Key Management Service Developer Guide. 15320 // 15321 // * Each statement in the key policy must contain one or more principals. 15322 // The principals in the key policy must exist and be visible to KMS. When 15323 // you create a new Amazon Web Services principal (for example, an IAM user 15324 // or role), you might need to enforce a delay before including the new principal 15325 // in a key policy because the new principal might not be immediately visible 15326 // to KMS. For more information, see Changes that I make are not always immediately 15327 // visible (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) 15328 // in the Amazon Web Services Identity and Access Management User Guide. 15329 // 15330 // The key policy cannot exceed 32 kilobytes (32768 bytes). For more information, 15331 // see Resource Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/resource-limits.html) 15332 // in the Key Management Service Developer Guide. 15333 // 15334 // Policy is a required field 15335 Policy *string `min:"1" type:"string" required:"true"` 15336 15337 // The name of the key policy. The only valid value is default. 15338 // 15339 // PolicyName is a required field 15340 PolicyName *string `min:"1" type:"string" required:"true"` 15341 } 15342 15343 // String returns the string representation. 15344 // 15345 // API parameter values that are decorated as "sensitive" in the API will not 15346 // be included in the string output. The member name will be present, but the 15347 // value will be replaced with "sensitive". 15348 func (s PutKeyPolicyInput) String() string { 15349 return awsutil.Prettify(s) 15350 } 15351 15352 // GoString returns the string representation. 15353 // 15354 // API parameter values that are decorated as "sensitive" in the API will not 15355 // be included in the string output. The member name will be present, but the 15356 // value will be replaced with "sensitive". 15357 func (s PutKeyPolicyInput) GoString() string { 15358 return s.String() 15359 } 15360 15361 // Validate inspects the fields of the type to determine if they are valid. 15362 func (s *PutKeyPolicyInput) Validate() error { 15363 invalidParams := request.ErrInvalidParams{Context: "PutKeyPolicyInput"} 15364 if s.KeyId == nil { 15365 invalidParams.Add(request.NewErrParamRequired("KeyId")) 15366 } 15367 if s.KeyId != nil && len(*s.KeyId) < 1 { 15368 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 15369 } 15370 if s.Policy == nil { 15371 invalidParams.Add(request.NewErrParamRequired("Policy")) 15372 } 15373 if s.Policy != nil && len(*s.Policy) < 1 { 15374 invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) 15375 } 15376 if s.PolicyName == nil { 15377 invalidParams.Add(request.NewErrParamRequired("PolicyName")) 15378 } 15379 if s.PolicyName != nil && len(*s.PolicyName) < 1 { 15380 invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) 15381 } 15382 15383 if invalidParams.Len() > 0 { 15384 return invalidParams 15385 } 15386 return nil 15387 } 15388 15389 // SetBypassPolicyLockoutSafetyCheck sets the BypassPolicyLockoutSafetyCheck field's value. 15390 func (s *PutKeyPolicyInput) SetBypassPolicyLockoutSafetyCheck(v bool) *PutKeyPolicyInput { 15391 s.BypassPolicyLockoutSafetyCheck = &v 15392 return s 15393 } 15394 15395 // SetKeyId sets the KeyId field's value. 15396 func (s *PutKeyPolicyInput) SetKeyId(v string) *PutKeyPolicyInput { 15397 s.KeyId = &v 15398 return s 15399 } 15400 15401 // SetPolicy sets the Policy field's value. 15402 func (s *PutKeyPolicyInput) SetPolicy(v string) *PutKeyPolicyInput { 15403 s.Policy = &v 15404 return s 15405 } 15406 15407 // SetPolicyName sets the PolicyName field's value. 15408 func (s *PutKeyPolicyInput) SetPolicyName(v string) *PutKeyPolicyInput { 15409 s.PolicyName = &v 15410 return s 15411 } 15412 15413 type PutKeyPolicyOutput struct { 15414 _ struct{} `type:"structure"` 15415 } 15416 15417 // String returns the string representation. 15418 // 15419 // API parameter values that are decorated as "sensitive" in the API will not 15420 // be included in the string output. The member name will be present, but the 15421 // value will be replaced with "sensitive". 15422 func (s PutKeyPolicyOutput) String() string { 15423 return awsutil.Prettify(s) 15424 } 15425 15426 // GoString returns the string representation. 15427 // 15428 // API parameter values that are decorated as "sensitive" in the API will not 15429 // be included in the string output. The member name will be present, but the 15430 // value will be replaced with "sensitive". 15431 func (s PutKeyPolicyOutput) GoString() string { 15432 return s.String() 15433 } 15434 15435 type ReEncryptInput struct { 15436 _ struct{} `type:"structure"` 15437 15438 // Ciphertext of the data to reencrypt. 15439 // CiphertextBlob is automatically base64 encoded/decoded by the SDK. 15440 // 15441 // CiphertextBlob is a required field 15442 CiphertextBlob []byte `min:"1" type:"blob" required:"true"` 15443 15444 // Specifies the encryption algorithm that KMS will use to reecrypt the data 15445 // after it has decrypted it. The default value, SYMMETRIC_DEFAULT, represents 15446 // the encryption algorithm used for symmetric KMS keys. 15447 // 15448 // This parameter is required only when the destination KMS key is an asymmetric 15449 // KMS key. 15450 DestinationEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` 15451 15452 // Specifies that encryption context to use when the reencrypting the data. 15453 // 15454 // A destination encryption context is valid only when the destination KMS key 15455 // is a symmetric KMS key. The standard ciphertext format for asymmetric KMS 15456 // keys does not include fields for metadata. 15457 // 15458 // An encryption context is a collection of non-secret key-value pairs that 15459 // represents additional authenticated data. When you use an encryption context 15460 // to encrypt data, you must specify the same (an exact case-sensitive match) 15461 // encryption context to decrypt the data. An encryption context is optional 15462 // when encrypting with a symmetric KMS key, but it is highly recommended. 15463 // 15464 // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 15465 // in the Key Management Service Developer Guide. 15466 DestinationEncryptionContext map[string]*string `type:"map"` 15467 15468 // A unique identifier for the KMS key that is used to reencrypt the data. Specify 15469 // a symmetric or asymmetric KMS key with a KeyUsage value of ENCRYPT_DECRYPT. 15470 // To find the KeyUsage value of a KMS key, use the DescribeKey operation. 15471 // 15472 // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. 15473 // When using an alias name, prefix it with "alias/". To specify a KMS key in 15474 // a different Amazon Web Services account, you must use the key ARN or alias 15475 // ARN. 15476 // 15477 // For example: 15478 // 15479 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 15480 // 15481 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 15482 // 15483 // * Alias name: alias/ExampleAlias 15484 // 15485 // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias 15486 // 15487 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 15488 // To get the alias name and alias ARN, use ListAliases. 15489 // 15490 // DestinationKeyId is a required field 15491 DestinationKeyId *string `min:"1" type:"string" required:"true"` 15492 15493 // A list of grant tokens. 15494 // 15495 // Use a grant token when your permission to call this operation comes from 15496 // a new grant that has not yet achieved eventual consistency. For more information, 15497 // see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) 15498 // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) 15499 // in the Key Management Service Developer Guide. 15500 GrantTokens []*string `type:"list"` 15501 15502 // Specifies the encryption algorithm that KMS will use to decrypt the ciphertext 15503 // before it is reencrypted. The default value, SYMMETRIC_DEFAULT, represents 15504 // the algorithm used for symmetric KMS keys. 15505 // 15506 // Specify the same algorithm that was used to encrypt the ciphertext. If you 15507 // specify a different algorithm, the decrypt attempt fails. 15508 // 15509 // This parameter is required only when the ciphertext was encrypted under an 15510 // asymmetric KMS key. 15511 SourceEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` 15512 15513 // Specifies the encryption context to use to decrypt the ciphertext. Enter 15514 // the same encryption context that was used to encrypt the ciphertext. 15515 // 15516 // An encryption context is a collection of non-secret key-value pairs that 15517 // represents additional authenticated data. When you use an encryption context 15518 // to encrypt data, you must specify the same (an exact case-sensitive match) 15519 // encryption context to decrypt the data. An encryption context is optional 15520 // when encrypting with a symmetric KMS key, but it is highly recommended. 15521 // 15522 // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) 15523 // in the Key Management Service Developer Guide. 15524 SourceEncryptionContext map[string]*string `type:"map"` 15525 15526 // Specifies the KMS key that KMS will use to decrypt the ciphertext before 15527 // it is re-encrypted. Enter a key ID of the KMS key that was used to encrypt 15528 // the ciphertext. 15529 // 15530 // This parameter is required only when the ciphertext was encrypted under an 15531 // asymmetric KMS key. If you used a symmetric KMS key, KMS can get the KMS 15532 // key from metadata that it adds to the symmetric ciphertext blob. However, 15533 // it is always recommended as a best practice. This practice ensures that you 15534 // use the KMS key that you intend. 15535 // 15536 // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. 15537 // When using an alias name, prefix it with "alias/". To specify a KMS key in 15538 // a different Amazon Web Services account, you must use the key ARN or alias 15539 // ARN. 15540 // 15541 // For example: 15542 // 15543 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 15544 // 15545 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 15546 // 15547 // * Alias name: alias/ExampleAlias 15548 // 15549 // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias 15550 // 15551 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 15552 // To get the alias name and alias ARN, use ListAliases. 15553 SourceKeyId *string `min:"1" type:"string"` 15554 } 15555 15556 // String returns the string representation. 15557 // 15558 // API parameter values that are decorated as "sensitive" in the API will not 15559 // be included in the string output. The member name will be present, but the 15560 // value will be replaced with "sensitive". 15561 func (s ReEncryptInput) String() string { 15562 return awsutil.Prettify(s) 15563 } 15564 15565 // GoString returns the string representation. 15566 // 15567 // API parameter values that are decorated as "sensitive" in the API will not 15568 // be included in the string output. The member name will be present, but the 15569 // value will be replaced with "sensitive". 15570 func (s ReEncryptInput) GoString() string { 15571 return s.String() 15572 } 15573 15574 // Validate inspects the fields of the type to determine if they are valid. 15575 func (s *ReEncryptInput) Validate() error { 15576 invalidParams := request.ErrInvalidParams{Context: "ReEncryptInput"} 15577 if s.CiphertextBlob == nil { 15578 invalidParams.Add(request.NewErrParamRequired("CiphertextBlob")) 15579 } 15580 if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 { 15581 invalidParams.Add(request.NewErrParamMinLen("CiphertextBlob", 1)) 15582 } 15583 if s.DestinationKeyId == nil { 15584 invalidParams.Add(request.NewErrParamRequired("DestinationKeyId")) 15585 } 15586 if s.DestinationKeyId != nil && len(*s.DestinationKeyId) < 1 { 15587 invalidParams.Add(request.NewErrParamMinLen("DestinationKeyId", 1)) 15588 } 15589 if s.SourceKeyId != nil && len(*s.SourceKeyId) < 1 { 15590 invalidParams.Add(request.NewErrParamMinLen("SourceKeyId", 1)) 15591 } 15592 15593 if invalidParams.Len() > 0 { 15594 return invalidParams 15595 } 15596 return nil 15597 } 15598 15599 // SetCiphertextBlob sets the CiphertextBlob field's value. 15600 func (s *ReEncryptInput) SetCiphertextBlob(v []byte) *ReEncryptInput { 15601 s.CiphertextBlob = v 15602 return s 15603 } 15604 15605 // SetDestinationEncryptionAlgorithm sets the DestinationEncryptionAlgorithm field's value. 15606 func (s *ReEncryptInput) SetDestinationEncryptionAlgorithm(v string) *ReEncryptInput { 15607 s.DestinationEncryptionAlgorithm = &v 15608 return s 15609 } 15610 15611 // SetDestinationEncryptionContext sets the DestinationEncryptionContext field's value. 15612 func (s *ReEncryptInput) SetDestinationEncryptionContext(v map[string]*string) *ReEncryptInput { 15613 s.DestinationEncryptionContext = v 15614 return s 15615 } 15616 15617 // SetDestinationKeyId sets the DestinationKeyId field's value. 15618 func (s *ReEncryptInput) SetDestinationKeyId(v string) *ReEncryptInput { 15619 s.DestinationKeyId = &v 15620 return s 15621 } 15622 15623 // SetGrantTokens sets the GrantTokens field's value. 15624 func (s *ReEncryptInput) SetGrantTokens(v []*string) *ReEncryptInput { 15625 s.GrantTokens = v 15626 return s 15627 } 15628 15629 // SetSourceEncryptionAlgorithm sets the SourceEncryptionAlgorithm field's value. 15630 func (s *ReEncryptInput) SetSourceEncryptionAlgorithm(v string) *ReEncryptInput { 15631 s.SourceEncryptionAlgorithm = &v 15632 return s 15633 } 15634 15635 // SetSourceEncryptionContext sets the SourceEncryptionContext field's value. 15636 func (s *ReEncryptInput) SetSourceEncryptionContext(v map[string]*string) *ReEncryptInput { 15637 s.SourceEncryptionContext = v 15638 return s 15639 } 15640 15641 // SetSourceKeyId sets the SourceKeyId field's value. 15642 func (s *ReEncryptInput) SetSourceKeyId(v string) *ReEncryptInput { 15643 s.SourceKeyId = &v 15644 return s 15645 } 15646 15647 type ReEncryptOutput struct { 15648 _ struct{} `type:"structure"` 15649 15650 // The reencrypted data. When you use the HTTP API or the Amazon Web Services 15651 // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. 15652 // CiphertextBlob is automatically base64 encoded/decoded by the SDK. 15653 CiphertextBlob []byte `min:"1" type:"blob"` 15654 15655 // The encryption algorithm that was used to reencrypt the data. 15656 DestinationEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` 15657 15658 // The Amazon Resource Name (key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN)) 15659 // of the KMS key that was used to reencrypt the data. 15660 KeyId *string `min:"1" type:"string"` 15661 15662 // The encryption algorithm that was used to decrypt the ciphertext before it 15663 // was reencrypted. 15664 SourceEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` 15665 15666 // Unique identifier of the KMS key used to originally encrypt the data. 15667 SourceKeyId *string `min:"1" type:"string"` 15668 } 15669 15670 // String returns the string representation. 15671 // 15672 // API parameter values that are decorated as "sensitive" in the API will not 15673 // be included in the string output. The member name will be present, but the 15674 // value will be replaced with "sensitive". 15675 func (s ReEncryptOutput) String() string { 15676 return awsutil.Prettify(s) 15677 } 15678 15679 // GoString returns the string representation. 15680 // 15681 // API parameter values that are decorated as "sensitive" in the API will not 15682 // be included in the string output. The member name will be present, but the 15683 // value will be replaced with "sensitive". 15684 func (s ReEncryptOutput) GoString() string { 15685 return s.String() 15686 } 15687 15688 // SetCiphertextBlob sets the CiphertextBlob field's value. 15689 func (s *ReEncryptOutput) SetCiphertextBlob(v []byte) *ReEncryptOutput { 15690 s.CiphertextBlob = v 15691 return s 15692 } 15693 15694 // SetDestinationEncryptionAlgorithm sets the DestinationEncryptionAlgorithm field's value. 15695 func (s *ReEncryptOutput) SetDestinationEncryptionAlgorithm(v string) *ReEncryptOutput { 15696 s.DestinationEncryptionAlgorithm = &v 15697 return s 15698 } 15699 15700 // SetKeyId sets the KeyId field's value. 15701 func (s *ReEncryptOutput) SetKeyId(v string) *ReEncryptOutput { 15702 s.KeyId = &v 15703 return s 15704 } 15705 15706 // SetSourceEncryptionAlgorithm sets the SourceEncryptionAlgorithm field's value. 15707 func (s *ReEncryptOutput) SetSourceEncryptionAlgorithm(v string) *ReEncryptOutput { 15708 s.SourceEncryptionAlgorithm = &v 15709 return s 15710 } 15711 15712 // SetSourceKeyId sets the SourceKeyId field's value. 15713 func (s *ReEncryptOutput) SetSourceKeyId(v string) *ReEncryptOutput { 15714 s.SourceKeyId = &v 15715 return s 15716 } 15717 15718 type ReplicateKeyInput struct { 15719 _ struct{} `type:"structure"` 15720 15721 // A flag to indicate whether to bypass the key policy lockout safety check. 15722 // 15723 // Setting this value to true increases the risk that the KMS key becomes unmanageable. 15724 // Do not set this value to true indiscriminately. 15725 // 15726 // For more information, refer to the scenario in the Default Key Policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) 15727 // section in the Key Management Service Developer Guide. 15728 // 15729 // Use this parameter only when you intend to prevent the principal that is 15730 // making the request from making a subsequent PutKeyPolicy request on the KMS 15731 // key. 15732 // 15733 // The default value is false. 15734 BypassPolicyLockoutSafetyCheck *bool `type:"boolean"` 15735 15736 // A description of the KMS key. The default value is an empty string (no description). 15737 // 15738 // The description is not a shared property of multi-Region keys. You can specify 15739 // the same description or a different description for each key in a set of 15740 // related multi-Region keys. KMS does not synchronize this property. 15741 Description *string `type:"string"` 15742 15743 // Identifies the multi-Region primary key that is being replicated. To determine 15744 // whether a KMS key is a multi-Region primary key, use the DescribeKey operation 15745 // to check the value of the MultiRegionKeyType property. 15746 // 15747 // Specify the key ID or key ARN of a multi-Region primary key. 15748 // 15749 // For example: 15750 // 15751 // * Key ID: mrk-1234abcd12ab34cd56ef1234567890ab 15752 // 15753 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab 15754 // 15755 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 15756 // 15757 // KeyId is a required field 15758 KeyId *string `min:"1" type:"string" required:"true"` 15759 15760 // The key policy to attach to the KMS key. This parameter is optional. If you 15761 // do not provide a key policy, KMS attaches the default key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) 15762 // to the KMS key. 15763 // 15764 // The key policy is not a shared property of multi-Region keys. You can specify 15765 // the same key policy or a different key policy for each key in a set of related 15766 // multi-Region keys. KMS does not synchronize this property. 15767 // 15768 // If you provide a key policy, it must meet the following criteria: 15769 // 15770 // * If you don't set BypassPolicyLockoutSafetyCheck to true, the key policy 15771 // must give the caller kms:PutKeyPolicy permission on the replica key. This 15772 // reduces the risk that the KMS key becomes unmanageable. For more information, 15773 // refer to the scenario in the Default Key Policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) 15774 // section of the Key Management Service Developer Guide . 15775 // 15776 // * Each statement in the key policy must contain one or more principals. 15777 // The principals in the key policy must exist and be visible to KMS. When 15778 // you create a new Amazon Web Services principal (for example, an IAM user 15779 // or role), you might need to enforce a delay before including the new principal 15780 // in a key policy because the new principal might not be immediately visible 15781 // to KMS. For more information, see Changes that I make are not always immediately 15782 // visible (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) 15783 // in the Identity and Access Management User Guide . 15784 // 15785 // * The key policy size quota is 32 kilobytes (32768 bytes). 15786 Policy *string `min:"1" type:"string"` 15787 15788 // The Region ID of the Amazon Web Services Region for this replica key. 15789 // 15790 // Enter the Region ID, such as us-east-1 or ap-southeast-2. For a list of Amazon 15791 // Web Services Regions in which KMS is supported, see KMS service endpoints 15792 // (https://docs.aws.amazon.com/general/latest/gr/kms.html#kms_region) in the 15793 // Amazon Web Services General Reference. 15794 // 15795 // The replica must be in a different Amazon Web Services Region than its primary 15796 // key and other replicas of that primary key, but in the same Amazon Web Services 15797 // partition. KMS must be available in the replica Region. If the Region is 15798 // not enabled by default, the Amazon Web Services account must be enabled in 15799 // the Region. 15800 // 15801 // For information about Amazon Web Services partitions, see Amazon Resource 15802 // Names (ARNs) in the Amazon Web Services General Reference. (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) 15803 // For information about enabling and disabling Regions, see Enabling a Region 15804 // (https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable) 15805 // and Disabling a Region (https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-disable) 15806 // in the Amazon Web Services General Reference. 15807 // 15808 // ReplicaRegion is a required field 15809 ReplicaRegion *string `min:"1" type:"string" required:"true"` 15810 15811 // Assigns one or more tags to the replica key. Use this parameter to tag the 15812 // KMS key when it is created. To tag an existing KMS key, use the TagResource 15813 // operation. 15814 // 15815 // Tagging or untagging a KMS key can allow or deny permission to the KMS key. 15816 // For details, see Using ABAC in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) 15817 // in the Key Management Service Developer Guide. 15818 // 15819 // To use this parameter, you must have kms:TagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) 15820 // permission in an IAM policy. 15821 // 15822 // Tags are not a shared property of multi-Region keys. You can specify the 15823 // same tags or different tags for each key in a set of related multi-Region 15824 // keys. KMS does not synchronize this property. 15825 // 15826 // Each tag consists of a tag key and a tag value. Both the tag key and the 15827 // tag value are required, but the tag value can be an empty (null) string. 15828 // You cannot have more than one tag on a KMS key with the same tag key. If 15829 // you specify an existing tag key with a different tag value, KMS replaces 15830 // the current tag value with the specified one. 15831 // 15832 // When you add tags to an Amazon Web Services resource, Amazon Web Services 15833 // generates a cost allocation report with usage and costs aggregated by tags. 15834 // Tags can also be used to control access to a KMS key. For details, see Tagging 15835 // Keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html). 15836 Tags []*Tag `type:"list"` 15837 } 15838 15839 // String returns the string representation. 15840 // 15841 // API parameter values that are decorated as "sensitive" in the API will not 15842 // be included in the string output. The member name will be present, but the 15843 // value will be replaced with "sensitive". 15844 func (s ReplicateKeyInput) String() string { 15845 return awsutil.Prettify(s) 15846 } 15847 15848 // GoString returns the string representation. 15849 // 15850 // API parameter values that are decorated as "sensitive" in the API will not 15851 // be included in the string output. The member name will be present, but the 15852 // value will be replaced with "sensitive". 15853 func (s ReplicateKeyInput) GoString() string { 15854 return s.String() 15855 } 15856 15857 // Validate inspects the fields of the type to determine if they are valid. 15858 func (s *ReplicateKeyInput) Validate() error { 15859 invalidParams := request.ErrInvalidParams{Context: "ReplicateKeyInput"} 15860 if s.KeyId == nil { 15861 invalidParams.Add(request.NewErrParamRequired("KeyId")) 15862 } 15863 if s.KeyId != nil && len(*s.KeyId) < 1 { 15864 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 15865 } 15866 if s.Policy != nil && len(*s.Policy) < 1 { 15867 invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) 15868 } 15869 if s.ReplicaRegion == nil { 15870 invalidParams.Add(request.NewErrParamRequired("ReplicaRegion")) 15871 } 15872 if s.ReplicaRegion != nil && len(*s.ReplicaRegion) < 1 { 15873 invalidParams.Add(request.NewErrParamMinLen("ReplicaRegion", 1)) 15874 } 15875 if s.Tags != nil { 15876 for i, v := range s.Tags { 15877 if v == nil { 15878 continue 15879 } 15880 if err := v.Validate(); err != nil { 15881 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) 15882 } 15883 } 15884 } 15885 15886 if invalidParams.Len() > 0 { 15887 return invalidParams 15888 } 15889 return nil 15890 } 15891 15892 // SetBypassPolicyLockoutSafetyCheck sets the BypassPolicyLockoutSafetyCheck field's value. 15893 func (s *ReplicateKeyInput) SetBypassPolicyLockoutSafetyCheck(v bool) *ReplicateKeyInput { 15894 s.BypassPolicyLockoutSafetyCheck = &v 15895 return s 15896 } 15897 15898 // SetDescription sets the Description field's value. 15899 func (s *ReplicateKeyInput) SetDescription(v string) *ReplicateKeyInput { 15900 s.Description = &v 15901 return s 15902 } 15903 15904 // SetKeyId sets the KeyId field's value. 15905 func (s *ReplicateKeyInput) SetKeyId(v string) *ReplicateKeyInput { 15906 s.KeyId = &v 15907 return s 15908 } 15909 15910 // SetPolicy sets the Policy field's value. 15911 func (s *ReplicateKeyInput) SetPolicy(v string) *ReplicateKeyInput { 15912 s.Policy = &v 15913 return s 15914 } 15915 15916 // SetReplicaRegion sets the ReplicaRegion field's value. 15917 func (s *ReplicateKeyInput) SetReplicaRegion(v string) *ReplicateKeyInput { 15918 s.ReplicaRegion = &v 15919 return s 15920 } 15921 15922 // SetTags sets the Tags field's value. 15923 func (s *ReplicateKeyInput) SetTags(v []*Tag) *ReplicateKeyInput { 15924 s.Tags = v 15925 return s 15926 } 15927 15928 type ReplicateKeyOutput struct { 15929 _ struct{} `type:"structure"` 15930 15931 // Displays details about the new replica key, including its Amazon Resource 15932 // Name (key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN)) 15933 // and key state (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html). 15934 // It also includes the ARN and Amazon Web Services Region of its primary key 15935 // and other replica keys. 15936 ReplicaKeyMetadata *KeyMetadata `type:"structure"` 15937 15938 // The key policy of the new replica key. The value is a key policy document 15939 // in JSON format. 15940 ReplicaPolicy *string `min:"1" type:"string"` 15941 15942 // The tags on the new replica key. The value is a list of tag key and tag value 15943 // pairs. 15944 ReplicaTags []*Tag `type:"list"` 15945 } 15946 15947 // String returns the string representation. 15948 // 15949 // API parameter values that are decorated as "sensitive" in the API will not 15950 // be included in the string output. The member name will be present, but the 15951 // value will be replaced with "sensitive". 15952 func (s ReplicateKeyOutput) String() string { 15953 return awsutil.Prettify(s) 15954 } 15955 15956 // GoString returns the string representation. 15957 // 15958 // API parameter values that are decorated as "sensitive" in the API will not 15959 // be included in the string output. The member name will be present, but the 15960 // value will be replaced with "sensitive". 15961 func (s ReplicateKeyOutput) GoString() string { 15962 return s.String() 15963 } 15964 15965 // SetReplicaKeyMetadata sets the ReplicaKeyMetadata field's value. 15966 func (s *ReplicateKeyOutput) SetReplicaKeyMetadata(v *KeyMetadata) *ReplicateKeyOutput { 15967 s.ReplicaKeyMetadata = v 15968 return s 15969 } 15970 15971 // SetReplicaPolicy sets the ReplicaPolicy field's value. 15972 func (s *ReplicateKeyOutput) SetReplicaPolicy(v string) *ReplicateKeyOutput { 15973 s.ReplicaPolicy = &v 15974 return s 15975 } 15976 15977 // SetReplicaTags sets the ReplicaTags field's value. 15978 func (s *ReplicateKeyOutput) SetReplicaTags(v []*Tag) *ReplicateKeyOutput { 15979 s.ReplicaTags = v 15980 return s 15981 } 15982 15983 type RetireGrantInput struct { 15984 _ struct{} `type:"structure"` 15985 15986 // Identifies the grant to retire. To get the grant ID, use CreateGrant, ListGrants, 15987 // or ListRetirableGrants. 15988 // 15989 // * Grant ID Example - 0123456789012345678901234567890123456789012345678901234567890123 15990 GrantId *string `min:"1" type:"string"` 15991 15992 // Identifies the grant to be retired. You can use a grant token to identify 15993 // a new grant even before it has achieved eventual consistency. 15994 // 15995 // Only the CreateGrant operation returns a grant token. For details, see Grant 15996 // token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) 15997 // and Eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-eventual-consistency) 15998 // in the Key Management Service Developer Guide. 15999 GrantToken *string `min:"1" type:"string"` 16000 16001 // The key ARN KMS key associated with the grant. To find the key ARN, use the 16002 // ListKeys operation. 16003 // 16004 // For example: arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab 16005 KeyId *string `min:"1" type:"string"` 16006 } 16007 16008 // String returns the string representation. 16009 // 16010 // API parameter values that are decorated as "sensitive" in the API will not 16011 // be included in the string output. The member name will be present, but the 16012 // value will be replaced with "sensitive". 16013 func (s RetireGrantInput) String() string { 16014 return awsutil.Prettify(s) 16015 } 16016 16017 // GoString returns the string representation. 16018 // 16019 // API parameter values that are decorated as "sensitive" in the API will not 16020 // be included in the string output. The member name will be present, but the 16021 // value will be replaced with "sensitive". 16022 func (s RetireGrantInput) GoString() string { 16023 return s.String() 16024 } 16025 16026 // Validate inspects the fields of the type to determine if they are valid. 16027 func (s *RetireGrantInput) Validate() error { 16028 invalidParams := request.ErrInvalidParams{Context: "RetireGrantInput"} 16029 if s.GrantId != nil && len(*s.GrantId) < 1 { 16030 invalidParams.Add(request.NewErrParamMinLen("GrantId", 1)) 16031 } 16032 if s.GrantToken != nil && len(*s.GrantToken) < 1 { 16033 invalidParams.Add(request.NewErrParamMinLen("GrantToken", 1)) 16034 } 16035 if s.KeyId != nil && len(*s.KeyId) < 1 { 16036 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 16037 } 16038 16039 if invalidParams.Len() > 0 { 16040 return invalidParams 16041 } 16042 return nil 16043 } 16044 16045 // SetGrantId sets the GrantId field's value. 16046 func (s *RetireGrantInput) SetGrantId(v string) *RetireGrantInput { 16047 s.GrantId = &v 16048 return s 16049 } 16050 16051 // SetGrantToken sets the GrantToken field's value. 16052 func (s *RetireGrantInput) SetGrantToken(v string) *RetireGrantInput { 16053 s.GrantToken = &v 16054 return s 16055 } 16056 16057 // SetKeyId sets the KeyId field's value. 16058 func (s *RetireGrantInput) SetKeyId(v string) *RetireGrantInput { 16059 s.KeyId = &v 16060 return s 16061 } 16062 16063 type RetireGrantOutput struct { 16064 _ struct{} `type:"structure"` 16065 } 16066 16067 // String returns the string representation. 16068 // 16069 // API parameter values that are decorated as "sensitive" in the API will not 16070 // be included in the string output. The member name will be present, but the 16071 // value will be replaced with "sensitive". 16072 func (s RetireGrantOutput) String() string { 16073 return awsutil.Prettify(s) 16074 } 16075 16076 // GoString returns the string representation. 16077 // 16078 // API parameter values that are decorated as "sensitive" in the API will not 16079 // be included in the string output. The member name will be present, but the 16080 // value will be replaced with "sensitive". 16081 func (s RetireGrantOutput) GoString() string { 16082 return s.String() 16083 } 16084 16085 type RevokeGrantInput struct { 16086 _ struct{} `type:"structure"` 16087 16088 // Identifies the grant to revoke. To get the grant ID, use CreateGrant, ListGrants, 16089 // or ListRetirableGrants. 16090 // 16091 // GrantId is a required field 16092 GrantId *string `min:"1" type:"string" required:"true"` 16093 16094 // A unique identifier for the KMS key associated with the grant. To get the 16095 // key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 16096 // 16097 // Specify the key ID or key ARN of the KMS key. To specify a KMS key in a different 16098 // Amazon Web Services account, you must use the key ARN. 16099 // 16100 // For example: 16101 // 16102 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 16103 // 16104 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 16105 // 16106 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 16107 // 16108 // KeyId is a required field 16109 KeyId *string `min:"1" type:"string" required:"true"` 16110 } 16111 16112 // String returns the string representation. 16113 // 16114 // API parameter values that are decorated as "sensitive" in the API will not 16115 // be included in the string output. The member name will be present, but the 16116 // value will be replaced with "sensitive". 16117 func (s RevokeGrantInput) String() string { 16118 return awsutil.Prettify(s) 16119 } 16120 16121 // GoString returns the string representation. 16122 // 16123 // API parameter values that are decorated as "sensitive" in the API will not 16124 // be included in the string output. The member name will be present, but the 16125 // value will be replaced with "sensitive". 16126 func (s RevokeGrantInput) GoString() string { 16127 return s.String() 16128 } 16129 16130 // Validate inspects the fields of the type to determine if they are valid. 16131 func (s *RevokeGrantInput) Validate() error { 16132 invalidParams := request.ErrInvalidParams{Context: "RevokeGrantInput"} 16133 if s.GrantId == nil { 16134 invalidParams.Add(request.NewErrParamRequired("GrantId")) 16135 } 16136 if s.GrantId != nil && len(*s.GrantId) < 1 { 16137 invalidParams.Add(request.NewErrParamMinLen("GrantId", 1)) 16138 } 16139 if s.KeyId == nil { 16140 invalidParams.Add(request.NewErrParamRequired("KeyId")) 16141 } 16142 if s.KeyId != nil && len(*s.KeyId) < 1 { 16143 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 16144 } 16145 16146 if invalidParams.Len() > 0 { 16147 return invalidParams 16148 } 16149 return nil 16150 } 16151 16152 // SetGrantId sets the GrantId field's value. 16153 func (s *RevokeGrantInput) SetGrantId(v string) *RevokeGrantInput { 16154 s.GrantId = &v 16155 return s 16156 } 16157 16158 // SetKeyId sets the KeyId field's value. 16159 func (s *RevokeGrantInput) SetKeyId(v string) *RevokeGrantInput { 16160 s.KeyId = &v 16161 return s 16162 } 16163 16164 type RevokeGrantOutput struct { 16165 _ struct{} `type:"structure"` 16166 } 16167 16168 // String returns the string representation. 16169 // 16170 // API parameter values that are decorated as "sensitive" in the API will not 16171 // be included in the string output. The member name will be present, but the 16172 // value will be replaced with "sensitive". 16173 func (s RevokeGrantOutput) String() string { 16174 return awsutil.Prettify(s) 16175 } 16176 16177 // GoString returns the string representation. 16178 // 16179 // API parameter values that are decorated as "sensitive" in the API will not 16180 // be included in the string output. The member name will be present, but the 16181 // value will be replaced with "sensitive". 16182 func (s RevokeGrantOutput) GoString() string { 16183 return s.String() 16184 } 16185 16186 type ScheduleKeyDeletionInput struct { 16187 _ struct{} `type:"structure"` 16188 16189 // The unique identifier of the KMS key to delete. 16190 // 16191 // Specify the key ID or key ARN of the KMS key. 16192 // 16193 // For example: 16194 // 16195 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 16196 // 16197 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 16198 // 16199 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 16200 // 16201 // KeyId is a required field 16202 KeyId *string `min:"1" type:"string" required:"true"` 16203 16204 // The waiting period, specified in number of days. After the waiting period 16205 // ends, KMS deletes the KMS key. 16206 // 16207 // If the KMS key is a multi-Region primary key with replicas, the waiting period 16208 // begins when the last of its replica keys is deleted. Otherwise, the waiting 16209 // period begins immediately. 16210 // 16211 // This value is optional. If you include a value, it must be between 7 and 16212 // 30, inclusive. If you do not include a value, it defaults to 30. 16213 PendingWindowInDays *int64 `min:"1" type:"integer"` 16214 } 16215 16216 // String returns the string representation. 16217 // 16218 // API parameter values that are decorated as "sensitive" in the API will not 16219 // be included in the string output. The member name will be present, but the 16220 // value will be replaced with "sensitive". 16221 func (s ScheduleKeyDeletionInput) String() string { 16222 return awsutil.Prettify(s) 16223 } 16224 16225 // GoString returns the string representation. 16226 // 16227 // API parameter values that are decorated as "sensitive" in the API will not 16228 // be included in the string output. The member name will be present, but the 16229 // value will be replaced with "sensitive". 16230 func (s ScheduleKeyDeletionInput) GoString() string { 16231 return s.String() 16232 } 16233 16234 // Validate inspects the fields of the type to determine if they are valid. 16235 func (s *ScheduleKeyDeletionInput) Validate() error { 16236 invalidParams := request.ErrInvalidParams{Context: "ScheduleKeyDeletionInput"} 16237 if s.KeyId == nil { 16238 invalidParams.Add(request.NewErrParamRequired("KeyId")) 16239 } 16240 if s.KeyId != nil && len(*s.KeyId) < 1 { 16241 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 16242 } 16243 if s.PendingWindowInDays != nil && *s.PendingWindowInDays < 1 { 16244 invalidParams.Add(request.NewErrParamMinValue("PendingWindowInDays", 1)) 16245 } 16246 16247 if invalidParams.Len() > 0 { 16248 return invalidParams 16249 } 16250 return nil 16251 } 16252 16253 // SetKeyId sets the KeyId field's value. 16254 func (s *ScheduleKeyDeletionInput) SetKeyId(v string) *ScheduleKeyDeletionInput { 16255 s.KeyId = &v 16256 return s 16257 } 16258 16259 // SetPendingWindowInDays sets the PendingWindowInDays field's value. 16260 func (s *ScheduleKeyDeletionInput) SetPendingWindowInDays(v int64) *ScheduleKeyDeletionInput { 16261 s.PendingWindowInDays = &v 16262 return s 16263 } 16264 16265 type ScheduleKeyDeletionOutput struct { 16266 _ struct{} `type:"structure"` 16267 16268 // The date and time after which KMS deletes the KMS key. 16269 // 16270 // If the KMS key is a multi-Region primary key with replica keys, this field 16271 // does not appear. The deletion date for the primary key isn't known until 16272 // its last replica key is deleted. 16273 DeletionDate *time.Time `type:"timestamp"` 16274 16275 // The Amazon Resource Name (key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN)) 16276 // of the KMS key whose deletion is scheduled. 16277 KeyId *string `min:"1" type:"string"` 16278 16279 // The current status of the KMS key. 16280 // 16281 // For more information about how key state affects the use of a KMS key, see 16282 // Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) 16283 // in the Key Management Service Developer Guide. 16284 KeyState *string `type:"string" enum:"KeyState"` 16285 16286 // The waiting period before the KMS key is deleted. 16287 // 16288 // If the KMS key is a multi-Region primary key with replicas, the waiting period 16289 // begins when the last of its replica keys is deleted. Otherwise, the waiting 16290 // period begins immediately. 16291 PendingWindowInDays *int64 `min:"1" type:"integer"` 16292 } 16293 16294 // String returns the string representation. 16295 // 16296 // API parameter values that are decorated as "sensitive" in the API will not 16297 // be included in the string output. The member name will be present, but the 16298 // value will be replaced with "sensitive". 16299 func (s ScheduleKeyDeletionOutput) String() string { 16300 return awsutil.Prettify(s) 16301 } 16302 16303 // GoString returns the string representation. 16304 // 16305 // API parameter values that are decorated as "sensitive" in the API will not 16306 // be included in the string output. The member name will be present, but the 16307 // value will be replaced with "sensitive". 16308 func (s ScheduleKeyDeletionOutput) GoString() string { 16309 return s.String() 16310 } 16311 16312 // SetDeletionDate sets the DeletionDate field's value. 16313 func (s *ScheduleKeyDeletionOutput) SetDeletionDate(v time.Time) *ScheduleKeyDeletionOutput { 16314 s.DeletionDate = &v 16315 return s 16316 } 16317 16318 // SetKeyId sets the KeyId field's value. 16319 func (s *ScheduleKeyDeletionOutput) SetKeyId(v string) *ScheduleKeyDeletionOutput { 16320 s.KeyId = &v 16321 return s 16322 } 16323 16324 // SetKeyState sets the KeyState field's value. 16325 func (s *ScheduleKeyDeletionOutput) SetKeyState(v string) *ScheduleKeyDeletionOutput { 16326 s.KeyState = &v 16327 return s 16328 } 16329 16330 // SetPendingWindowInDays sets the PendingWindowInDays field's value. 16331 func (s *ScheduleKeyDeletionOutput) SetPendingWindowInDays(v int64) *ScheduleKeyDeletionOutput { 16332 s.PendingWindowInDays = &v 16333 return s 16334 } 16335 16336 type SignInput struct { 16337 _ struct{} `type:"structure"` 16338 16339 // A list of grant tokens. 16340 // 16341 // Use a grant token when your permission to call this operation comes from 16342 // a new grant that has not yet achieved eventual consistency. For more information, 16343 // see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) 16344 // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) 16345 // in the Key Management Service Developer Guide. 16346 GrantTokens []*string `type:"list"` 16347 16348 // Identifies an asymmetric KMS key. KMS uses the private key in the asymmetric 16349 // KMS key to sign the message. The KeyUsage type of the KMS key must be SIGN_VERIFY. 16350 // To find the KeyUsage of a KMS key, use the DescribeKey operation. 16351 // 16352 // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. 16353 // When using an alias name, prefix it with "alias/". To specify a KMS key in 16354 // a different Amazon Web Services account, you must use the key ARN or alias 16355 // ARN. 16356 // 16357 // For example: 16358 // 16359 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 16360 // 16361 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 16362 // 16363 // * Alias name: alias/ExampleAlias 16364 // 16365 // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias 16366 // 16367 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 16368 // To get the alias name and alias ARN, use ListAliases. 16369 // 16370 // KeyId is a required field 16371 KeyId *string `min:"1" type:"string" required:"true"` 16372 16373 // Specifies the message or message digest to sign. Messages can be 0-4096 bytes. 16374 // To sign a larger message, provide the message digest. 16375 // 16376 // If you provide a message, KMS generates a hash digest of the message and 16377 // then signs it. 16378 // 16379 // Message is a sensitive parameter and its value will be 16380 // replaced with "sensitive" in string returned by SignInput's 16381 // String and GoString methods. 16382 // 16383 // Message is automatically base64 encoded/decoded by the SDK. 16384 // 16385 // Message is a required field 16386 Message []byte `min:"1" type:"blob" required:"true" sensitive:"true"` 16387 16388 // Tells KMS whether the value of the Message parameter is a message or message 16389 // digest. The default value, RAW, indicates a message. To indicate a message 16390 // digest, enter DIGEST. 16391 MessageType *string `type:"string" enum:"MessageType"` 16392 16393 // Specifies the signing algorithm to use when signing the message. 16394 // 16395 // Choose an algorithm that is compatible with the type and size of the specified 16396 // asymmetric KMS key. 16397 // 16398 // SigningAlgorithm is a required field 16399 SigningAlgorithm *string `type:"string" required:"true" enum:"SigningAlgorithmSpec"` 16400 } 16401 16402 // String returns the string representation. 16403 // 16404 // API parameter values that are decorated as "sensitive" in the API will not 16405 // be included in the string output. The member name will be present, but the 16406 // value will be replaced with "sensitive". 16407 func (s SignInput) String() string { 16408 return awsutil.Prettify(s) 16409 } 16410 16411 // GoString returns the string representation. 16412 // 16413 // API parameter values that are decorated as "sensitive" in the API will not 16414 // be included in the string output. The member name will be present, but the 16415 // value will be replaced with "sensitive". 16416 func (s SignInput) GoString() string { 16417 return s.String() 16418 } 16419 16420 // Validate inspects the fields of the type to determine if they are valid. 16421 func (s *SignInput) Validate() error { 16422 invalidParams := request.ErrInvalidParams{Context: "SignInput"} 16423 if s.KeyId == nil { 16424 invalidParams.Add(request.NewErrParamRequired("KeyId")) 16425 } 16426 if s.KeyId != nil && len(*s.KeyId) < 1 { 16427 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 16428 } 16429 if s.Message == nil { 16430 invalidParams.Add(request.NewErrParamRequired("Message")) 16431 } 16432 if s.Message != nil && len(s.Message) < 1 { 16433 invalidParams.Add(request.NewErrParamMinLen("Message", 1)) 16434 } 16435 if s.SigningAlgorithm == nil { 16436 invalidParams.Add(request.NewErrParamRequired("SigningAlgorithm")) 16437 } 16438 16439 if invalidParams.Len() > 0 { 16440 return invalidParams 16441 } 16442 return nil 16443 } 16444 16445 // SetGrantTokens sets the GrantTokens field's value. 16446 func (s *SignInput) SetGrantTokens(v []*string) *SignInput { 16447 s.GrantTokens = v 16448 return s 16449 } 16450 16451 // SetKeyId sets the KeyId field's value. 16452 func (s *SignInput) SetKeyId(v string) *SignInput { 16453 s.KeyId = &v 16454 return s 16455 } 16456 16457 // SetMessage sets the Message field's value. 16458 func (s *SignInput) SetMessage(v []byte) *SignInput { 16459 s.Message = v 16460 return s 16461 } 16462 16463 // SetMessageType sets the MessageType field's value. 16464 func (s *SignInput) SetMessageType(v string) *SignInput { 16465 s.MessageType = &v 16466 return s 16467 } 16468 16469 // SetSigningAlgorithm sets the SigningAlgorithm field's value. 16470 func (s *SignInput) SetSigningAlgorithm(v string) *SignInput { 16471 s.SigningAlgorithm = &v 16472 return s 16473 } 16474 16475 type SignOutput struct { 16476 _ struct{} `type:"structure"` 16477 16478 // The Amazon Resource Name (key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN)) 16479 // of the asymmetric KMS key that was used to sign the message. 16480 KeyId *string `min:"1" type:"string"` 16481 16482 // The cryptographic signature that was generated for the message. 16483 // 16484 // * When used with the supported RSA signing algorithms, the encoding of 16485 // this value is defined by PKCS #1 in RFC 8017 (https://tools.ietf.org/html/rfc8017). 16486 // 16487 // * When used with the ECDSA_SHA_256, ECDSA_SHA_384, or ECDSA_SHA_512 signing 16488 // algorithms, this value is a DER-encoded object as defined by ANS X9.62–2005 16489 // and RFC 3279 Section 2.2.3 (https://tools.ietf.org/html/rfc3279#section-2.2.3). 16490 // This is the most commonly used signature format and is appropriate for 16491 // most uses. 16492 // 16493 // When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. 16494 // Otherwise, it is not Base64-encoded. 16495 // Signature is automatically base64 encoded/decoded by the SDK. 16496 Signature []byte `min:"1" type:"blob"` 16497 16498 // The signing algorithm that was used to sign the message. 16499 SigningAlgorithm *string `type:"string" enum:"SigningAlgorithmSpec"` 16500 } 16501 16502 // String returns the string representation. 16503 // 16504 // API parameter values that are decorated as "sensitive" in the API will not 16505 // be included in the string output. The member name will be present, but the 16506 // value will be replaced with "sensitive". 16507 func (s SignOutput) String() string { 16508 return awsutil.Prettify(s) 16509 } 16510 16511 // GoString returns the string representation. 16512 // 16513 // API parameter values that are decorated as "sensitive" in the API will not 16514 // be included in the string output. The member name will be present, but the 16515 // value will be replaced with "sensitive". 16516 func (s SignOutput) GoString() string { 16517 return s.String() 16518 } 16519 16520 // SetKeyId sets the KeyId field's value. 16521 func (s *SignOutput) SetKeyId(v string) *SignOutput { 16522 s.KeyId = &v 16523 return s 16524 } 16525 16526 // SetSignature sets the Signature field's value. 16527 func (s *SignOutput) SetSignature(v []byte) *SignOutput { 16528 s.Signature = v 16529 return s 16530 } 16531 16532 // SetSigningAlgorithm sets the SigningAlgorithm field's value. 16533 func (s *SignOutput) SetSigningAlgorithm(v string) *SignOutput { 16534 s.SigningAlgorithm = &v 16535 return s 16536 } 16537 16538 // A key-value pair. A tag consists of a tag key and a tag value. Tag keys and 16539 // tag values are both required, but tag values can be empty (null) strings. 16540 // 16541 // For information about the rules that apply to tag keys and tag values, see 16542 // User-Defined Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html) 16543 // in the Amazon Web Services Billing and Cost Management User Guide. 16544 type Tag struct { 16545 _ struct{} `type:"structure"` 16546 16547 // The key of the tag. 16548 // 16549 // TagKey is a required field 16550 TagKey *string `min:"1" type:"string" required:"true"` 16551 16552 // The value of the tag. 16553 // 16554 // TagValue is a required field 16555 TagValue *string `type:"string" required:"true"` 16556 } 16557 16558 // String returns the string representation. 16559 // 16560 // API parameter values that are decorated as "sensitive" in the API will not 16561 // be included in the string output. The member name will be present, but the 16562 // value will be replaced with "sensitive". 16563 func (s Tag) String() string { 16564 return awsutil.Prettify(s) 16565 } 16566 16567 // GoString returns the string representation. 16568 // 16569 // API parameter values that are decorated as "sensitive" in the API will not 16570 // be included in the string output. The member name will be present, but the 16571 // value will be replaced with "sensitive". 16572 func (s Tag) GoString() string { 16573 return s.String() 16574 } 16575 16576 // Validate inspects the fields of the type to determine if they are valid. 16577 func (s *Tag) Validate() error { 16578 invalidParams := request.ErrInvalidParams{Context: "Tag"} 16579 if s.TagKey == nil { 16580 invalidParams.Add(request.NewErrParamRequired("TagKey")) 16581 } 16582 if s.TagKey != nil && len(*s.TagKey) < 1 { 16583 invalidParams.Add(request.NewErrParamMinLen("TagKey", 1)) 16584 } 16585 if s.TagValue == nil { 16586 invalidParams.Add(request.NewErrParamRequired("TagValue")) 16587 } 16588 16589 if invalidParams.Len() > 0 { 16590 return invalidParams 16591 } 16592 return nil 16593 } 16594 16595 // SetTagKey sets the TagKey field's value. 16596 func (s *Tag) SetTagKey(v string) *Tag { 16597 s.TagKey = &v 16598 return s 16599 } 16600 16601 // SetTagValue sets the TagValue field's value. 16602 func (s *Tag) SetTagValue(v string) *Tag { 16603 s.TagValue = &v 16604 return s 16605 } 16606 16607 // The request was rejected because one or more tags are not valid. 16608 type TagException struct { 16609 _ struct{} `type:"structure"` 16610 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 16611 16612 Message_ *string `locationName:"message" type:"string"` 16613 } 16614 16615 // String returns the string representation. 16616 // 16617 // API parameter values that are decorated as "sensitive" in the API will not 16618 // be included in the string output. The member name will be present, but the 16619 // value will be replaced with "sensitive". 16620 func (s TagException) String() string { 16621 return awsutil.Prettify(s) 16622 } 16623 16624 // GoString returns the string representation. 16625 // 16626 // API parameter values that are decorated as "sensitive" in the API will not 16627 // be included in the string output. The member name will be present, but the 16628 // value will be replaced with "sensitive". 16629 func (s TagException) GoString() string { 16630 return s.String() 16631 } 16632 16633 func newErrorTagException(v protocol.ResponseMetadata) error { 16634 return &TagException{ 16635 RespMetadata: v, 16636 } 16637 } 16638 16639 // Code returns the exception type name. 16640 func (s *TagException) Code() string { 16641 return "TagException" 16642 } 16643 16644 // Message returns the exception's message. 16645 func (s *TagException) Message() string { 16646 if s.Message_ != nil { 16647 return *s.Message_ 16648 } 16649 return "" 16650 } 16651 16652 // OrigErr always returns nil, satisfies awserr.Error interface. 16653 func (s *TagException) OrigErr() error { 16654 return nil 16655 } 16656 16657 func (s *TagException) Error() string { 16658 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 16659 } 16660 16661 // Status code returns the HTTP status code for the request's response error. 16662 func (s *TagException) StatusCode() int { 16663 return s.RespMetadata.StatusCode 16664 } 16665 16666 // RequestID returns the service's response RequestID for request. 16667 func (s *TagException) RequestID() string { 16668 return s.RespMetadata.RequestID 16669 } 16670 16671 type TagResourceInput struct { 16672 _ struct{} `type:"structure"` 16673 16674 // Identifies a customer managed key in the account and Region. 16675 // 16676 // Specify the key ID or key ARN of the KMS key. 16677 // 16678 // For example: 16679 // 16680 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 16681 // 16682 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 16683 // 16684 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 16685 // 16686 // KeyId is a required field 16687 KeyId *string `min:"1" type:"string" required:"true"` 16688 16689 // One or more tags. 16690 // 16691 // Each tag consists of a tag key and a tag value. The tag value can be an empty 16692 // (null) string. 16693 // 16694 // You cannot have more than one tag on a KMS key with the same tag key. If 16695 // you specify an existing tag key with a different tag value, KMS replaces 16696 // the current tag value with the specified one. 16697 // 16698 // Tags is a required field 16699 Tags []*Tag `type:"list" required:"true"` 16700 } 16701 16702 // String returns the string representation. 16703 // 16704 // API parameter values that are decorated as "sensitive" in the API will not 16705 // be included in the string output. The member name will be present, but the 16706 // value will be replaced with "sensitive". 16707 func (s TagResourceInput) String() string { 16708 return awsutil.Prettify(s) 16709 } 16710 16711 // GoString returns the string representation. 16712 // 16713 // API parameter values that are decorated as "sensitive" in the API will not 16714 // be included in the string output. The member name will be present, but the 16715 // value will be replaced with "sensitive". 16716 func (s TagResourceInput) GoString() string { 16717 return s.String() 16718 } 16719 16720 // Validate inspects the fields of the type to determine if they are valid. 16721 func (s *TagResourceInput) Validate() error { 16722 invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} 16723 if s.KeyId == nil { 16724 invalidParams.Add(request.NewErrParamRequired("KeyId")) 16725 } 16726 if s.KeyId != nil && len(*s.KeyId) < 1 { 16727 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 16728 } 16729 if s.Tags == nil { 16730 invalidParams.Add(request.NewErrParamRequired("Tags")) 16731 } 16732 if s.Tags != nil { 16733 for i, v := range s.Tags { 16734 if v == nil { 16735 continue 16736 } 16737 if err := v.Validate(); err != nil { 16738 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) 16739 } 16740 } 16741 } 16742 16743 if invalidParams.Len() > 0 { 16744 return invalidParams 16745 } 16746 return nil 16747 } 16748 16749 // SetKeyId sets the KeyId field's value. 16750 func (s *TagResourceInput) SetKeyId(v string) *TagResourceInput { 16751 s.KeyId = &v 16752 return s 16753 } 16754 16755 // SetTags sets the Tags field's value. 16756 func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { 16757 s.Tags = v 16758 return s 16759 } 16760 16761 type TagResourceOutput struct { 16762 _ struct{} `type:"structure"` 16763 } 16764 16765 // String returns the string representation. 16766 // 16767 // API parameter values that are decorated as "sensitive" in the API will not 16768 // be included in the string output. The member name will be present, but the 16769 // value will be replaced with "sensitive". 16770 func (s TagResourceOutput) String() string { 16771 return awsutil.Prettify(s) 16772 } 16773 16774 // GoString returns the string representation. 16775 // 16776 // API parameter values that are decorated as "sensitive" in the API will not 16777 // be included in the string output. The member name will be present, but the 16778 // value will be replaced with "sensitive". 16779 func (s TagResourceOutput) GoString() string { 16780 return s.String() 16781 } 16782 16783 // The request was rejected because a specified parameter is not supported or 16784 // a specified resource is not valid for this operation. 16785 type UnsupportedOperationException struct { 16786 _ struct{} `type:"structure"` 16787 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 16788 16789 Message_ *string `locationName:"message" type:"string"` 16790 } 16791 16792 // String returns the string representation. 16793 // 16794 // API parameter values that are decorated as "sensitive" in the API will not 16795 // be included in the string output. The member name will be present, but the 16796 // value will be replaced with "sensitive". 16797 func (s UnsupportedOperationException) String() string { 16798 return awsutil.Prettify(s) 16799 } 16800 16801 // GoString returns the string representation. 16802 // 16803 // API parameter values that are decorated as "sensitive" in the API will not 16804 // be included in the string output. The member name will be present, but the 16805 // value will be replaced with "sensitive". 16806 func (s UnsupportedOperationException) GoString() string { 16807 return s.String() 16808 } 16809 16810 func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error { 16811 return &UnsupportedOperationException{ 16812 RespMetadata: v, 16813 } 16814 } 16815 16816 // Code returns the exception type name. 16817 func (s *UnsupportedOperationException) Code() string { 16818 return "UnsupportedOperationException" 16819 } 16820 16821 // Message returns the exception's message. 16822 func (s *UnsupportedOperationException) Message() string { 16823 if s.Message_ != nil { 16824 return *s.Message_ 16825 } 16826 return "" 16827 } 16828 16829 // OrigErr always returns nil, satisfies awserr.Error interface. 16830 func (s *UnsupportedOperationException) OrigErr() error { 16831 return nil 16832 } 16833 16834 func (s *UnsupportedOperationException) Error() string { 16835 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 16836 } 16837 16838 // Status code returns the HTTP status code for the request's response error. 16839 func (s *UnsupportedOperationException) StatusCode() int { 16840 return s.RespMetadata.StatusCode 16841 } 16842 16843 // RequestID returns the service's response RequestID for request. 16844 func (s *UnsupportedOperationException) RequestID() string { 16845 return s.RespMetadata.RequestID 16846 } 16847 16848 type UntagResourceInput struct { 16849 _ struct{} `type:"structure"` 16850 16851 // Identifies the KMS key from which you are removing tags. 16852 // 16853 // Specify the key ID or key ARN of the KMS key. 16854 // 16855 // For example: 16856 // 16857 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 16858 // 16859 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 16860 // 16861 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 16862 // 16863 // KeyId is a required field 16864 KeyId *string `min:"1" type:"string" required:"true"` 16865 16866 // One or more tag keys. Specify only the tag keys, not the tag values. 16867 // 16868 // TagKeys is a required field 16869 TagKeys []*string `type:"list" required:"true"` 16870 } 16871 16872 // String returns the string representation. 16873 // 16874 // API parameter values that are decorated as "sensitive" in the API will not 16875 // be included in the string output. The member name will be present, but the 16876 // value will be replaced with "sensitive". 16877 func (s UntagResourceInput) String() string { 16878 return awsutil.Prettify(s) 16879 } 16880 16881 // GoString returns the string representation. 16882 // 16883 // API parameter values that are decorated as "sensitive" in the API will not 16884 // be included in the string output. The member name will be present, but the 16885 // value will be replaced with "sensitive". 16886 func (s UntagResourceInput) GoString() string { 16887 return s.String() 16888 } 16889 16890 // Validate inspects the fields of the type to determine if they are valid. 16891 func (s *UntagResourceInput) Validate() error { 16892 invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} 16893 if s.KeyId == nil { 16894 invalidParams.Add(request.NewErrParamRequired("KeyId")) 16895 } 16896 if s.KeyId != nil && len(*s.KeyId) < 1 { 16897 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 16898 } 16899 if s.TagKeys == nil { 16900 invalidParams.Add(request.NewErrParamRequired("TagKeys")) 16901 } 16902 16903 if invalidParams.Len() > 0 { 16904 return invalidParams 16905 } 16906 return nil 16907 } 16908 16909 // SetKeyId sets the KeyId field's value. 16910 func (s *UntagResourceInput) SetKeyId(v string) *UntagResourceInput { 16911 s.KeyId = &v 16912 return s 16913 } 16914 16915 // SetTagKeys sets the TagKeys field's value. 16916 func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { 16917 s.TagKeys = v 16918 return s 16919 } 16920 16921 type UntagResourceOutput struct { 16922 _ struct{} `type:"structure"` 16923 } 16924 16925 // String returns the string representation. 16926 // 16927 // API parameter values that are decorated as "sensitive" in the API will not 16928 // be included in the string output. The member name will be present, but the 16929 // value will be replaced with "sensitive". 16930 func (s UntagResourceOutput) String() string { 16931 return awsutil.Prettify(s) 16932 } 16933 16934 // GoString returns the string representation. 16935 // 16936 // API parameter values that are decorated as "sensitive" in the API will not 16937 // be included in the string output. The member name will be present, but the 16938 // value will be replaced with "sensitive". 16939 func (s UntagResourceOutput) GoString() string { 16940 return s.String() 16941 } 16942 16943 type UpdateAliasInput struct { 16944 _ struct{} `type:"structure"` 16945 16946 // Identifies the alias that is changing its KMS key. This value must begin 16947 // with alias/ followed by the alias name, such as alias/ExampleAlias. You cannot 16948 // use UpdateAlias to change the alias name. 16949 // 16950 // AliasName is a required field 16951 AliasName *string `min:"1" type:"string" required:"true"` 16952 16953 // Identifies the customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) 16954 // to associate with the alias. You don't have permission to associate an alias 16955 // with an Amazon Web Services managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). 16956 // 16957 // The KMS key must be in the same Amazon Web Services account and Region as 16958 // the alias. Also, the new target KMS key must be the same type as the current 16959 // target KMS key (both symmetric or both asymmetric) and they must have the 16960 // same key usage. 16961 // 16962 // Specify the key ID or key ARN of the KMS key. 16963 // 16964 // For example: 16965 // 16966 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 16967 // 16968 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 16969 // 16970 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 16971 // 16972 // To verify that the alias is mapped to the correct KMS key, use ListAliases. 16973 // 16974 // TargetKeyId is a required field 16975 TargetKeyId *string `min:"1" type:"string" required:"true"` 16976 } 16977 16978 // String returns the string representation. 16979 // 16980 // API parameter values that are decorated as "sensitive" in the API will not 16981 // be included in the string output. The member name will be present, but the 16982 // value will be replaced with "sensitive". 16983 func (s UpdateAliasInput) String() string { 16984 return awsutil.Prettify(s) 16985 } 16986 16987 // GoString returns the string representation. 16988 // 16989 // API parameter values that are decorated as "sensitive" in the API will not 16990 // be included in the string output. The member name will be present, but the 16991 // value will be replaced with "sensitive". 16992 func (s UpdateAliasInput) GoString() string { 16993 return s.String() 16994 } 16995 16996 // Validate inspects the fields of the type to determine if they are valid. 16997 func (s *UpdateAliasInput) Validate() error { 16998 invalidParams := request.ErrInvalidParams{Context: "UpdateAliasInput"} 16999 if s.AliasName == nil { 17000 invalidParams.Add(request.NewErrParamRequired("AliasName")) 17001 } 17002 if s.AliasName != nil && len(*s.AliasName) < 1 { 17003 invalidParams.Add(request.NewErrParamMinLen("AliasName", 1)) 17004 } 17005 if s.TargetKeyId == nil { 17006 invalidParams.Add(request.NewErrParamRequired("TargetKeyId")) 17007 } 17008 if s.TargetKeyId != nil && len(*s.TargetKeyId) < 1 { 17009 invalidParams.Add(request.NewErrParamMinLen("TargetKeyId", 1)) 17010 } 17011 17012 if invalidParams.Len() > 0 { 17013 return invalidParams 17014 } 17015 return nil 17016 } 17017 17018 // SetAliasName sets the AliasName field's value. 17019 func (s *UpdateAliasInput) SetAliasName(v string) *UpdateAliasInput { 17020 s.AliasName = &v 17021 return s 17022 } 17023 17024 // SetTargetKeyId sets the TargetKeyId field's value. 17025 func (s *UpdateAliasInput) SetTargetKeyId(v string) *UpdateAliasInput { 17026 s.TargetKeyId = &v 17027 return s 17028 } 17029 17030 type UpdateAliasOutput struct { 17031 _ struct{} `type:"structure"` 17032 } 17033 17034 // String returns the string representation. 17035 // 17036 // API parameter values that are decorated as "sensitive" in the API will not 17037 // be included in the string output. The member name will be present, but the 17038 // value will be replaced with "sensitive". 17039 func (s UpdateAliasOutput) String() string { 17040 return awsutil.Prettify(s) 17041 } 17042 17043 // GoString returns the string representation. 17044 // 17045 // API parameter values that are decorated as "sensitive" in the API will not 17046 // be included in the string output. The member name will be present, but the 17047 // value will be replaced with "sensitive". 17048 func (s UpdateAliasOutput) GoString() string { 17049 return s.String() 17050 } 17051 17052 type UpdateCustomKeyStoreInput struct { 17053 _ struct{} `type:"structure"` 17054 17055 // Associates the custom key store with a related CloudHSM cluster. 17056 // 17057 // Enter the cluster ID of the cluster that you used to create the custom key 17058 // store or a cluster that shares a backup history and has the same cluster 17059 // certificate as the original cluster. You cannot use this parameter to associate 17060 // a custom key store with an unrelated cluster. In addition, the replacement 17061 // cluster must fulfill the requirements (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore) 17062 // for a cluster associated with a custom key store. To view the cluster certificate 17063 // of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) 17064 // operation. 17065 CloudHsmClusterId *string `min:"19" type:"string"` 17066 17067 // Identifies the custom key store that you want to update. Enter the ID of 17068 // the custom key store. To find the ID of a custom key store, use the DescribeCustomKeyStores 17069 // operation. 17070 // 17071 // CustomKeyStoreId is a required field 17072 CustomKeyStoreId *string `min:"1" type:"string" required:"true"` 17073 17074 // Enter the current password of the kmsuser crypto user (CU) in the CloudHSM 17075 // cluster that is associated with the custom key store. 17076 // 17077 // This parameter tells KMS the current password of the kmsuser crypto user 17078 // (CU). It does not set or change the password of any users in the CloudHSM 17079 // cluster. 17080 // 17081 // KeyStorePassword is a sensitive parameter and its value will be 17082 // replaced with "sensitive" in string returned by UpdateCustomKeyStoreInput's 17083 // String and GoString methods. 17084 KeyStorePassword *string `min:"7" type:"string" sensitive:"true"` 17085 17086 // Changes the friendly name of the custom key store to the value that you specify. 17087 // The custom key store name must be unique in the Amazon Web Services account. 17088 NewCustomKeyStoreName *string `min:"1" type:"string"` 17089 } 17090 17091 // String returns the string representation. 17092 // 17093 // API parameter values that are decorated as "sensitive" in the API will not 17094 // be included in the string output. The member name will be present, but the 17095 // value will be replaced with "sensitive". 17096 func (s UpdateCustomKeyStoreInput) String() string { 17097 return awsutil.Prettify(s) 17098 } 17099 17100 // GoString returns the string representation. 17101 // 17102 // API parameter values that are decorated as "sensitive" in the API will not 17103 // be included in the string output. The member name will be present, but the 17104 // value will be replaced with "sensitive". 17105 func (s UpdateCustomKeyStoreInput) GoString() string { 17106 return s.String() 17107 } 17108 17109 // Validate inspects the fields of the type to determine if they are valid. 17110 func (s *UpdateCustomKeyStoreInput) Validate() error { 17111 invalidParams := request.ErrInvalidParams{Context: "UpdateCustomKeyStoreInput"} 17112 if s.CloudHsmClusterId != nil && len(*s.CloudHsmClusterId) < 19 { 17113 invalidParams.Add(request.NewErrParamMinLen("CloudHsmClusterId", 19)) 17114 } 17115 if s.CustomKeyStoreId == nil { 17116 invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreId")) 17117 } 17118 if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { 17119 invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) 17120 } 17121 if s.KeyStorePassword != nil && len(*s.KeyStorePassword) < 7 { 17122 invalidParams.Add(request.NewErrParamMinLen("KeyStorePassword", 7)) 17123 } 17124 if s.NewCustomKeyStoreName != nil && len(*s.NewCustomKeyStoreName) < 1 { 17125 invalidParams.Add(request.NewErrParamMinLen("NewCustomKeyStoreName", 1)) 17126 } 17127 17128 if invalidParams.Len() > 0 { 17129 return invalidParams 17130 } 17131 return nil 17132 } 17133 17134 // SetCloudHsmClusterId sets the CloudHsmClusterId field's value. 17135 func (s *UpdateCustomKeyStoreInput) SetCloudHsmClusterId(v string) *UpdateCustomKeyStoreInput { 17136 s.CloudHsmClusterId = &v 17137 return s 17138 } 17139 17140 // SetCustomKeyStoreId sets the CustomKeyStoreId field's value. 17141 func (s *UpdateCustomKeyStoreInput) SetCustomKeyStoreId(v string) *UpdateCustomKeyStoreInput { 17142 s.CustomKeyStoreId = &v 17143 return s 17144 } 17145 17146 // SetKeyStorePassword sets the KeyStorePassword field's value. 17147 func (s *UpdateCustomKeyStoreInput) SetKeyStorePassword(v string) *UpdateCustomKeyStoreInput { 17148 s.KeyStorePassword = &v 17149 return s 17150 } 17151 17152 // SetNewCustomKeyStoreName sets the NewCustomKeyStoreName field's value. 17153 func (s *UpdateCustomKeyStoreInput) SetNewCustomKeyStoreName(v string) *UpdateCustomKeyStoreInput { 17154 s.NewCustomKeyStoreName = &v 17155 return s 17156 } 17157 17158 type UpdateCustomKeyStoreOutput struct { 17159 _ struct{} `type:"structure"` 17160 } 17161 17162 // String returns the string representation. 17163 // 17164 // API parameter values that are decorated as "sensitive" in the API will not 17165 // be included in the string output. The member name will be present, but the 17166 // value will be replaced with "sensitive". 17167 func (s UpdateCustomKeyStoreOutput) String() string { 17168 return awsutil.Prettify(s) 17169 } 17170 17171 // GoString returns the string representation. 17172 // 17173 // API parameter values that are decorated as "sensitive" in the API will not 17174 // be included in the string output. The member name will be present, but the 17175 // value will be replaced with "sensitive". 17176 func (s UpdateCustomKeyStoreOutput) GoString() string { 17177 return s.String() 17178 } 17179 17180 type UpdateKeyDescriptionInput struct { 17181 _ struct{} `type:"structure"` 17182 17183 // New description for the KMS key. 17184 // 17185 // Description is a required field 17186 Description *string `type:"string" required:"true"` 17187 17188 // Updates the description of the specified KMS key. 17189 // 17190 // Specify the key ID or key ARN of the KMS key. 17191 // 17192 // For example: 17193 // 17194 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 17195 // 17196 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 17197 // 17198 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 17199 // 17200 // KeyId is a required field 17201 KeyId *string `min:"1" type:"string" required:"true"` 17202 } 17203 17204 // String returns the string representation. 17205 // 17206 // API parameter values that are decorated as "sensitive" in the API will not 17207 // be included in the string output. The member name will be present, but the 17208 // value will be replaced with "sensitive". 17209 func (s UpdateKeyDescriptionInput) String() string { 17210 return awsutil.Prettify(s) 17211 } 17212 17213 // GoString returns the string representation. 17214 // 17215 // API parameter values that are decorated as "sensitive" in the API will not 17216 // be included in the string output. The member name will be present, but the 17217 // value will be replaced with "sensitive". 17218 func (s UpdateKeyDescriptionInput) GoString() string { 17219 return s.String() 17220 } 17221 17222 // Validate inspects the fields of the type to determine if they are valid. 17223 func (s *UpdateKeyDescriptionInput) Validate() error { 17224 invalidParams := request.ErrInvalidParams{Context: "UpdateKeyDescriptionInput"} 17225 if s.Description == nil { 17226 invalidParams.Add(request.NewErrParamRequired("Description")) 17227 } 17228 if s.KeyId == nil { 17229 invalidParams.Add(request.NewErrParamRequired("KeyId")) 17230 } 17231 if s.KeyId != nil && len(*s.KeyId) < 1 { 17232 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 17233 } 17234 17235 if invalidParams.Len() > 0 { 17236 return invalidParams 17237 } 17238 return nil 17239 } 17240 17241 // SetDescription sets the Description field's value. 17242 func (s *UpdateKeyDescriptionInput) SetDescription(v string) *UpdateKeyDescriptionInput { 17243 s.Description = &v 17244 return s 17245 } 17246 17247 // SetKeyId sets the KeyId field's value. 17248 func (s *UpdateKeyDescriptionInput) SetKeyId(v string) *UpdateKeyDescriptionInput { 17249 s.KeyId = &v 17250 return s 17251 } 17252 17253 type UpdateKeyDescriptionOutput struct { 17254 _ struct{} `type:"structure"` 17255 } 17256 17257 // String returns the string representation. 17258 // 17259 // API parameter values that are decorated as "sensitive" in the API will not 17260 // be included in the string output. The member name will be present, but the 17261 // value will be replaced with "sensitive". 17262 func (s UpdateKeyDescriptionOutput) String() string { 17263 return awsutil.Prettify(s) 17264 } 17265 17266 // GoString returns the string representation. 17267 // 17268 // API parameter values that are decorated as "sensitive" in the API will not 17269 // be included in the string output. The member name will be present, but the 17270 // value will be replaced with "sensitive". 17271 func (s UpdateKeyDescriptionOutput) GoString() string { 17272 return s.String() 17273 } 17274 17275 type UpdatePrimaryRegionInput struct { 17276 _ struct{} `type:"structure"` 17277 17278 // Identifies the current primary key. When the operation completes, this KMS 17279 // key will be a replica key. 17280 // 17281 // Specify the key ID or key ARN of a multi-Region primary key. 17282 // 17283 // For example: 17284 // 17285 // * Key ID: mrk-1234abcd12ab34cd56ef1234567890ab 17286 // 17287 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab 17288 // 17289 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 17290 // 17291 // KeyId is a required field 17292 KeyId *string `min:"1" type:"string" required:"true"` 17293 17294 // The Amazon Web Services Region of the new primary key. Enter the Region ID, 17295 // such as us-east-1 or ap-southeast-2. There must be an existing replica key 17296 // in this Region. 17297 // 17298 // When the operation completes, the multi-Region key in this Region will be 17299 // the primary key. 17300 // 17301 // PrimaryRegion is a required field 17302 PrimaryRegion *string `min:"1" type:"string" required:"true"` 17303 } 17304 17305 // String returns the string representation. 17306 // 17307 // API parameter values that are decorated as "sensitive" in the API will not 17308 // be included in the string output. The member name will be present, but the 17309 // value will be replaced with "sensitive". 17310 func (s UpdatePrimaryRegionInput) String() string { 17311 return awsutil.Prettify(s) 17312 } 17313 17314 // GoString returns the string representation. 17315 // 17316 // API parameter values that are decorated as "sensitive" in the API will not 17317 // be included in the string output. The member name will be present, but the 17318 // value will be replaced with "sensitive". 17319 func (s UpdatePrimaryRegionInput) GoString() string { 17320 return s.String() 17321 } 17322 17323 // Validate inspects the fields of the type to determine if they are valid. 17324 func (s *UpdatePrimaryRegionInput) Validate() error { 17325 invalidParams := request.ErrInvalidParams{Context: "UpdatePrimaryRegionInput"} 17326 if s.KeyId == nil { 17327 invalidParams.Add(request.NewErrParamRequired("KeyId")) 17328 } 17329 if s.KeyId != nil && len(*s.KeyId) < 1 { 17330 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 17331 } 17332 if s.PrimaryRegion == nil { 17333 invalidParams.Add(request.NewErrParamRequired("PrimaryRegion")) 17334 } 17335 if s.PrimaryRegion != nil && len(*s.PrimaryRegion) < 1 { 17336 invalidParams.Add(request.NewErrParamMinLen("PrimaryRegion", 1)) 17337 } 17338 17339 if invalidParams.Len() > 0 { 17340 return invalidParams 17341 } 17342 return nil 17343 } 17344 17345 // SetKeyId sets the KeyId field's value. 17346 func (s *UpdatePrimaryRegionInput) SetKeyId(v string) *UpdatePrimaryRegionInput { 17347 s.KeyId = &v 17348 return s 17349 } 17350 17351 // SetPrimaryRegion sets the PrimaryRegion field's value. 17352 func (s *UpdatePrimaryRegionInput) SetPrimaryRegion(v string) *UpdatePrimaryRegionInput { 17353 s.PrimaryRegion = &v 17354 return s 17355 } 17356 17357 type UpdatePrimaryRegionOutput struct { 17358 _ struct{} `type:"structure"` 17359 } 17360 17361 // String returns the string representation. 17362 // 17363 // API parameter values that are decorated as "sensitive" in the API will not 17364 // be included in the string output. The member name will be present, but the 17365 // value will be replaced with "sensitive". 17366 func (s UpdatePrimaryRegionOutput) String() string { 17367 return awsutil.Prettify(s) 17368 } 17369 17370 // GoString returns the string representation. 17371 // 17372 // API parameter values that are decorated as "sensitive" in the API will not 17373 // be included in the string output. The member name will be present, but the 17374 // value will be replaced with "sensitive". 17375 func (s UpdatePrimaryRegionOutput) GoString() string { 17376 return s.String() 17377 } 17378 17379 type VerifyInput struct { 17380 _ struct{} `type:"structure"` 17381 17382 // A list of grant tokens. 17383 // 17384 // Use a grant token when your permission to call this operation comes from 17385 // a new grant that has not yet achieved eventual consistency. For more information, 17386 // see Grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token) 17387 // and Using a grant token (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token) 17388 // in the Key Management Service Developer Guide. 17389 GrantTokens []*string `type:"list"` 17390 17391 // Identifies the asymmetric KMS key that will be used to verify the signature. 17392 // This must be the same KMS key that was used to generate the signature. If 17393 // you specify a different KMS key, the signature verification fails. 17394 // 17395 // To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. 17396 // When using an alias name, prefix it with "alias/". To specify a KMS key in 17397 // a different Amazon Web Services account, you must use the key ARN or alias 17398 // ARN. 17399 // 17400 // For example: 17401 // 17402 // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab 17403 // 17404 // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab 17405 // 17406 // * Alias name: alias/ExampleAlias 17407 // 17408 // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias 17409 // 17410 // To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. 17411 // To get the alias name and alias ARN, use ListAliases. 17412 // 17413 // KeyId is a required field 17414 KeyId *string `min:"1" type:"string" required:"true"` 17415 17416 // Specifies the message that was signed. You can submit a raw message of up 17417 // to 4096 bytes, or a hash digest of the message. If you submit a digest, use 17418 // the MessageType parameter with a value of DIGEST. 17419 // 17420 // If the message specified here is different from the message that was signed, 17421 // the signature verification fails. A message and its hash digest are considered 17422 // to be the same message. 17423 // 17424 // Message is a sensitive parameter and its value will be 17425 // replaced with "sensitive" in string returned by VerifyInput's 17426 // String and GoString methods. 17427 // 17428 // Message is automatically base64 encoded/decoded by the SDK. 17429 // 17430 // Message is a required field 17431 Message []byte `min:"1" type:"blob" required:"true" sensitive:"true"` 17432 17433 // Tells KMS whether the value of the Message parameter is a message or message 17434 // digest. The default value, RAW, indicates a message. To indicate a message 17435 // digest, enter DIGEST. 17436 // 17437 // Use the DIGEST value only when the value of the Message parameter is a message 17438 // digest. If you use the DIGEST value with a raw message, the security of the 17439 // verification operation can be compromised. 17440 MessageType *string `type:"string" enum:"MessageType"` 17441 17442 // The signature that the Sign operation generated. 17443 // Signature is automatically base64 encoded/decoded by the SDK. 17444 // 17445 // Signature is a required field 17446 Signature []byte `min:"1" type:"blob" required:"true"` 17447 17448 // The signing algorithm that was used to sign the message. If you submit a 17449 // different algorithm, the signature verification fails. 17450 // 17451 // SigningAlgorithm is a required field 17452 SigningAlgorithm *string `type:"string" required:"true" enum:"SigningAlgorithmSpec"` 17453 } 17454 17455 // String returns the string representation. 17456 // 17457 // API parameter values that are decorated as "sensitive" in the API will not 17458 // be included in the string output. The member name will be present, but the 17459 // value will be replaced with "sensitive". 17460 func (s VerifyInput) String() string { 17461 return awsutil.Prettify(s) 17462 } 17463 17464 // GoString returns the string representation. 17465 // 17466 // API parameter values that are decorated as "sensitive" in the API will not 17467 // be included in the string output. The member name will be present, but the 17468 // value will be replaced with "sensitive". 17469 func (s VerifyInput) GoString() string { 17470 return s.String() 17471 } 17472 17473 // Validate inspects the fields of the type to determine if they are valid. 17474 func (s *VerifyInput) Validate() error { 17475 invalidParams := request.ErrInvalidParams{Context: "VerifyInput"} 17476 if s.KeyId == nil { 17477 invalidParams.Add(request.NewErrParamRequired("KeyId")) 17478 } 17479 if s.KeyId != nil && len(*s.KeyId) < 1 { 17480 invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) 17481 } 17482 if s.Message == nil { 17483 invalidParams.Add(request.NewErrParamRequired("Message")) 17484 } 17485 if s.Message != nil && len(s.Message) < 1 { 17486 invalidParams.Add(request.NewErrParamMinLen("Message", 1)) 17487 } 17488 if s.Signature == nil { 17489 invalidParams.Add(request.NewErrParamRequired("Signature")) 17490 } 17491 if s.Signature != nil && len(s.Signature) < 1 { 17492 invalidParams.Add(request.NewErrParamMinLen("Signature", 1)) 17493 } 17494 if s.SigningAlgorithm == nil { 17495 invalidParams.Add(request.NewErrParamRequired("SigningAlgorithm")) 17496 } 17497 17498 if invalidParams.Len() > 0 { 17499 return invalidParams 17500 } 17501 return nil 17502 } 17503 17504 // SetGrantTokens sets the GrantTokens field's value. 17505 func (s *VerifyInput) SetGrantTokens(v []*string) *VerifyInput { 17506 s.GrantTokens = v 17507 return s 17508 } 17509 17510 // SetKeyId sets the KeyId field's value. 17511 func (s *VerifyInput) SetKeyId(v string) *VerifyInput { 17512 s.KeyId = &v 17513 return s 17514 } 17515 17516 // SetMessage sets the Message field's value. 17517 func (s *VerifyInput) SetMessage(v []byte) *VerifyInput { 17518 s.Message = v 17519 return s 17520 } 17521 17522 // SetMessageType sets the MessageType field's value. 17523 func (s *VerifyInput) SetMessageType(v string) *VerifyInput { 17524 s.MessageType = &v 17525 return s 17526 } 17527 17528 // SetSignature sets the Signature field's value. 17529 func (s *VerifyInput) SetSignature(v []byte) *VerifyInput { 17530 s.Signature = v 17531 return s 17532 } 17533 17534 // SetSigningAlgorithm sets the SigningAlgorithm field's value. 17535 func (s *VerifyInput) SetSigningAlgorithm(v string) *VerifyInput { 17536 s.SigningAlgorithm = &v 17537 return s 17538 } 17539 17540 type VerifyOutput struct { 17541 _ struct{} `type:"structure"` 17542 17543 // The Amazon Resource Name (key ARN (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN)) 17544 // of the asymmetric KMS key that was used to verify the signature. 17545 KeyId *string `min:"1" type:"string"` 17546 17547 // A Boolean value that indicates whether the signature was verified. A value 17548 // of True indicates that the Signature was produced by signing the Message 17549 // with the specified KeyID and SigningAlgorithm. If the signature is not verified, 17550 // the Verify operation fails with a KMSInvalidSignatureException exception. 17551 SignatureValid *bool `type:"boolean"` 17552 17553 // The signing algorithm that was used to verify the signature. 17554 SigningAlgorithm *string `type:"string" enum:"SigningAlgorithmSpec"` 17555 } 17556 17557 // String returns the string representation. 17558 // 17559 // API parameter values that are decorated as "sensitive" in the API will not 17560 // be included in the string output. The member name will be present, but the 17561 // value will be replaced with "sensitive". 17562 func (s VerifyOutput) String() string { 17563 return awsutil.Prettify(s) 17564 } 17565 17566 // GoString returns the string representation. 17567 // 17568 // API parameter values that are decorated as "sensitive" in the API will not 17569 // be included in the string output. The member name will be present, but the 17570 // value will be replaced with "sensitive". 17571 func (s VerifyOutput) GoString() string { 17572 return s.String() 17573 } 17574 17575 // SetKeyId sets the KeyId field's value. 17576 func (s *VerifyOutput) SetKeyId(v string) *VerifyOutput { 17577 s.KeyId = &v 17578 return s 17579 } 17580 17581 // SetSignatureValid sets the SignatureValid field's value. 17582 func (s *VerifyOutput) SetSignatureValid(v bool) *VerifyOutput { 17583 s.SignatureValid = &v 17584 return s 17585 } 17586 17587 // SetSigningAlgorithm sets the SigningAlgorithm field's value. 17588 func (s *VerifyOutput) SetSigningAlgorithm(v string) *VerifyOutput { 17589 s.SigningAlgorithm = &v 17590 return s 17591 } 17592 17593 const ( 17594 // AlgorithmSpecRsaesPkcs1V15 is a AlgorithmSpec enum value 17595 AlgorithmSpecRsaesPkcs1V15 = "RSAES_PKCS1_V1_5" 17596 17597 // AlgorithmSpecRsaesOaepSha1 is a AlgorithmSpec enum value 17598 AlgorithmSpecRsaesOaepSha1 = "RSAES_OAEP_SHA_1" 17599 17600 // AlgorithmSpecRsaesOaepSha256 is a AlgorithmSpec enum value 17601 AlgorithmSpecRsaesOaepSha256 = "RSAES_OAEP_SHA_256" 17602 ) 17603 17604 // AlgorithmSpec_Values returns all elements of the AlgorithmSpec enum 17605 func AlgorithmSpec_Values() []string { 17606 return []string{ 17607 AlgorithmSpecRsaesPkcs1V15, 17608 AlgorithmSpecRsaesOaepSha1, 17609 AlgorithmSpecRsaesOaepSha256, 17610 } 17611 } 17612 17613 const ( 17614 // ConnectionErrorCodeTypeInvalidCredentials is a ConnectionErrorCodeType enum value 17615 ConnectionErrorCodeTypeInvalidCredentials = "INVALID_CREDENTIALS" 17616 17617 // ConnectionErrorCodeTypeClusterNotFound is a ConnectionErrorCodeType enum value 17618 ConnectionErrorCodeTypeClusterNotFound = "CLUSTER_NOT_FOUND" 17619 17620 // ConnectionErrorCodeTypeNetworkErrors is a ConnectionErrorCodeType enum value 17621 ConnectionErrorCodeTypeNetworkErrors = "NETWORK_ERRORS" 17622 17623 // ConnectionErrorCodeTypeInternalError is a ConnectionErrorCodeType enum value 17624 ConnectionErrorCodeTypeInternalError = "INTERNAL_ERROR" 17625 17626 // ConnectionErrorCodeTypeInsufficientCloudhsmHsms is a ConnectionErrorCodeType enum value 17627 ConnectionErrorCodeTypeInsufficientCloudhsmHsms = "INSUFFICIENT_CLOUDHSM_HSMS" 17628 17629 // ConnectionErrorCodeTypeUserLockedOut is a ConnectionErrorCodeType enum value 17630 ConnectionErrorCodeTypeUserLockedOut = "USER_LOCKED_OUT" 17631 17632 // ConnectionErrorCodeTypeUserNotFound is a ConnectionErrorCodeType enum value 17633 ConnectionErrorCodeTypeUserNotFound = "USER_NOT_FOUND" 17634 17635 // ConnectionErrorCodeTypeUserLoggedIn is a ConnectionErrorCodeType enum value 17636 ConnectionErrorCodeTypeUserLoggedIn = "USER_LOGGED_IN" 17637 17638 // ConnectionErrorCodeTypeSubnetNotFound is a ConnectionErrorCodeType enum value 17639 ConnectionErrorCodeTypeSubnetNotFound = "SUBNET_NOT_FOUND" 17640 ) 17641 17642 // ConnectionErrorCodeType_Values returns all elements of the ConnectionErrorCodeType enum 17643 func ConnectionErrorCodeType_Values() []string { 17644 return []string{ 17645 ConnectionErrorCodeTypeInvalidCredentials, 17646 ConnectionErrorCodeTypeClusterNotFound, 17647 ConnectionErrorCodeTypeNetworkErrors, 17648 ConnectionErrorCodeTypeInternalError, 17649 ConnectionErrorCodeTypeInsufficientCloudhsmHsms, 17650 ConnectionErrorCodeTypeUserLockedOut, 17651 ConnectionErrorCodeTypeUserNotFound, 17652 ConnectionErrorCodeTypeUserLoggedIn, 17653 ConnectionErrorCodeTypeSubnetNotFound, 17654 } 17655 } 17656 17657 const ( 17658 // ConnectionStateTypeConnected is a ConnectionStateType enum value 17659 ConnectionStateTypeConnected = "CONNECTED" 17660 17661 // ConnectionStateTypeConnecting is a ConnectionStateType enum value 17662 ConnectionStateTypeConnecting = "CONNECTING" 17663 17664 // ConnectionStateTypeFailed is a ConnectionStateType enum value 17665 ConnectionStateTypeFailed = "FAILED" 17666 17667 // ConnectionStateTypeDisconnected is a ConnectionStateType enum value 17668 ConnectionStateTypeDisconnected = "DISCONNECTED" 17669 17670 // ConnectionStateTypeDisconnecting is a ConnectionStateType enum value 17671 ConnectionStateTypeDisconnecting = "DISCONNECTING" 17672 ) 17673 17674 // ConnectionStateType_Values returns all elements of the ConnectionStateType enum 17675 func ConnectionStateType_Values() []string { 17676 return []string{ 17677 ConnectionStateTypeConnected, 17678 ConnectionStateTypeConnecting, 17679 ConnectionStateTypeFailed, 17680 ConnectionStateTypeDisconnected, 17681 ConnectionStateTypeDisconnecting, 17682 } 17683 } 17684 17685 const ( 17686 // CustomerMasterKeySpecRsa2048 is a CustomerMasterKeySpec enum value 17687 CustomerMasterKeySpecRsa2048 = "RSA_2048" 17688 17689 // CustomerMasterKeySpecRsa3072 is a CustomerMasterKeySpec enum value 17690 CustomerMasterKeySpecRsa3072 = "RSA_3072" 17691 17692 // CustomerMasterKeySpecRsa4096 is a CustomerMasterKeySpec enum value 17693 CustomerMasterKeySpecRsa4096 = "RSA_4096" 17694 17695 // CustomerMasterKeySpecEccNistP256 is a CustomerMasterKeySpec enum value 17696 CustomerMasterKeySpecEccNistP256 = "ECC_NIST_P256" 17697 17698 // CustomerMasterKeySpecEccNistP384 is a CustomerMasterKeySpec enum value 17699 CustomerMasterKeySpecEccNistP384 = "ECC_NIST_P384" 17700 17701 // CustomerMasterKeySpecEccNistP521 is a CustomerMasterKeySpec enum value 17702 CustomerMasterKeySpecEccNistP521 = "ECC_NIST_P521" 17703 17704 // CustomerMasterKeySpecEccSecgP256k1 is a CustomerMasterKeySpec enum value 17705 CustomerMasterKeySpecEccSecgP256k1 = "ECC_SECG_P256K1" 17706 17707 // CustomerMasterKeySpecSymmetricDefault is a CustomerMasterKeySpec enum value 17708 CustomerMasterKeySpecSymmetricDefault = "SYMMETRIC_DEFAULT" 17709 ) 17710 17711 // CustomerMasterKeySpec_Values returns all elements of the CustomerMasterKeySpec enum 17712 func CustomerMasterKeySpec_Values() []string { 17713 return []string{ 17714 CustomerMasterKeySpecRsa2048, 17715 CustomerMasterKeySpecRsa3072, 17716 CustomerMasterKeySpecRsa4096, 17717 CustomerMasterKeySpecEccNistP256, 17718 CustomerMasterKeySpecEccNistP384, 17719 CustomerMasterKeySpecEccNistP521, 17720 CustomerMasterKeySpecEccSecgP256k1, 17721 CustomerMasterKeySpecSymmetricDefault, 17722 } 17723 } 17724 17725 const ( 17726 // DataKeyPairSpecRsa2048 is a DataKeyPairSpec enum value 17727 DataKeyPairSpecRsa2048 = "RSA_2048" 17728 17729 // DataKeyPairSpecRsa3072 is a DataKeyPairSpec enum value 17730 DataKeyPairSpecRsa3072 = "RSA_3072" 17731 17732 // DataKeyPairSpecRsa4096 is a DataKeyPairSpec enum value 17733 DataKeyPairSpecRsa4096 = "RSA_4096" 17734 17735 // DataKeyPairSpecEccNistP256 is a DataKeyPairSpec enum value 17736 DataKeyPairSpecEccNistP256 = "ECC_NIST_P256" 17737 17738 // DataKeyPairSpecEccNistP384 is a DataKeyPairSpec enum value 17739 DataKeyPairSpecEccNistP384 = "ECC_NIST_P384" 17740 17741 // DataKeyPairSpecEccNistP521 is a DataKeyPairSpec enum value 17742 DataKeyPairSpecEccNistP521 = "ECC_NIST_P521" 17743 17744 // DataKeyPairSpecEccSecgP256k1 is a DataKeyPairSpec enum value 17745 DataKeyPairSpecEccSecgP256k1 = "ECC_SECG_P256K1" 17746 ) 17747 17748 // DataKeyPairSpec_Values returns all elements of the DataKeyPairSpec enum 17749 func DataKeyPairSpec_Values() []string { 17750 return []string{ 17751 DataKeyPairSpecRsa2048, 17752 DataKeyPairSpecRsa3072, 17753 DataKeyPairSpecRsa4096, 17754 DataKeyPairSpecEccNistP256, 17755 DataKeyPairSpecEccNistP384, 17756 DataKeyPairSpecEccNistP521, 17757 DataKeyPairSpecEccSecgP256k1, 17758 } 17759 } 17760 17761 const ( 17762 // DataKeySpecAes256 is a DataKeySpec enum value 17763 DataKeySpecAes256 = "AES_256" 17764 17765 // DataKeySpecAes128 is a DataKeySpec enum value 17766 DataKeySpecAes128 = "AES_128" 17767 ) 17768 17769 // DataKeySpec_Values returns all elements of the DataKeySpec enum 17770 func DataKeySpec_Values() []string { 17771 return []string{ 17772 DataKeySpecAes256, 17773 DataKeySpecAes128, 17774 } 17775 } 17776 17777 const ( 17778 // EncryptionAlgorithmSpecSymmetricDefault is a EncryptionAlgorithmSpec enum value 17779 EncryptionAlgorithmSpecSymmetricDefault = "SYMMETRIC_DEFAULT" 17780 17781 // EncryptionAlgorithmSpecRsaesOaepSha1 is a EncryptionAlgorithmSpec enum value 17782 EncryptionAlgorithmSpecRsaesOaepSha1 = "RSAES_OAEP_SHA_1" 17783 17784 // EncryptionAlgorithmSpecRsaesOaepSha256 is a EncryptionAlgorithmSpec enum value 17785 EncryptionAlgorithmSpecRsaesOaepSha256 = "RSAES_OAEP_SHA_256" 17786 ) 17787 17788 // EncryptionAlgorithmSpec_Values returns all elements of the EncryptionAlgorithmSpec enum 17789 func EncryptionAlgorithmSpec_Values() []string { 17790 return []string{ 17791 EncryptionAlgorithmSpecSymmetricDefault, 17792 EncryptionAlgorithmSpecRsaesOaepSha1, 17793 EncryptionAlgorithmSpecRsaesOaepSha256, 17794 } 17795 } 17796 17797 const ( 17798 // ExpirationModelTypeKeyMaterialExpires is a ExpirationModelType enum value 17799 ExpirationModelTypeKeyMaterialExpires = "KEY_MATERIAL_EXPIRES" 17800 17801 // ExpirationModelTypeKeyMaterialDoesNotExpire is a ExpirationModelType enum value 17802 ExpirationModelTypeKeyMaterialDoesNotExpire = "KEY_MATERIAL_DOES_NOT_EXPIRE" 17803 ) 17804 17805 // ExpirationModelType_Values returns all elements of the ExpirationModelType enum 17806 func ExpirationModelType_Values() []string { 17807 return []string{ 17808 ExpirationModelTypeKeyMaterialExpires, 17809 ExpirationModelTypeKeyMaterialDoesNotExpire, 17810 } 17811 } 17812 17813 const ( 17814 // GrantOperationDecrypt is a GrantOperation enum value 17815 GrantOperationDecrypt = "Decrypt" 17816 17817 // GrantOperationEncrypt is a GrantOperation enum value 17818 GrantOperationEncrypt = "Encrypt" 17819 17820 // GrantOperationGenerateDataKey is a GrantOperation enum value 17821 GrantOperationGenerateDataKey = "GenerateDataKey" 17822 17823 // GrantOperationGenerateDataKeyWithoutPlaintext is a GrantOperation enum value 17824 GrantOperationGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext" 17825 17826 // GrantOperationReEncryptFrom is a GrantOperation enum value 17827 GrantOperationReEncryptFrom = "ReEncryptFrom" 17828 17829 // GrantOperationReEncryptTo is a GrantOperation enum value 17830 GrantOperationReEncryptTo = "ReEncryptTo" 17831 17832 // GrantOperationSign is a GrantOperation enum value 17833 GrantOperationSign = "Sign" 17834 17835 // GrantOperationVerify is a GrantOperation enum value 17836 GrantOperationVerify = "Verify" 17837 17838 // GrantOperationGetPublicKey is a GrantOperation enum value 17839 GrantOperationGetPublicKey = "GetPublicKey" 17840 17841 // GrantOperationCreateGrant is a GrantOperation enum value 17842 GrantOperationCreateGrant = "CreateGrant" 17843 17844 // GrantOperationRetireGrant is a GrantOperation enum value 17845 GrantOperationRetireGrant = "RetireGrant" 17846 17847 // GrantOperationDescribeKey is a GrantOperation enum value 17848 GrantOperationDescribeKey = "DescribeKey" 17849 17850 // GrantOperationGenerateDataKeyPair is a GrantOperation enum value 17851 GrantOperationGenerateDataKeyPair = "GenerateDataKeyPair" 17852 17853 // GrantOperationGenerateDataKeyPairWithoutPlaintext is a GrantOperation enum value 17854 GrantOperationGenerateDataKeyPairWithoutPlaintext = "GenerateDataKeyPairWithoutPlaintext" 17855 ) 17856 17857 // GrantOperation_Values returns all elements of the GrantOperation enum 17858 func GrantOperation_Values() []string { 17859 return []string{ 17860 GrantOperationDecrypt, 17861 GrantOperationEncrypt, 17862 GrantOperationGenerateDataKey, 17863 GrantOperationGenerateDataKeyWithoutPlaintext, 17864 GrantOperationReEncryptFrom, 17865 GrantOperationReEncryptTo, 17866 GrantOperationSign, 17867 GrantOperationVerify, 17868 GrantOperationGetPublicKey, 17869 GrantOperationCreateGrant, 17870 GrantOperationRetireGrant, 17871 GrantOperationDescribeKey, 17872 GrantOperationGenerateDataKeyPair, 17873 GrantOperationGenerateDataKeyPairWithoutPlaintext, 17874 } 17875 } 17876 17877 const ( 17878 // KeyManagerTypeAws is a KeyManagerType enum value 17879 KeyManagerTypeAws = "AWS" 17880 17881 // KeyManagerTypeCustomer is a KeyManagerType enum value 17882 KeyManagerTypeCustomer = "CUSTOMER" 17883 ) 17884 17885 // KeyManagerType_Values returns all elements of the KeyManagerType enum 17886 func KeyManagerType_Values() []string { 17887 return []string{ 17888 KeyManagerTypeAws, 17889 KeyManagerTypeCustomer, 17890 } 17891 } 17892 17893 const ( 17894 // KeySpecRsa2048 is a KeySpec enum value 17895 KeySpecRsa2048 = "RSA_2048" 17896 17897 // KeySpecRsa3072 is a KeySpec enum value 17898 KeySpecRsa3072 = "RSA_3072" 17899 17900 // KeySpecRsa4096 is a KeySpec enum value 17901 KeySpecRsa4096 = "RSA_4096" 17902 17903 // KeySpecEccNistP256 is a KeySpec enum value 17904 KeySpecEccNistP256 = "ECC_NIST_P256" 17905 17906 // KeySpecEccNistP384 is a KeySpec enum value 17907 KeySpecEccNistP384 = "ECC_NIST_P384" 17908 17909 // KeySpecEccNistP521 is a KeySpec enum value 17910 KeySpecEccNistP521 = "ECC_NIST_P521" 17911 17912 // KeySpecEccSecgP256k1 is a KeySpec enum value 17913 KeySpecEccSecgP256k1 = "ECC_SECG_P256K1" 17914 17915 // KeySpecSymmetricDefault is a KeySpec enum value 17916 KeySpecSymmetricDefault = "SYMMETRIC_DEFAULT" 17917 ) 17918 17919 // KeySpec_Values returns all elements of the KeySpec enum 17920 func KeySpec_Values() []string { 17921 return []string{ 17922 KeySpecRsa2048, 17923 KeySpecRsa3072, 17924 KeySpecRsa4096, 17925 KeySpecEccNistP256, 17926 KeySpecEccNistP384, 17927 KeySpecEccNistP521, 17928 KeySpecEccSecgP256k1, 17929 KeySpecSymmetricDefault, 17930 } 17931 } 17932 17933 const ( 17934 // KeyStateCreating is a KeyState enum value 17935 KeyStateCreating = "Creating" 17936 17937 // KeyStateEnabled is a KeyState enum value 17938 KeyStateEnabled = "Enabled" 17939 17940 // KeyStateDisabled is a KeyState enum value 17941 KeyStateDisabled = "Disabled" 17942 17943 // KeyStatePendingDeletion is a KeyState enum value 17944 KeyStatePendingDeletion = "PendingDeletion" 17945 17946 // KeyStatePendingImport is a KeyState enum value 17947 KeyStatePendingImport = "PendingImport" 17948 17949 // KeyStatePendingReplicaDeletion is a KeyState enum value 17950 KeyStatePendingReplicaDeletion = "PendingReplicaDeletion" 17951 17952 // KeyStateUnavailable is a KeyState enum value 17953 KeyStateUnavailable = "Unavailable" 17954 17955 // KeyStateUpdating is a KeyState enum value 17956 KeyStateUpdating = "Updating" 17957 ) 17958 17959 // KeyState_Values returns all elements of the KeyState enum 17960 func KeyState_Values() []string { 17961 return []string{ 17962 KeyStateCreating, 17963 KeyStateEnabled, 17964 KeyStateDisabled, 17965 KeyStatePendingDeletion, 17966 KeyStatePendingImport, 17967 KeyStatePendingReplicaDeletion, 17968 KeyStateUnavailable, 17969 KeyStateUpdating, 17970 } 17971 } 17972 17973 const ( 17974 // KeyUsageTypeSignVerify is a KeyUsageType enum value 17975 KeyUsageTypeSignVerify = "SIGN_VERIFY" 17976 17977 // KeyUsageTypeEncryptDecrypt is a KeyUsageType enum value 17978 KeyUsageTypeEncryptDecrypt = "ENCRYPT_DECRYPT" 17979 ) 17980 17981 // KeyUsageType_Values returns all elements of the KeyUsageType enum 17982 func KeyUsageType_Values() []string { 17983 return []string{ 17984 KeyUsageTypeSignVerify, 17985 KeyUsageTypeEncryptDecrypt, 17986 } 17987 } 17988 17989 const ( 17990 // MessageTypeRaw is a MessageType enum value 17991 MessageTypeRaw = "RAW" 17992 17993 // MessageTypeDigest is a MessageType enum value 17994 MessageTypeDigest = "DIGEST" 17995 ) 17996 17997 // MessageType_Values returns all elements of the MessageType enum 17998 func MessageType_Values() []string { 17999 return []string{ 18000 MessageTypeRaw, 18001 MessageTypeDigest, 18002 } 18003 } 18004 18005 const ( 18006 // MultiRegionKeyTypePrimary is a MultiRegionKeyType enum value 18007 MultiRegionKeyTypePrimary = "PRIMARY" 18008 18009 // MultiRegionKeyTypeReplica is a MultiRegionKeyType enum value 18010 MultiRegionKeyTypeReplica = "REPLICA" 18011 ) 18012 18013 // MultiRegionKeyType_Values returns all elements of the MultiRegionKeyType enum 18014 func MultiRegionKeyType_Values() []string { 18015 return []string{ 18016 MultiRegionKeyTypePrimary, 18017 MultiRegionKeyTypeReplica, 18018 } 18019 } 18020 18021 const ( 18022 // OriginTypeAwsKms is a OriginType enum value 18023 OriginTypeAwsKms = "AWS_KMS" 18024 18025 // OriginTypeExternal is a OriginType enum value 18026 OriginTypeExternal = "EXTERNAL" 18027 18028 // OriginTypeAwsCloudhsm is a OriginType enum value 18029 OriginTypeAwsCloudhsm = "AWS_CLOUDHSM" 18030 ) 18031 18032 // OriginType_Values returns all elements of the OriginType enum 18033 func OriginType_Values() []string { 18034 return []string{ 18035 OriginTypeAwsKms, 18036 OriginTypeExternal, 18037 OriginTypeAwsCloudhsm, 18038 } 18039 } 18040 18041 const ( 18042 // SigningAlgorithmSpecRsassaPssSha256 is a SigningAlgorithmSpec enum value 18043 SigningAlgorithmSpecRsassaPssSha256 = "RSASSA_PSS_SHA_256" 18044 18045 // SigningAlgorithmSpecRsassaPssSha384 is a SigningAlgorithmSpec enum value 18046 SigningAlgorithmSpecRsassaPssSha384 = "RSASSA_PSS_SHA_384" 18047 18048 // SigningAlgorithmSpecRsassaPssSha512 is a SigningAlgorithmSpec enum value 18049 SigningAlgorithmSpecRsassaPssSha512 = "RSASSA_PSS_SHA_512" 18050 18051 // SigningAlgorithmSpecRsassaPkcs1V15Sha256 is a SigningAlgorithmSpec enum value 18052 SigningAlgorithmSpecRsassaPkcs1V15Sha256 = "RSASSA_PKCS1_V1_5_SHA_256" 18053 18054 // SigningAlgorithmSpecRsassaPkcs1V15Sha384 is a SigningAlgorithmSpec enum value 18055 SigningAlgorithmSpecRsassaPkcs1V15Sha384 = "RSASSA_PKCS1_V1_5_SHA_384" 18056 18057 // SigningAlgorithmSpecRsassaPkcs1V15Sha512 is a SigningAlgorithmSpec enum value 18058 SigningAlgorithmSpecRsassaPkcs1V15Sha512 = "RSASSA_PKCS1_V1_5_SHA_512" 18059 18060 // SigningAlgorithmSpecEcdsaSha256 is a SigningAlgorithmSpec enum value 18061 SigningAlgorithmSpecEcdsaSha256 = "ECDSA_SHA_256" 18062 18063 // SigningAlgorithmSpecEcdsaSha384 is a SigningAlgorithmSpec enum value 18064 SigningAlgorithmSpecEcdsaSha384 = "ECDSA_SHA_384" 18065 18066 // SigningAlgorithmSpecEcdsaSha512 is a SigningAlgorithmSpec enum value 18067 SigningAlgorithmSpecEcdsaSha512 = "ECDSA_SHA_512" 18068 ) 18069 18070 // SigningAlgorithmSpec_Values returns all elements of the SigningAlgorithmSpec enum 18071 func SigningAlgorithmSpec_Values() []string { 18072 return []string{ 18073 SigningAlgorithmSpecRsassaPssSha256, 18074 SigningAlgorithmSpecRsassaPssSha384, 18075 SigningAlgorithmSpecRsassaPssSha512, 18076 SigningAlgorithmSpecRsassaPkcs1V15Sha256, 18077 SigningAlgorithmSpecRsassaPkcs1V15Sha384, 18078 SigningAlgorithmSpecRsassaPkcs1V15Sha512, 18079 SigningAlgorithmSpecEcdsaSha256, 18080 SigningAlgorithmSpecEcdsaSha384, 18081 SigningAlgorithmSpecEcdsaSha512, 18082 } 18083 } 18084 18085 const ( 18086 // WrappingKeySpecRsa2048 is a WrappingKeySpec enum value 18087 WrappingKeySpecRsa2048 = "RSA_2048" 18088 ) 18089 18090 // WrappingKeySpec_Values returns all elements of the WrappingKeySpec enum 18091 func WrappingKeySpec_Values() []string { 18092 return []string{ 18093 WrappingKeySpecRsa2048, 18094 } 18095 }