Zum Hauptinhalt springen

Get the public key to verify the webhook signature

GET/v2/public-keys/{serial}
API-Version
v2
Request-Methode
GET
Operation-ID
extension-get-public-key

Request​

  • serialstringrequired

    The serial id of a specific public key. Use latest to get the latest public key.

Responses​

Format
application/json
Beschreibung

Use this public key to verify the webhook signature on your end.

  • algorithmstringrequired
  • keyrequired
  • serialstring (uuid)required
Content-Type: application/json

{
"algorithm": "Ed25519",
"key": null,
"serial": "f0f86186-0a5a-45b2-aa33-502777496347"
}
{
"properties": {
"algorithm": {
"example": "Ed25519",
"type": "string"
},
"key": {
"anyOf": [
{
"description": "raw base64 public key",
"format": "byte",
"type": "string"
},
{
"description": "SPKI, ASN.1 DER serialized, PEM encoded public key",
"type": "string"
}
]
},
"serial": {
"format": "uuid",
"type": "string"
}
},
"required": [
"serial",
"algorithm",
"key"
],
"type": "object"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/public-keys/latest?purpose=webhook&format=raw
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.marketplace.extensionGetPublicKey({
"serial": "latest",
"queryParameters": {
"purpose": "webhook",
"format": "raw"
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Marketplace\ExtensionGetPublicKey\ExtensionGetPublicKeyRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new ExtensionGetPublicKeyRequest(
serial: "latest"
))
->withPurpose("webhook")
->withFormat("raw");
$response = $client->marketplace()->extensionGetPublicKey($request);

var_dump($response->getBody();

Auf dieser Seite