Synopsis
#define FLUX_RSA_KEY (key)
#define FLUX_RSA_PUBLIC_KEY (key)
#define FLUX_RSA_SECRET_KEY (key)
struct FluxRSAKey;
struct FluxRSAPublicKey;
struct FluxRSASecretKey;
gboolean flux_rsa_generate_keypair (guint key_size,
FluxRSAPublicKey **public_key,
FluxRSASecretKey **secret_key);
FluxRSAKey* flux_rsa_dup_key (FluxRSAKey *key);
void flux_rsa_finalize_public_key (FluxRSAPublicKey *pkey);
void flux_rsa_finalize_secret_key (FluxRSASecretKey *skey);
FluxRSAPublicKey* flux_rsa_import_public_key
(const guchar *in,
guint in_len);
FluxRSASecretKey* flux_rsa_import_secret_key
(const guchar *in,
guint in_len);
void flux_rsa_export_public_key (FluxRSAPublicKey *public_key,
guchar **out,
guint *out_len);
void flux_rsa_export_secret_key (FluxRSASecretKey *secret_key,
guchar **out,
guint *out_len);
guint flux_rsa_get_key_length (FluxRSAKey *key);
guint flux_rsa_get_block_size (FluxRSAKey *key);
void flux_rsa_encrypt (FluxRSAPublicKey *pkey,
guchar **ciphertext,
guint *ciphertext_len,
const guchar *plaintext,
guint plaintext_len);
void flux_rsa_decrypt (FluxRSASecretKey *skey,
guchar **plaintext,
guint *plaintext_len,
const guchar *ciphertext,
guint ciphertext_len);
void flux_rsa_sign (FluxRSASecretKey *skey,
guchar **signature,
guint *signature_len,
const guchar *hash,
guint hash_len);
gboolean flux_rsa_verify (FluxRSAPublicKey *pkey,
const guchar *signature,
guint signature_len,
const guchar *hash,
guint hash_len);
Details
FLUX_RSA_KEY()
#define FLUX_RSA_KEY(key) ((FluxRSAKey *) key)
FLUX_RSA_PUBLIC_KEY()
#define FLUX_RSA_PUBLIC_KEY(key) ((FluxRSAPublicKey *) key)
FLUX_RSA_SECRET_KEY()
#define FLUX_RSA_SECRET_KEY(key) ((FluxRSASecretKey *) key)
struct FluxRSAKey
struct FluxRSAKey {
FluxObject object;
mpz_t n;
};
struct FluxRSAPublicKey
struct FluxRSAPublicKey {
FluxRSAKey key;
mpz_t e;
};
struct FluxRSASecretKey
struct FluxRSASecretKey {
FluxRSAKey key;
mpz_t d;
};
flux_rsa_generate_keypair ()
gboolean flux_rsa_generate_keypair (guint key_size,
FluxRSAPublicKey **public_key,
FluxRSASecretKey **secret_key);
key_size : |
|
public_key : |
|
secret_key : |
|
Returns : |
|
flux_rsa_finalize_public_key ()
void flux_rsa_finalize_public_key (FluxRSAPublicKey *pkey);
flux_rsa_finalize_secret_key ()
void flux_rsa_finalize_secret_key (FluxRSASecretKey *skey);
flux_rsa_import_public_key ()
FluxRSAPublicKey* flux_rsa_import_public_key
(const guchar *in,
guint in_len);
flux_rsa_import_secret_key ()
FluxRSASecretKey* flux_rsa_import_secret_key
(const guchar *in,
guint in_len);
flux_rsa_export_public_key ()
void flux_rsa_export_public_key (FluxRSAPublicKey *public_key,
guchar **out,
guint *out_len);
public_key : |
|
out : |
|
out_len : |
|
flux_rsa_export_secret_key ()
void flux_rsa_export_secret_key (FluxRSASecretKey *secret_key,
guchar **out,
guint *out_len);
secret_key : |
|
out : |
|
out_len : |
|
flux_rsa_get_key_length ()
guint flux_rsa_get_key_length (FluxRSAKey *key);
flux_rsa_get_block_size ()
guint flux_rsa_get_block_size (FluxRSAKey *key);
flux_rsa_encrypt ()
void flux_rsa_encrypt (FluxRSAPublicKey *pkey,
guchar **ciphertext,
guint *ciphertext_len,
const guchar *plaintext,
guint plaintext_len);
pkey : |
|
ciphertext : |
|
ciphertext_len : |
|
plaintext : |
|
plaintext_len : |
|
flux_rsa_decrypt ()
void flux_rsa_decrypt (FluxRSASecretKey *skey,
guchar **plaintext,
guint *plaintext_len,
const guchar *ciphertext,
guint ciphertext_len);
skey : |
|
plaintext : |
|
plaintext_len : |
|
ciphertext : |
|
ciphertext_len : |
|
flux_rsa_sign ()
void flux_rsa_sign (FluxRSASecretKey *skey,
guchar **signature,
guint *signature_len,
const guchar *hash,
guint hash_len);
skey : |
|
signature : |
|
signature_len : |
|
hash : |
|
hash_len : |
|
flux_rsa_verify ()
gboolean flux_rsa_verify (FluxRSAPublicKey *pkey,
const guchar *signature,
guint signature_len,
const guchar *hash,
guint hash_len);
pkey : |
|
signature : |
|
signature_len : |
|
hash : |
|
hash_len : |
|
Returns : |
|