/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.kms.model; import java.io.Serializable; public class GetPublicKeyResult implements Serializable { /** *

* The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public key was * downloaded. *

*

* Constraints:
* Length: 1 - 2048
*/ private String keyId; /** *

* The exported public key. *

*

* The value is a DER-encoded X.509 public key, also known as * SubjectPublicKeyInfo (SPKI), as defined in RFC 5280. When you use the * HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. * Otherwise, it is not Base64-encoded. *

*

*

* Constraints:
* Length: 1 - 8192
*/ private java.nio.ByteBuffer publicKey; /** *

* Instead, use the KeySpec field in the * GetPublicKey response. *

*

* The KeySpec and CustomerMasterKeySpec fields * have the same value. We recommend that you use the KeySpec * field in your code. However, to avoid breaking changes, KMS supports both * fields. *

*

* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, * ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, * HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2 */ private String customerMasterKeySpec; /** *

* The type of the of the public key that was downloaded. *

*

* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, * ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, * HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2 */ private String keySpec; /** *

* The permitted use of the public key. Valid values are * ENCRYPT_DECRYPT or SIGN_VERIFY. *

*

* This information is critical. If a public key with * SIGN_VERIFY key usage encrypts data outside of KMS, the * ciphertext cannot be decrypted. *

*

* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC */ private String keyUsage; /** *

* The encryption algorithms that KMS supports for this key. *

*

* This information is critical. If a public key encrypts data outside of * KMS by using an unsupported encryption algorithm, the ciphertext cannot * be decrypted. *

*

* This field appears in the response only when the KeyUsage of * the public key is ENCRYPT_DECRYPT. *

*/ private java.util.List encryptionAlgorithms = new java.util.ArrayList(); /** *

* The signing algorithms that KMS supports for this key. *

*

* This field appears in the response only when the KeyUsage of * the public key is SIGN_VERIFY. *

*/ private java.util.List signingAlgorithms = new java.util.ArrayList(); /** *

* The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public key was * downloaded. *

*

* Constraints:
* Length: 1 - 2048
* * @return

* The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public key * was downloaded. *

*/ public String getKeyId() { return keyId; } /** *

* The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public key was * downloaded. *

*

* Constraints:
* Length: 1 - 2048
* * @param keyId

* The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public * key was downloaded. *

*/ public void setKeyId(String keyId) { this.keyId = keyId; } /** *

* The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public key was * downloaded. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 2048
* * @param keyId

* The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public * key was downloaded. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetPublicKeyResult withKeyId(String keyId) { this.keyId = keyId; return this; } /** *

* The exported public key. *

*

* The value is a DER-encoded X.509 public key, also known as * SubjectPublicKeyInfo (SPKI), as defined in RFC 5280. When you use the * HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. * Otherwise, it is not Base64-encoded. *

*

*

* Constraints:
* Length: 1 - 8192
* * @return

* The exported public key. *

*

* The value is a DER-encoded X.509 public key, also known as * SubjectPublicKeyInfo (SPKI), as defined in RFC 5280. When you * use the HTTP API or the Amazon Web Services CLI, the value is * Base64-encoded. Otherwise, it is not Base64-encoded. *

*

*/ public java.nio.ByteBuffer getPublicKey() { return publicKey; } /** *

* The exported public key. *

*

* The value is a DER-encoded X.509 public key, also known as * SubjectPublicKeyInfo (SPKI), as defined in RFC 5280. When you use the * HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. * Otherwise, it is not Base64-encoded. *

*

*

* Constraints:
* Length: 1 - 8192
* * @param publicKey

* The exported public key. *

*

* The value is a DER-encoded X.509 public key, also known as * SubjectPublicKeyInfo (SPKI), as defined in RFC 5280. When * you use the HTTP API or the Amazon Web Services CLI, the value * is Base64-encoded. Otherwise, it is not Base64-encoded. *

*

*/ public void setPublicKey(java.nio.ByteBuffer publicKey) { this.publicKey = publicKey; } /** *

* The exported public key. *

*

* The value is a DER-encoded X.509 public key, also known as * SubjectPublicKeyInfo (SPKI), as defined in RFC 5280. When you use the * HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. * Otherwise, it is not Base64-encoded. *

*

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 8192
* * @param publicKey

* The exported public key. *

*

* The value is a DER-encoded X.509 public key, also known as * SubjectPublicKeyInfo (SPKI), as defined in RFC 5280. When * you use the HTTP API or the Amazon Web Services CLI, the value * is Base64-encoded. Otherwise, it is not Base64-encoded. *

*

* @return A reference to this updated object so that method calls can be * chained together. */ public GetPublicKeyResult withPublicKey(java.nio.ByteBuffer publicKey) { this.publicKey = publicKey; return this; } /** *

* Instead, use the KeySpec field in the * GetPublicKey response. *

*

* The KeySpec and CustomerMasterKeySpec fields * have the same value. We recommend that you use the KeySpec * field in your code. However, to avoid breaking changes, KMS supports both * fields. *

*

* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, * ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, * HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2 * * @return

* Instead, use the KeySpec field in the * GetPublicKey response. *

*

* The KeySpec and CustomerMasterKeySpec * fields have the same value. We recommend that you use the * KeySpec field in your code. However, to avoid * breaking changes, KMS supports both fields. *

* @see CustomerMasterKeySpec */ public String getCustomerMasterKeySpec() { return customerMasterKeySpec; } /** *

* Instead, use the KeySpec field in the * GetPublicKey response. *

*

* The KeySpec and CustomerMasterKeySpec fields * have the same value. We recommend that you use the KeySpec * field in your code. However, to avoid breaking changes, KMS supports both * fields. *

*

* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, * ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, * HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2 * * @param customerMasterKeySpec

* Instead, use the KeySpec field in the * GetPublicKey response. *

*

* The KeySpec and * CustomerMasterKeySpec fields have the same value. * We recommend that you use the KeySpec field in * your code. However, to avoid breaking changes, KMS supports * both fields. *

* @see CustomerMasterKeySpec */ public void setCustomerMasterKeySpec(String customerMasterKeySpec) { this.customerMasterKeySpec = customerMasterKeySpec; } /** *

* Instead, use the KeySpec field in the * GetPublicKey response. *

*

* The KeySpec and CustomerMasterKeySpec fields * have the same value. We recommend that you use the KeySpec * field in your code. However, to avoid breaking changes, KMS supports both * fields. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, * ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, * HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2 * * @param customerMasterKeySpec

* Instead, use the KeySpec field in the * GetPublicKey response. *

*

* The KeySpec and * CustomerMasterKeySpec fields have the same value. * We recommend that you use the KeySpec field in * your code. However, to avoid breaking changes, KMS supports * both fields. *

* @return A reference to this updated object so that method calls can be * chained together. * @see CustomerMasterKeySpec */ public GetPublicKeyResult withCustomerMasterKeySpec(String customerMasterKeySpec) { this.customerMasterKeySpec = customerMasterKeySpec; return this; } /** *

* Instead, use the KeySpec field in the * GetPublicKey response. *

*

* The KeySpec and CustomerMasterKeySpec fields * have the same value. We recommend that you use the KeySpec * field in your code. However, to avoid breaking changes, KMS supports both * fields. *

*

* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, * ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, * HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2 * * @param customerMasterKeySpec

* Instead, use the KeySpec field in the * GetPublicKey response. *

*

* The KeySpec and * CustomerMasterKeySpec fields have the same value. * We recommend that you use the KeySpec field in * your code. However, to avoid breaking changes, KMS supports * both fields. *

* @see CustomerMasterKeySpec */ public void setCustomerMasterKeySpec(CustomerMasterKeySpec customerMasterKeySpec) { this.customerMasterKeySpec = customerMasterKeySpec.toString(); } /** *

* Instead, use the KeySpec field in the * GetPublicKey response. *

*

* The KeySpec and CustomerMasterKeySpec fields * have the same value. We recommend that you use the KeySpec * field in your code. However, to avoid breaking changes, KMS supports both * fields. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, * ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, * HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2 * * @param customerMasterKeySpec

* Instead, use the KeySpec field in the * GetPublicKey response. *

*

* The KeySpec and * CustomerMasterKeySpec fields have the same value. * We recommend that you use the KeySpec field in * your code. However, to avoid breaking changes, KMS supports * both fields. *

* @return A reference to this updated object so that method calls can be * chained together. * @see CustomerMasterKeySpec */ public GetPublicKeyResult withCustomerMasterKeySpec(CustomerMasterKeySpec customerMasterKeySpec) { this.customerMasterKeySpec = customerMasterKeySpec.toString(); return this; } /** *

* The type of the of the public key that was downloaded. *

*

* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, * ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, * HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2 * * @return

* The type of the of the public key that was downloaded. *

* @see KeySpec */ public String getKeySpec() { return keySpec; } /** *

* The type of the of the public key that was downloaded. *

*

* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, * ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, * HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2 * * @param keySpec

* The type of the of the public key that was downloaded. *

* @see KeySpec */ public void setKeySpec(String keySpec) { this.keySpec = keySpec; } /** *

* The type of the of the public key that was downloaded. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, * ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, * HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2 * * @param keySpec

* The type of the of the public key that was downloaded. *

* @return A reference to this updated object so that method calls can be * chained together. * @see KeySpec */ public GetPublicKeyResult withKeySpec(String keySpec) { this.keySpec = keySpec; return this; } /** *

* The type of the of the public key that was downloaded. *

*

* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, * ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, * HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2 * * @param keySpec

* The type of the of the public key that was downloaded. *

* @see KeySpec */ public void setKeySpec(KeySpec keySpec) { this.keySpec = keySpec.toString(); } /** *

* The type of the of the public key that was downloaded. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, * ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, * HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2 * * @param keySpec

* The type of the of the public key that was downloaded. *

* @return A reference to this updated object so that method calls can be * chained together. * @see KeySpec */ public GetPublicKeyResult withKeySpec(KeySpec keySpec) { this.keySpec = keySpec.toString(); return this; } /** *

* The permitted use of the public key. Valid values are * ENCRYPT_DECRYPT or SIGN_VERIFY. *

*

* This information is critical. If a public key with * SIGN_VERIFY key usage encrypts data outside of KMS, the * ciphertext cannot be decrypted. *

*

* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC * * @return

* The permitted use of the public key. Valid values are * ENCRYPT_DECRYPT or SIGN_VERIFY. *

*

* This information is critical. If a public key with * SIGN_VERIFY key usage encrypts data outside of KMS, * the ciphertext cannot be decrypted. *

* @see KeyUsageType */ public String getKeyUsage() { return keyUsage; } /** *

* The permitted use of the public key. Valid values are * ENCRYPT_DECRYPT or SIGN_VERIFY. *

*

* This information is critical. If a public key with * SIGN_VERIFY key usage encrypts data outside of KMS, the * ciphertext cannot be decrypted. *

*

* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC * * @param keyUsage

* The permitted use of the public key. Valid values are * ENCRYPT_DECRYPT or SIGN_VERIFY. *

*

* This information is critical. If a public key with * SIGN_VERIFY key usage encrypts data outside of * KMS, the ciphertext cannot be decrypted. *

* @see KeyUsageType */ public void setKeyUsage(String keyUsage) { this.keyUsage = keyUsage; } /** *

* The permitted use of the public key. Valid values are * ENCRYPT_DECRYPT or SIGN_VERIFY. *

*

* This information is critical. If a public key with * SIGN_VERIFY key usage encrypts data outside of KMS, the * ciphertext cannot be decrypted. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC * * @param keyUsage

* The permitted use of the public key. Valid values are * ENCRYPT_DECRYPT or SIGN_VERIFY. *

*

* This information is critical. If a public key with * SIGN_VERIFY key usage encrypts data outside of * KMS, the ciphertext cannot be decrypted. *

* @return A reference to this updated object so that method calls can be * chained together. * @see KeyUsageType */ public GetPublicKeyResult withKeyUsage(String keyUsage) { this.keyUsage = keyUsage; return this; } /** *

* The permitted use of the public key. Valid values are * ENCRYPT_DECRYPT or SIGN_VERIFY. *

*

* This information is critical. If a public key with * SIGN_VERIFY key usage encrypts data outside of KMS, the * ciphertext cannot be decrypted. *

*

* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC * * @param keyUsage

* The permitted use of the public key. Valid values are * ENCRYPT_DECRYPT or SIGN_VERIFY. *

*

* This information is critical. If a public key with * SIGN_VERIFY key usage encrypts data outside of * KMS, the ciphertext cannot be decrypted. *

* @see KeyUsageType */ public void setKeyUsage(KeyUsageType keyUsage) { this.keyUsage = keyUsage.toString(); } /** *

* The permitted use of the public key. Valid values are * ENCRYPT_DECRYPT or SIGN_VERIFY. *

*

* This information is critical. If a public key with * SIGN_VERIFY key usage encrypts data outside of KMS, the * ciphertext cannot be decrypted. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC * * @param keyUsage

* The permitted use of the public key. Valid values are * ENCRYPT_DECRYPT or SIGN_VERIFY. *

*

* This information is critical. If a public key with * SIGN_VERIFY key usage encrypts data outside of * KMS, the ciphertext cannot be decrypted. *

* @return A reference to this updated object so that method calls can be * chained together. * @see KeyUsageType */ public GetPublicKeyResult withKeyUsage(KeyUsageType keyUsage) { this.keyUsage = keyUsage.toString(); return this; } /** *

* The encryption algorithms that KMS supports for this key. *

*

* This information is critical. If a public key encrypts data outside of * KMS by using an unsupported encryption algorithm, the ciphertext cannot * be decrypted. *

*

* This field appears in the response only when the KeyUsage of * the public key is ENCRYPT_DECRYPT. *

* * @return

* The encryption algorithms that KMS supports for this key. *

*

* This information is critical. If a public key encrypts data * outside of KMS by using an unsupported encryption algorithm, the * ciphertext cannot be decrypted. *

*

* This field appears in the response only when the * KeyUsage of the public key is * ENCRYPT_DECRYPT. *

*/ public java.util.List getEncryptionAlgorithms() { return encryptionAlgorithms; } /** *

* The encryption algorithms that KMS supports for this key. *

*

* This information is critical. If a public key encrypts data outside of * KMS by using an unsupported encryption algorithm, the ciphertext cannot * be decrypted. *

*

* This field appears in the response only when the KeyUsage of * the public key is ENCRYPT_DECRYPT. *

* * @param encryptionAlgorithms

* The encryption algorithms that KMS supports for this key. *

*

* This information is critical. If a public key encrypts data * outside of KMS by using an unsupported encryption algorithm, * the ciphertext cannot be decrypted. *

*

* This field appears in the response only when the * KeyUsage of the public key is * ENCRYPT_DECRYPT. *

*/ public void setEncryptionAlgorithms(java.util.Collection encryptionAlgorithms) { if (encryptionAlgorithms == null) { this.encryptionAlgorithms = null; return; } this.encryptionAlgorithms = new java.util.ArrayList(encryptionAlgorithms); } /** *

* The encryption algorithms that KMS supports for this key. *

*

* This information is critical. If a public key encrypts data outside of * KMS by using an unsupported encryption algorithm, the ciphertext cannot * be decrypted. *

*

* This field appears in the response only when the KeyUsage of * the public key is ENCRYPT_DECRYPT. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param encryptionAlgorithms

* The encryption algorithms that KMS supports for this key. *

*

* This information is critical. If a public key encrypts data * outside of KMS by using an unsupported encryption algorithm, * the ciphertext cannot be decrypted. *

*

* This field appears in the response only when the * KeyUsage of the public key is * ENCRYPT_DECRYPT. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetPublicKeyResult withEncryptionAlgorithms(String... encryptionAlgorithms) { if (getEncryptionAlgorithms() == null) { this.encryptionAlgorithms = new java.util.ArrayList(encryptionAlgorithms.length); } for (String value : encryptionAlgorithms) { this.encryptionAlgorithms.add(value); } return this; } /** *

* The encryption algorithms that KMS supports for this key. *

*

* This information is critical. If a public key encrypts data outside of * KMS by using an unsupported encryption algorithm, the ciphertext cannot * be decrypted. *

*

* This field appears in the response only when the KeyUsage of * the public key is ENCRYPT_DECRYPT. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param encryptionAlgorithms

* The encryption algorithms that KMS supports for this key. *

*

* This information is critical. If a public key encrypts data * outside of KMS by using an unsupported encryption algorithm, * the ciphertext cannot be decrypted. *

*

* This field appears in the response only when the * KeyUsage of the public key is * ENCRYPT_DECRYPT. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetPublicKeyResult withEncryptionAlgorithms( java.util.Collection encryptionAlgorithms) { setEncryptionAlgorithms(encryptionAlgorithms); return this; } /** *

* The signing algorithms that KMS supports for this key. *

*

* This field appears in the response only when the KeyUsage of * the public key is SIGN_VERIFY. *

* * @return

* The signing algorithms that KMS supports for this key. *

*

* This field appears in the response only when the * KeyUsage of the public key is * SIGN_VERIFY. *

*/ public java.util.List getSigningAlgorithms() { return signingAlgorithms; } /** *

* The signing algorithms that KMS supports for this key. *

*

* This field appears in the response only when the KeyUsage of * the public key is SIGN_VERIFY. *

* * @param signingAlgorithms

* The signing algorithms that KMS supports for this key. *

*

* This field appears in the response only when the * KeyUsage of the public key is * SIGN_VERIFY. *

*/ public void setSigningAlgorithms(java.util.Collection signingAlgorithms) { if (signingAlgorithms == null) { this.signingAlgorithms = null; return; } this.signingAlgorithms = new java.util.ArrayList(signingAlgorithms); } /** *

* The signing algorithms that KMS supports for this key. *

*

* This field appears in the response only when the KeyUsage of * the public key is SIGN_VERIFY. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param signingAlgorithms

* The signing algorithms that KMS supports for this key. *

*

* This field appears in the response only when the * KeyUsage of the public key is * SIGN_VERIFY. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetPublicKeyResult withSigningAlgorithms(String... signingAlgorithms) { if (getSigningAlgorithms() == null) { this.signingAlgorithms = new java.util.ArrayList(signingAlgorithms.length); } for (String value : signingAlgorithms) { this.signingAlgorithms.add(value); } return this; } /** *

* The signing algorithms that KMS supports for this key. *

*

* This field appears in the response only when the KeyUsage of * the public key is SIGN_VERIFY. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param signingAlgorithms

* The signing algorithms that KMS supports for this key. *

*

* This field appears in the response only when the * KeyUsage of the public key is * SIGN_VERIFY. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetPublicKeyResult withSigningAlgorithms(java.util.Collection signingAlgorithms) { setSigningAlgorithms(signingAlgorithms); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getKeyId() != null) sb.append("KeyId: " + getKeyId() + ","); if (getPublicKey() != null) sb.append("PublicKey: " + getPublicKey() + ","); if (getCustomerMasterKeySpec() != null) sb.append("CustomerMasterKeySpec: " + getCustomerMasterKeySpec() + ","); if (getKeySpec() != null) sb.append("KeySpec: " + getKeySpec() + ","); if (getKeyUsage() != null) sb.append("KeyUsage: " + getKeyUsage() + ","); if (getEncryptionAlgorithms() != null) sb.append("EncryptionAlgorithms: " + getEncryptionAlgorithms() + ","); if (getSigningAlgorithms() != null) sb.append("SigningAlgorithms: " + getSigningAlgorithms()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getKeyId() == null) ? 0 : getKeyId().hashCode()); hashCode = prime * hashCode + ((getPublicKey() == null) ? 0 : getPublicKey().hashCode()); hashCode = prime * hashCode + ((getCustomerMasterKeySpec() == null) ? 0 : getCustomerMasterKeySpec().hashCode()); hashCode = prime * hashCode + ((getKeySpec() == null) ? 0 : getKeySpec().hashCode()); hashCode = prime * hashCode + ((getKeyUsage() == null) ? 0 : getKeyUsage().hashCode()); hashCode = prime * hashCode + ((getEncryptionAlgorithms() == null) ? 0 : getEncryptionAlgorithms().hashCode()); hashCode = prime * hashCode + ((getSigningAlgorithms() == null) ? 0 : getSigningAlgorithms().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetPublicKeyResult == false) return false; GetPublicKeyResult other = (GetPublicKeyResult) obj; if (other.getKeyId() == null ^ this.getKeyId() == null) return false; if (other.getKeyId() != null && other.getKeyId().equals(this.getKeyId()) == false) return false; if (other.getPublicKey() == null ^ this.getPublicKey() == null) return false; if (other.getPublicKey() != null && other.getPublicKey().equals(this.getPublicKey()) == false) return false; if (other.getCustomerMasterKeySpec() == null ^ this.getCustomerMasterKeySpec() == null) return false; if (other.getCustomerMasterKeySpec() != null && other.getCustomerMasterKeySpec().equals(this.getCustomerMasterKeySpec()) == false) return false; if (other.getKeySpec() == null ^ this.getKeySpec() == null) return false; if (other.getKeySpec() != null && other.getKeySpec().equals(this.getKeySpec()) == false) return false; if (other.getKeyUsage() == null ^ this.getKeyUsage() == null) return false; if (other.getKeyUsage() != null && other.getKeyUsage().equals(this.getKeyUsage()) == false) return false; if (other.getEncryptionAlgorithms() == null ^ this.getEncryptionAlgorithms() == null) return false; if (other.getEncryptionAlgorithms() != null && other.getEncryptionAlgorithms().equals(this.getEncryptionAlgorithms()) == false) return false; if (other.getSigningAlgorithms() == null ^ this.getSigningAlgorithms() == null) return false; if (other.getSigningAlgorithms() != null && other.getSigningAlgorithms().equals(this.getSigningAlgorithms()) == false) return false; return true; } }