Write OpenPGP packets
[Core API]


Functions

ops_boolean_t ops_write_compressed (const unsigned char *data, const unsigned int len, ops_create_info_t *cinfo)
 Writes Compressed packet.
void ops_writer_push_compressed (ops_create_info_t *cinfo)
 Pushes a compressed writer onto the stack.
ops_boolean_t ops_write_struct_user_id (ops_user_id_t *id, ops_create_info_t *info)
 Writes a User Id packet.
ops_boolean_t ops_write_user_id (const unsigned char *user_id, ops_create_info_t *info)
 Write a User Id packet.
ops_boolean_t ops_write_struct_public_key (const ops_public_key_t *key, ops_create_info_t *info)
 Writes a Public Key packet.
ops_boolean_t ops_write_rsa_public_key (time_t time, const BIGNUM *n, const BIGNUM *e, ops_create_info_t *info)
 Writes one RSA public key packet.
ops_boolean_t ops_write_struct_secret_key (const ops_secret_key_t *key, const unsigned char *passphrase, const size_t pplen, ops_create_info_t *info)
 Writes a Secret Key packet.
ops_boolean_t ops_write_pk_session_key (ops_create_info_t *info, ops_pk_session_key_t *pksk)
 Writes Public Key Session Key packet.
ops_boolean_t ops_write_mdc (const unsigned char *hashed, ops_create_info_t *info)
 Writes MDC packet.
ops_boolean_t ops_write_literal_data_from_buf (const unsigned char *data, const int maxlen, const ops_literal_data_type_t type, ops_create_info_t *info)
 Writes Literal Data packet from buffer.
ops_boolean_t ops_write_literal_data_from_file (const char *filename, const ops_literal_data_type_t type, ops_create_info_t *info)
 Writes Literal Data packet from contents of file.
ops_boolean_t ops_write_symmetrically_encrypted_data (const unsigned char *data, const int len, ops_create_info_t *info)
 Write Symmetrically Encrypted packet.
ops_boolean_t ops_write_one_pass_sig (const ops_secret_key_t *skey, const ops_hash_algorithm_t hash_alg, const ops_sig_type_t sig_type, ops_create_info_t *info)
 Write a One Pass Signature packet.
ops_boolean_t ops_writer_push_signed (ops_create_info_t *cinfo, const ops_sig_type_t sig_type, const ops_secret_key_t *skey)
 Pushes a signed writer onto the stack.
ops_boolean_t ops_write (const void *src, unsigned length, ops_create_info_t *info)
ops_boolean_t ops_write_scalar (unsigned n, unsigned length, ops_create_info_t *info)
ops_boolean_t ops_write_mpi (const BIGNUM *bn, ops_create_info_t *info)
ops_boolean_t ops_write_ptag (ops_content_tag_t tag, ops_create_info_t *info)
ops_boolean_t ops_write_length (unsigned length, ops_create_info_t *info)

Function Documentation

ops_boolean_t ops_write const void *  src,
unsigned  length,
ops_create_info_t info
 

Parameters:
src 
length 
info 
Returns:
1 if OK, otherwise 0

ops_boolean_t ops_write_compressed const unsigned char *  data,
const unsigned int  len,
ops_create_info_t cinfo
 

Writes Compressed packet.

Parameters:
data Data to write out
len Length of data
cinfo Write settings
Returns:
ops_true if OK; else ops_false

ops_boolean_t ops_write_length unsigned  length,
ops_create_info_t info
 

Parameters:
length 
info 
Returns:
1 if OK, otherwise 0

ops_boolean_t ops_write_literal_data_from_buf const unsigned char *  data,
const int  maxlen,
const ops_literal_data_type_t  type,
ops_create_info_t info
 

Writes Literal Data packet from buffer.

Parameters:
data Buffer to write out
maxlen Max length of buffer
type Literal Data Type
info Write settings
Returns:
ops_true if OK; else ops_false

ops_boolean_t ops_write_literal_data_from_file const char *  filename,
const ops_literal_data_type_t  type,
ops_create_info_t info
 

Writes Literal Data packet from contents of file.

Parameters:
filename Name of file to read from
type Literal Data Type
info Write settings
Returns:
ops_true if OK; else ops_false

ops_boolean_t ops_write_mdc const unsigned char *  hashed,
ops_create_info_t info
 

Writes MDC packet.

Parameters:
hashed Hash for MDC
info Write settings
Returns:
ops_true if OK; else ops_false

ops_boolean_t ops_write_mpi const BIGNUM *  bn,
ops_create_info_t info
 

Parameters:
bn 
info 
Returns:
1 if OK, otherwise 0

ops_boolean_t ops_write_one_pass_sig const ops_secret_key_t skey,
const ops_hash_algorithm_t  hash_alg,
const ops_sig_type_t  sig_type,
ops_create_info_t info
 

Write a One Pass Signature packet.

Parameters:
skey Secret Key to use
hash_alg Hash Algorithm to use
sig_type Signature type
info Write settings
Returns:
ops_true if OK; else ops_false

ops_boolean_t ops_write_pk_session_key ops_create_info_t info,
ops_pk_session_key_t pksk
 

Writes Public Key Session Key packet.

Parameters:
info Write settings
pksk Public Key Session Key to write out
Returns:
ops_true if OK; else ops_false

ops_boolean_t ops_write_ptag ops_content_tag_t  tag,
ops_create_info_t info
 

Parameters:
tag 
info 
Returns:
1 if OK, otherwise 0

ops_boolean_t ops_write_rsa_public_key time_t  time,
const BIGNUM *  n,
const BIGNUM *  e,
ops_create_info_t info
 

Writes one RSA public key packet.

Parameters:
time Creation time
n RSA public modulus
e RSA public encryption exponent
info Writer settings
Returns:
ops_true if OK, otherwise ops_false

ops_boolean_t ops_write_scalar unsigned  n,
unsigned  length,
ops_create_info_t info
 

Parameters:
n 
length 
info 
Returns:
ops_true if OK, otherwise ops_false

ops_boolean_t ops_write_struct_public_key const ops_public_key_t key,
ops_create_info_t info
 

Writes a Public Key packet.

Parameters:
key 
info 
Returns:
ops_true if OK, otherwise ops_false

ops_boolean_t ops_write_struct_secret_key const ops_secret_key_t key,
const unsigned char *  passphrase,
const size_t  pplen,
ops_create_info_t info
 

Writes a Secret Key packet.

Parameters:
key The secret key
passphrase The passphrase
pplen Length of passphrase
info 
Returns:
ops_true if OK; else ops_false

ops_boolean_t ops_write_struct_user_id ops_user_id_t id,
ops_create_info_t info
 

Writes a User Id packet.

Parameters:
id 
info 
Returns:
ops_true if OK, otherwise ops_false

ops_boolean_t ops_write_symmetrically_encrypted_data const unsigned char *  data,
const int  len,
ops_create_info_t info
 

Write Symmetrically Encrypted packet.

Parameters:
data Data to encrypt
len Length of data
info Write settings
Returns:
ops_true if OK; else ops_false
Note:
Hard-coded to use AES256

ops_boolean_t ops_write_user_id const unsigned char *  user_id,
ops_create_info_t info
 

Write a User Id packet.

Parameters:
user_id 
info 
Returns:
return value from ops_write_struct_user_id()

void ops_writer_push_compressed ops_create_info_t cinfo  ) 
 

Pushes a compressed writer onto the stack.

Data written will be encoded as a compressed packet.

Parameters:
cinfo Write settings

ops_boolean_t ops_writer_push_signed ops_create_info_t cinfo,
const ops_sig_type_t  sig_type,
const ops_secret_key_t skey
 

Pushes a signed writer onto the stack.

Data written will be encoded as a onepass signature packet, followed by a literal packet, followed by a signature packet. Once this writer has been added to the stack, cleartext can be written straight to the output, and it will be encoded as a literal packet and signed.

Parameters:
cinfo Write settings
sig_type the type of input to be signed (text or binary)
skey the key used to sign the stream.
Returns:
false if the initial onepass packet could not be created.


Generated on Fri May 24 00:00:03 2013 for OpenPGP:SDK by  doxygen 1.4.6