1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #pragma once 7 #include <aws/kms/KMS_EXPORTS.h> 8 #include <aws/core/utils/memory/stl/AWSString.h> 9 #include <aws/kms/model/SigningAlgorithmSpec.h> 10 #include <utility> 11 12 namespace Aws 13 { 14 template<typename RESULT_TYPE> 15 class AmazonWebServiceResult; 16 17 namespace Utils 18 { 19 namespace Json 20 { 21 class JsonValue; 22 } // namespace Json 23 } // namespace Utils 24 namespace KMS 25 { 26 namespace Model 27 { 28 class AWS_KMS_API VerifyResult 29 { 30 public: 31 VerifyResult(); 32 VerifyResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); 33 VerifyResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); 34 35 36 /** 37 * <p>The Amazon Resource Name (<a 38 * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key 39 * ARN</a>) of the asymmetric KMS key that was used to verify the signature.</p> 40 */ GetKeyId()41 inline const Aws::String& GetKeyId() const{ return m_keyId; } 42 43 /** 44 * <p>The Amazon Resource Name (<a 45 * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key 46 * ARN</a>) of the asymmetric KMS key that was used to verify the signature.</p> 47 */ SetKeyId(const Aws::String & value)48 inline void SetKeyId(const Aws::String& value) { m_keyId = value; } 49 50 /** 51 * <p>The Amazon Resource Name (<a 52 * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key 53 * ARN</a>) of the asymmetric KMS key that was used to verify the signature.</p> 54 */ SetKeyId(Aws::String && value)55 inline void SetKeyId(Aws::String&& value) { m_keyId = std::move(value); } 56 57 /** 58 * <p>The Amazon Resource Name (<a 59 * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key 60 * ARN</a>) of the asymmetric KMS key that was used to verify the signature.</p> 61 */ SetKeyId(const char * value)62 inline void SetKeyId(const char* value) { m_keyId.assign(value); } 63 64 /** 65 * <p>The Amazon Resource Name (<a 66 * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key 67 * ARN</a>) of the asymmetric KMS key that was used to verify the signature.</p> 68 */ WithKeyId(const Aws::String & value)69 inline VerifyResult& WithKeyId(const Aws::String& value) { SetKeyId(value); return *this;} 70 71 /** 72 * <p>The Amazon Resource Name (<a 73 * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key 74 * ARN</a>) of the asymmetric KMS key that was used to verify the signature.</p> 75 */ WithKeyId(Aws::String && value)76 inline VerifyResult& WithKeyId(Aws::String&& value) { SetKeyId(std::move(value)); return *this;} 77 78 /** 79 * <p>The Amazon Resource Name (<a 80 * href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key 81 * ARN</a>) of the asymmetric KMS key that was used to verify the signature.</p> 82 */ WithKeyId(const char * value)83 inline VerifyResult& WithKeyId(const char* value) { SetKeyId(value); return *this;} 84 85 86 /** 87 * <p>A Boolean value that indicates whether the signature was verified. A value of 88 * <code>True</code> indicates that the <code>Signature</code> was produced by 89 * signing the <code>Message</code> with the specified <code>KeyID</code> and 90 * <code>SigningAlgorithm.</code> If the signature is not verified, the 91 * <code>Verify</code> operation fails with a 92 * <code>KMSInvalidSignatureException</code> exception. </p> 93 */ GetSignatureValid()94 inline bool GetSignatureValid() const{ return m_signatureValid; } 95 96 /** 97 * <p>A Boolean value that indicates whether the signature was verified. A value of 98 * <code>True</code> indicates that the <code>Signature</code> was produced by 99 * signing the <code>Message</code> with the specified <code>KeyID</code> and 100 * <code>SigningAlgorithm.</code> If the signature is not verified, the 101 * <code>Verify</code> operation fails with a 102 * <code>KMSInvalidSignatureException</code> exception. </p> 103 */ SetSignatureValid(bool value)104 inline void SetSignatureValid(bool value) { m_signatureValid = value; } 105 106 /** 107 * <p>A Boolean value that indicates whether the signature was verified. A value of 108 * <code>True</code> indicates that the <code>Signature</code> was produced by 109 * signing the <code>Message</code> with the specified <code>KeyID</code> and 110 * <code>SigningAlgorithm.</code> If the signature is not verified, the 111 * <code>Verify</code> operation fails with a 112 * <code>KMSInvalidSignatureException</code> exception. </p> 113 */ WithSignatureValid(bool value)114 inline VerifyResult& WithSignatureValid(bool value) { SetSignatureValid(value); return *this;} 115 116 117 /** 118 * <p>The signing algorithm that was used to verify the signature.</p> 119 */ GetSigningAlgorithm()120 inline const SigningAlgorithmSpec& GetSigningAlgorithm() const{ return m_signingAlgorithm; } 121 122 /** 123 * <p>The signing algorithm that was used to verify the signature.</p> 124 */ SetSigningAlgorithm(const SigningAlgorithmSpec & value)125 inline void SetSigningAlgorithm(const SigningAlgorithmSpec& value) { m_signingAlgorithm = value; } 126 127 /** 128 * <p>The signing algorithm that was used to verify the signature.</p> 129 */ SetSigningAlgorithm(SigningAlgorithmSpec && value)130 inline void SetSigningAlgorithm(SigningAlgorithmSpec&& value) { m_signingAlgorithm = std::move(value); } 131 132 /** 133 * <p>The signing algorithm that was used to verify the signature.</p> 134 */ WithSigningAlgorithm(const SigningAlgorithmSpec & value)135 inline VerifyResult& WithSigningAlgorithm(const SigningAlgorithmSpec& value) { SetSigningAlgorithm(value); return *this;} 136 137 /** 138 * <p>The signing algorithm that was used to verify the signature.</p> 139 */ WithSigningAlgorithm(SigningAlgorithmSpec && value)140 inline VerifyResult& WithSigningAlgorithm(SigningAlgorithmSpec&& value) { SetSigningAlgorithm(std::move(value)); return *this;} 141 142 private: 143 144 Aws::String m_keyId; 145 146 bool m_signatureValid; 147 148 SigningAlgorithmSpec m_signingAlgorithm; 149 }; 150 151 } // namespace Model 152 } // namespace KMS 153 } // namespace Aws 154