Software APIs
Data Structures | Macros | Typedefs | Enumerations | Functions
acorn.h File Reference

(9ad4f65042)

acorn.h: dynamic library interface for acorn. More...

#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  acorn_buffer
 A byte array with length included. More...
 
struct  acorn_object_keyEntry
 Describes a key pair. More...
 
struct  acorn_request_getVersion
 Input parameters for acorn_command_getVersion. More...
 
struct  acorn_response_getVersion
 Output parameters for acorn_command_getVersion. More...
 
struct  acorn_request_list
 Input parameters for acorn_command_list. More...
 
struct  acorn_response_list
 Output parameters for acorn_command_list. More...
 
struct  acorn_request_getPublic
 Input parameters for acorn_command_getPublic. More...
 
struct  acorn_response_getPublic
 Output parameters for acorn_command_getPublic. More...
 
struct  acorn_request_getPublicHash
 Input parameters for acorn_command_getPublicHash. More...
 
struct  acorn_response_getPublicHash
 Output parameters for acorn_command_getPublicHash. More...
 
struct  acorn_request_getKeyInfo
 Input parameters for acorn_command_getKeyInfo. More...
 
struct  acorn_response_getKeyInfo
 Output parameters for acorn_command_getKeyInfo. More...
 
struct  acorn_request_generate
 Input parameters for acorn_command_generate. More...
 
struct  acorn_response_generate
 Output parameters for acorn_command_generate. More...
 
struct  acorn_request_importKeypair
 Input parameters for acorn_command_importKeypair. More...
 
struct  acorn_response_importKeypair
 Output parameters for acorn_command_importKeypair. More...
 
struct  acorn_request_sign
 Input parameters for acorn_command_sign. More...
 
struct  acorn_response_sign
 Output parameters for acorn_command_sign. More...
 
struct  acorn_request_verify
 Input parameters for acorn_command_verify. More...
 
struct  acorn_response_verify
 Output parameters for acorn_command_verify. More...
 
struct  acorn_request_signImmediate
 Input parameters for acorn_command_signImmediate. More...
 
struct  acorn_response_signImmediate
 Output parameters for acorn_command_signImmediate. More...
 
struct  acorn_request_verifyImmediate
 Input parameters for acorn_command_verifyImmediate. More...
 
struct  acorn_response_verifyImmediate
 Output parameters for acorn_command_verifyImmediate. More...
 
struct  acorn_request_see_getVersion
 Input parameters for acorn_command_see_getVersion. More...
 
struct  acorn_response_see_getVersion
 Output parameters for acorn_command_see_getVersion. More...
 
struct  acorn_commandlist
 
struct  acorn_cmdlist
 

Typedefs

typedef int(* acorn_commandfn_getVersion) (const struct acorn_request_getVersion *request, struct acorn_response_getVersion *response, char **errstring)
 
typedef int(* acorn_cmdfn_getVersion) (struct acorn_response_getVersion *response, char **errstring)
 
typedef void EXPORT acorn_free_getVersion(struct acorn_request_getVersion *request, struct acorn_response_getVersion *response)
 Reclaim resources used by corresponding command. More...
 
typedef int(* acorn_commandfn_list) (const struct acorn_request_list *request, struct acorn_response_list *response, char **errstring)
 
typedef int(* acorn_cmdfn_list) (struct acorn_response_list *response, char **errstring)
 
typedef void EXPORT acorn_free_list(struct acorn_request_list *request, struct acorn_response_list *response)
 Reclaim resources used by corresponding command. More...
 
typedef int(* acorn_commandfn_getPublic) (const struct acorn_request_getPublic *request, struct acorn_response_getPublic *response, char **errstring)
 
typedef int(* acorn_cmdfn_getPublic) (const char *alias, struct acorn_response_getPublic *response, char **errstring)
 
typedef void EXPORT acorn_free_getPublic(struct acorn_request_getPublic *request, struct acorn_response_getPublic *response)
 Reclaim resources used by corresponding command. More...
 
typedef int(* acorn_commandfn_getPublicHash) (const struct acorn_request_getPublicHash *request, struct acorn_response_getPublicHash *response, char **errstring)
 
typedef int(* acorn_cmdfn_getPublicHash) (const struct acorn_buffer publicKey, struct acorn_response_getPublicHash *response, char **errstring)
 
typedef void EXPORT acorn_free_getPublicHash(struct acorn_request_getPublicHash *request, struct acorn_response_getPublicHash *response)
 Reclaim resources used by corresponding command. More...
 
typedef int(* acorn_commandfn_getKeyInfo) (const struct acorn_request_getKeyInfo *request, struct acorn_response_getKeyInfo *response, char **errstring)
 
typedef int(* acorn_cmdfn_getKeyInfo) (const char *alias, struct acorn_response_getKeyInfo *response, char **errstring)
 
typedef void EXPORT acorn_free_getKeyInfo(struct acorn_request_getKeyInfo *request, struct acorn_response_getKeyInfo *response)
 Reclaim resources used by corresponding command. More...
 
typedef int(* acorn_commandfn_generate) (const struct acorn_request_generate *request, struct acorn_response_generate *response, char **errstring)
 
typedef int(* acorn_cmdfn_generate) (const char *alias, const char *algorithm, const char *token, unsigned flags, struct acorn_response_generate *response, char **errstring)
 
typedef void EXPORT acorn_free_generate(struct acorn_request_generate *request, struct acorn_response_generate *response)
 Reclaim resources used by corresponding command. More...
 
typedef int(* acorn_commandfn_importKeypair) (const struct acorn_request_importKeypair *request, struct acorn_response_importKeypair *response, char **errstring)
 
typedef int(* acorn_cmdfn_importKeypair) (const char *alias, const char *algorithm, const struct acorn_buffer publicKey, const struct acorn_buffer privateKey, const char *token, unsigned overwrite, struct acorn_response_importKeypair *response, char **errstring)
 
typedef void EXPORT acorn_free_importKeypair(struct acorn_request_importKeypair *request, struct acorn_response_importKeypair *response)
 Reclaim resources used by corresponding command. More...
 
typedef int(* acorn_commandfn_sign) (const struct acorn_request_sign *request, struct acorn_response_sign *response, char **errstring)
 
typedef int(* acorn_cmdfn_sign) (const char *alias, const char *keyhash, const struct acorn_buffer message, struct acorn_response_sign *response, char **errstring)
 
typedef void EXPORT acorn_free_sign(struct acorn_request_sign *request, struct acorn_response_sign *response)
 Reclaim resources used by corresponding command. More...
 
typedef int(* acorn_commandfn_verify) (const struct acorn_request_verify *request, struct acorn_response_verify *response, char **errstring)
 
typedef int(* acorn_cmdfn_verify) (const char *alias, const char *keyhash, const struct acorn_buffer message, const struct acorn_buffer signature, struct acorn_response_verify *response, char **errstring)
 
typedef void EXPORT acorn_free_verify(struct acorn_request_verify *request, struct acorn_response_verify *response)
 Reclaim resources used by corresponding command. More...
 
typedef int(* acorn_commandfn_signImmediate) (const struct acorn_request_signImmediate *request, struct acorn_response_signImmediate *response, char **errstring)
 
typedef int(* acorn_cmdfn_signImmediate) (const struct acorn_buffer privateBlob, const char *token, const struct acorn_buffer message, struct acorn_response_signImmediate *response, char **errstring)
 
typedef void EXPORT acorn_free_signImmediate(struct acorn_request_signImmediate *request, struct acorn_response_signImmediate *response)
 Reclaim resources used by corresponding command. More...
 
typedef int(* acorn_commandfn_verifyImmediate) (const struct acorn_request_verifyImmediate *request, struct acorn_response_verifyImmediate *response, char **errstring)
 
typedef int(* acorn_cmdfn_verifyImmediate) (const struct acorn_buffer publicKey, const char *algorithm, const struct acorn_buffer message, const struct acorn_buffer signature, struct acorn_response_verifyImmediate *response, char **errstring)
 
typedef void EXPORT acorn_free_verifyImmediate(struct acorn_request_verifyImmediate *request, struct acorn_response_verifyImmediate *response)
 Reclaim resources used by corresponding command. More...
 
typedef int(* acorn_commandfn_see_getVersion) (const struct acorn_request_see_getVersion *request, struct acorn_response_see_getVersion *response, char **errstring)
 
typedef int(* acorn_cmdfn_see_getVersion) (struct acorn_response_see_getVersion *response, char **errstring)
 
typedef void EXPORT acorn_free_see_getVersion(struct acorn_request_see_getVersion *request, struct acorn_response_see_getVersion *response)
 Reclaim resources used by corresponding command. More...
 
typedef int EXPORT acorn_getcommandlist(struct acorn_commandlist *list, char **errstring)
 Populates a structure containing each command in request structure form. More...
 
typedef int EXPORT acorn_getcmdlist(struct acorn_cmdlist *list, char **errstring)
 Populates a structure containing each command in request inline form. More...
 

Enumerations

enum  acorn_enum_generateFlags {
  acorn_enum_generateFlags_overwrite = 0 ,
  acorn_enum_generateFlags_exportPrivate = 1 ,
  acorn_enum_generateFlags__LIMIT = 2
}
 

Functions

int EXPORT acorn_init (void)
 Automatically called by dynamic library initialization.
 
void EXPORT acorn_cleanup (void)
 Automatically called by dynamic library cleanup.
 
void EXPORT acorn_errstream (FILE *out)
 
int EXPORT acorn_command_getVersion (const struct acorn_request_getVersion *request, struct acorn_response_getVersion *response, char **errstring)
 Returns information about the host software. More...
 
int EXPORT acorn_cmd_getVersion (struct acorn_response_getVersion *response, char **errstring)
 Returns information about the host software. More...
 
int EXPORT acorn_command_list (const struct acorn_request_list *request, struct acorn_response_list *response, char **errstring)
 Returns a list of available key aliases with algorithm names. More...
 
int EXPORT acorn_cmd_list (struct acorn_response_list *response, char **errstring)
 Returns a list of available key aliases with algorithm names. More...
 
int EXPORT acorn_command_getPublic (const struct acorn_request_getPublic *request, struct acorn_response_getPublic *response, char **errstring)
 Returns the public key associated with a given alias. More...
 
int EXPORT acorn_cmd_getPublic (const char *alias, struct acorn_response_getPublic *response, char **errstring)
 Returns the public key associated with a given alias. More...
 
int EXPORT acorn_command_getPublicHash (const struct acorn_request_getPublicHash *request, struct acorn_response_getPublicHash *response, char **errstring)
 Returns a hash value for a given public key. More...
 
int EXPORT acorn_cmd_getPublicHash (const struct acorn_buffer publicKey, struct acorn_response_getPublicHash *response, char **errstring)
 Returns a hash value for a given public key. More...
 
int EXPORT acorn_command_getKeyInfo (const struct acorn_request_getKeyInfo *request, struct acorn_response_getKeyInfo *response, char **errstring)
 Returns the hash, algorithm and public key associated with a given alias. More...
 
int EXPORT acorn_cmd_getKeyInfo (const char *alias, struct acorn_response_getKeyInfo *response, char **errstring)
 Returns the hash, algorithm and public key associated with a given alias. More...
 
int EXPORT acorn_command_generate (const struct acorn_request_generate *request, struct acorn_response_generate *response, char **errstring)
 Generates a key pair and saves it under the specified alias. More...
 
int EXPORT acorn_cmd_generate (const char *alias, const char *algorithm, const char *token, unsigned flags, struct acorn_response_generate *response, char **errstring)
 Generates a key pair and saves it under the specified alias. More...
 
int EXPORT acorn_command_importKeypair (const struct acorn_request_importKeypair *request, struct acorn_response_importKeypair *response, char **errstring)
 Imports a signature key pair and saves it under the specified alias. More...
 
int EXPORT acorn_cmd_importKeypair (const char *alias, const char *algorithm, const struct acorn_buffer publicKey, const struct acorn_buffer privateKey, const char *token, unsigned overwrite, struct acorn_response_importKeypair *response, char **errstring)
 Imports a signature key pair and saves it under the specified alias. More...
 
int EXPORT acorn_command_sign (const struct acorn_request_sign *request, struct acorn_response_sign *response, char **errstring)
 Creates a digital signature of the specified message. More...
 
int EXPORT acorn_cmd_sign (const char *alias, const char *keyhash, const struct acorn_buffer message, struct acorn_response_sign *response, char **errstring)
 Creates a digital signature of the specified message. More...
 
int EXPORT acorn_command_verify (const struct acorn_request_verify *request, struct acorn_response_verify *response, char **errstring)
 Determines whether a given signature is valid for a message and key pair. More...
 
int EXPORT acorn_cmd_verify (const char *alias, const char *keyhash, const struct acorn_buffer message, const struct acorn_buffer signature, struct acorn_response_verify *response, char **errstring)
 Determines whether a given signature is valid for a message and key pair. More...
 
int EXPORT acorn_command_signImmediate (const struct acorn_request_signImmediate *request, struct acorn_response_signImmediate *response, char **errstring)
 Creates a digital signature of the specified message. More...
 
int EXPORT acorn_cmd_signImmediate (const struct acorn_buffer privateBlob, const char *token, const struct acorn_buffer message, struct acorn_response_signImmediate *response, char **errstring)
 Creates a digital signature of the specified message. More...
 
int EXPORT acorn_command_verifyImmediate (const struct acorn_request_verifyImmediate *request, struct acorn_response_verifyImmediate *response, char **errstring)
 Determines whether a given signature is valid for a message and public key. More...
 
int EXPORT acorn_cmd_verifyImmediate (const struct acorn_buffer publicKey, const char *algorithm, const struct acorn_buffer message, const struct acorn_buffer signature, struct acorn_response_verifyImmediate *response, char **errstring)
 Determines whether a given signature is valid for a message and public key. More...
 
int EXPORT acorn_command_see_getVersion (const struct acorn_request_see_getVersion *request, struct acorn_response_see_getVersion *response, char **errstring)
 
int EXPORT acorn_cmd_see_getVersion (struct acorn_response_see_getVersion *response, char **errstring)
 

Detailed Description

acorn.h: dynamic library interface for acorn.

Copyright 2015-2024 Entrust, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Generated by interface.js – DO NOT EDIT

Definition in file acorn.h.


Data Structure Documentation

◆ acorn_buffer

struct acorn_buffer

A byte array with length included.

Definition at line 51 of file acorn.h.

Data Fields
unsigned len Number of bytes referenced by ptr.
unsigned char * ptr Pointer to an array of bytes.

◆ acorn_object_keyEntry

struct acorn_object_keyEntry

Describes a key pair.

Definition at line 66 of file acorn.h.

Data Fields
char * algorithm Cryptographic algorithm with which this key pair can be used.

For example, this might be dilitium2

char * alias User defined name for key pair.

◆ acorn_request_getVersion

struct acorn_request_getVersion

Input parameters for acorn_command_getVersion.

See also
acorn_command_getVersion
acorn_response_getVersion

Definition at line 80 of file acorn.h.

Data Fields
int unused Some C compilers reject empty structs.

◆ acorn_response_getVersion

struct acorn_response_getVersion

Output parameters for acorn_command_getVersion.

See also
acorn_command_getVersion
acorn_request_getVersion

Definition at line 89 of file acorn.h.

Data Fields
char * version Semantic version number for host software.

For example, "0.1.2" All versions with the same initial number should be compatible at runtime.

◆ acorn_request_list

struct acorn_request_list

Input parameters for acorn_command_list.

See also
acorn_command_list
acorn_response_list

Definition at line 148 of file acorn.h.

Data Fields
int unused Some C compilers reject empty structs.

◆ acorn_response_list

struct acorn_response_list

Output parameters for acorn_command_list.

See also
acorn_command_list
acorn_request_list

Definition at line 157 of file acorn.h.

Data Fields
struct acorn_object_keyEntry * entries Description of each key saved in the system.
unsigned n_entries Number of entries in entries.

◆ acorn_request_getPublic

struct acorn_request_getPublic

Input parameters for acorn_command_getPublic.

See also
acorn_command_getPublic
acorn_response_getPublic

Definition at line 216 of file acorn.h.

Data Fields
char * alias Specifies which saved key pair for which to fetch the public component.

◆ acorn_response_getPublic

struct acorn_response_getPublic

Output parameters for acorn_command_getPublic.

See also
acorn_command_getPublic
acorn_request_getPublic

Definition at line 227 of file acorn.h.

Data Fields
struct acorn_buffer publicKey Public key material.

◆ acorn_request_getPublicHash

struct acorn_request_getPublicHash

Input parameters for acorn_command_getPublicHash.

See also
acorn_command_getPublicHash
acorn_response_getPublicHash

Definition at line 288 of file acorn.h.

Data Fields
struct acorn_buffer publicKey Public key material.

◆ acorn_response_getPublicHash

struct acorn_response_getPublicHash

Output parameters for acorn_command_getPublicHash.

See also
acorn_command_getPublicHash
acorn_request_getPublicHash

Definition at line 298 of file acorn.h.

Data Fields
char * hash Uniquely idenfies a public key.

◆ acorn_request_getKeyInfo

struct acorn_request_getKeyInfo

Input parameters for acorn_command_getKeyInfo.

See also
acorn_command_getKeyInfo
acorn_response_getKeyInfo

Definition at line 358 of file acorn.h.

Data Fields
char * alias Specifies which key pair to describe.

◆ acorn_response_getKeyInfo

struct acorn_response_getKeyInfo

Output parameters for acorn_command_getKeyInfo.

See also
acorn_command_getKeyInfo
acorn_request_getKeyInfo

Definition at line 368 of file acorn.h.

Data Fields
char * algorithm Cryptographic algorithm with which this key pair can be used.
char * hash Uniquely idenfies a public key.
struct acorn_buffer privateBlob Opaque and encrypted private key.
struct acorn_buffer publicKey Public key material.

◆ acorn_request_generate

struct acorn_request_generate

Input parameters for acorn_command_generate.

See also
acorn_command_generate
acorn_response_generate

Definition at line 439 of file acorn.h.

Data Fields
char * algorithm Cryptographic algorithm to use.
char * alias Name for new key pair (optional)
unsigned flags Set bit one to overwrite existing alias key pair if one exists.

Set bit two to provide private key without encryption in the response privateKey field (DANGEROUS). Setting this undermines the ability of the HSM to protect the key material, though the key still benefits from hardware random number generation.

char * token Specifies the operator card set or softoken to use.

Use the preload command to avoid console prompts

◆ acorn_response_generate

struct acorn_response_generate

Output parameters for acorn_command_generate.

See also
acorn_command_generate
acorn_request_generate

Definition at line 466 of file acorn.h.

Data Fields
char * alias Name of new key pair.
char * hash Unique identifier for key pair.
struct acorn_buffer privateBlob Opaque representation of encrypted private key material.
struct acorn_buffer privateKey Exposed private key material (present only when exportPrivate flag is set).

◆ acorn_request_importKeypair

struct acorn_request_importKeypair

Input parameters for acorn_command_importKeypair.

See also
acorn_command_importKeypair
acorn_response_importKeypair

Definition at line 556 of file acorn.h.

Data Fields
char * algorithm Cryptographic algorithm to use.
char * alias Name for new key pair (optional)
unsigned overwrite Delete existing alias key pair if one exists.
struct acorn_buffer privateKey Private portion of key pair.
struct acorn_buffer publicKey Public portion of key pair.
char * token Specifies the operator card set or softoken to use.

Use the preload command to avoid console prompts

◆ acorn_response_importKeypair

struct acorn_response_importKeypair

Output parameters for acorn_command_importKeypair.

See also
acorn_command_importKeypair
acorn_request_importKeypair

Definition at line 582 of file acorn.h.

Data Fields
char * alias Name of new key pair.
char * hash Unique identifier for key pair.
struct acorn_buffer privateBlob Opaque representation of encrypted private key material.

◆ acorn_request_sign

struct acorn_request_sign

Input parameters for acorn_command_sign.

See also
acorn_command_sign
acorn_response_sign

Definition at line 668 of file acorn.h.

Data Fields
char * alias Specifies key pair to sign with.
char * keyhash Ignored unless alias is missing.
struct acorn_buffer message Data to be signed.

◆ acorn_response_sign

struct acorn_response_sign

Output parameters for acorn_command_sign.

See also
acorn_command_sign
acorn_request_sign

Definition at line 684 of file acorn.h.

Data Fields
struct acorn_buffer signature Cryptographic signature of message.

◆ acorn_request_verify

struct acorn_request_verify

Input parameters for acorn_command_verify.

See also
acorn_command_verify
acorn_response_verify

Definition at line 752 of file acorn.h.

Data Fields
char * alias Specifies key pair used for signature.
char * keyhash Ignored unless alias is missing.
struct acorn_buffer message Data that has been signed.
struct acorn_buffer signature Cryptographic signature of message.

◆ acorn_response_verify

struct acorn_response_verify

Output parameters for acorn_command_verify.

See also
acorn_command_verify
acorn_request_verify

Definition at line 771 of file acorn.h.

Data Fields
unsigned verified True if and only if signature is cryptographically valid for given message.

◆ acorn_request_signImmediate

struct acorn_request_signImmediate

Input parameters for acorn_command_signImmediate.

See also
acorn_command_signImmediate
acorn_response_signImmediate

Definition at line 843 of file acorn.h.

Data Fields
struct acorn_buffer message Data to be signed.
struct acorn_buffer privateBlob Opaque representation of encrypted private key material.
char * token Specifies the operator card set or softoken to use.

Use the preload command to avoid console prompts

◆ acorn_response_signImmediate

struct acorn_response_signImmediate

Output parameters for acorn_command_signImmediate.

See also
acorn_command_signImmediate
acorn_request_signImmediate

Definition at line 860 of file acorn.h.

Data Fields
struct acorn_buffer signature Cryptographic signature of message.

◆ acorn_request_verifyImmediate

struct acorn_request_verifyImmediate

Input parameters for acorn_command_verifyImmediate.

See also
acorn_command_verifyImmediate
acorn_response_verifyImmediate

Definition at line 930 of file acorn.h.

Data Fields
char * algorithm Cryptographic algorithm used to sign.
struct acorn_buffer message Data that has been signed.
struct acorn_buffer publicKey Public key of pair used to sign.
struct acorn_buffer signature Cryptographic signature of message.

◆ acorn_response_verifyImmediate

struct acorn_response_verifyImmediate

Output parameters for acorn_command_verifyImmediate.

See also
acorn_command_verifyImmediate
acorn_request_verifyImmediate

Definition at line 949 of file acorn.h.

Data Fields
unsigned verified True if and only if signature is cryptographically valid for given message.

◆ acorn_request_see_getVersion

struct acorn_request_see_getVersion

Input parameters for acorn_command_see_getVersion.

See also
acorn_command_see_getVersion
acorn_response_see_getVersion

Definition at line 1021 of file acorn.h.

Data Fields
int unused Some C compilers reject empty structs.

◆ acorn_response_see_getVersion

struct acorn_response_see_getVersion

Output parameters for acorn_command_see_getVersion.

See also
acorn_command_see_getVersion
acorn_request_see_getVersion

Definition at line 1030 of file acorn.h.

Data Fields
char * version Sementic version number of SEE machine.

◆ acorn_commandlist

struct acorn_commandlist

Definition at line 1068 of file acorn.h.

Data Fields
acorn_commandfn_generate generate
acorn_commandfn_getKeyInfo getKeyInfo
acorn_commandfn_getPublic getPublic
acorn_commandfn_getPublicHash getPublicHash
acorn_commandfn_getVersion getVersion
acorn_commandfn_importKeypair importKeypair
acorn_commandfn_list list
acorn_commandfn_see_getVersion see_getVersion
acorn_commandfn_sign sign
acorn_commandfn_signImmediate signImmediate
acorn_commandfn_verify verify
acorn_commandfn_verifyImmediate verifyImmediate

◆ acorn_cmdlist

struct acorn_cmdlist

Definition at line 1083 of file acorn.h.

Data Fields
acorn_cmdfn_generate generate
acorn_cmdfn_getKeyInfo getKeyInfo
acorn_cmdfn_getPublic getPublic
acorn_cmdfn_getPublicHash getPublicHash
acorn_cmdfn_getVersion getVersion
acorn_cmdfn_importKeypair importKeypair
acorn_cmdfn_list list
acorn_commandfn_see_getVersion see_getVersion
acorn_cmdfn_sign sign
acorn_cmdfn_signImmediate signImmediate
acorn_cmdfn_verify verify
acorn_cmdfn_verifyImmediate verifyImmediate

Typedef Documentation

◆ acorn_free_generate

typedef void EXPORT acorn_free_generate(struct acorn_request_generate *request, struct acorn_response_generate *response)

Reclaim resources used by corresponding command.

See also
acorn_command_generate
Parameters
request(Optional) request data to free
response(Optional) response data to free

Definition at line 548 of file acorn.h.

◆ acorn_free_getKeyInfo

typedef void EXPORT acorn_free_getKeyInfo(struct acorn_request_getKeyInfo *request, struct acorn_response_getKeyInfo *response)

Reclaim resources used by corresponding command.

See also
acorn_command_getKeyInfo
Parameters
request(Optional) request data to free
response(Optional) response data to free

Definition at line 431 of file acorn.h.

◆ acorn_free_getPublic

typedef void EXPORT acorn_free_getPublic(struct acorn_request_getPublic *request, struct acorn_response_getPublic *response)

Reclaim resources used by corresponding command.

See also
acorn_command_getPublic
Parameters
request(Optional) request data to free
response(Optional) response data to free

Definition at line 280 of file acorn.h.

◆ acorn_free_getPublicHash

typedef void EXPORT acorn_free_getPublicHash(struct acorn_request_getPublicHash *request, struct acorn_response_getPublicHash *response)

Reclaim resources used by corresponding command.

See also
acorn_command_getPublicHash
Parameters
request(Optional) request data to free
response(Optional) response data to free

Definition at line 350 of file acorn.h.

◆ acorn_free_getVersion

typedef void EXPORT acorn_free_getVersion(struct acorn_request_getVersion *request, struct acorn_response_getVersion *response)

Reclaim resources used by corresponding command.

See also
acorn_command_getVersion
Parameters
request(Optional) request data to free
response(Optional) response data to free

Definition at line 140 of file acorn.h.

◆ acorn_free_importKeypair

typedef void EXPORT acorn_free_importKeypair(struct acorn_request_importKeypair *request, struct acorn_response_importKeypair *response)

Reclaim resources used by corresponding command.

See also
acorn_command_importKeypair
Parameters
request(Optional) request data to free
response(Optional) response data to free

Definition at line 660 of file acorn.h.

◆ acorn_free_list

typedef void EXPORT acorn_free_list(struct acorn_request_list *request, struct acorn_response_list *response)

Reclaim resources used by corresponding command.

See also
acorn_command_list
Parameters
request(Optional) request data to free
response(Optional) response data to free

Definition at line 208 of file acorn.h.

◆ acorn_free_see_getVersion

typedef void EXPORT acorn_free_see_getVersion(struct acorn_request_see_getVersion *request, struct acorn_response_see_getVersion *response)

Reclaim resources used by corresponding command.

See also
acorn_command_see_getVersion
Parameters
request(Optional) request data to free
response(Optional) response data to free

Definition at line 1064 of file acorn.h.

◆ acorn_free_sign

typedef void EXPORT acorn_free_sign(struct acorn_request_sign *request, struct acorn_response_sign *response)

Reclaim resources used by corresponding command.

See also
acorn_command_sign
Parameters
request(Optional) request data to free
response(Optional) response data to free

Definition at line 744 of file acorn.h.

◆ acorn_free_signImmediate

typedef void EXPORT acorn_free_signImmediate(struct acorn_request_signImmediate *request, struct acorn_response_signImmediate *response)

Reclaim resources used by corresponding command.

See also
acorn_command_signImmediate
Parameters
request(Optional) request data to free
response(Optional) response data to free

Definition at line 922 of file acorn.h.

◆ acorn_free_verify

typedef void EXPORT acorn_free_verify(struct acorn_request_verify *request, struct acorn_response_verify *response)

Reclaim resources used by corresponding command.

See also
acorn_command_verify
Parameters
request(Optional) request data to free
response(Optional) response data to free

Definition at line 835 of file acorn.h.

◆ acorn_free_verifyImmediate

typedef void EXPORT acorn_free_verifyImmediate(struct acorn_request_verifyImmediate *request, struct acorn_response_verifyImmediate *response)

Reclaim resources used by corresponding command.

See also
acorn_command_verifyImmediate
Parameters
request(Optional) request data to free
response(Optional) response data to free

Definition at line 1013 of file acorn.h.

◆ acorn_getcmdlist

typedef int EXPORT acorn_getcmdlist(struct acorn_cmdlist *list, char **errstring)

Populates a structure containing each command in request inline form.

Parameters
listfunction pointer list to be populated
Returns
EXIT_SUCCESS (0) or a non-zero failure code

Definition at line 1118 of file acorn.h.

◆ acorn_getcommandlist

typedef int EXPORT acorn_getcommandlist(struct acorn_commandlist *list, char **errstring)

Populates a structure containing each command in request structure form.

Parameters
listfunction pointer list to be populated
Returns
EXIT_SUCCESS (0) or a non-zero failure code

Definition at line 1106 of file acorn.h.

Function Documentation

◆ acorn_cmd_generate()

int EXPORT acorn_cmd_generate ( const char *  alias,
const char *  algorithm,
const char *  token,
unsigned  flags,
struct acorn_response_generate response,
char **  errstring 
)

Generates a key pair and saves it under the specified alias.

The key pair can be used for subsequent commands and will be saved between instances of the application.

Parameters
aliasName for new key pair (optional)
algorithmCryptographic algorithm to use
tokenSpecifies the operator card set or softoken to use. Use the preload command to avoid console prompts
flagsSet bit one to overwrite existing alias key pair if one exists.
flagsSet bit two to provide private key without encryption in the response privateKey field (DANGEROUS). Setting this undermines the ability of the HSM to protect the key material, though the key still benefits from hardware random number generation.
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_cmd_getKeyInfo()

int EXPORT acorn_cmd_getKeyInfo ( const char *  alias,
struct acorn_response_getKeyInfo response,
char **  errstring 
)

Returns the hash, algorithm and public key associated with a given alias.

Parameters
aliasSpecifies which key pair to describe
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_cmd_getPublic()

int EXPORT acorn_cmd_getPublic ( const char *  alias,
struct acorn_response_getPublic response,
char **  errstring 
)

Returns the public key associated with a given alias.

Parameters
aliasSpecifies which saved key pair for which to fetch the public component
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_cmd_getPublicHash()

int EXPORT acorn_cmd_getPublicHash ( const struct acorn_buffer  publicKey,
struct acorn_response_getPublicHash response,
char **  errstring 
)

Returns a hash value for a given public key.

Parameters
publicKeyPublic key material
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_cmd_getVersion()

int EXPORT acorn_cmd_getVersion ( struct acorn_response_getVersion response,
char **  errstring 
)

Returns information about the host software.

Parameters
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_cmd_importKeypair()

int EXPORT acorn_cmd_importKeypair ( const char *  alias,
const char *  algorithm,
const struct acorn_buffer  publicKey,
const struct acorn_buffer  privateKey,
const char *  token,
unsigned  overwrite,
struct acorn_response_importKeypair response,
char **  errstring 
)

Imports a signature key pair and saves it under the specified alias.

The key pair can be used for subsequent commands and will be saved between instances of the application.

Parameters
aliasName for new key pair (optional)
algorithmCryptographic algorithm to use
publicKeyPublic portion of key pair
privateKeyPrivate portion of key pair
tokenSpecifies the operator card set or softoken to use. Use the preload command to avoid console prompts
overwriteDelete existing alias key pair if one exists
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_cmd_list()

int EXPORT acorn_cmd_list ( struct acorn_response_list response,
char **  errstring 
)

Returns a list of available key aliases with algorithm names.

Parameters
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_cmd_sign()

int EXPORT acorn_cmd_sign ( const char *  alias,
const char *  keyhash,
const struct acorn_buffer  message,
struct acorn_response_sign response,
char **  errstring 
)

Creates a digital signature of the specified message.

The keyhash argument is ignored unless the alias is missing.

Parameters
aliasSpecifies key pair to sign with
keyhashIgnored unless alias is missing
messageData to be signed
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_cmd_signImmediate()

int EXPORT acorn_cmd_signImmediate ( const struct acorn_buffer  privateBlob,
const char *  token,
const struct acorn_buffer  message,
struct acorn_response_signImmediate response,
char **  errstring 
)

Creates a digital signature of the specified message.

The keyhash argument is ignored unless the alias is missing.

Parameters
privateBlobOpaque representation of encrypted private key material
tokenSpecifies the operator card set or softoken to use. Use the preload command to avoid console prompts
messageData to be signed
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_cmd_verify()

int EXPORT acorn_cmd_verify ( const char *  alias,
const char *  keyhash,
const struct acorn_buffer  message,
const struct acorn_buffer  signature,
struct acorn_response_verify response,
char **  errstring 
)

Determines whether a given signature is valid for a message and key pair.

The keyhash argument is ignored unless the alias is missing.

Parameters
aliasSpecifies key pair used for signature
keyhashIgnored unless alias is missing
messageData that has been signed
signatureCryptographic signature of message
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_cmd_verifyImmediate()

int EXPORT acorn_cmd_verifyImmediate ( const struct acorn_buffer  publicKey,
const char *  algorithm,
const struct acorn_buffer  message,
const struct acorn_buffer  signature,
struct acorn_response_verifyImmediate response,
char **  errstring 
)

Determines whether a given signature is valid for a message and public key.

Parameters
publicKeyPublic key of pair used to sign
algorithmCryptographic algorithm used to sign
messageData that has been signed
signatureCryptographic signature of message
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_command_generate()

int EXPORT acorn_command_generate ( const struct acorn_request_generate request,
struct acorn_response_generate response,
char **  errstring 
)

Generates a key pair and saves it under the specified alias.

The key pair can be used for subsequent commands and will be saved between instances of the application.

Parameters
requestinput data to process
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_command_getKeyInfo()

int EXPORT acorn_command_getKeyInfo ( const struct acorn_request_getKeyInfo request,
struct acorn_response_getKeyInfo response,
char **  errstring 
)

Returns the hash, algorithm and public key associated with a given alias.

Parameters
requestinput data to process
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_command_getPublic()

int EXPORT acorn_command_getPublic ( const struct acorn_request_getPublic request,
struct acorn_response_getPublic response,
char **  errstring 
)

Returns the public key associated with a given alias.

Parameters
requestinput data to process
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_command_getPublicHash()

int EXPORT acorn_command_getPublicHash ( const struct acorn_request_getPublicHash request,
struct acorn_response_getPublicHash response,
char **  errstring 
)

Returns a hash value for a given public key.

Parameters
requestinput data to process
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_command_getVersion()

int EXPORT acorn_command_getVersion ( const struct acorn_request_getVersion request,
struct acorn_response_getVersion response,
char **  errstring 
)

Returns information about the host software.

Parameters
requestinput data to process
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_command_importKeypair()

int EXPORT acorn_command_importKeypair ( const struct acorn_request_importKeypair request,
struct acorn_response_importKeypair response,
char **  errstring 
)

Imports a signature key pair and saves it under the specified alias.

The key pair can be used for subsequent commands and will be saved between instances of the application.

Parameters
requestinput data to process
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_command_list()

int EXPORT acorn_command_list ( const struct acorn_request_list request,
struct acorn_response_list response,
char **  errstring 
)

Returns a list of available key aliases with algorithm names.

Parameters
requestinput data to process
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_command_sign()

int EXPORT acorn_command_sign ( const struct acorn_request_sign request,
struct acorn_response_sign response,
char **  errstring 
)

Creates a digital signature of the specified message.

The keyhash argument is ignored unless the alias is missing.

Parameters
requestinput data to process
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_command_signImmediate()

int EXPORT acorn_command_signImmediate ( const struct acorn_request_signImmediate request,
struct acorn_response_signImmediate response,
char **  errstring 
)

Creates a digital signature of the specified message.

The keyhash argument is ignored unless the alias is missing.

Parameters
requestinput data to process
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_command_verify()

int EXPORT acorn_command_verify ( const struct acorn_request_verify request,
struct acorn_response_verify response,
char **  errstring 
)

Determines whether a given signature is valid for a message and key pair.

The keyhash argument is ignored unless the alias is missing.

Parameters
requestinput data to process
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code

◆ acorn_command_verifyImmediate()

int EXPORT acorn_command_verifyImmediate ( const struct acorn_request_verifyImmediate request,
struct acorn_response_verifyImmediate response,
char **  errstring 
)

Determines whether a given signature is valid for a message and public key.

Parameters
requestinput data to process
responseoutput data to populate
errstr(Optional) when not NULL, error message is allocated and assogned to this instead of being printed.
Returns
EXIT_SUCCESS (0) or a non-zero failure code