Skip to content

omggga/crypto_pro_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crypto_pro_api

CryptoPro Plugin Api

A JavaScript library that provides an asynchronous interface for interacting with the CryptoPro plugin.

API

about()

  • Returns information about the plugin.

version()

  • Retrieves and logs the version details of the plugin.

getCertificateList()

  • Fetches a list of available certificates. It also filters out certificates that are not currently valid or don't have a private key.

signHash(thumbprint, hash, signOption, isBase64)

  • Signs a hash using a specified certificate thumbprint.

signBase64(thumbprint, base64, type)

  • Signs a Base64 encoded string using a specified certificate thumbprint.

signString(thumbprint, base64)

  • Signs a string using a specified certificate thumbprint.

verify(base64data, sign)

  • Verifies the signature of a Base64 encoded data.

verifyHash(hash, signedHash, toBase64)

  • Verifies the signature of a hash.

getHash(data, binary)

  • Computes the hash of the provided data.

signHashData(thumbprint, hash, base64)

  • Signs hash data and verifies the signature.

signHashDataNoVerify(thumbprint, hash, base64)

  • Signs hash data without verifying the signature.

Dependencies

Ensure that the CryptoPro plugin is installed and properly configured on the client's machine.

Usage

import { about, version } from 'crypto_pro_api'

async function getPluginInfo() {
    const pluginAbout = await about()
    const pluginVersion = await version()
    console.log(pluginAbout, pluginVersion)
}

getPluginInfo()

License

MIT License

About

CryptoPro Plugin Api

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published