0.5.14-rc5 • Published 6 months ago

@antimatterhq/cryptoserver v0.5.14-rc5

Weekly downloads
-
License
-
Repository
-
Last release
6 months ago

The purpose of the client library is to provide a convenient way to encrypt and decrypt data using the cryptoserver encryption as a service.

Installation

To install the typescript library, run

npm install --save --ignore-scripts @antimatterhq/cryptoserver

Usage

First, you must configure the client with authentication information. You will need to provide your API key, the name of the role to assume, and the name of the circumstance under which to assume the role. Then you can use the client to encrypt and decrypt.

import * as cryptoserver from '@antimatterhq/cryptoserver';

const client = new cryptoserver.Client(
    cryptoserver.AuthConfig.APIKey(
        "role",
        "circumstance",
        "apiKey",
    ),
    "localhost:8080",
);

// Alternatively, this can be done using a connection string
client = new cryptoserver.Client(
    undefined,
    "localhost:8080?role=role&circumstance=circumstance&api-key=apiKey",
);

// Define the compartment for encryption
const compartment = new cryptoserver.Compartment(
    process.env.EXTERNAL_ID || "",
    "default", // product name
    "default", // service name
    cryptoserver.DataType.Object,
);

// Encrypt some data
const plaintext = Buffer.from("this is some plaintext");
const ciphertext = client.encrypt(compartment, plaintext);

// Decrypt the data
const decryptedPlaintext = client.decrypt(ciphertext);

console.log(decryptedPlaintext.toString());
0.5.14-rc5

6 months ago

0.5.9-rc2

9 months ago

0.5.9-rc3

9 months ago

0.5.9-rc1

9 months ago

0.5.13

7 months ago

0.5.13-rc4

7 months ago

0.5.13-rc3

7 months ago

0.5.13-rc2

7 months ago

0.5.13-rc1

7 months ago

0.5.6-rc7

9 months ago

0.5.6-rc3

9 months ago

0.5.6-rc4

9 months ago

0.5.6-rc5

9 months ago

0.5.6-rc6

9 months ago

0.5.14-rc1

7 months ago

0.5.14-rc3

7 months ago

0.5.6-rc1

9 months ago

0.5.14-rc2

7 months ago

0.5.6-rc2

9 months ago

0.5.12-rc3

7 months ago

0.5.14-rc4

7 months ago

0.5.12-rc2

7 months ago

0.5.12-rc4

7 months ago

0.5.8-rc1

9 months ago

0.5.8-rc2

9 months ago

0.5.12-rc1

7 months ago

0.5.8-rc3

9 months ago

0.5.8-rc4

9 months ago

0.5.8-rc5

9 months ago

0.5.4

11 months ago

0.5.11-rc2

8 months ago

0.5.11-rc1

8 months ago

0.5.11-rc6

8 months ago

0.5.11-rc5

8 months ago

0.5.7

9 months ago

0.5.11-rc4

8 months ago

0.5.11-rc3

8 months ago

0.5.9

8 months ago

0.5.10-rc1

8 months ago

0.5.10-rc3

8 months ago

0.5.10-rc2

8 months ago

0.5.10-rc5

8 months ago

0.5.10-rc4

8 months ago

0.5.10-rc7

8 months ago

0.5.10-rc6

8 months ago

0.5.11-rc7

7 months ago

0.5.5-rc1

10 months ago

0.5.3-rc3

11 months ago

0.5.3-rc2

11 months ago

0.4.3-rc1

11 months ago

0.4.2-rc3

11 months ago

0.4.2-rc2

11 months ago

0.4.0-r7

11 months ago

0.4.0-rock6

11 months ago

0.4.0-rock5

11 months ago

0.4.0-rock4

11 months ago

0.4.0-rock3

11 months ago

0.4.0-rock2

11 months ago

0.4.0-rock1

11 months ago

0.4.2-rc1

11 months ago

0.4.1-rc1

11 months ago

0.4.1

11 months ago

0.4.0-rc1

12 months ago

0.3.0-rc1

1 year ago

0.2.4-rc1

1 year ago

0.2.3-rc2

1 year ago

0.2.3-rc1

1 year ago

0.2.2

1 year ago

0.2.1-rc4

1 year ago

0.2.1-rc3

1 year ago

0.2.1-rc2

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago