github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl@v0.2.0/awscryptographymaterialproviderssmithygenerated/Keyring.go (about) 1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package awscryptographymaterialproviderssmithygenerated 4 5 import ( 6 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/AwsCryptographyMaterialProvidersTypes" 7 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/awscryptographymaterialproviderssmithygeneratedtypes" 8 ) 9 10 type Keyring struct { 11 Impl AwsCryptographyMaterialProvidersTypes.IKeyring 12 } 13 14 func (this *Keyring) OnEncrypt(params awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput) (*awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput, error) { 15 var dafny_request AwsCryptographyMaterialProvidersTypes.OnEncryptInput = OnEncryptInput_ToDafny(params) 16 var dafny_response = this.Impl.OnEncrypt(dafny_request) 17 18 if dafny_response.Is_Failure() { 19 err := dafny_response.Dtor_error().(AwsCryptographyMaterialProvidersTypes.Error) 20 return nil, Error_FromDafny(err) 21 } 22 var native_response = OnEncryptOutput_FromDafny(dafny_response.Dtor_value().(AwsCryptographyMaterialProvidersTypes.OnEncryptOutput)) 23 return &native_response, nil 24 25 } 26 27 func (this *Keyring) OnDecrypt(params awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput) (*awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput, error) { 28 var dafny_request AwsCryptographyMaterialProvidersTypes.OnDecryptInput = OnDecryptInput_ToDafny(params) 29 var dafny_response = this.Impl.OnDecrypt(dafny_request) 30 31 if dafny_response.Is_Failure() { 32 err := dafny_response.Dtor_error().(AwsCryptographyMaterialProvidersTypes.Error) 33 return nil, Error_FromDafny(err) 34 } 35 var native_response = OnDecryptOutput_FromDafny(dafny_response.Dtor_value().(AwsCryptographyMaterialProvidersTypes.OnDecryptOutput)) 36 return &native_response, nil 37 38 }