Global

Methods

openpgp_crypto_asymetricDecrypt(algo, publicMPIs, secretMPIs, data) → {BigInteger}

Decrypts data using the specified public key multiprecision integers of the private key, the specified secretMPIs of the private key and the specified algorithm.
Parameters:
Name Type Description
algo Integer Algorithm to be used (See RFC4880 9.1)
publicMPIs openpgp_type_mpi[] Algorithm dependent multiprecision integers of the public key part of the private key
secretMPIs openpgp_type_mpi[] Algorithm dependent multiprecision integers of the private key used
data openpgp_type_mpi Data to be encrypted as MPI
Source:
Returns:
returns a big integer containing the decrypted data; otherwise null
Type
BigInteger

openpgp_crypto_asymetricEncrypt(algo, publicMPIs, data) → {openpgp_type_mpi|Array.<openpgp_type_mpi>}

Encrypts data using the specified public key multiprecision integers and the specified algorithm.
Parameters:
Name Type Description
algo Integer Algorithm to be used (See RFC4880 9.1)
publicMPIs openpgp_type_mpi[] Algorithm dependent multiprecision integers
data openpgp_type_mpi Data to be encrypted as MPI
Source:
Returns:
if RSA an openpgp_type_mpi; if elgamal encryption an array of two openpgp_type_mpi is returned; otherwise null
Type
openpgp_type_mpi | Array.<openpgp_type_mpi>

openpgp_crypto_generateKeyPair(keyType, numBits) → {openpgp_keypair}

Calls the necessary crypto functions to generate a keypair. Called directly by openpgp.js
Parameters:
Name Type Description
keyType Integer Follows OpenPGP algorithm convention.
numBits Integer Number of bits to make the key to be generated
Source:
Returns:
Type
openpgp_keypair

openpgp_crypto_generateSessionKey(algo) → {String}

Generating a session key for the specified symmetric algorithm
Parameters:
Name Type Description
algo Integer Algorithm to use (see RFC4880 9.2)
Source:
Returns:
Random bytes as a string to be used as a key
Type
String

openpgp_crypto_getHashByteLength(algo) → {Integer}

Returns the hash size in bytes of the specified hash algorithm type
Parameters:
Name Type Description
algo Integer Hash algorithm type (See RFC4880 9.4)
Source:
Returns:
Size in bytes of the resulting hash
Type
Integer

openpgp_crypto_getPrefixRandom(algo) → {String}

generate random byte prefix as string for the specified algorithm
Parameters:
Name Type Description
algo Integer Algorithm to use (see RFC4880 9.2)
Source:
Returns:
Random bytes with length equal to the block size of the cipher
Type
String

openpgp_crypto_getPseudoRandom(from, to) → {Integer}

Return a pseudo-random number in the specified range
Parameters:
Name Type Description
from Integer Min of the random number
to Integer Max of the random number (max 32bit)
Source:
Returns:
A pseudo random number
Type
Integer

openpgp_crypto_getRandomBigInteger(bits) → {BigInteger}

Create a secure random big integer of bits length
Parameters:
Name Type Description
bits Integer Bit length of the MPI to create
Source:
Returns:
Resulting big integer
Type
BigInteger

openpgp_crypto_getRandomBytes(length) → {String}

Retrieve secure random byte string of the specified length
Parameters:
Name Type Description
length Integer Length in bytes to generate
Source:
Returns:
Random byte string
Type
String

openpgp_crypto_getSecureRandom(from, to) → {Integer}

Return a secure random number in the specified range
Parameters:
Name Type Description
from Integer Min of the random number
to Integer Max of the random number (max 32bit)
Source:
Returns:
A secure random number
Type
Integer

openpgp_crypto_hashData(algo, data) → {String}

Create a hash on the specified data using the specified algorithm
Parameters:
Name Type Description
algo Integer Hash algorithm type (see RFC4880 9.4)
data String Data to be hashed
Source:
Returns:
hash value
Type
String

openpgp_crypto_MDCSystemBytes(algo, key, data) → {String}

retrieve the MDC prefixed bytes by decrypting them
Parameters:
Name Type Description
algo Integer Algorithm to use (see RFC4880 9.2)
key String Key as string. length is depending on the algorithm used
data String Encrypted data where the prefix is decrypted from
Source:
Returns:
Plain text data of the prefixed data
Type
String

openpgp_crypto_signData(hash_algo, algo, publicMPIs, secretMPIs, data) → {String|openpgp_type_mpi}

Create a signature on data using the specified algorithm
Parameters:
Name Type Description
hash_algo Integer hash Algorithm to use (See RFC4880 9.4)
algo Integer Asymmetric cipher algorithm to use (See RFC4880 9.1)
publicMPIs openpgp_type_mpi[] Public key multiprecision integers of the private key
secretMPIs openpgp_type_mpi[] Private key multiprecision integers which is used to sign the data
data String Data to be signed
Source:
Returns:
Type
String | openpgp_type_mpi

openpgp_crypto_verifySignature(algo, hash_algo, msg_MPIs, publickey_MPIs, data) → {Boolean}

Parameters:
Name Type Description
algo Integer public Key algorithm
hash_algo Integer Hash algorithm
msg_MPIs openpgp_type_mpi[] Signature multiprecision integers
publickey_MPIs openpgp_type_mpi[] Public key multiprecision integers
data String Data on where the signature was computed on.
Source:
Returns:
true if signature (sig_data was equal to data over hash)
Type
Boolean

Type Definitions

openpgp_keypair

Properties:
Name Type Description
privateKey openpgp_packet_keymaterial
publicKey openpgp_packet_keymaterial
Source: