github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl@v0.2.0/awscryptographymaterialproviderssmithygeneratedtypes/types.go (about) 1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package awscryptographymaterialproviderssmithygeneratedtypes 4 5 import ( 6 "fmt" 7 "unicode/utf8" 8 9 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/awscryptographykeystoresmithygenerated" 10 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/awscryptographykeystoresmithygeneratedtypes" 11 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/primitives/awscryptographyprimitivessmithygeneratedtypes" 12 "github.com/aws/aws-sdk-go-v2/service/kms" 13 kmstypes "github.com/aws/aws-sdk-go-v2/service/kms/types" 14 ) 15 16 type HKDF struct { 17 Hmac awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm 18 19 InputKeyLength int32 20 21 OutputKeyLength int32 22 23 SaltLength int32 24 } 25 26 func (input HKDF) Validate() error { 27 if input.InputKeyLength < 1 { 28 return fmt.Errorf("SymmetricKeyLength has a minimum of 1 but has the value of %d.", input.InputKeyLength) 29 } 30 if input.InputKeyLength > 32 { 31 return fmt.Errorf("SymmetricKeyLength has a maximum of 32 but has the value of %d.", input.InputKeyLength) 32 } 33 if input.OutputKeyLength < 1 { 34 return fmt.Errorf("SymmetricKeyLength has a minimum of 1 but has the value of %d.", input.OutputKeyLength) 35 } 36 if input.OutputKeyLength > 32 { 37 return fmt.Errorf("SymmetricKeyLength has a maximum of 32 but has the value of %d.", input.OutputKeyLength) 38 } 39 if input.SaltLength < 0 { 40 return fmt.Errorf("PositiveInteger has a minimum of 0 but has the value of %d.", input.SaltLength) 41 } 42 43 return nil 44 } 45 46 type IDENTITY struct { 47 } 48 49 func (input IDENTITY) Validate() error { 50 51 return nil 52 } 53 54 type None struct { 55 } 56 57 func (input None) Validate() error { 58 59 return nil 60 } 61 62 type DIRECT_KEY_WRAPPING struct { 63 } 64 65 func (input DIRECT_KEY_WRAPPING) Validate() error { 66 67 return nil 68 } 69 70 type IntermediateKeyWrapping struct { 71 KeyEncryptionKeyKdf DerivationAlgorithm 72 73 MacKeyKdf DerivationAlgorithm 74 75 PdkEncryptAlgorithm Encrypt 76 } 77 78 func (input IntermediateKeyWrapping) Validate() error { 79 if input.KeyEncryptionKeyKdf == nil { 80 return fmt.Errorf("input.KeyEncryptionKeyKdf is required but has a nil value.") 81 } 82 if input.Aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_Validate() != nil { 83 return input.Aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_Validate() 84 } 85 if input.MacKeyKdf == nil { 86 return fmt.Errorf("input.MacKeyKdf is required but has a nil value.") 87 } 88 if input.Aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_Validate() != nil { 89 return input.Aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_Validate() 90 } 91 if input.PdkEncryptAlgorithm == nil { 92 return fmt.Errorf("input.PdkEncryptAlgorithm is required but has a nil value.") 93 } 94 if input.Aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_Validate() != nil { 95 return input.Aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_Validate() 96 } 97 98 return nil 99 } 100 101 func (input IntermediateKeyWrapping) Aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_Validate() error { 102 if input.KeyEncryptionKeyKdf == nil { 103 return nil 104 } 105 switch unionType := input.KeyEncryptionKeyKdf.(type) { 106 case *DerivationAlgorithmMemberHKDF: 107 if unionType.Value.Validate() != nil { 108 return unionType.Value.Validate() 109 } 110 case *DerivationAlgorithmMemberIDENTITY: 111 if unionType.Value.Validate() != nil { 112 return unionType.Value.Validate() 113 } 114 case *DerivationAlgorithmMemberNone: 115 if unionType.Value.Validate() != nil { 116 return unionType.Value.Validate() 117 } 118 // Default case should not be reached. 119 default: 120 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 121 } 122 123 return nil 124 } 125 func (input IntermediateKeyWrapping) Aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_Validate() error { 126 if input.MacKeyKdf == nil { 127 return nil 128 } 129 switch unionType := input.MacKeyKdf.(type) { 130 case *DerivationAlgorithmMemberHKDF: 131 if unionType.Value.Validate() != nil { 132 return unionType.Value.Validate() 133 } 134 case *DerivationAlgorithmMemberIDENTITY: 135 if unionType.Value.Validate() != nil { 136 return unionType.Value.Validate() 137 } 138 case *DerivationAlgorithmMemberNone: 139 if unionType.Value.Validate() != nil { 140 return unionType.Value.Validate() 141 } 142 // Default case should not be reached. 143 default: 144 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 145 } 146 147 return nil 148 } 149 func (input IntermediateKeyWrapping) Aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_Validate() error { 150 if input.PdkEncryptAlgorithm == nil { 151 return nil 152 } 153 switch unionType := input.PdkEncryptAlgorithm.(type) { 154 case *EncryptMemberAES_GCM: 155 if unionType.Value.Validate() != nil { 156 return unionType.Value.Validate() 157 } 158 // Default case should not be reached. 159 default: 160 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 161 } 162 163 return nil 164 } 165 166 type ECDSA struct { 167 Curve awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm 168 } 169 170 func (input ECDSA) Validate() error { 171 172 return nil 173 } 174 175 type AlgorithmSuiteInfo struct { 176 BinaryId []byte 177 178 Commitment DerivationAlgorithm 179 180 EdkWrapping EdkWrappingAlgorithm 181 182 Encrypt Encrypt 183 184 Id AlgorithmSuiteId 185 186 Kdf DerivationAlgorithm 187 188 MessageVersion int32 189 190 Signature SignatureAlgorithm 191 192 SymmetricSignature SymmetricSignatureAlgorithm 193 } 194 195 func (input AlgorithmSuiteInfo) Validate() error { 196 if input.Commitment == nil { 197 return fmt.Errorf("input.Commitment is required but has a nil value.") 198 } 199 if input.Aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_Validate() != nil { 200 return input.Aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_Validate() 201 } 202 if input.EdkWrapping == nil { 203 return fmt.Errorf("input.EdkWrapping is required but has a nil value.") 204 } 205 if input.Aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_Validate() != nil { 206 return input.Aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_Validate() 207 } 208 if input.Encrypt == nil { 209 return fmt.Errorf("input.Encrypt is required but has a nil value.") 210 } 211 if input.Aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_Validate() != nil { 212 return input.Aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_Validate() 213 } 214 if input.Id == nil { 215 return fmt.Errorf("input.Id is required but has a nil value.") 216 } 217 if input.Aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_Validate() != nil { 218 return input.Aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_Validate() 219 } 220 if input.Kdf == nil { 221 return fmt.Errorf("input.Kdf is required but has a nil value.") 222 } 223 if input.Aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_Validate() != nil { 224 return input.Aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_Validate() 225 } 226 if input.Signature == nil { 227 return fmt.Errorf("input.Signature is required but has a nil value.") 228 } 229 if input.Aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_Validate() != nil { 230 return input.Aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_Validate() 231 } 232 if input.SymmetricSignature == nil { 233 return fmt.Errorf("input.SymmetricSignature is required but has a nil value.") 234 } 235 if input.Aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_Validate() != nil { 236 return input.Aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_Validate() 237 } 238 239 return nil 240 } 241 242 func (input AlgorithmSuiteInfo) Aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_Validate() error { 243 if input.Commitment == nil { 244 return nil 245 } 246 switch unionType := input.Commitment.(type) { 247 case *DerivationAlgorithmMemberHKDF: 248 if unionType.Value.Validate() != nil { 249 return unionType.Value.Validate() 250 } 251 case *DerivationAlgorithmMemberIDENTITY: 252 if unionType.Value.Validate() != nil { 253 return unionType.Value.Validate() 254 } 255 case *DerivationAlgorithmMemberNone: 256 if unionType.Value.Validate() != nil { 257 return unionType.Value.Validate() 258 } 259 // Default case should not be reached. 260 default: 261 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 262 } 263 264 return nil 265 } 266 func (input AlgorithmSuiteInfo) Aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_Validate() error { 267 if input.EdkWrapping == nil { 268 return nil 269 } 270 switch unionType := input.EdkWrapping.(type) { 271 case *EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING: 272 if unionType.Value.Validate() != nil { 273 return unionType.Value.Validate() 274 } 275 case *EdkWrappingAlgorithmMemberIntermediateKeyWrapping: 276 if unionType.Value.Validate() != nil { 277 return unionType.Value.Validate() 278 } 279 // Default case should not be reached. 280 default: 281 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 282 } 283 284 return nil 285 } 286 func (input AlgorithmSuiteInfo) Aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_Validate() error { 287 if input.Encrypt == nil { 288 return nil 289 } 290 switch unionType := input.Encrypt.(type) { 291 case *EncryptMemberAES_GCM: 292 if unionType.Value.Validate() != nil { 293 return unionType.Value.Validate() 294 } 295 // Default case should not be reached. 296 default: 297 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 298 } 299 300 return nil 301 } 302 func (input AlgorithmSuiteInfo) Aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_Validate() error { 303 if input.Id == nil { 304 return nil 305 } 306 switch unionType := input.Id.(type) { 307 case *AlgorithmSuiteIdMemberESDK: 308 case *AlgorithmSuiteIdMemberDBE: 309 // Default case should not be reached. 310 default: 311 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 312 } 313 314 return nil 315 } 316 func (input AlgorithmSuiteInfo) Aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_Validate() error { 317 if input.Kdf == nil { 318 return nil 319 } 320 switch unionType := input.Kdf.(type) { 321 case *DerivationAlgorithmMemberHKDF: 322 if unionType.Value.Validate() != nil { 323 return unionType.Value.Validate() 324 } 325 case *DerivationAlgorithmMemberIDENTITY: 326 if unionType.Value.Validate() != nil { 327 return unionType.Value.Validate() 328 } 329 case *DerivationAlgorithmMemberNone: 330 if unionType.Value.Validate() != nil { 331 return unionType.Value.Validate() 332 } 333 // Default case should not be reached. 334 default: 335 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 336 } 337 338 return nil 339 } 340 func (input AlgorithmSuiteInfo) Aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_Validate() error { 341 if input.Signature == nil { 342 return nil 343 } 344 switch unionType := input.Signature.(type) { 345 case *SignatureAlgorithmMemberECDSA: 346 if unionType.Value.Validate() != nil { 347 return unionType.Value.Validate() 348 } 349 case *SignatureAlgorithmMemberNone: 350 if unionType.Value.Validate() != nil { 351 return unionType.Value.Validate() 352 } 353 // Default case should not be reached. 354 default: 355 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 356 } 357 358 return nil 359 } 360 func (input AlgorithmSuiteInfo) Aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_Validate() error { 361 if input.SymmetricSignature == nil { 362 return nil 363 } 364 switch unionType := input.SymmetricSignature.(type) { 365 case *SymmetricSignatureAlgorithmMemberHMAC: 366 case *SymmetricSignatureAlgorithmMemberNone: 367 if unionType.Value.Validate() != nil { 368 return unionType.Value.Validate() 369 } 370 // Default case should not be reached. 371 default: 372 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 373 } 374 375 return nil 376 } 377 378 type GetClientInput struct { 379 Region string 380 } 381 382 func (input GetClientInput) Validate() error { 383 384 return nil 385 } 386 387 type KmsClientReference struct { 388 } 389 390 func (input KmsClientReference) Validate() error { 391 392 return nil 393 } 394 395 type GetClientOutput struct { 396 Client *kms.Client 397 } 398 399 func (input GetClientOutput) Validate() error { 400 401 return nil 402 } 403 404 type DiscoveryFilter struct { 405 AccountIds []string 406 407 Partition string 408 } 409 410 func (input DiscoveryFilter) Validate() error { 411 if input.AccountIds == nil { 412 return fmt.Errorf("input.AccountIds is required but has a nil value.") 413 } 414 415 return nil 416 } 417 418 type CreateAwsKmsDiscoveryKeyringInput struct { 419 KmsClient *kms.Client 420 421 DiscoveryFilter *DiscoveryFilter 422 423 GrantTokens []string 424 } 425 426 func (input CreateAwsKmsDiscoveryKeyringInput) Validate() error { 427 if input.DiscoveryFilter != nil { 428 if input.DiscoveryFilter.Validate() != nil { 429 return input.DiscoveryFilter.Validate() 430 } 431 432 } 433 434 return nil 435 } 436 437 type KeyringReference struct { 438 } 439 440 func (input KeyringReference) Validate() error { 441 442 return nil 443 } 444 445 type CreateKeyringOutput struct { 446 Keyring IKeyring 447 } 448 449 func (input CreateKeyringOutput) Validate() error { 450 451 return nil 452 } 453 454 type ClientSupplierReference struct { 455 } 456 457 func (input ClientSupplierReference) Validate() error { 458 459 return nil 460 } 461 462 type CreateAwsKmsDiscoveryMultiKeyringInput struct { 463 Regions []string 464 465 ClientSupplier IClientSupplier 466 467 DiscoveryFilter *DiscoveryFilter 468 469 GrantTokens []string 470 } 471 472 func (input CreateAwsKmsDiscoveryMultiKeyringInput) Validate() error { 473 if input.Regions == nil { 474 return fmt.Errorf("input.Regions is required but has a nil value.") 475 } 476 if input.DiscoveryFilter != nil { 477 if input.DiscoveryFilter.Validate() != nil { 478 return input.DiscoveryFilter.Validate() 479 } 480 481 } 482 483 return nil 484 } 485 486 type KmsPrivateKeyToStaticPublicKeyInput struct { 487 RecipientPublicKey []byte 488 489 SenderKmsIdentifier string 490 491 SenderPublicKey []byte 492 } 493 494 func (input KmsPrivateKeyToStaticPublicKeyInput) Validate() error { 495 496 return nil 497 } 498 499 type KmsPublicKeyDiscoveryInput struct { 500 RecipientKmsIdentifier string 501 } 502 503 func (input KmsPublicKeyDiscoveryInput) Validate() error { 504 505 return nil 506 } 507 508 type CreateAwsKmsEcdhKeyringInput struct { 509 CurveSpec awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec 510 511 KeyAgreementScheme KmsEcdhStaticConfigurations 512 513 KmsClient *kms.Client 514 515 GrantTokens []string 516 } 517 518 func (input CreateAwsKmsEcdhKeyringInput) Validate() error { 519 if input.KeyAgreementScheme == nil { 520 return fmt.Errorf("input.KeyAgreementScheme is required but has a nil value.") 521 } 522 if input.Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_Validate() != nil { 523 return input.Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_Validate() 524 } 525 526 return nil 527 } 528 529 func (input CreateAwsKmsEcdhKeyringInput) Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_Validate() error { 530 if input.KeyAgreementScheme == nil { 531 return nil 532 } 533 switch unionType := input.KeyAgreementScheme.(type) { 534 case *KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery: 535 if unionType.Value.Validate() != nil { 536 return unionType.Value.Validate() 537 } 538 case *KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey: 539 if unionType.Value.Validate() != nil { 540 return unionType.Value.Validate() 541 } 542 // Default case should not be reached. 543 default: 544 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 545 } 546 547 return nil 548 } 549 550 type BranchKeyIdSupplierReference struct { 551 } 552 553 func (input BranchKeyIdSupplierReference) Validate() error { 554 555 return nil 556 } 557 558 type DefaultCache struct { 559 EntryCapacity int32 560 } 561 562 func (input DefaultCache) Validate() error { 563 if input.EntryCapacity < 1 { 564 return fmt.Errorf("CountingNumber has a minimum of 1 but has the value of %d.", input.EntryCapacity) 565 } 566 567 return nil 568 } 569 570 type MultiThreadedCache struct { 571 EntryCapacity int32 572 573 EntryPruningTailSize *int32 574 } 575 576 func (input MultiThreadedCache) Validate() error { 577 if input.EntryCapacity < 1 { 578 return fmt.Errorf("CountingNumber has a minimum of 1 but has the value of %d.", input.EntryCapacity) 579 } 580 if input.EntryPruningTailSize != nil { 581 if *input.EntryPruningTailSize < 1 { 582 return fmt.Errorf("CountingNumber has a minimum of 1 but has the value of %d.", *input.EntryPruningTailSize) 583 } 584 } 585 586 return nil 587 } 588 589 type NoCache struct { 590 } 591 592 func (input NoCache) Validate() error { 593 594 return nil 595 } 596 597 type CryptographicMaterialsCacheReference struct { 598 } 599 600 func (input CryptographicMaterialsCacheReference) Validate() error { 601 602 return nil 603 } 604 605 type SingleThreadedCache struct { 606 EntryCapacity int32 607 608 EntryPruningTailSize *int32 609 } 610 611 func (input SingleThreadedCache) Validate() error { 612 if input.EntryCapacity < 1 { 613 return fmt.Errorf("CountingNumber has a minimum of 1 but has the value of %d.", input.EntryCapacity) 614 } 615 if input.EntryPruningTailSize != nil { 616 if *input.EntryPruningTailSize < 1 { 617 return fmt.Errorf("CountingNumber has a minimum of 1 but has the value of %d.", *input.EntryPruningTailSize) 618 } 619 } 620 621 return nil 622 } 623 624 type StormTrackingCache struct { 625 EntryCapacity int32 626 627 FanOut int32 628 629 GraceInterval int32 630 631 GracePeriod int32 632 633 InFlightTTL int32 634 635 SleepMilli int32 636 637 EntryPruningTailSize *int32 638 639 TimeUnits *TimeUnits 640 } 641 642 func (input StormTrackingCache) Validate() error { 643 if input.EntryCapacity < 1 { 644 return fmt.Errorf("CountingNumber has a minimum of 1 but has the value of %d.", input.EntryCapacity) 645 } 646 if input.FanOut < 1 { 647 return fmt.Errorf("CountingNumber has a minimum of 1 but has the value of %d.", input.FanOut) 648 } 649 if input.GraceInterval < 1 { 650 return fmt.Errorf("CountingNumber has a minimum of 1 but has the value of %d.", input.GraceInterval) 651 } 652 if input.GracePeriod < 1 { 653 return fmt.Errorf("CountingNumber has a minimum of 1 but has the value of %d.", input.GracePeriod) 654 } 655 if input.InFlightTTL < 1 { 656 return fmt.Errorf("CountingNumber has a minimum of 1 but has the value of %d.", input.InFlightTTL) 657 } 658 if input.SleepMilli < 1 { 659 return fmt.Errorf("CountingNumber has a minimum of 1 but has the value of %d.", input.SleepMilli) 660 } 661 if input.EntryPruningTailSize != nil { 662 if *input.EntryPruningTailSize < 1 { 663 return fmt.Errorf("CountingNumber has a minimum of 1 but has the value of %d.", *input.EntryPruningTailSize) 664 } 665 } 666 667 return nil 668 } 669 670 type KeyStoreReference struct { 671 } 672 673 func (input KeyStoreReference) Validate() error { 674 675 return nil 676 } 677 678 type CreateAwsKmsHierarchicalKeyringInput struct { 679 KeyStore *awscryptographykeystoresmithygenerated.Client 680 681 TtlSeconds int64 682 683 BranchKeyId *string 684 685 BranchKeyIdSupplier IBranchKeyIdSupplier 686 687 Cache CacheType 688 689 PartitionId *string 690 } 691 692 func (input CreateAwsKmsHierarchicalKeyringInput) Validate() error { 693 if input.TtlSeconds < 0 { 694 return fmt.Errorf("PositiveLong has a minimum of 0 but has the value of %d.", input.TtlSeconds) 695 } 696 if input.Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_Validate() != nil { 697 return input.Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_Validate() 698 } 699 700 return nil 701 } 702 703 func (input CreateAwsKmsHierarchicalKeyringInput) Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_Validate() error { 704 if input.Cache == nil { 705 return nil 706 } 707 switch unionType := input.Cache.(type) { 708 case *CacheTypeMemberDefault: 709 if unionType.Value.Validate() != nil { 710 return unionType.Value.Validate() 711 } 712 case *CacheTypeMemberNo: 713 if unionType.Value.Validate() != nil { 714 return unionType.Value.Validate() 715 } 716 case *CacheTypeMemberSingleThreaded: 717 if unionType.Value.Validate() != nil { 718 return unionType.Value.Validate() 719 } 720 case *CacheTypeMemberMultiThreaded: 721 if unionType.Value.Validate() != nil { 722 return unionType.Value.Validate() 723 } 724 case *CacheTypeMemberStormTracking: 725 if unionType.Value.Validate() != nil { 726 return unionType.Value.Validate() 727 } 728 case *CacheTypeMemberShared: 729 // Default case should not be reached. 730 default: 731 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 732 } 733 734 return nil 735 } 736 737 type CreateAwsKmsKeyringInput struct { 738 KmsClient *kms.Client 739 740 KmsKeyId string 741 742 GrantTokens []string 743 } 744 745 func (input CreateAwsKmsKeyringInput) Validate() error { 746 747 return nil 748 } 749 750 type CreateAwsKmsMrkDiscoveryKeyringInput struct { 751 KmsClient *kms.Client 752 753 Region string 754 755 DiscoveryFilter *DiscoveryFilter 756 757 GrantTokens []string 758 } 759 760 func (input CreateAwsKmsMrkDiscoveryKeyringInput) Validate() error { 761 if input.DiscoveryFilter != nil { 762 if input.DiscoveryFilter.Validate() != nil { 763 return input.DiscoveryFilter.Validate() 764 } 765 766 } 767 768 return nil 769 } 770 771 type CreateAwsKmsMrkDiscoveryMultiKeyringInput struct { 772 Regions []string 773 774 ClientSupplier IClientSupplier 775 776 DiscoveryFilter *DiscoveryFilter 777 778 GrantTokens []string 779 } 780 781 func (input CreateAwsKmsMrkDiscoveryMultiKeyringInput) Validate() error { 782 if input.Regions == nil { 783 return fmt.Errorf("input.Regions is required but has a nil value.") 784 } 785 if input.DiscoveryFilter != nil { 786 if input.DiscoveryFilter.Validate() != nil { 787 return input.DiscoveryFilter.Validate() 788 } 789 790 } 791 792 return nil 793 } 794 795 type CreateAwsKmsMrkKeyringInput struct { 796 KmsClient *kms.Client 797 798 KmsKeyId string 799 800 GrantTokens []string 801 } 802 803 func (input CreateAwsKmsMrkKeyringInput) Validate() error { 804 805 return nil 806 } 807 808 type CreateAwsKmsMrkMultiKeyringInput struct { 809 ClientSupplier IClientSupplier 810 811 Generator *string 812 813 GrantTokens []string 814 815 KmsKeyIds []string 816 } 817 818 func (input CreateAwsKmsMrkMultiKeyringInput) Validate() error { 819 820 return nil 821 } 822 823 type CreateAwsKmsMultiKeyringInput struct { 824 ClientSupplier IClientSupplier 825 826 Generator *string 827 828 GrantTokens []string 829 830 KmsKeyIds []string 831 } 832 833 func (input CreateAwsKmsMultiKeyringInput) Validate() error { 834 835 return nil 836 } 837 838 type CreateAwsKmsRsaKeyringInput struct { 839 EncryptionAlgorithm kmstypes.EncryptionAlgorithmSpec 840 841 KmsKeyId string 842 843 GrantTokens []string 844 845 KmsClient *kms.Client 846 847 PublicKey []byte 848 } 849 850 func (input CreateAwsKmsRsaKeyringInput) Validate() error { 851 852 return nil 853 } 854 855 type CreateCryptographicMaterialsCacheInput struct { 856 Cache CacheType 857 } 858 859 func (input CreateCryptographicMaterialsCacheInput) Validate() error { 860 if input.Cache == nil { 861 return fmt.Errorf("input.Cache is required but has a nil value.") 862 } 863 if input.Aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_Validate() != nil { 864 return input.Aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_Validate() 865 } 866 867 return nil 868 } 869 870 func (input CreateCryptographicMaterialsCacheInput) Aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_Validate() error { 871 if input.Cache == nil { 872 return nil 873 } 874 switch unionType := input.Cache.(type) { 875 case *CacheTypeMemberDefault: 876 if unionType.Value.Validate() != nil { 877 return unionType.Value.Validate() 878 } 879 case *CacheTypeMemberNo: 880 if unionType.Value.Validate() != nil { 881 return unionType.Value.Validate() 882 } 883 case *CacheTypeMemberSingleThreaded: 884 if unionType.Value.Validate() != nil { 885 return unionType.Value.Validate() 886 } 887 case *CacheTypeMemberMultiThreaded: 888 if unionType.Value.Validate() != nil { 889 return unionType.Value.Validate() 890 } 891 case *CacheTypeMemberStormTracking: 892 if unionType.Value.Validate() != nil { 893 return unionType.Value.Validate() 894 } 895 case *CacheTypeMemberShared: 896 // Default case should not be reached. 897 default: 898 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 899 } 900 901 return nil 902 } 903 904 type CreateCryptographicMaterialsCacheOutput struct { 905 MaterialsCache ICryptographicMaterialsCache 906 } 907 908 func (input CreateCryptographicMaterialsCacheOutput) Validate() error { 909 910 return nil 911 } 912 913 type CreateDefaultClientSupplierInput struct { 914 } 915 916 func (input CreateDefaultClientSupplierInput) Validate() error { 917 918 return nil 919 } 920 921 type CreateDefaultClientSupplierOutput struct { 922 Client IClientSupplier 923 } 924 925 func (input CreateDefaultClientSupplierOutput) Validate() error { 926 927 return nil 928 } 929 930 type CryptographicMaterialsManagerReference struct { 931 } 932 933 func (input CryptographicMaterialsManagerReference) Validate() error { 934 935 return nil 936 } 937 938 type CreateCryptographicMaterialsManagerOutput struct { 939 MaterialsManager ICryptographicMaterialsManager 940 } 941 942 func (input CreateCryptographicMaterialsManagerOutput) Validate() error { 943 944 return nil 945 } 946 947 type CreateDefaultCryptographicMaterialsManagerInput struct { 948 Keyring IKeyring 949 } 950 951 func (input CreateDefaultCryptographicMaterialsManagerInput) Validate() error { 952 953 return nil 954 } 955 956 type CreateMultiKeyringInput struct { 957 ChildKeyrings []IKeyring 958 959 Generator IKeyring 960 } 961 962 func (input CreateMultiKeyringInput) Validate() error { 963 if input.ChildKeyrings == nil { 964 return fmt.Errorf("input.ChildKeyrings is required but has a nil value.") 965 } 966 967 return nil 968 } 969 970 type CreateRawAesKeyringInput struct { 971 KeyName string 972 973 KeyNamespace string 974 975 WrappingAlg AesWrappingAlg 976 977 WrappingKey []byte 978 } 979 980 func (input CreateRawAesKeyringInput) Validate() error { 981 982 return nil 983 } 984 985 type EphemeralPrivateKeyToStaticPublicKeyInput struct { 986 RecipientPublicKey []byte 987 } 988 989 func (input EphemeralPrivateKeyToStaticPublicKeyInput) Validate() error { 990 991 return nil 992 } 993 994 type PublicKeyDiscoveryInput struct { 995 RecipientStaticPrivateKey []byte 996 } 997 998 func (input PublicKeyDiscoveryInput) Validate() error { 999 1000 return nil 1001 } 1002 1003 type RawPrivateKeyToStaticPublicKeyInput struct { 1004 RecipientPublicKey []byte 1005 1006 SenderStaticPrivateKey []byte 1007 } 1008 1009 func (input RawPrivateKeyToStaticPublicKeyInput) Validate() error { 1010 1011 return nil 1012 } 1013 1014 type CreateRawEcdhKeyringInput struct { 1015 CurveSpec awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec 1016 1017 KeyAgreementScheme RawEcdhStaticConfigurations 1018 } 1019 1020 func (input CreateRawEcdhKeyringInput) Validate() error { 1021 if input.KeyAgreementScheme == nil { 1022 return fmt.Errorf("input.KeyAgreementScheme is required but has a nil value.") 1023 } 1024 if input.Aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_Validate() != nil { 1025 return input.Aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_Validate() 1026 } 1027 1028 return nil 1029 } 1030 1031 func (input CreateRawEcdhKeyringInput) Aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_Validate() error { 1032 if input.KeyAgreementScheme == nil { 1033 return nil 1034 } 1035 switch unionType := input.KeyAgreementScheme.(type) { 1036 case *RawEcdhStaticConfigurationsMemberPublicKeyDiscovery: 1037 if unionType.Value.Validate() != nil { 1038 return unionType.Value.Validate() 1039 } 1040 case *RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey: 1041 if unionType.Value.Validate() != nil { 1042 return unionType.Value.Validate() 1043 } 1044 case *RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey: 1045 if unionType.Value.Validate() != nil { 1046 return unionType.Value.Validate() 1047 } 1048 // Default case should not be reached. 1049 default: 1050 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 1051 } 1052 1053 return nil 1054 } 1055 1056 type CreateRawRsaKeyringInput struct { 1057 KeyName string 1058 1059 KeyNamespace string 1060 1061 PaddingScheme PaddingScheme 1062 1063 PrivateKey []byte 1064 1065 PublicKey []byte 1066 } 1067 1068 func (input CreateRawRsaKeyringInput) Validate() error { 1069 1070 return nil 1071 } 1072 1073 type CreateRequiredEncryptionContextCMMInput struct { 1074 RequiredEncryptionContextKeys []string 1075 1076 Keyring IKeyring 1077 1078 UnderlyingCMM ICryptographicMaterialsManager 1079 } 1080 1081 func (input CreateRequiredEncryptionContextCMMInput) Validate() error { 1082 if input.RequiredEncryptionContextKeys == nil { 1083 return fmt.Errorf("input.RequiredEncryptionContextKeys is required but has a nil value.") 1084 } 1085 if input.Aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_Validate() != nil { 1086 return input.Aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_Validate() 1087 } 1088 1089 return nil 1090 } 1091 1092 func (input CreateRequiredEncryptionContextCMMInput) Aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_Validate() error { 1093 for _, item := range input.RequiredEncryptionContextKeys { 1094 if !utf8.ValidString(item) { 1095 return fmt.Errorf("Invalid UTF bytes %s ", item) 1096 } 1097 } 1098 1099 return nil 1100 } 1101 1102 type CreateRequiredEncryptionContextCMMOutput struct { 1103 MaterialsManager ICryptographicMaterialsManager 1104 } 1105 1106 func (input CreateRequiredEncryptionContextCMMOutput) Validate() error { 1107 1108 return nil 1109 } 1110 1111 type EncryptedDataKey struct { 1112 Ciphertext []byte 1113 1114 KeyProviderId string 1115 1116 KeyProviderInfo []byte 1117 } 1118 1119 func (input EncryptedDataKey) Validate() error { 1120 if !utf8.ValidString(input.KeyProviderId) { 1121 return fmt.Errorf("Invalid UTF bytes %s ", input.KeyProviderId) 1122 } 1123 1124 return nil 1125 } 1126 1127 type DecryptMaterialsInput struct { 1128 AlgorithmSuiteId AlgorithmSuiteId 1129 1130 CommitmentPolicy CommitmentPolicy 1131 1132 EncryptedDataKeys []EncryptedDataKey 1133 1134 EncryptionContext map[string]string 1135 1136 ReproducedEncryptionContext map[string]string 1137 } 1138 1139 func (input DecryptMaterialsInput) Validate() error { 1140 if input.AlgorithmSuiteId == nil { 1141 return fmt.Errorf("input.AlgorithmSuiteId is required but has a nil value.") 1142 } 1143 if input.Aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_Validate() != nil { 1144 return input.Aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_Validate() 1145 } 1146 if input.CommitmentPolicy == nil { 1147 return fmt.Errorf("input.CommitmentPolicy is required but has a nil value.") 1148 } 1149 if input.Aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_Validate() != nil { 1150 return input.Aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_Validate() 1151 } 1152 if input.EncryptedDataKeys == nil { 1153 return fmt.Errorf("input.EncryptedDataKeys is required but has a nil value.") 1154 } 1155 if input.Aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_Validate() != nil { 1156 return input.Aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_Validate() 1157 } 1158 if input.EncryptionContext == nil { 1159 return fmt.Errorf("input.EncryptionContext is required but has a nil value.") 1160 } 1161 if input.Aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_Validate() != nil { 1162 return input.Aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_Validate() 1163 } 1164 if input.Aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_Validate() != nil { 1165 return input.Aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_Validate() 1166 } 1167 1168 return nil 1169 } 1170 1171 func (input DecryptMaterialsInput) Aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_Validate() error { 1172 if input.AlgorithmSuiteId == nil { 1173 return nil 1174 } 1175 switch unionType := input.AlgorithmSuiteId.(type) { 1176 case *AlgorithmSuiteIdMemberESDK: 1177 case *AlgorithmSuiteIdMemberDBE: 1178 // Default case should not be reached. 1179 default: 1180 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 1181 } 1182 1183 return nil 1184 } 1185 func (input DecryptMaterialsInput) Aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_Validate() error { 1186 if input.CommitmentPolicy == nil { 1187 return nil 1188 } 1189 switch unionType := input.CommitmentPolicy.(type) { 1190 case *CommitmentPolicyMemberESDK: 1191 case *CommitmentPolicyMemberDBE: 1192 // Default case should not be reached. 1193 default: 1194 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 1195 } 1196 1197 return nil 1198 } 1199 func (input DecryptMaterialsInput) Aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_Validate() error { 1200 for _, item := range input.EncryptedDataKeys { 1201 if item.Validate() != nil { 1202 return item.Validate() 1203 } 1204 } 1205 1206 return nil 1207 } 1208 func (input DecryptMaterialsInput) Aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_Validate() error { 1209 for key, value := range input.EncryptionContext { 1210 if !utf8.ValidString(key) { 1211 return fmt.Errorf("Invalid UTF bytes %s ", key) 1212 } 1213 if !utf8.ValidString(value) { 1214 return fmt.Errorf("Invalid UTF bytes %s ", value) 1215 } 1216 } 1217 1218 return nil 1219 } 1220 func (input DecryptMaterialsInput) Aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_Validate() error { 1221 for key, value := range input.ReproducedEncryptionContext { 1222 if !utf8.ValidString(key) { 1223 return fmt.Errorf("Invalid UTF bytes %s ", key) 1224 } 1225 if !utf8.ValidString(value) { 1226 return fmt.Errorf("Invalid UTF bytes %s ", value) 1227 } 1228 } 1229 1230 return nil 1231 } 1232 1233 type DecryptionMaterials struct { 1234 AlgorithmSuite AlgorithmSuiteInfo 1235 1236 EncryptionContext map[string]string 1237 1238 RequiredEncryptionContextKeys []string 1239 1240 PlaintextDataKey []byte 1241 1242 SymmetricSigningKey []byte 1243 1244 VerificationKey []byte 1245 } 1246 1247 func (input DecryptionMaterials) Validate() error { 1248 if input.AlgorithmSuite.Validate() != nil { 1249 return input.AlgorithmSuite.Validate() 1250 } 1251 if input.EncryptionContext == nil { 1252 return fmt.Errorf("input.EncryptionContext is required but has a nil value.") 1253 } 1254 if input.Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_Validate() != nil { 1255 return input.Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_Validate() 1256 } 1257 if input.RequiredEncryptionContextKeys == nil { 1258 return fmt.Errorf("input.RequiredEncryptionContextKeys is required but has a nil value.") 1259 } 1260 if input.Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_Validate() != nil { 1261 return input.Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_Validate() 1262 } 1263 1264 return nil 1265 } 1266 1267 func (input DecryptionMaterials) Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_Validate() error { 1268 for key, value := range input.EncryptionContext { 1269 if !utf8.ValidString(key) { 1270 return fmt.Errorf("Invalid UTF bytes %s ", key) 1271 } 1272 if !utf8.ValidString(value) { 1273 return fmt.Errorf("Invalid UTF bytes %s ", value) 1274 } 1275 } 1276 1277 return nil 1278 } 1279 func (input DecryptionMaterials) Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_Validate() error { 1280 for _, item := range input.RequiredEncryptionContextKeys { 1281 if !utf8.ValidString(item) { 1282 return fmt.Errorf("Invalid UTF bytes %s ", item) 1283 } 1284 } 1285 1286 return nil 1287 } 1288 1289 type DecryptMaterialsOutput struct { 1290 DecryptionMaterials DecryptionMaterials 1291 } 1292 1293 func (input DecryptMaterialsOutput) Validate() error { 1294 if input.DecryptionMaterials.Validate() != nil { 1295 return input.DecryptionMaterials.Validate() 1296 } 1297 1298 return nil 1299 } 1300 1301 type GetEncryptionMaterialsInput struct { 1302 CommitmentPolicy CommitmentPolicy 1303 1304 EncryptionContext map[string]string 1305 1306 AlgorithmSuiteId AlgorithmSuiteId 1307 1308 MaxPlaintextLength *int64 1309 1310 RequiredEncryptionContextKeys []string 1311 } 1312 1313 func (input GetEncryptionMaterialsInput) Validate() error { 1314 if input.CommitmentPolicy == nil { 1315 return fmt.Errorf("input.CommitmentPolicy is required but has a nil value.") 1316 } 1317 if input.Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_Validate() != nil { 1318 return input.Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_Validate() 1319 } 1320 if input.EncryptionContext == nil { 1321 return fmt.Errorf("input.EncryptionContext is required but has a nil value.") 1322 } 1323 if input.Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_Validate() != nil { 1324 return input.Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_Validate() 1325 } 1326 if input.Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_Validate() != nil { 1327 return input.Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_Validate() 1328 } 1329 if input.Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_Validate() != nil { 1330 return input.Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_Validate() 1331 } 1332 1333 return nil 1334 } 1335 1336 func (input GetEncryptionMaterialsInput) Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_Validate() error { 1337 if input.CommitmentPolicy == nil { 1338 return nil 1339 } 1340 switch unionType := input.CommitmentPolicy.(type) { 1341 case *CommitmentPolicyMemberESDK: 1342 case *CommitmentPolicyMemberDBE: 1343 // Default case should not be reached. 1344 default: 1345 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 1346 } 1347 1348 return nil 1349 } 1350 func (input GetEncryptionMaterialsInput) Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_Validate() error { 1351 for key, value := range input.EncryptionContext { 1352 if !utf8.ValidString(key) { 1353 return fmt.Errorf("Invalid UTF bytes %s ", key) 1354 } 1355 if !utf8.ValidString(value) { 1356 return fmt.Errorf("Invalid UTF bytes %s ", value) 1357 } 1358 } 1359 1360 return nil 1361 } 1362 func (input GetEncryptionMaterialsInput) Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_Validate() error { 1363 if input.AlgorithmSuiteId == nil { 1364 return nil 1365 } 1366 switch unionType := input.AlgorithmSuiteId.(type) { 1367 case *AlgorithmSuiteIdMemberESDK: 1368 case *AlgorithmSuiteIdMemberDBE: 1369 // Default case should not be reached. 1370 default: 1371 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 1372 } 1373 1374 return nil 1375 } 1376 func (input GetEncryptionMaterialsInput) Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_Validate() error { 1377 for _, item := range input.RequiredEncryptionContextKeys { 1378 if !utf8.ValidString(item) { 1379 return fmt.Errorf("Invalid UTF bytes %s ", item) 1380 } 1381 } 1382 1383 return nil 1384 } 1385 1386 type EncryptionMaterials struct { 1387 AlgorithmSuite AlgorithmSuiteInfo 1388 1389 EncryptedDataKeys []EncryptedDataKey 1390 1391 EncryptionContext map[string]string 1392 1393 RequiredEncryptionContextKeys []string 1394 1395 PlaintextDataKey []byte 1396 1397 SigningKey []byte 1398 1399 SymmetricSigningKeys [][]byte 1400 } 1401 1402 func (input EncryptionMaterials) Validate() error { 1403 if input.AlgorithmSuite.Validate() != nil { 1404 return input.AlgorithmSuite.Validate() 1405 } 1406 if input.EncryptedDataKeys == nil { 1407 return fmt.Errorf("input.EncryptedDataKeys is required but has a nil value.") 1408 } 1409 if input.Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_Validate() != nil { 1410 return input.Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_Validate() 1411 } 1412 if input.EncryptionContext == nil { 1413 return fmt.Errorf("input.EncryptionContext is required but has a nil value.") 1414 } 1415 if input.Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_Validate() != nil { 1416 return input.Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_Validate() 1417 } 1418 if input.RequiredEncryptionContextKeys == nil { 1419 return fmt.Errorf("input.RequiredEncryptionContextKeys is required but has a nil value.") 1420 } 1421 if input.Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_Validate() != nil { 1422 return input.Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_Validate() 1423 } 1424 1425 return nil 1426 } 1427 1428 func (input EncryptionMaterials) Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_Validate() error { 1429 for _, item := range input.EncryptedDataKeys { 1430 if item.Validate() != nil { 1431 return item.Validate() 1432 } 1433 } 1434 1435 return nil 1436 } 1437 func (input EncryptionMaterials) Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_Validate() error { 1438 for key, value := range input.EncryptionContext { 1439 if !utf8.ValidString(key) { 1440 return fmt.Errorf("Invalid UTF bytes %s ", key) 1441 } 1442 if !utf8.ValidString(value) { 1443 return fmt.Errorf("Invalid UTF bytes %s ", value) 1444 } 1445 } 1446 1447 return nil 1448 } 1449 func (input EncryptionMaterials) Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_Validate() error { 1450 for _, item := range input.RequiredEncryptionContextKeys { 1451 if !utf8.ValidString(item) { 1452 return fmt.Errorf("Invalid UTF bytes %s ", item) 1453 } 1454 } 1455 1456 return nil 1457 } 1458 1459 type GetEncryptionMaterialsOutput struct { 1460 EncryptionMaterials EncryptionMaterials 1461 } 1462 1463 func (input GetEncryptionMaterialsOutput) Validate() error { 1464 if input.EncryptionMaterials.Validate() != nil { 1465 return input.EncryptionMaterials.Validate() 1466 } 1467 1468 return nil 1469 } 1470 1471 type GetAlgorithmSuiteInfoInput struct { 1472 BinaryId []byte 1473 } 1474 1475 func (input GetAlgorithmSuiteInfoInput) Validate() error { 1476 1477 return nil 1478 } 1479 1480 type InitializeDecryptionMaterialsInput struct { 1481 AlgorithmSuiteId AlgorithmSuiteId 1482 1483 EncryptionContext map[string]string 1484 1485 RequiredEncryptionContextKeys []string 1486 } 1487 1488 func (input InitializeDecryptionMaterialsInput) Validate() error { 1489 if input.AlgorithmSuiteId == nil { 1490 return fmt.Errorf("input.AlgorithmSuiteId is required but has a nil value.") 1491 } 1492 if input.Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_Validate() != nil { 1493 return input.Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_Validate() 1494 } 1495 if input.EncryptionContext == nil { 1496 return fmt.Errorf("input.EncryptionContext is required but has a nil value.") 1497 } 1498 if input.Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_Validate() != nil { 1499 return input.Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_Validate() 1500 } 1501 if input.RequiredEncryptionContextKeys == nil { 1502 return fmt.Errorf("input.RequiredEncryptionContextKeys is required but has a nil value.") 1503 } 1504 if input.Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_Validate() != nil { 1505 return input.Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_Validate() 1506 } 1507 1508 return nil 1509 } 1510 1511 func (input InitializeDecryptionMaterialsInput) Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_Validate() error { 1512 if input.AlgorithmSuiteId == nil { 1513 return nil 1514 } 1515 switch unionType := input.AlgorithmSuiteId.(type) { 1516 case *AlgorithmSuiteIdMemberESDK: 1517 case *AlgorithmSuiteIdMemberDBE: 1518 // Default case should not be reached. 1519 default: 1520 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 1521 } 1522 1523 return nil 1524 } 1525 func (input InitializeDecryptionMaterialsInput) Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_Validate() error { 1526 for key, value := range input.EncryptionContext { 1527 if !utf8.ValidString(key) { 1528 return fmt.Errorf("Invalid UTF bytes %s ", key) 1529 } 1530 if !utf8.ValidString(value) { 1531 return fmt.Errorf("Invalid UTF bytes %s ", value) 1532 } 1533 } 1534 1535 return nil 1536 } 1537 func (input InitializeDecryptionMaterialsInput) Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_Validate() error { 1538 for _, item := range input.RequiredEncryptionContextKeys { 1539 if !utf8.ValidString(item) { 1540 return fmt.Errorf("Invalid UTF bytes %s ", item) 1541 } 1542 } 1543 1544 return nil 1545 } 1546 1547 type InitializeEncryptionMaterialsInput struct { 1548 AlgorithmSuiteId AlgorithmSuiteId 1549 1550 EncryptionContext map[string]string 1551 1552 RequiredEncryptionContextKeys []string 1553 1554 SigningKey []byte 1555 1556 VerificationKey []byte 1557 } 1558 1559 func (input InitializeEncryptionMaterialsInput) Validate() error { 1560 if input.AlgorithmSuiteId == nil { 1561 return fmt.Errorf("input.AlgorithmSuiteId is required but has a nil value.") 1562 } 1563 if input.Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_Validate() != nil { 1564 return input.Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_Validate() 1565 } 1566 if input.EncryptionContext == nil { 1567 return fmt.Errorf("input.EncryptionContext is required but has a nil value.") 1568 } 1569 if input.Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_Validate() != nil { 1570 return input.Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_Validate() 1571 } 1572 if input.RequiredEncryptionContextKeys == nil { 1573 return fmt.Errorf("input.RequiredEncryptionContextKeys is required but has a nil value.") 1574 } 1575 if input.Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_Validate() != nil { 1576 return input.Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_Validate() 1577 } 1578 1579 return nil 1580 } 1581 1582 func (input InitializeEncryptionMaterialsInput) Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_Validate() error { 1583 if input.AlgorithmSuiteId == nil { 1584 return nil 1585 } 1586 switch unionType := input.AlgorithmSuiteId.(type) { 1587 case *AlgorithmSuiteIdMemberESDK: 1588 case *AlgorithmSuiteIdMemberDBE: 1589 // Default case should not be reached. 1590 default: 1591 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 1592 } 1593 1594 return nil 1595 } 1596 func (input InitializeEncryptionMaterialsInput) Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_Validate() error { 1597 for key, value := range input.EncryptionContext { 1598 if !utf8.ValidString(key) { 1599 return fmt.Errorf("Invalid UTF bytes %s ", key) 1600 } 1601 if !utf8.ValidString(value) { 1602 return fmt.Errorf("Invalid UTF bytes %s ", value) 1603 } 1604 } 1605 1606 return nil 1607 } 1608 func (input InitializeEncryptionMaterialsInput) Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_Validate() error { 1609 for _, item := range input.RequiredEncryptionContextKeys { 1610 if !utf8.ValidString(item) { 1611 return fmt.Errorf("Invalid UTF bytes %s ", item) 1612 } 1613 } 1614 1615 return nil 1616 } 1617 1618 type OnDecryptInput struct { 1619 EncryptedDataKeys []EncryptedDataKey 1620 1621 Materials DecryptionMaterials 1622 } 1623 1624 func (input OnDecryptInput) Validate() error { 1625 if input.EncryptedDataKeys == nil { 1626 return fmt.Errorf("input.EncryptedDataKeys is required but has a nil value.") 1627 } 1628 if input.Aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_Validate() != nil { 1629 return input.Aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_Validate() 1630 } 1631 if input.Materials.Validate() != nil { 1632 return input.Materials.Validate() 1633 } 1634 1635 return nil 1636 } 1637 1638 func (input OnDecryptInput) Aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_Validate() error { 1639 for _, item := range input.EncryptedDataKeys { 1640 if item.Validate() != nil { 1641 return item.Validate() 1642 } 1643 } 1644 1645 return nil 1646 } 1647 1648 type OnDecryptOutput struct { 1649 Materials DecryptionMaterials 1650 } 1651 1652 func (input OnDecryptOutput) Validate() error { 1653 if input.Materials.Validate() != nil { 1654 return input.Materials.Validate() 1655 } 1656 1657 return nil 1658 } 1659 1660 type OnEncryptInput struct { 1661 Materials EncryptionMaterials 1662 } 1663 1664 func (input OnEncryptInput) Validate() error { 1665 if input.Materials.Validate() != nil { 1666 return input.Materials.Validate() 1667 } 1668 1669 return nil 1670 } 1671 1672 type OnEncryptOutput struct { 1673 Materials EncryptionMaterials 1674 } 1675 1676 func (input OnEncryptOutput) Validate() error { 1677 if input.Materials.Validate() != nil { 1678 return input.Materials.Validate() 1679 } 1680 1681 return nil 1682 } 1683 1684 type ValidateCommitmentPolicyOnDecryptInput struct { 1685 Algorithm AlgorithmSuiteId 1686 1687 CommitmentPolicy CommitmentPolicy 1688 } 1689 1690 func (input ValidateCommitmentPolicyOnDecryptInput) Validate() error { 1691 if input.Algorithm == nil { 1692 return fmt.Errorf("input.Algorithm is required but has a nil value.") 1693 } 1694 if input.Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_Validate() != nil { 1695 return input.Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_Validate() 1696 } 1697 if input.CommitmentPolicy == nil { 1698 return fmt.Errorf("input.CommitmentPolicy is required but has a nil value.") 1699 } 1700 if input.Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_Validate() != nil { 1701 return input.Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_Validate() 1702 } 1703 1704 return nil 1705 } 1706 1707 func (input ValidateCommitmentPolicyOnDecryptInput) Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_Validate() error { 1708 if input.Algorithm == nil { 1709 return nil 1710 } 1711 switch unionType := input.Algorithm.(type) { 1712 case *AlgorithmSuiteIdMemberESDK: 1713 case *AlgorithmSuiteIdMemberDBE: 1714 // Default case should not be reached. 1715 default: 1716 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 1717 } 1718 1719 return nil 1720 } 1721 func (input ValidateCommitmentPolicyOnDecryptInput) Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_Validate() error { 1722 if input.CommitmentPolicy == nil { 1723 return nil 1724 } 1725 switch unionType := input.CommitmentPolicy.(type) { 1726 case *CommitmentPolicyMemberESDK: 1727 case *CommitmentPolicyMemberDBE: 1728 // Default case should not be reached. 1729 default: 1730 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 1731 } 1732 1733 return nil 1734 } 1735 1736 type ValidateCommitmentPolicyOnEncryptInput struct { 1737 Algorithm AlgorithmSuiteId 1738 1739 CommitmentPolicy CommitmentPolicy 1740 } 1741 1742 func (input ValidateCommitmentPolicyOnEncryptInput) Validate() error { 1743 if input.Algorithm == nil { 1744 return fmt.Errorf("input.Algorithm is required but has a nil value.") 1745 } 1746 if input.Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_Validate() != nil { 1747 return input.Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_Validate() 1748 } 1749 if input.CommitmentPolicy == nil { 1750 return fmt.Errorf("input.CommitmentPolicy is required but has a nil value.") 1751 } 1752 if input.Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_Validate() != nil { 1753 return input.Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_Validate() 1754 } 1755 1756 return nil 1757 } 1758 1759 func (input ValidateCommitmentPolicyOnEncryptInput) Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_Validate() error { 1760 if input.Algorithm == nil { 1761 return nil 1762 } 1763 switch unionType := input.Algorithm.(type) { 1764 case *AlgorithmSuiteIdMemberESDK: 1765 case *AlgorithmSuiteIdMemberDBE: 1766 // Default case should not be reached. 1767 default: 1768 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 1769 } 1770 1771 return nil 1772 } 1773 func (input ValidateCommitmentPolicyOnEncryptInput) Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_Validate() error { 1774 if input.CommitmentPolicy == nil { 1775 return nil 1776 } 1777 switch unionType := input.CommitmentPolicy.(type) { 1778 case *CommitmentPolicyMemberESDK: 1779 case *CommitmentPolicyMemberDBE: 1780 // Default case should not be reached. 1781 default: 1782 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 1783 } 1784 1785 return nil 1786 } 1787 1788 type ValidDecryptionMaterialsTransitionInput struct { 1789 Start DecryptionMaterials 1790 1791 Stop DecryptionMaterials 1792 } 1793 1794 func (input ValidDecryptionMaterialsTransitionInput) Validate() error { 1795 if input.Start.Validate() != nil { 1796 return input.Start.Validate() 1797 } 1798 if input.Stop.Validate() != nil { 1799 return input.Stop.Validate() 1800 } 1801 1802 return nil 1803 } 1804 1805 type ValidEncryptionMaterialsTransitionInput struct { 1806 Start EncryptionMaterials 1807 1808 Stop EncryptionMaterials 1809 } 1810 1811 func (input ValidEncryptionMaterialsTransitionInput) Validate() error { 1812 if input.Start.Validate() != nil { 1813 return input.Start.Validate() 1814 } 1815 if input.Stop.Validate() != nil { 1816 return input.Stop.Validate() 1817 } 1818 1819 return nil 1820 } 1821 1822 type GetBranchKeyIdInput struct { 1823 EncryptionContext map[string]string 1824 } 1825 1826 func (input GetBranchKeyIdInput) Validate() error { 1827 if input.EncryptionContext == nil { 1828 return fmt.Errorf("input.EncryptionContext is required but has a nil value.") 1829 } 1830 if input.Aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_Validate() != nil { 1831 return input.Aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_Validate() 1832 } 1833 1834 return nil 1835 } 1836 1837 func (input GetBranchKeyIdInput) Aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_Validate() error { 1838 for key, value := range input.EncryptionContext { 1839 if !utf8.ValidString(key) { 1840 return fmt.Errorf("Invalid UTF bytes %s ", key) 1841 } 1842 if !utf8.ValidString(value) { 1843 return fmt.Errorf("Invalid UTF bytes %s ", value) 1844 } 1845 } 1846 1847 return nil 1848 } 1849 1850 type GetBranchKeyIdOutput struct { 1851 BranchKeyId string 1852 } 1853 1854 func (input GetBranchKeyIdOutput) Validate() error { 1855 1856 return nil 1857 } 1858 1859 type DeleteCacheEntryInput struct { 1860 Identifier []byte 1861 } 1862 1863 func (input DeleteCacheEntryInput) Validate() error { 1864 1865 return nil 1866 } 1867 1868 type GetCacheEntryInput struct { 1869 Identifier []byte 1870 1871 BytesUsed *int64 1872 } 1873 1874 func (input GetCacheEntryInput) Validate() error { 1875 1876 return nil 1877 } 1878 1879 type GetCacheEntryOutput struct { 1880 BytesUsed int32 1881 1882 CreationTime int64 1883 1884 ExpiryTime int64 1885 1886 Materials Materials 1887 1888 MessagesUsed int32 1889 } 1890 1891 func (input GetCacheEntryOutput) Validate() error { 1892 if input.BytesUsed < 0 { 1893 return fmt.Errorf("PositiveInteger has a minimum of 0 but has the value of %d.", input.BytesUsed) 1894 } 1895 if input.CreationTime < 0 { 1896 return fmt.Errorf("PositiveLong has a minimum of 0 but has the value of %d.", input.CreationTime) 1897 } 1898 if input.ExpiryTime < 0 { 1899 return fmt.Errorf("PositiveLong has a minimum of 0 but has the value of %d.", input.ExpiryTime) 1900 } 1901 if input.Materials == nil { 1902 return fmt.Errorf("input.Materials is required but has a nil value.") 1903 } 1904 if input.Aws_cryptography_materialProviders_GetCacheEntryOutput_materials_Validate() != nil { 1905 return input.Aws_cryptography_materialProviders_GetCacheEntryOutput_materials_Validate() 1906 } 1907 if input.MessagesUsed < 0 { 1908 return fmt.Errorf("PositiveInteger has a minimum of 0 but has the value of %d.", input.MessagesUsed) 1909 } 1910 1911 return nil 1912 } 1913 1914 func (input GetCacheEntryOutput) Aws_cryptography_materialProviders_GetCacheEntryOutput_materials_Validate() error { 1915 if input.Materials == nil { 1916 return nil 1917 } 1918 switch unionType := input.Materials.(type) { 1919 case *MaterialsMemberEncryption: 1920 if unionType.Value.Validate() != nil { 1921 return unionType.Value.Validate() 1922 } 1923 case *MaterialsMemberDecryption: 1924 if unionType.Value.Validate() != nil { 1925 return unionType.Value.Validate() 1926 } 1927 case *MaterialsMemberBranchKey: 1928 if unionType.Value.Validate() != nil { 1929 return unionType.Value.Validate() 1930 } 1931 case *MaterialsMemberBeaconKey: 1932 if unionType.Value.Validate() != nil { 1933 return unionType.Value.Validate() 1934 } 1935 // Default case should not be reached. 1936 default: 1937 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 1938 } 1939 1940 return nil 1941 } 1942 1943 type PutCacheEntryInput struct { 1944 CreationTime int64 1945 1946 ExpiryTime int64 1947 1948 Identifier []byte 1949 1950 Materials Materials 1951 1952 BytesUsed *int32 1953 1954 MessagesUsed *int32 1955 } 1956 1957 func (input PutCacheEntryInput) Validate() error { 1958 if input.CreationTime < 0 { 1959 return fmt.Errorf("PositiveLong has a minimum of 0 but has the value of %d.", input.CreationTime) 1960 } 1961 if input.ExpiryTime < 0 { 1962 return fmt.Errorf("PositiveLong has a minimum of 0 but has the value of %d.", input.ExpiryTime) 1963 } 1964 if input.Materials == nil { 1965 return fmt.Errorf("input.Materials is required but has a nil value.") 1966 } 1967 if input.Aws_cryptography_materialProviders_PutCacheEntryInput_materials_Validate() != nil { 1968 return input.Aws_cryptography_materialProviders_PutCacheEntryInput_materials_Validate() 1969 } 1970 if input.BytesUsed != nil { 1971 if *input.BytesUsed < 0 { 1972 return fmt.Errorf("PositiveInteger has a minimum of 0 but has the value of %d.", *input.BytesUsed) 1973 } 1974 } 1975 if input.MessagesUsed != nil { 1976 if *input.MessagesUsed < 0 { 1977 return fmt.Errorf("PositiveInteger has a minimum of 0 but has the value of %d.", *input.MessagesUsed) 1978 } 1979 } 1980 1981 return nil 1982 } 1983 1984 func (input PutCacheEntryInput) Aws_cryptography_materialProviders_PutCacheEntryInput_materials_Validate() error { 1985 if input.Materials == nil { 1986 return nil 1987 } 1988 switch unionType := input.Materials.(type) { 1989 case *MaterialsMemberEncryption: 1990 if unionType.Value.Validate() != nil { 1991 return unionType.Value.Validate() 1992 } 1993 case *MaterialsMemberDecryption: 1994 if unionType.Value.Validate() != nil { 1995 return unionType.Value.Validate() 1996 } 1997 case *MaterialsMemberBranchKey: 1998 if unionType.Value.Validate() != nil { 1999 return unionType.Value.Validate() 2000 } 2001 case *MaterialsMemberBeaconKey: 2002 if unionType.Value.Validate() != nil { 2003 return unionType.Value.Validate() 2004 } 2005 // Default case should not be reached. 2006 default: 2007 panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) 2008 } 2009 2010 return nil 2011 } 2012 2013 type UpdateUsageMetadataInput struct { 2014 BytesUsed int32 2015 2016 Identifier []byte 2017 } 2018 2019 func (input UpdateUsageMetadataInput) Validate() error { 2020 if input.BytesUsed < 0 { 2021 return fmt.Errorf("PositiveInteger has a minimum of 0 but has the value of %d.", input.BytesUsed) 2022 } 2023 2024 return nil 2025 } 2026 2027 type DdbClientReference struct { 2028 } 2029 2030 func (input DdbClientReference) Validate() error { 2031 2032 return nil 2033 } 2034 2035 type MaterialProvidersConfig struct { 2036 } 2037 2038 func (input MaterialProvidersConfig) Validate() error { 2039 2040 return nil 2041 } 2042 2043 // AlgorithmSuiteIdMemberDBE 2044 // AlgorithmSuiteIdMemberESDK 2045 type AlgorithmSuiteId interface { 2046 isAlgorithmSuiteId() 2047 } 2048 2049 type AlgorithmSuiteIdMemberDBE struct { 2050 Value DBEAlgorithmSuiteId 2051 } 2052 2053 func (*AlgorithmSuiteIdMemberDBE) isAlgorithmSuiteId() {} 2054 2055 type AlgorithmSuiteIdMemberESDK struct { 2056 Value ESDKAlgorithmSuiteId 2057 } 2058 2059 func (*AlgorithmSuiteIdMemberESDK) isAlgorithmSuiteId() {} 2060 2061 // CacheTypeMemberDefault 2062 // CacheTypeMemberMultiThreaded 2063 // CacheTypeMemberNo 2064 // CacheTypeMemberShared 2065 // CacheTypeMemberSingleThreaded 2066 // CacheTypeMemberStormTracking 2067 type CacheType interface { 2068 isCacheType() 2069 } 2070 2071 type CacheTypeMemberDefault struct { 2072 Value DefaultCache 2073 } 2074 2075 func (*CacheTypeMemberDefault) isCacheType() {} 2076 2077 type CacheTypeMemberMultiThreaded struct { 2078 Value MultiThreadedCache 2079 } 2080 2081 func (*CacheTypeMemberMultiThreaded) isCacheType() {} 2082 2083 type CacheTypeMemberNo struct { 2084 Value NoCache 2085 } 2086 2087 func (*CacheTypeMemberNo) isCacheType() {} 2088 2089 type CacheTypeMemberShared struct { 2090 Value ICryptographicMaterialsCache 2091 } 2092 2093 func (*CacheTypeMemberShared) isCacheType() {} 2094 2095 type CacheTypeMemberSingleThreaded struct { 2096 Value SingleThreadedCache 2097 } 2098 2099 func (*CacheTypeMemberSingleThreaded) isCacheType() {} 2100 2101 type CacheTypeMemberStormTracking struct { 2102 Value StormTrackingCache 2103 } 2104 2105 func (*CacheTypeMemberStormTracking) isCacheType() {} 2106 2107 // CommitmentPolicyMemberDBE 2108 // CommitmentPolicyMemberESDK 2109 type CommitmentPolicy interface { 2110 isCommitmentPolicy() 2111 } 2112 2113 type CommitmentPolicyMemberDBE struct { 2114 Value DBECommitmentPolicy 2115 } 2116 2117 func (*CommitmentPolicyMemberDBE) isCommitmentPolicy() {} 2118 2119 type CommitmentPolicyMemberESDK struct { 2120 Value ESDKCommitmentPolicy 2121 } 2122 2123 func (*CommitmentPolicyMemberESDK) isCommitmentPolicy() {} 2124 2125 // DerivationAlgorithmMemberHKDF 2126 // DerivationAlgorithmMemberIDENTITY 2127 // DerivationAlgorithmMemberNone 2128 type DerivationAlgorithm interface { 2129 isDerivationAlgorithm() 2130 } 2131 2132 type DerivationAlgorithmMemberHKDF struct { 2133 Value HKDF 2134 } 2135 2136 func (*DerivationAlgorithmMemberHKDF) isDerivationAlgorithm() {} 2137 2138 type DerivationAlgorithmMemberIDENTITY struct { 2139 Value IDENTITY 2140 } 2141 2142 func (*DerivationAlgorithmMemberIDENTITY) isDerivationAlgorithm() {} 2143 2144 type DerivationAlgorithmMemberNone struct { 2145 Value None 2146 } 2147 2148 func (*DerivationAlgorithmMemberNone) isDerivationAlgorithm() {} 2149 2150 // EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING 2151 // EdkWrappingAlgorithmMemberIntermediateKeyWrapping 2152 type EdkWrappingAlgorithm interface { 2153 isEdkWrappingAlgorithm() 2154 } 2155 2156 type EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING struct { 2157 Value DIRECT_KEY_WRAPPING 2158 } 2159 2160 func (*EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING) isEdkWrappingAlgorithm() {} 2161 2162 type EdkWrappingAlgorithmMemberIntermediateKeyWrapping struct { 2163 Value IntermediateKeyWrapping 2164 } 2165 2166 func (*EdkWrappingAlgorithmMemberIntermediateKeyWrapping) isEdkWrappingAlgorithm() {} 2167 2168 // EncryptMemberAES_GCM 2169 type Encrypt interface { 2170 isEncrypt() 2171 } 2172 2173 type EncryptMemberAES_GCM struct { 2174 Value awscryptographyprimitivessmithygeneratedtypes.AES_GCM 2175 } 2176 2177 func (*EncryptMemberAES_GCM) isEncrypt() {} 2178 2179 // KeyAgreementSchemeMemberStaticConfiguration 2180 type KeyAgreementScheme interface { 2181 isKeyAgreementScheme() 2182 } 2183 2184 type KeyAgreementSchemeMemberStaticConfiguration struct { 2185 Value StaticConfigurations 2186 } 2187 2188 func (*KeyAgreementSchemeMemberStaticConfiguration) isKeyAgreementScheme() {} 2189 2190 // KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey 2191 // KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery 2192 type KmsEcdhStaticConfigurations interface { 2193 isKmsEcdhStaticConfigurations() 2194 } 2195 2196 type KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey struct { 2197 Value KmsPrivateKeyToStaticPublicKeyInput 2198 } 2199 2200 func (*KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey) isKmsEcdhStaticConfigurations() { 2201 } 2202 2203 type KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery struct { 2204 Value KmsPublicKeyDiscoveryInput 2205 } 2206 2207 func (*KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery) isKmsEcdhStaticConfigurations() {} 2208 2209 // MaterialsMemberBeaconKey 2210 // MaterialsMemberBranchKey 2211 // MaterialsMemberDecryption 2212 // MaterialsMemberEncryption 2213 type Materials interface { 2214 isMaterials() 2215 } 2216 2217 type MaterialsMemberBeaconKey struct { 2218 Value awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials 2219 } 2220 2221 func (*MaterialsMemberBeaconKey) isMaterials() {} 2222 2223 type MaterialsMemberBranchKey struct { 2224 Value awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials 2225 } 2226 2227 func (*MaterialsMemberBranchKey) isMaterials() {} 2228 2229 type MaterialsMemberDecryption struct { 2230 Value DecryptionMaterials 2231 } 2232 2233 func (*MaterialsMemberDecryption) isMaterials() {} 2234 2235 type MaterialsMemberEncryption struct { 2236 Value EncryptionMaterials 2237 } 2238 2239 func (*MaterialsMemberEncryption) isMaterials() {} 2240 2241 // RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey 2242 // RawEcdhStaticConfigurationsMemberPublicKeyDiscovery 2243 // RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey 2244 type RawEcdhStaticConfigurations interface { 2245 isRawEcdhStaticConfigurations() 2246 } 2247 2248 type RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey struct { 2249 Value EphemeralPrivateKeyToStaticPublicKeyInput 2250 } 2251 2252 func (*RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey) isRawEcdhStaticConfigurations() { 2253 } 2254 2255 type RawEcdhStaticConfigurationsMemberPublicKeyDiscovery struct { 2256 Value PublicKeyDiscoveryInput 2257 } 2258 2259 func (*RawEcdhStaticConfigurationsMemberPublicKeyDiscovery) isRawEcdhStaticConfigurations() {} 2260 2261 type RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey struct { 2262 Value RawPrivateKeyToStaticPublicKeyInput 2263 } 2264 2265 func (*RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey) isRawEcdhStaticConfigurations() { 2266 } 2267 2268 // SignatureAlgorithmMemberECDSA 2269 // SignatureAlgorithmMemberNone 2270 type SignatureAlgorithm interface { 2271 isSignatureAlgorithm() 2272 } 2273 2274 type SignatureAlgorithmMemberECDSA struct { 2275 Value ECDSA 2276 } 2277 2278 func (*SignatureAlgorithmMemberECDSA) isSignatureAlgorithm() {} 2279 2280 type SignatureAlgorithmMemberNone struct { 2281 Value None 2282 } 2283 2284 func (*SignatureAlgorithmMemberNone) isSignatureAlgorithm() {} 2285 2286 // StaticConfigurationsMemberAWS_KMS_ECDH 2287 // StaticConfigurationsMemberRAW_ECDH 2288 type StaticConfigurations interface { 2289 isStaticConfigurations() 2290 } 2291 2292 type StaticConfigurationsMemberAWS_KMS_ECDH struct { 2293 Value KmsEcdhStaticConfigurations 2294 } 2295 2296 func (*StaticConfigurationsMemberAWS_KMS_ECDH) isStaticConfigurations() {} 2297 2298 type StaticConfigurationsMemberRAW_ECDH struct { 2299 Value RawEcdhStaticConfigurations 2300 } 2301 2302 func (*StaticConfigurationsMemberRAW_ECDH) isStaticConfigurations() {} 2303 2304 // SymmetricSignatureAlgorithmMemberHMAC 2305 // SymmetricSignatureAlgorithmMemberNone 2306 type SymmetricSignatureAlgorithm interface { 2307 isSymmetricSignatureAlgorithm() 2308 } 2309 2310 type SymmetricSignatureAlgorithmMemberHMAC struct { 2311 Value awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm 2312 } 2313 2314 func (*SymmetricSignatureAlgorithmMemberHMAC) isSymmetricSignatureAlgorithm() {} 2315 2316 type SymmetricSignatureAlgorithmMemberNone struct { 2317 Value None 2318 } 2319 2320 func (*SymmetricSignatureAlgorithmMemberNone) isSymmetricSignatureAlgorithm() {} 2321 2322 type AwsCryptographicMaterialProvidersBaseException interface { 2323 // This is a dummy method to allow type assertion since Go empty interfaces 2324 // aren't useful for type assertion checks. No concrete class is expected to implement 2325 // this method. This is also not exported. 2326 interfaceBindingMethod() 2327 } 2328 2329 type IBranchKeyIdSupplier interface { 2330 GetBranchKeyId(GetBranchKeyIdInput) (*GetBranchKeyIdOutput, error) 2331 } 2332 2333 type IClientSupplier interface { 2334 GetClient(GetClientInput) (kms.Client, error) 2335 } 2336 2337 type ICryptographicMaterialsCache interface { 2338 PutCacheEntry(PutCacheEntryInput) error 2339 2340 GetCacheEntry(GetCacheEntryInput) (*GetCacheEntryOutput, error) 2341 2342 UpdateUsageMetadata(UpdateUsageMetadataInput) error 2343 2344 DeleteCacheEntry(DeleteCacheEntryInput) error 2345 } 2346 2347 type ICryptographicMaterialsManager interface { 2348 GetEncryptionMaterials(GetEncryptionMaterialsInput) (*GetEncryptionMaterialsOutput, error) 2349 2350 DecryptMaterials(DecryptMaterialsInput) (*DecryptMaterialsOutput, error) 2351 } 2352 2353 type IKeyring interface { 2354 OnEncrypt(OnEncryptInput) (*OnEncryptOutput, error) 2355 2356 OnDecrypt(OnDecryptInput) (*OnDecryptOutput, error) 2357 }