PsaImportKey

Import a key in binary format. Opcode: 6 (0x0006)

Parameters

NameTypeDescription
key_nameStringName of the key to import
attributesKeyAttributesThe attributes of the new key
dataVector of bytesBuffer containing the key data

The content of the data buffer is interpreted according to the type declared in attributes. Parsec supports the formats described in the documentation of PsaExportKey or PsaExportPublicKey for the chosen type. The key size is always determined from the data buffer. If the key size in attributes is nonzero, it must be equal to the size from data.

Results

No values are returned by this operation.

Specific response status codes

  • PsaErrorAlreadyExists: There is already a key with the given name.
  • PsaErrorNotSupported: The key type or key size is not supported.
  • PsaErrorInvalidArgument: The key attributes, as a whole, are invalid.
  • PsaErrorInvalidArgument: The key data is not correctly formatted.
  • PsaErrorInvalidArgument: The size in attributes is nonzero and does not match the size of the key data.

Description

This function supports any output from PsaExportKey. Refer to the documentation of PsaExportPublicKey for the format of public keys and to the documentation of PsaExportKey for the format for other key types.

This specification supports a single format for each key type. Parsec might support other formats in the future.

Contract

Protobuf

Copyright 2019 Contributors to the Parsec project.