# IRPCLogin.GetPublicKeyAnonymous

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Login and sessions](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/GetPublicKeyAnonymous/

Badges: `Vault API / core` `session` `no session`

Gets the server's RSA public key without a session, for encrypting authentication data before
login.

- **Service:** [Login and sessions](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/index.md) `MFiles.IRPCLogin`
- **gRPC method:** `/MFiles.IRPCLogin/GetPublicKeyAnonymous`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-public-key-anonymous`
- **Request:** [`GetPublicKeyAnonymousRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/GetPublicKeyAnonymous/index.md#request)
- **Response:** [`GetPublicKeyAnonymousResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/GetPublicKeyAnonymous/index.md#response)
- **Book and level:** Vault API, core
- **Kind:** session
- **Session:** Not needed: the call can be made before logging in.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

Same key as [GetPublicKey](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/GetPublicKey/index.md). Over TLS, applications do not
need it. Leave `remote_can_be_null` unset.

<a id="request"></a>

## Request: GetPublicKeyAnonymousRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `remote_can_be_null` | [`ServerAddress`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ServerAddress/index.md) | If set, specifies the address of the remote server. |
| `remote_can_be_null.network_address` | `string` | The network address (name) of the server. |
| `remote_can_be_null.endpoint` | `string` | The endpoint of the server. |
| `remote_can_be_null.protocol_sequence` | `string` | The protocol sequence of the server. |
| `vault` | `string` | M-Files vault GUID. |
| `password_encryption` | [`PasswordEncryption`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.PasswordEncryption/index.md) | Encryption for which the key is requested. Values: `PASSWORD_ENCRYPTION_RC4` (0), `PASSWORD_ENCRYPTION_UNENCRYPTED` (1), `PASSWORD_ENCRYPTION_AES256` (2). |

<a id="response"></a>

## Response: GetPublicKeyAnonymousResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `public_key` | `bytes` | Receives the public key as a BLOB. |

<a id="related"></a>

## Related methods

- [GetPublicKey](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/GetPublicKey/index.md): Gets the server's RSA public key, for encrypting secrets that a client sends to the server.
