GNUnet 0.25.2-11-g84e94e98c
 
Loading...
Searching...
No Matches
crypto_pkey.c File Reference

api to interact handle generic public keys More...

#include "platform.h"
#include "gnunet_util_lib.h"
Include dependency graph for crypto_pkey.c:

Go to the source code of this file.

Functions

static enum GNUNET_GenericReturnValue check_key_type (uint32_t type)
 
void GNUNET_CRYPTO_private_key_clear (struct GNUNET_CRYPTO_BlindablePrivateKey *key)
 Clear memory that was used to store a private key.
 
ssize_t GNUNET_CRYPTO_blindable_sk_get_length (const struct GNUNET_CRYPTO_BlindablePrivateKey *key)
 Get the compacted length of a GNUNET_CRYPTO_BlindablePrivateKey.
 
ssize_t GNUNET_CRYPTO_public_key_get_length (const struct GNUNET_CRYPTO_BlindablePublicKey *key)
 Get the compacted length of a GNUNET_CRYPTO_BlindablePublicKey.
 
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_read_public_key_from_buffer (const void *buffer, size_t len, struct GNUNET_CRYPTO_BlindablePublicKey *key, size_t *kb_read)
 Reads a GNUNET_CRYPTO_BlindablePublicKey from a compact buffer.
 
ssize_t GNUNET_CRYPTO_write_blindable_pk_to_buffer (const struct GNUNET_CRYPTO_BlindablePublicKey *key, void *buffer, size_t len)
 Writes a GNUNET_CRYPTO_BlindablePublicKey to a compact buffer.
 
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_read_private_key_from_buffer (const void *buffer, size_t len, struct GNUNET_CRYPTO_BlindablePrivateKey *key, size_t *kb_read)
 Reads a GNUNET_CRYPTO_BlindablePrivateKey from a compact buffer.
 
ssize_t GNUNET_CRYPTO_write_blindable_sk_to_buffer (const struct GNUNET_CRYPTO_BlindablePrivateKey *key, void *buffer, size_t len)
 Writes a GNUNET_CRYPTO_BlindablePrivateKey to a compact buffer.
 
ssize_t GNUNET_CRYPTO_blinded_key_signature_get_length (const struct GNUNET_CRYPTO_BlindableKeySignature *sig)
 Get the compacted length of a #GNUNET_CRYPTO_Signature.
 
ssize_t GNUNET_CRYPTO_blinded_key_signature_get_length_by_type (uint32_t type)
 Get the compacted length of a signature by type.
 
ssize_t GNUNET_CRYPTO_read_blinded_key_signature_from_buffer (struct GNUNET_CRYPTO_BlindableKeySignature *sig, const void *buffer, size_t len)
 Reads a GNUNET_CRYPTO_BlindableKeySignature from a compact buffer.
 
ssize_t GNUNET_CRYPTO_write_blinded_key_signature_to_buffer (const struct GNUNET_CRYPTO_BlindableKeySignature *sig, void *buffer, size_t len)
 Writes a GNUNET_CRYPTO_BlindableKeySignature to a compact buffer.
 
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blinded_key_sign_raw_ (const struct GNUNET_CRYPTO_BlindablePrivateKey *priv, const struct GNUNET_CRYPTO_SignaturePurpose *purpose, unsigned char *sig)
 Sign a given block.
 
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blinded_key_sign_ (const struct GNUNET_CRYPTO_BlindablePrivateKey *priv, const struct GNUNET_CRYPTO_SignaturePurpose *purpose, struct GNUNET_CRYPTO_BlindableKeySignature *sig)
 Sign a given block.
 
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blinded_key_signature_verify_ (uint32_t purpose, const struct GNUNET_CRYPTO_SignaturePurpose *validate, const struct GNUNET_CRYPTO_BlindableKeySignature *sig, const struct GNUNET_CRYPTO_BlindablePublicKey *pub)
 Verify a given signature.
 
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blinded_key_signature_verify_raw_ (uint32_t purpose, const struct GNUNET_CRYPTO_SignaturePurpose *validate, const unsigned char *sig, const struct GNUNET_CRYPTO_BlindablePublicKey *pub)
 Verify a given signature.
 
char * GNUNET_CRYPTO_blindable_public_key_to_string (const struct GNUNET_CRYPTO_BlindablePublicKey *key)
 Creates a (Base32) string representation of the public key.
 
char * GNUNET_CRYPTO_blindable_private_key_to_string (const struct GNUNET_CRYPTO_BlindablePrivateKey *key)
 Creates a (Base32) string representation of the private key.
 
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blindable_public_key_from_string (const char *str, struct GNUNET_CRYPTO_BlindablePublicKey *key)
 Parses a (Base32) string representation of the public key.
 
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blindable_private_key_from_string (const char *str, struct GNUNET_CRYPTO_BlindablePrivateKey *key)
 Parses a (Base32) string representation of the private key.
 
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blindable_key_get_public (const struct GNUNET_CRYPTO_BlindablePrivateKey *privkey, struct GNUNET_CRYPTO_BlindablePublicKey *key)
 Retrieves the public key representation of a private key.
 

Detailed Description

api to interact handle generic public keys

Author
Martin Schanzenbach

Definition in file crypto_pkey.c.

Function Documentation

◆ check_key_type()

static enum GNUNET_GenericReturnValue check_key_type ( uint32_t  type)
static

Definition at line 32 of file crypto_pkey.c.

33{
34 switch (type)
35 {
38 return GNUNET_OK;
39 default:
40 return GNUNET_SYSERR;
41 }
42 return GNUNET_SYSERR;
43}
static uint32_t type
Type string converted to DNS type value.
@ GNUNET_PUBLIC_KEY_TYPE_EDDSA
EDDSA identity.
@ GNUNET_PUBLIC_KEY_TYPE_ECDSA
The identity type.
@ GNUNET_OK
@ GNUNET_SYSERR

References GNUNET_OK, GNUNET_PUBLIC_KEY_TYPE_ECDSA, GNUNET_PUBLIC_KEY_TYPE_EDDSA, GNUNET_SYSERR, and type.

Referenced by GNUNET_CRYPTO_blindable_private_key_from_string(), and GNUNET_CRYPTO_blindable_public_key_from_string().

Here is the caller graph for this function: