Skip to content

Commit

Permalink
Add types for jsrsasign (DefinitelyTyped#37784)
Browse files Browse the repository at this point in the history
  • Loading branch information
ffflorian authored and sheetalkamat committed Aug 21, 2019
1 parent d1d0eff commit 54712a7
Show file tree
Hide file tree
Showing 105 changed files with 7,605 additions and 0 deletions.
18 changes: 18 additions & 0 deletions types/jsrsasign/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Type definitions for jsrsasign 8.0
// Project: https://github.com/kjur/jsrsasign
// Definitions by: Florian Keller <https://github.com/ffflorian>
// Definitions: https://github.com/ffflorian/jsrsasign-types
// TypeScript Version: 2.7

/// <reference path="./jsrsasign.d.ts" />
/// <reference path="./modules/BigInteger.d.ts" />
/// <reference path="./modules/ECCurveFp.d.ts" />
/// <reference path="./modules/ECFieldElementFp.d.ts" />
/// <reference path="./modules/ECPointFp.d.ts" />
/// <reference path="./modules/KEYUTIL.d.ts" />
/// <reference path="./modules/KJUR/index.d.ts" />
/// <reference path="./modules/RSAKey.d.ts" />
/// <reference path="./modules/X509.d.ts" />

export = jsrsasign;
export as namespace jsrsasign;
23 changes: 23 additions & 0 deletions types/jsrsasign/jsrsasign-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { KJUR, KEYUTIL } from 'jsrsasign';

const ec = new KJUR.crypto.ECDSA({ curve: 'secp256r1' });
ec.generateKeyPairHex();
ec.getPublicKeyXYHex();
ec.parseSigHex('30...');
ec.parseSigHexInHexRS('30...');

KJUR.crypto.ECDSA.getName('2b8104000a');

new KJUR.asn1.cades.OtherHash('1234');
new KJUR.asn1.cades.OtherHash({ alg: 'sha256', hash: '1234' });
new KJUR.asn1.cades.OtherHash({ alg: 'sha256', cert: '' });
new KJUR.asn1.cades.OtherHash({ cert: '' });

new KJUR.asn1.x509.AuthorityKeyIdentifier({
critical: true,
kid: { hex: '89ab' },
issuer: { str: '/C=US/CN=a' },
sn: { hex: '1234' },
});

KEYUTIL.getKey('pemPKCS1PrivateKey');
Loading

0 comments on commit 54712a7

Please sign in to comment.