Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/java/security/PublicKey#constants) \| [Inherited Constants](https://developer.android.com/reference/java/security/PublicKey#inhconstants) \| [Inherited Methods](https://developer.android.com/reference/java/security/PublicKey#inhmethods)

# PublicKey


`
public


interface
PublicKey
`


`


implements

https://developer.android.com/reference/java/security/Key


`

|---|
| java.security.PublicKey |

|---|
| Known indirect subclasses [DHPublicKey](https://developer.android.com/reference/javax/crypto/interfaces/DHPublicKey), [DSAPublicKey](https://developer.android.com/reference/java/security/interfaces/DSAPublicKey), [ECPublicKey](https://developer.android.com/reference/java/security/interfaces/ECPublicKey), [EdECPublicKey](https://developer.android.com/reference/java/security/interfaces/EdECPublicKey), [RSAPublicKey](https://developer.android.com/reference/java/security/interfaces/RSAPublicKey), [XECPublicKey](https://developer.android.com/reference/java/security/interfaces/XECPublicKey) |---|---| | [DHPublicKey](https://developer.android.com/reference/javax/crypto/interfaces/DHPublicKey) | The interface to a Diffie-Hellman public key. | | [DSAPublicKey](https://developer.android.com/reference/java/security/interfaces/DSAPublicKey) | The interface to a DSA public key. | | [ECPublicKey](https://developer.android.com/reference/java/security/interfaces/ECPublicKey) | The interface to an elliptic curve (EC) public key. | | [EdECPublicKey](https://developer.android.com/reference/java/security/interfaces/EdECPublicKey) | An interface for an elliptic curve public key as defined by [RFC 8032: Edwards-Curve Digital Signature Algorithm (EdDSA)](https://tools.ietf.org/html/rfc8032). | | [RSAPublicKey](https://developer.android.com/reference/java/security/interfaces/RSAPublicKey) | The interface to an RSA public key. | | [XECPublicKey](https://developer.android.com/reference/java/security/interfaces/XECPublicKey) | An interface for an elliptic curve public key as defined by RFC 7748. | |

<br />

*** ** * ** ***

<br />

A public key. This interface contains no methods or constants.
It merely serves to group (and provide type safety for) all public key
interfaces.

Note: The specialized public key interfaces extend this interface.
See, for example, the DSAPublicKey interface in
`java.security.interfaces`.
**See also:**

- `https://developer.android.com/reference/java/security/Key`
- `https://developer.android.com/reference/java/security/PrivateKey`
- `https://developer.android.com/reference/java/security/Certificate`
- `https://developer.android.com/reference/java/security/Signature#initVerify(java.security.PublicKey)`
- `https://developer.android.com/reference/java/security/interfaces/DSAPublicKey`
- `https://developer.android.com/reference/java/security/interfaces/RSAPublicKey`

## Summary

| ### Constants ||
|---|---|
| `long` | `https://developer.android.com/reference/java/security/PublicKey#serialVersionUID` *This constant was deprecated in API level 34. A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.* |

| ### Inherited constants |
|---|
| From interface `https://developer.android.com/reference/java/security/Key` |---|---| | `long` | `https://developer.android.com/reference/java/security/Key#serialVersionUID` *This constant was deprecated in API level 34. A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.* | |

| ### Inherited methods |
|---|---|
| From interface ` https://developer.android.com/reference/java/security/Key ` |---|---| | ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/security/Key#getAlgorithm()() ` Returns the standard algorithm name for this key. | | ` abstract byte[]` | ` https://developer.android.com/reference/java/security/Key#getEncoded()() ` Returns the key in its primary encoding format, or null if this key does not support encoding. | | ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/security/Key#getFormat()() ` Returns the name of the primary encoding format of this key, or null if this key does not support encoding. | ||

## Constants

### serialVersionUID

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final long serialVersionUID
```


**This constant was deprecated
in API level 34.**   

A `serialVersionUID` field in an interface is
ineffectual. Do not use; no replacement.

The class fingerprint that is set to indicate serialization
compatibility with a previous version of the class.

<br />

Constant Value:

7187392471159151072
(0x63bebf5f40c219e0)