public java.nio.ByteBuffer getPublicKey() {
        return this.publicKey;
    }
<p>
Specifies the public key in your peer's NIST-recommended elliptic curve (ECC) or SM2 (China Regions only) key
pair.
</p>
<p>
The public key must be a DER-encoded X.509 public key, also known as <code>SubjectPublicKeyInfo</code> (SPKI), as
defined in <a href="https://tools.ietf.org/html/rfc5280">RFC 5280</a>.
</p>
<p>
<a>GetPublicKey</a> returns the public key of an asymmetric KMS key pair in the required DER-encoded format.
</p>
<note>
<p>
If you use <a href="https://docs.aws.amazon.com/cli/v1/userguide/cli-chap-welcome.html">Amazon Web Services CLI
version 1</a>, you must provide the DER-encoded X.509 public key in a file. Otherwise, the Amazon Web Services
CLI Base64-encodes the public key a second time, resulting in a <code>ValidationException</code>.
</p>
</note>
<p>
You can specify the public key as binary data in a file using fileb (<code>fileb://&lt;path-to-file&gt;</code>)
or in-line using a Base64 encoded string.
</p>
<p>
{@code ByteBuffer}s are stateful. Calling their {@code get} methods changes their {@code position}. We recommend
using {@link java.nio.ByteBuffer#asReadOnlyBuffer()} to create a read-only view of the buffer with an independent
{@code position}, and calling {@code get} methods on this rather than directly on the returned {@code ByteBuffer}.
Doing so will ensure that anyone else using the {@code ByteBuffer} will not be affected by changes to the
{@code position}.
</p>

@return Specifies the public key in your peer's NIST-recommended elliptic curve (ECC) or SM2 (China Regions only)
        key pair.</p>
        <p>
        The public key must be a DER-encoded X.509 public key, also known as <code>SubjectPublicKeyInfo</code>
        (SPKI), as defined in <a href="https://tools.ietf.org/html/rfc5280">RFC 5280</a>.
        </p>
        <p>
        <a>GetPublicKey</a> returns the public key of an asymmetric KMS key pair in the required DER-encoded
        format.
        </p>
        <note>
        <p>
        If you use <a href="https://docs.aws.amazon.com/cli/v1/userguide/cli-chap-welcome.html">Amazon Web
        Services CLI version 1</a>, you must provide the DER-encoded X.509 public key in a file. Otherwise, the
        Amazon Web Services CLI Base64-encodes the public key a second time, resulting in a
        <code>ValidationException</code>.
        </p>
        </note>
        <p>
        You can specify the public key as binary data in a file using fileb (
        <code>fileb://&lt;path-to-file&gt;</code>) or in-line using a Base64 encoded string.
aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/model/DeriveSharedSecretRequest.java