Home Manual Reference Source

Function

Static Public Summary
public

decryptComment(comment$: string, envelope: string, privateKeyPEM: string): Promise<string>

public

decryptFileBlock(data$: *, privateKeyPEM: *): *

public

decryptImage(data$: string, privateKeyPEM: string): Promise<string>

public

decryptPrivateKey(privateKey$: *, password: *): *

public

encryptFileBlock(keyIV: *, block: *): *

public

encryptPrivateKey(privateKeyPEM: string, password: string): Promise<string>

Encrypts the user's raw private key with their password.

public

envelopeSeal(secret: string, publicKeyPEMs: Array<string>): Promise<string>

public

envelopeUnseal(envelope: string, privateKeyPEM: string): Promise<{key: string, iv: string}>

public

generateAuthorizationHeaders(method: *, path: *, session: *): *

public
public
public

Static Public

public decryptComment(comment$: string, envelope: string, privateKeyPEM: string): Promise<string> source

import decryptComment from '@pageproof/sdk/src/crypto/decryptComment.js'

Params:

NameTypeAttributeDescription
comment$ string

The encrypted comment

envelope string

The comment envelope

privateKeyPEM string

The user's private key (in PEM format)

Return:

Promise<string>

public decryptFileBlock(data$: *, privateKeyPEM: *): * source

import decryptFileBlock from '@pageproof/sdk/src/crypto/decryptFileBlock.js'

Params:

NameTypeAttributeDescription
data$ *
privateKeyPEM *

Return:

*

public decryptImage(data$: string, privateKeyPEM: string): Promise<string> source

Params:

NameTypeAttributeDescription
data$ string

The encrypted image data (containing the envelope and base64 encoded image)

privateKeyPEM string

The user's private key (in PEM format)

Return:

Promise<string>

public decryptPrivateKey(privateKey$: *, password: *): * source

import decryptPrivateKey from '@pageproof/sdk/src/crypto/decryptPrivateKey.js'

Params:

NameTypeAttributeDescription
privateKey$ *
password *

Return:

*

public encryptFileBlock(keyIV: *, block: *): * source

import encryptFileBlock from '@pageproof/sdk/src/crypto/encryptFileBlock.js'

Params:

NameTypeAttributeDescription
keyIV *
block *

Return:

*

public encryptPrivateKey(privateKeyPEM: string, password: string): Promise<string> source

import encryptPrivateKey from '@pageproof/sdk/src/crypto/encryptPrivateKey.js'

Encrypts the user's raw private key with their password.

Params:

NameTypeAttributeDescription
privateKeyPEM string
password string

Return:

Promise<string>

public envelopeSeal(secret: string, publicKeyPEMs: Array<string>): Promise<string> source

import {envelopeSeal} from '@pageproof/sdk/src/crypto/envelopes.js'

Params:

NameTypeAttributeDescription
secret string

The secret to seal

publicKeyPEMs Array<string>

The public key to seal the secret for

Return:

Promise<string>

public envelopeUnseal(envelope: string, privateKeyPEM: string): Promise<{key: string, iv: string}> source

import {envelopeUnseal} from '@pageproof/sdk/src/crypto/envelopes.js'

Params:

NameTypeAttributeDescription
envelope string

The envelope holding the secret

privateKeyPEM string

The private key used to unseal the secret

Return:

Promise<{key: string, iv: string}>

public generateAuthorizationHeaders(method: *, path: *, session: *): * source

import generateAuthorizationHeaders from '@pageproof/sdk/src/crypto/generateAuthorizationHeaders.js'

Params:

NameTypeAttributeDescription
method *
path *
session *

Return:

*

public generateKeyIV(): * source

import generateKeyIV from '@pageproof/sdk/src/crypto/generateKeyIV.js'

Return:

*

public generateKeyPair(): * source

import generateKeyPair from '@pageproof/sdk/src/crypto/generateKeyPair.js'

Return:

*

Promise<KeyPair>

public generatePasswordHash(password: string): Promise<string> source

import generatePasswordHash from '@pageproof/sdk/src/crypto/generatePasswordHash.js'

Params:

NameTypeAttributeDescription
password string

The password to hash

Return:

Promise<string>