Home  Contents

pki:key()

Cipher/PKI Core4 Lua Commands

SYNOPSIS

result = pki:key([radix])

DESCRIPTION

This function returns a table that contains the broken down components of a RSA key. Other key formats are not supported by this function.

Typically, the output of this function is of academical interest only.

The table contains the items N, E, D, P, Q, DP, DQ and QP.

The values are technically numbers, but are stored as strings because they would not fit into a Lua number. The optional parameter radix specifies the number base used for encoding. The default is 16 (hexadecimal).

Additionally, the table contains the information: keysize = Number of bits in the key, ciphersuite = "RSA", padding = Type of padding, hash = Type of hash.

RETURN VALUE

On success, returns a table.

In case of an error returns three values: nil, a string describing the error and a negative error code from the underlying mbed TLS implementation.

SEE ALSO