All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.lightsail.model.HostKeyAttributes Maven / Gradle / Ivy

/*
 * Copyright 2018-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.lightsail.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* Describes the public SSH host keys or the RDP certificate. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class HostKeyAttributes implements Serializable, Cloneable, StructuredPojo { /** *

* The SSH host key algorithm or the RDP certificate format. *

*

* For SSH host keys, the algorithm may be ssh-rsa, ecdsa-sha2-nistp256, * ssh-ed25519, etc. For RDP certificates, the algorithm is always x509-cert. *

*/ private String algorithm; /** *

* The public SSH host key or the RDP certificate. *

*/ private String publicKey; /** *

* The time that the SSH host key or RDP certificate was recorded by Lightsail. *

*/ private java.util.Date witnessedAt; /** *

* The SHA-1 fingerprint of the returned SSH host key or RDP certificate. *

*
    *
  • *

    * Example of an SHA-1 SSH fingerprint: *

    *

    * SHA1:1CHH6FaAaXjtFOsR/t83vf91SR0 *

    *
  • *
  • *

    * Example of an SHA-1 RDP fingerprint: *

    *

    * af:34:51:fe:09:f0:e0:da:b8:4e:56:ca:60:c2:10:ff:38:06:db:45 *

    *
  • *
*/ private String fingerprintSHA1; /** *

* The SHA-256 fingerprint of the returned SSH host key or RDP certificate. *

*
    *
  • *

    * Example of an SHA-256 SSH fingerprint: *

    *

    * SHA256:KTsMnRBh1IhD17HpdfsbzeGA4jOijm5tyXsMjKVbB8o *

    *
  • *
  • *

    * Example of an SHA-256 RDP fingerprint: *

    *

    * 03:9b:36:9f:4b:de:4e:61:70:fc:7c:c9:78:e7:d2:1a:1c:25:a8:0c:91:f6:7c:e4:d6:a0:85:c8:b4:53:99:68 *

    *
  • *
*/ private String fingerprintSHA256; /** *

* The returned RDP certificate is valid after this point in time. *

*

* This value is listed only for RDP certificates. *

*/ private java.util.Date notValidBefore; /** *

* The returned RDP certificate is not valid after this point in time. *

*

* This value is listed only for RDP certificates. *

*/ private java.util.Date notValidAfter; /** *

* The SSH host key algorithm or the RDP certificate format. *

*

* For SSH host keys, the algorithm may be ssh-rsa, ecdsa-sha2-nistp256, * ssh-ed25519, etc. For RDP certificates, the algorithm is always x509-cert. *

* * @param algorithm * The SSH host key algorithm or the RDP certificate format.

*

* For SSH host keys, the algorithm may be ssh-rsa, ecdsa-sha2-nistp256, * ssh-ed25519, etc. For RDP certificates, the algorithm is always x509-cert. */ public void setAlgorithm(String algorithm) { this.algorithm = algorithm; } /** *

* The SSH host key algorithm or the RDP certificate format. *

*

* For SSH host keys, the algorithm may be ssh-rsa, ecdsa-sha2-nistp256, * ssh-ed25519, etc. For RDP certificates, the algorithm is always x509-cert. *

* * @return The SSH host key algorithm or the RDP certificate format.

*

* For SSH host keys, the algorithm may be ssh-rsa, ecdsa-sha2-nistp256, * ssh-ed25519, etc. For RDP certificates, the algorithm is always x509-cert. */ public String getAlgorithm() { return this.algorithm; } /** *

* The SSH host key algorithm or the RDP certificate format. *

*

* For SSH host keys, the algorithm may be ssh-rsa, ecdsa-sha2-nistp256, * ssh-ed25519, etc. For RDP certificates, the algorithm is always x509-cert. *

* * @param algorithm * The SSH host key algorithm or the RDP certificate format.

*

* For SSH host keys, the algorithm may be ssh-rsa, ecdsa-sha2-nistp256, * ssh-ed25519, etc. For RDP certificates, the algorithm is always x509-cert. * @return Returns a reference to this object so that method calls can be chained together. */ public HostKeyAttributes withAlgorithm(String algorithm) { setAlgorithm(algorithm); return this; } /** *

* The public SSH host key or the RDP certificate. *

* * @param publicKey * The public SSH host key or the RDP certificate. */ public void setPublicKey(String publicKey) { this.publicKey = publicKey; } /** *

* The public SSH host key or the RDP certificate. *

* * @return The public SSH host key or the RDP certificate. */ public String getPublicKey() { return this.publicKey; } /** *

* The public SSH host key or the RDP certificate. *

* * @param publicKey * The public SSH host key or the RDP certificate. * @return Returns a reference to this object so that method calls can be chained together. */ public HostKeyAttributes withPublicKey(String publicKey) { setPublicKey(publicKey); return this; } /** *

* The time that the SSH host key or RDP certificate was recorded by Lightsail. *

* * @param witnessedAt * The time that the SSH host key or RDP certificate was recorded by Lightsail. */ public void setWitnessedAt(java.util.Date witnessedAt) { this.witnessedAt = witnessedAt; } /** *

* The time that the SSH host key or RDP certificate was recorded by Lightsail. *

* * @return The time that the SSH host key or RDP certificate was recorded by Lightsail. */ public java.util.Date getWitnessedAt() { return this.witnessedAt; } /** *

* The time that the SSH host key or RDP certificate was recorded by Lightsail. *

* * @param witnessedAt * The time that the SSH host key or RDP certificate was recorded by Lightsail. * @return Returns a reference to this object so that method calls can be chained together. */ public HostKeyAttributes withWitnessedAt(java.util.Date witnessedAt) { setWitnessedAt(witnessedAt); return this; } /** *

* The SHA-1 fingerprint of the returned SSH host key or RDP certificate. *

*
    *
  • *

    * Example of an SHA-1 SSH fingerprint: *

    *

    * SHA1:1CHH6FaAaXjtFOsR/t83vf91SR0 *

    *
  • *
  • *

    * Example of an SHA-1 RDP fingerprint: *

    *

    * af:34:51:fe:09:f0:e0:da:b8:4e:56:ca:60:c2:10:ff:38:06:db:45 *

    *
  • *
* * @param fingerprintSHA1 * The SHA-1 fingerprint of the returned SSH host key or RDP certificate.

*
    *
  • *

    * Example of an SHA-1 SSH fingerprint: *

    *

    * SHA1:1CHH6FaAaXjtFOsR/t83vf91SR0 *

    *
  • *
  • *

    * Example of an SHA-1 RDP fingerprint: *

    *

    * af:34:51:fe:09:f0:e0:da:b8:4e:56:ca:60:c2:10:ff:38:06:db:45 *

    *
  • */ public void setFingerprintSHA1(String fingerprintSHA1) { this.fingerprintSHA1 = fingerprintSHA1; } /** *

    * The SHA-1 fingerprint of the returned SSH host key or RDP certificate. *

    *
      *
    • *

      * Example of an SHA-1 SSH fingerprint: *

      *

      * SHA1:1CHH6FaAaXjtFOsR/t83vf91SR0 *

      *
    • *
    • *

      * Example of an SHA-1 RDP fingerprint: *

      *

      * af:34:51:fe:09:f0:e0:da:b8:4e:56:ca:60:c2:10:ff:38:06:db:45 *

      *
    • *
    * * @return The SHA-1 fingerprint of the returned SSH host key or RDP certificate.

    *
      *
    • *

      * Example of an SHA-1 SSH fingerprint: *

      *

      * SHA1:1CHH6FaAaXjtFOsR/t83vf91SR0 *

      *
    • *
    • *

      * Example of an SHA-1 RDP fingerprint: *

      *

      * af:34:51:fe:09:f0:e0:da:b8:4e:56:ca:60:c2:10:ff:38:06:db:45 *

      *
    • */ public String getFingerprintSHA1() { return this.fingerprintSHA1; } /** *

      * The SHA-1 fingerprint of the returned SSH host key or RDP certificate. *

      *
        *
      • *

        * Example of an SHA-1 SSH fingerprint: *

        *

        * SHA1:1CHH6FaAaXjtFOsR/t83vf91SR0 *

        *
      • *
      • *

        * Example of an SHA-1 RDP fingerprint: *

        *

        * af:34:51:fe:09:f0:e0:da:b8:4e:56:ca:60:c2:10:ff:38:06:db:45 *

        *
      • *
      * * @param fingerprintSHA1 * The SHA-1 fingerprint of the returned SSH host key or RDP certificate.

      *
        *
      • *

        * Example of an SHA-1 SSH fingerprint: *

        *

        * SHA1:1CHH6FaAaXjtFOsR/t83vf91SR0 *

        *
      • *
      • *

        * Example of an SHA-1 RDP fingerprint: *

        *

        * af:34:51:fe:09:f0:e0:da:b8:4e:56:ca:60:c2:10:ff:38:06:db:45 *

        *
      • * @return Returns a reference to this object so that method calls can be chained together. */ public HostKeyAttributes withFingerprintSHA1(String fingerprintSHA1) { setFingerprintSHA1(fingerprintSHA1); return this; } /** *

        * The SHA-256 fingerprint of the returned SSH host key or RDP certificate. *

        *
          *
        • *

          * Example of an SHA-256 SSH fingerprint: *

          *

          * SHA256:KTsMnRBh1IhD17HpdfsbzeGA4jOijm5tyXsMjKVbB8o *

          *
        • *
        • *

          * Example of an SHA-256 RDP fingerprint: *

          *

          * 03:9b:36:9f:4b:de:4e:61:70:fc:7c:c9:78:e7:d2:1a:1c:25:a8:0c:91:f6:7c:e4:d6:a0:85:c8:b4:53:99:68 *

          *
        • *
        * * @param fingerprintSHA256 * The SHA-256 fingerprint of the returned SSH host key or RDP certificate.

        *
          *
        • *

          * Example of an SHA-256 SSH fingerprint: *

          *

          * SHA256:KTsMnRBh1IhD17HpdfsbzeGA4jOijm5tyXsMjKVbB8o *

          *
        • *
        • *

          * Example of an SHA-256 RDP fingerprint: *

          *

          * 03:9b:36:9f:4b:de:4e:61:70:fc:7c:c9:78:e7:d2:1a:1c:25:a8:0c:91:f6:7c:e4:d6:a0:85:c8:b4:53:99:68 *

          *
        • */ public void setFingerprintSHA256(String fingerprintSHA256) { this.fingerprintSHA256 = fingerprintSHA256; } /** *

          * The SHA-256 fingerprint of the returned SSH host key or RDP certificate. *

          *
            *
          • *

            * Example of an SHA-256 SSH fingerprint: *

            *

            * SHA256:KTsMnRBh1IhD17HpdfsbzeGA4jOijm5tyXsMjKVbB8o *

            *
          • *
          • *

            * Example of an SHA-256 RDP fingerprint: *

            *

            * 03:9b:36:9f:4b:de:4e:61:70:fc:7c:c9:78:e7:d2:1a:1c:25:a8:0c:91:f6:7c:e4:d6:a0:85:c8:b4:53:99:68 *

            *
          • *
          * * @return The SHA-256 fingerprint of the returned SSH host key or RDP certificate.

          *
            *
          • *

            * Example of an SHA-256 SSH fingerprint: *

            *

            * SHA256:KTsMnRBh1IhD17HpdfsbzeGA4jOijm5tyXsMjKVbB8o *

            *
          • *
          • *

            * Example of an SHA-256 RDP fingerprint: *

            *

            * 03:9b:36:9f:4b:de:4e:61:70:fc:7c:c9:78:e7:d2:1a:1c:25:a8:0c:91:f6:7c:e4:d6:a0:85:c8:b4:53:99:68 *

            *
          • */ public String getFingerprintSHA256() { return this.fingerprintSHA256; } /** *

            * The SHA-256 fingerprint of the returned SSH host key or RDP certificate. *

            *
              *
            • *

              * Example of an SHA-256 SSH fingerprint: *

              *

              * SHA256:KTsMnRBh1IhD17HpdfsbzeGA4jOijm5tyXsMjKVbB8o *

              *
            • *
            • *

              * Example of an SHA-256 RDP fingerprint: *

              *

              * 03:9b:36:9f:4b:de:4e:61:70:fc:7c:c9:78:e7:d2:1a:1c:25:a8:0c:91:f6:7c:e4:d6:a0:85:c8:b4:53:99:68 *

              *
            • *
            * * @param fingerprintSHA256 * The SHA-256 fingerprint of the returned SSH host key or RDP certificate.

            *
              *
            • *

              * Example of an SHA-256 SSH fingerprint: *

              *

              * SHA256:KTsMnRBh1IhD17HpdfsbzeGA4jOijm5tyXsMjKVbB8o *

              *
            • *
            • *

              * Example of an SHA-256 RDP fingerprint: *

              *

              * 03:9b:36:9f:4b:de:4e:61:70:fc:7c:c9:78:e7:d2:1a:1c:25:a8:0c:91:f6:7c:e4:d6:a0:85:c8:b4:53:99:68 *

              *
            • * @return Returns a reference to this object so that method calls can be chained together. */ public HostKeyAttributes withFingerprintSHA256(String fingerprintSHA256) { setFingerprintSHA256(fingerprintSHA256); return this; } /** *

              * The returned RDP certificate is valid after this point in time. *

              *

              * This value is listed only for RDP certificates. *

              * * @param notValidBefore * The returned RDP certificate is valid after this point in time.

              *

              * This value is listed only for RDP certificates. */ public void setNotValidBefore(java.util.Date notValidBefore) { this.notValidBefore = notValidBefore; } /** *

              * The returned RDP certificate is valid after this point in time. *

              *

              * This value is listed only for RDP certificates. *

              * * @return The returned RDP certificate is valid after this point in time.

              *

              * This value is listed only for RDP certificates. */ public java.util.Date getNotValidBefore() { return this.notValidBefore; } /** *

              * The returned RDP certificate is valid after this point in time. *

              *

              * This value is listed only for RDP certificates. *

              * * @param notValidBefore * The returned RDP certificate is valid after this point in time.

              *

              * This value is listed only for RDP certificates. * @return Returns a reference to this object so that method calls can be chained together. */ public HostKeyAttributes withNotValidBefore(java.util.Date notValidBefore) { setNotValidBefore(notValidBefore); return this; } /** *

              * The returned RDP certificate is not valid after this point in time. *

              *

              * This value is listed only for RDP certificates. *

              * * @param notValidAfter * The returned RDP certificate is not valid after this point in time.

              *

              * This value is listed only for RDP certificates. */ public void setNotValidAfter(java.util.Date notValidAfter) { this.notValidAfter = notValidAfter; } /** *

              * The returned RDP certificate is not valid after this point in time. *

              *

              * This value is listed only for RDP certificates. *

              * * @return The returned RDP certificate is not valid after this point in time.

              *

              * This value is listed only for RDP certificates. */ public java.util.Date getNotValidAfter() { return this.notValidAfter; } /** *

              * The returned RDP certificate is not valid after this point in time. *

              *

              * This value is listed only for RDP certificates. *

              * * @param notValidAfter * The returned RDP certificate is not valid after this point in time.

              *

              * This value is listed only for RDP certificates. * @return Returns a reference to this object so that method calls can be chained together. */ public HostKeyAttributes withNotValidAfter(java.util.Date notValidAfter) { setNotValidAfter(notValidAfter); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAlgorithm() != null) sb.append("Algorithm: ").append(getAlgorithm()).append(","); if (getPublicKey() != null) sb.append("PublicKey: ").append(getPublicKey()).append(","); if (getWitnessedAt() != null) sb.append("WitnessedAt: ").append(getWitnessedAt()).append(","); if (getFingerprintSHA1() != null) sb.append("FingerprintSHA1: ").append(getFingerprintSHA1()).append(","); if (getFingerprintSHA256() != null) sb.append("FingerprintSHA256: ").append(getFingerprintSHA256()).append(","); if (getNotValidBefore() != null) sb.append("NotValidBefore: ").append(getNotValidBefore()).append(","); if (getNotValidAfter() != null) sb.append("NotValidAfter: ").append(getNotValidAfter()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof HostKeyAttributes == false) return false; HostKeyAttributes other = (HostKeyAttributes) obj; if (other.getAlgorithm() == null ^ this.getAlgorithm() == null) return false; if (other.getAlgorithm() != null && other.getAlgorithm().equals(this.getAlgorithm()) == 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.getWitnessedAt() == null ^ this.getWitnessedAt() == null) return false; if (other.getWitnessedAt() != null && other.getWitnessedAt().equals(this.getWitnessedAt()) == false) return false; if (other.getFingerprintSHA1() == null ^ this.getFingerprintSHA1() == null) return false; if (other.getFingerprintSHA1() != null && other.getFingerprintSHA1().equals(this.getFingerprintSHA1()) == false) return false; if (other.getFingerprintSHA256() == null ^ this.getFingerprintSHA256() == null) return false; if (other.getFingerprintSHA256() != null && other.getFingerprintSHA256().equals(this.getFingerprintSHA256()) == false) return false; if (other.getNotValidBefore() == null ^ this.getNotValidBefore() == null) return false; if (other.getNotValidBefore() != null && other.getNotValidBefore().equals(this.getNotValidBefore()) == false) return false; if (other.getNotValidAfter() == null ^ this.getNotValidAfter() == null) return false; if (other.getNotValidAfter() != null && other.getNotValidAfter().equals(this.getNotValidAfter()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAlgorithm() == null) ? 0 : getAlgorithm().hashCode()); hashCode = prime * hashCode + ((getPublicKey() == null) ? 0 : getPublicKey().hashCode()); hashCode = prime * hashCode + ((getWitnessedAt() == null) ? 0 : getWitnessedAt().hashCode()); hashCode = prime * hashCode + ((getFingerprintSHA1() == null) ? 0 : getFingerprintSHA1().hashCode()); hashCode = prime * hashCode + ((getFingerprintSHA256() == null) ? 0 : getFingerprintSHA256().hashCode()); hashCode = prime * hashCode + ((getNotValidBefore() == null) ? 0 : getNotValidBefore().hashCode()); hashCode = prime * hashCode + ((getNotValidAfter() == null) ? 0 : getNotValidAfter().hashCode()); return hashCode; } @Override public HostKeyAttributes clone() { try { return (HostKeyAttributes) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.lightsail.model.transform.HostKeyAttributesMarshaller.getInstance().marshall(this, protocolMarshaller); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy