react-native-cross-pki
v0.4.3-beta02
Published
React Native module for handling X509 certificates and key pairs from native platform key stores.
Downloads
21
Readme
react-native-cross-pki
React Native module for handling X509 certificates and key pairs from native platform key stores.
Installation
npm install react-native-cross-pki
Usage
import { CrossPki, DigestAlgorithm } from 'react-native-cross-pki';
// ...
const toSignData = 'SGVsbG8sIFdvcmxkIQ==';
const toSignHash = '3/1gIbsr1bCvZ2KQgJ7DpTGR3YHH9wpLKGiKNiGCmG8=';
// list certificates with associated private key
let certificates = await CrossPki.listCertificatesWithKey();
// select a certificate
let cert = certificates[0];
// get select certificate content (X509 Certificate DER encoded bytes in Base64)
let content = cert.encoded;
// sign data with selected certificate
let signature = await CrossPki.signData(cert.thumbprint, DigestAlgorithm.sha256, toSignData);
// sign hash with selected certificate
let hashSignature = await CrossPki.signHash(cert.thumbprint, DigestAlgorithm.sha256, toSignHash);
License
PROPRIETARY COMMERCIAL LICENSE
This is proprietary software/module part of Lacuna Software PkiSuite. For licensing please visit https://lacunasoftware.com