---
title: "System::Security::Cryptography::X509Certificates::X509Certificate::GetPublicKey method"
url: "https://reference.aspose.com/pdf/cpp/system.security.cryptography.x509certificates/x509certificate/getpublickey/"
product: "Aspose.PDF for C++ API Reference"
description: "System::Security::Cryptography::X509Certificates::X509Certificate::GetPublicKey method. Gets public key from certificate as array of bytes in C++."
---

## X509Certificate::GetPublicKey method


Gets public key from certificate as array of bytes.

```cpp
virtual ByteArrayPtr System::Security::Cryptography::X509Certificates::X509Certificate::GetPublicKey() const
```


### ReturnValue

[Byte](../../../system/byte/) representation of public key.

## See Also

* Typedef [ByteArrayPtr](../../../system/bytearrayptr/)
* Class [X509Certificate](../)
* Namespace [System::Security::Cryptography::X509Certificates](../../)
* Library [Aspose.PDF for C++](../../../)
