├── .github ├── FUNDING.yml └── workflows │ └── codeql-analysis.yml ├── ChangeLog.txt ├── ChangeLog_jws322.txt ├── LICENSE.txt ├── Makefile ├── README.md ├── api ├── files.html ├── index.html └── symbols │ ├── ASN1HEX.html │ ├── Base64x.html │ ├── KEYUTIL.html │ ├── KJUR.asn1.ASN1Object.html │ ├── KJUR.asn1.ASN1Util.html │ ├── KJUR.asn1.DERAbstractString.html │ ├── KJUR.asn1.DERAbstractStructured.html │ ├── KJUR.asn1.DERAbstractTime.html │ ├── KJUR.asn1.DERBMPString.html │ ├── KJUR.asn1.DERBitString.html │ ├── KJUR.asn1.DERBoolean.html │ ├── KJUR.asn1.DEREnumerated.html │ ├── KJUR.asn1.DERGeneralizedTime.html │ ├── KJUR.asn1.DERIA5String.html │ ├── KJUR.asn1.DERInteger.html │ ├── KJUR.asn1.DERNull.html │ ├── KJUR.asn1.DERNumericString.html │ ├── KJUR.asn1.DERObjectIdentifier.html │ ├── KJUR.asn1.DEROctetString.html │ ├── KJUR.asn1.DERPrintableString.html │ ├── KJUR.asn1.DERSequence.html │ ├── KJUR.asn1.DERSet.html │ ├── KJUR.asn1.DERTaggedObject.html │ ├── KJUR.asn1.DERTeletexString.html │ ├── KJUR.asn1.DERUTCTime.html │ ├── KJUR.asn1.DERUTF8String.html │ ├── KJUR.asn1.DERVisibleString.html │ ├── KJUR.asn1.cades.CAdESUtil.html │ ├── KJUR.asn1.cades.CompleteCertificateRefs.html │ ├── KJUR.asn1.cades.OtherCertID.html │ ├── KJUR.asn1.cades.OtherHash.html │ ├── KJUR.asn1.cades.OtherHashAlgAndValue.html │ ├── KJUR.asn1.cades.OtherHashValue.html │ ├── KJUR.asn1.cades.SignaturePolicyId.html │ ├── KJUR.asn1.cades.SignaturePolicyIdentifier.html │ ├── KJUR.asn1.cades.SignatureTimeStamp.html │ ├── KJUR.asn1.cades.html │ ├── KJUR.asn1.cms.Attribute.html │ ├── KJUR.asn1.cms.AttributeList.html │ ├── KJUR.asn1.cms.CMSParser.html │ ├── KJUR.asn1.cms.CMSUtil.html │ ├── KJUR.asn1.cms.CertificateSet.html │ ├── KJUR.asn1.cms.ContentInfo.html │ ├── KJUR.asn1.cms.ContentType.html │ ├── KJUR.asn1.cms.ESSCertID.html │ ├── KJUR.asn1.cms.ESSCertIDv2.html │ ├── KJUR.asn1.cms.EncapsulatedContentInfo.html │ ├── KJUR.asn1.cms.IssuerAndSerialNumber.html │ ├── KJUR.asn1.cms.IssuerSerial.html │ ├── KJUR.asn1.cms.MessageDigest.html │ ├── KJUR.asn1.cms.OtherRevocationFormat.html │ ├── KJUR.asn1.cms.RevocationInfoChoice.html │ ├── KJUR.asn1.cms.RevocationInfoChoices.html │ ├── KJUR.asn1.cms.SignedData.html │ ├── KJUR.asn1.cms.SignerIdentifier.html │ ├── KJUR.asn1.cms.SignerInfo.html │ ├── KJUR.asn1.cms.SigningCertificate.html │ ├── KJUR.asn1.cms.SigningCertificateV2.html │ ├── KJUR.asn1.cms.SigningTime.html │ ├── KJUR.asn1.cms.SubjectKeyIdentifier.html │ ├── KJUR.asn1.cms.html │ ├── KJUR.asn1.csr.CSRUtil.html │ ├── KJUR.asn1.csr.CertificationRequest.html │ ├── KJUR.asn1.csr.CertificationRequestInfo.html │ ├── KJUR.asn1.csr.html │ ├── KJUR.asn1.html │ ├── KJUR.asn1.ocsp.BasicOCSPResponse.html │ ├── KJUR.asn1.ocsp.CertID.html │ ├── KJUR.asn1.ocsp.CertStatus.html │ ├── KJUR.asn1.ocsp.OCSPParser.html │ ├── KJUR.asn1.ocsp.OCSPRequest.html │ ├── KJUR.asn1.ocsp.OCSPResponse.html │ ├── KJUR.asn1.ocsp.OCSPUtil.html │ ├── KJUR.asn1.ocsp.Request.html │ ├── KJUR.asn1.ocsp.ResponderID.html │ ├── KJUR.asn1.ocsp.ResponseBytes.html │ ├── KJUR.asn1.ocsp.ResponseData.html │ ├── KJUR.asn1.ocsp.SingleResponse.html │ ├── KJUR.asn1.ocsp.SingleResponseList.html │ ├── KJUR.asn1.ocsp.TBSRequest.html │ ├── KJUR.asn1.ocsp.html │ ├── KJUR.asn1.tsp.AbstractTSAAdapter.html │ ├── KJUR.asn1.tsp.Accuracy.html │ ├── KJUR.asn1.tsp.FixedTSAAdapter.html │ ├── KJUR.asn1.tsp.MessageImprint.html │ ├── KJUR.asn1.tsp.PKIFailureInfo.html │ ├── KJUR.asn1.tsp.PKIFreeText.html │ ├── KJUR.asn1.tsp.PKIStatus.html │ ├── KJUR.asn1.tsp.PKIStatusInfo.html │ ├── KJUR.asn1.tsp.SimpleTSAAdapter.html │ ├── KJUR.asn1.tsp.TSPParser.html │ ├── KJUR.asn1.tsp.TSPUtil.html │ ├── KJUR.asn1.tsp.TSTInfo.html │ ├── KJUR.asn1.tsp.TimeStampReq.html │ ├── KJUR.asn1.tsp.TimeStampResp.html │ ├── KJUR.asn1.tsp.TimeStampToken.html │ ├── KJUR.asn1.tsp.html │ ├── KJUR.asn1.x509.AdobeTimeStamp.html │ ├── KJUR.asn1.x509.AlgorithmIdentifier.html │ ├── KJUR.asn1.x509.AttributeTypeAndValue.html │ ├── KJUR.asn1.x509.AuthorityInfoAccess.html │ ├── KJUR.asn1.x509.AuthorityKeyIdentifier.html │ ├── KJUR.asn1.x509.BasicConstraints.html │ ├── KJUR.asn1.x509.CRL.html │ ├── KJUR.asn1.x509.CRLDistributionPoints.html │ ├── KJUR.asn1.x509.CRLEntry.html │ ├── KJUR.asn1.x509.CRLNumber.html │ ├── KJUR.asn1.x509.CRLReason.html │ ├── KJUR.asn1.x509.Certificate.html │ ├── KJUR.asn1.x509.CertificatePolicies.html │ ├── KJUR.asn1.x509.DisplayText.html │ ├── KJUR.asn1.x509.DistributionPoint.html │ ├── KJUR.asn1.x509.DistributionPointName.html │ ├── KJUR.asn1.x509.ExtKeyUsage.html │ ├── KJUR.asn1.x509.Extension.html │ ├── KJUR.asn1.x509.Extensions.html │ ├── KJUR.asn1.x509.GeneralName.html │ ├── KJUR.asn1.x509.GeneralNames.html │ ├── KJUR.asn1.x509.GeneralSubtree.html │ ├── KJUR.asn1.x509.InhibitAnyPolicy.html │ ├── KJUR.asn1.x509.IssuerAltName.html │ ├── KJUR.asn1.x509.KeyUsage.html │ ├── KJUR.asn1.x509.NameConstraints.html │ ├── KJUR.asn1.x509.NoticeReference.html │ ├── KJUR.asn1.x509.OCSPNoCheck.html │ ├── KJUR.asn1.x509.OCSPNonce.html │ ├── KJUR.asn1.x509.OID.html │ ├── KJUR.asn1.x509.OtherName.html │ ├── KJUR.asn1.x509.PolicyConstraints.html │ ├── KJUR.asn1.x509.PolicyInformation.html │ ├── KJUR.asn1.x509.PolicyMappings.html │ ├── KJUR.asn1.x509.PolicyQualifierInfo.html │ ├── KJUR.asn1.x509.PrivateExtension.html │ ├── KJUR.asn1.x509.RDN.html │ ├── KJUR.asn1.x509.SubjectAltName.html │ ├── KJUR.asn1.x509.SubjectDirectoryAttributes.html │ ├── KJUR.asn1.x509.SubjectKeyIdentifier.html │ ├── KJUR.asn1.x509.SubjectPublicKeyInfo.html │ ├── KJUR.asn1.x509.TBSCertList.html │ ├── KJUR.asn1.x509.TBSCertificate.html │ ├── KJUR.asn1.x509.Time.html │ ├── KJUR.asn1.x509.UserNotice.html │ ├── KJUR.asn1.x509.X500Name.html │ ├── KJUR.asn1.x509.X509Util.html │ ├── KJUR.asn1.x509.html │ ├── KJUR.crypto.Cipher.html │ ├── KJUR.crypto.DSA.html │ ├── KJUR.crypto.ECDSA.html │ ├── KJUR.crypto.ECParameterDB.html │ ├── KJUR.crypto.Mac.html │ ├── KJUR.crypto.MessageDigest.html │ ├── KJUR.crypto.OID.html │ ├── KJUR.crypto.Signature.html │ ├── KJUR.crypto.Util.html │ ├── KJUR.crypto.html │ ├── KJUR.html │ ├── KJUR.jws.IntDate.html │ ├── KJUR.jws.JWS.html │ ├── KJUR.jws.JWSJS.html │ ├── KJUR.jws.html │ ├── KJUR.lang.String.html │ ├── RSAKey.html │ ├── X509.html │ ├── X509CRL.html │ ├── global__.html │ └── src │ ├── asn1-1.0.js.html │ ├── asn1cades-1.0.js.html │ ├── asn1cms-1.0.js.html │ ├── asn1csr-1.0.js.html │ ├── asn1hex-1.1.js.html │ ├── asn1ocsp-1.0.js.html │ ├── asn1tsp-1.0.js.html │ ├── asn1x509-1.0.js.html │ ├── base64x-1.1.js.html │ ├── crypto-1.1.js.html │ ├── dsa-2.0.js.html │ ├── ecdsa-modified-1.0.js.html │ ├── ecparam-1.0.js.html │ ├── jws-3.3.js.html │ ├── jwsjs-2.0.js.html │ ├── keyutil-1.0.js.html │ ├── nodeutil-1.0.js.html │ ├── rsapem-1.1.js.html │ ├── rsasign-1.2.js.html │ ├── x509-1.1.js.html │ └── x509crl.js.html ├── ext ├── THIRDPARTY_LICENSE.bitcoin.txt ├── THIRDPARTY_LICENSE.cryptojs.txt ├── THIRDPARTY_LICENSE.jsonsans.txt ├── THIRDPARTY_LICENSE.tomwu.txt ├── base64-min.js ├── base64.js ├── cj │ ├── THIRDPARTY_LICENSE.cryptojs.txt │ ├── aes.js │ ├── aes_min.js │ ├── cipher-core.js │ ├── cipher-core_min.js │ ├── core-min.js.ORG │ ├── core.js.ORG │ ├── cryptojs-312-core-fix-min.js │ ├── cryptojs-312-core-fix.js │ ├── enc-base64.js │ ├── enc-base64_min.js │ ├── hmac.js │ ├── hmac_min.js │ ├── md5.js │ ├── md5_min.js │ ├── pbkdf2.js │ ├── pbkdf2_min.js │ ├── ripemd160.js │ ├── ripemd160_min.js │ ├── sha1.js │ ├── sha1_min.js │ ├── sha224.js │ ├── sha224_min.js │ ├── sha256.js │ ├── sha256_min.js │ ├── sha384.js │ ├── sha384_min.js │ ├── sha512.js │ ├── sha512_min.js │ ├── tripledes.js │ ├── tripledes_min.js │ ├── x64-core.js │ └── x64-core_min.js ├── ec-min.js ├── ec-patch-min.js ├── ec-patch.js ├── ec.js ├── jsbn-min.js ├── jsbn.js ├── jsbn2-min.js ├── jsbn2.js ├── json-sans-eval-min.js ├── json-sans-eval.js ├── prng4-min.js ├── prng4.js ├── rng-min.js ├── rng.js ├── rsa-min.js ├── rsa.js ├── rsa2-min.js └── rsa2.js ├── index.html ├── index_alg.html ├── index_jws.html ├── index_jws_gen.png ├── index_jws_genjs.png ├── index_jwsmat.html ├── index_jwsut.html ├── index_oldnews.html ├── jsrsasign-all-min.js ├── jsrsasign-jwths-min.js ├── jsrsasign-rsa-min.js ├── min ├── asn1-1.0.min.js ├── asn1cades-1.0.min.js ├── asn1cms-1.0.min.js ├── asn1csr-1.0.min.js ├── asn1hex-1.1.min.js ├── asn1ocsp-1.0.min.js ├── asn1tsp-1.0.min.js ├── asn1x509-1.0.min.js ├── base64x-1.1.min.js ├── crypto-1.1.min.js ├── dsa-2.0.min.js ├── ecdsa-modified-1.0.min.js ├── ecparam-1.0.min.js ├── jws-3.3.min.js ├── jwsjs-2.0.min.js ├── keyutil-1.0.min.js ├── nodeutil-1.0.min.js ├── pkcs5pkey-1.0.min.js ├── rsapem-1.1.min.js ├── rsasign-1.2.min.js ├── x509-1.1.min.js └── x509crl.min.js ├── mobile ├── index.html └── tool_jwt.html ├── npm ├── .npmignore ├── Makefile ├── README.md ├── lib │ ├── footer.js │ ├── header.js │ ├── jsrsasign-all-min.js │ ├── jsrsasign-jwths-min.js │ ├── jsrsasign-rsa-min.js │ ├── jsrsasign.js │ └── lib.js ├── package.json └── test │ ├── t_base64x.js │ ├── t_keyutil_getpem.js │ ├── t_rsasign.js │ └── t_sig_rsasha1.js ├── npm_util ├── Makefile ├── README.md ├── lib │ ├── footer.js │ ├── header.js │ └── jsrsasign-util.js ├── package-lock.json └── package.json ├── sample-rsasign.png ├── sample ├── css │ ├── bbplayer.css │ ├── clndr.css │ ├── fd-slider.css │ ├── flexslider.css │ ├── jquery.nouislider.css │ └── style.css ├── images │ ├── arrow-left.png │ ├── arrow-right.png │ ├── audio.jpg │ ├── audio2.jpg │ ├── close.png │ ├── cloud.png │ ├── clouds.png │ ├── heart.png │ ├── img_sprite.png │ ├── left_arrow.png │ ├── likes.png │ ├── lock.png │ ├── mail.png │ ├── mail1.png │ ├── menu_1_left.png │ ├── menu_1_right.png │ ├── menu_2_left.png │ ├── menu_3_left.png │ ├── menu_3_right.PNG │ ├── menu_4_left.png │ ├── menu_4_right.png │ ├── menu_5_1.PNG │ ├── menu_5_2.png │ ├── menu_5_3.png │ ├── menu_5_4.png │ ├── menu_5_5.png │ ├── notify.png │ ├── pause.png │ ├── pic1.jpg │ ├── pic2.jpg │ ├── play.png │ ├── plus.png │ ├── request.png │ ├── search.png │ ├── serch_plus.png │ ├── set.png │ ├── shop.png │ ├── sun.png │ ├── sun1.png │ ├── sun_cloud.png │ ├── sun_icon1.png │ ├── tag_close.png │ ├── temp.png │ ├── twit_1_ban.jpg │ ├── twit_1_social_dribble.png │ ├── twit_1_social_dribbleh.png │ ├── twit_1_social_fb.png │ ├── twit_1_social_fbh.png │ ├── twit_1_social_twitter.png │ ├── twit_1_social_twitterh.png │ ├── twit_1_social_vimeo.png │ ├── twit_1_social_vimeoh.png │ ├── twit_1_user.png │ ├── user.png │ ├── weather_1.jpg │ └── weather_2.jpg ├── index.html ├── js │ ├── Chart.js │ ├── bbplayer.js │ ├── clndr.js │ ├── easyResponsiveTabs.js │ ├── fd-slider.js │ ├── jquery-1.11.1.min.js │ ├── jquery.circliful.min.js │ ├── jquery.flexslider.js │ ├── jquery.nouislider.js │ ├── moment-2.2.1.js │ ├── site.js │ ├── underscore-min.js │ └── w3layouts-License.txt ├── sample-ecdsa.html ├── sample-rsasign.html ├── sample_jwsgenerate.html ├── sample_jwsgenerate2.html ├── sample_jwsgenerate3.html ├── sample_jwsjsgen1.html ├── sample_jwsjsgen2.html ├── sample_jwsjsveri1.html ├── sample_jwsverify.html ├── sample_jwsverify2.html ├── sample_jwsverify3.html ├── tool_intary.html └── tool_jwktp.html ├── sample_node ├── README.md ├── asn1dump ├── asn1extract ├── asn1extract2 ├── cmssign ├── datadecrypt ├── dataencrypt ├── datasign ├── dataverify ├── eckey2hex ├── gencsr ├── genjwk ├── genkey ├── jwktopkcs8 ├── jwssign ├── jwsview ├── jwtverify ├── pemtobin ├── pemtojwk ├── showcert └── tsr2certs ├── src ├── asn1-1.0.js ├── asn1cades-1.0.js ├── asn1cms-1.0.js ├── asn1csr-1.0.js ├── asn1hex-1.1.js ├── asn1ocsp-1.0.js ├── asn1tsp-1.0.js ├── asn1x509-1.0.js ├── base64x-1.1.js ├── crypto-1.1.js ├── dsa-2.0.js ├── ecdsa-modified-1.0.js ├── ecparam-1.0.js ├── jws-3.3.js ├── jwsjs-2.0.js ├── keyutil-1.0.js ├── nodeutil-1.0.js ├── pkcs5pkey-1.0.js ├── rsapem-1.1.js ├── rsasign-1.2.js ├── x509-1.1.js └── x509crl.js ├── test ├── ecc-testvectors.js ├── index.html ├── jquery-1.4.2.min.js ├── qunit-do-asn1-newobj.html ├── qunit-do-asn1-oidhex.html ├── qunit-do-asn1.html ├── qunit-do-asn1cades.html ├── qunit-do-asn1cms.html ├── qunit-do-asn1csr.html ├── qunit-do-asn1hex-dump.html ├── qunit-do-asn1hex-parse.html ├── qunit-do-asn1hex.html ├── qunit-do-asn1ocsp.html ├── qunit-do-asn1tsp.html ├── qunit-do-asn1x509-multirdn.html ├── qunit-do-asn1x509-newcert-veri.html ├── qunit-do-asn1x509-newcrt.html ├── qunit-do-asn1x509-tbscert.html ├── qunit-do-asn1x509.html ├── qunit-do-base64x-class.html ├── qunit-do-base64x.html ├── qunit-do-crypto-cipher.html ├── qunit-do-crypto-ecdsa.html ├── qunit-do-crypto-mac.html ├── qunit-do-crypto-mac2.html ├── qunit-do-crypto-md.html ├── qunit-do-crypto-pss.html ├── qunit-do-crypto-sigini.html ├── qunit-do-crypto-siginidsa.html ├── qunit-do-crypto-sjcl.html ├── qunit-do-crypto.html ├── qunit-do-dsa.html ├── qunit-do-ecdsamod-nisttv.html ├── qunit-do-ecdsamod-s.html ├── qunit-do-ecdsamod-unsupport.html ├── qunit-do-ecdsamod.html ├── qunit-do-ecparam.html ├── qunit-do-jws-intdate.html ├── qunit-do-jws-sign-hs.html ├── qunit-do-jws-sign-slow.html ├── qunit-do-jws-sign.html ├── qunit-do-jws-util.html ├── qunit-do-jws.html ├── qunit-do-jwt-veri.html ├── qunit-do-keyutil-csr.html ├── qunit-do-keyutil-des.html ├── qunit-do-keyutil-dsa.html ├── qunit-do-keyutil-ec.html ├── qunit-do-keyutil-eprv.html ├── qunit-do-keyutil-gen.html ├── qunit-do-keyutil-getkey.html ├── qunit-do-keyutil-getpem.html ├── qunit-do-keyutil-jwk.html ├── qunit-do-keyutil-keyid.html ├── qunit-do-keyutil-p8egen.html ├── qunit-do-keyutil-pairpem.html ├── qunit-do-keyutil-pub.html ├── qunit-do-keyutil-rsa.html ├── qunit-do-keyutil.html ├── qunit-do-package-jwths.html ├── qunit-do-package-rsa.html ├── qunit-do-pkcs5-eprv.html ├── qunit-do-pkcs5-pub.html ├── qunit-do-pkcs5.html ├── qunit-do-rsagenkeylen.html ├── qunit-do-rsapem.html ├── qunit-do-rsasign-pss.html ├── qunit-do-rsasign.html ├── qunit-do-x509-ext.html ├── qunit-do-x509-getinfo.html ├── qunit-do-x509-hex2dn.html ├── qunit-do-x509-key.html ├── qunit-do-x509-kid.html ├── qunit-do-x509-param.html ├── qunit-do-x509-v1.html ├── qunit-do-x509.html ├── qunit.css ├── qunit.js └── x509crl.html └── tool ├── tool_asn1dumper.html ├── tool_asn1encoder.html ├── tool_b64udec.html ├── tool_b64uenc.html ├── tool_ca.html ├── tool_ca2.html ├── tool_cades.html ├── tool_certview.html ├── tool_cmssign.html ├── tool_csr.html ├── tool_forfact.html ├── tool_httpscfg.html ├── tool_jwsverifyanalyze.html ├── tool_jwt.html ├── tool_jwtveri.html ├── tool_pkcs5view.html ├── tool_roca.html ├── tool_string.html ├── tool_tsreq.html └── tool_tsres.html /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: kjur 4 | # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 5 | #patreon: # Replace with a single Patreon username 6 | #open_collective: # Replace with a single Open Collective username 7 | #ko_fi: # Replace with a single Ko-fi username 8 | #tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 9 | #community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 10 | #liberapay: # Replace with a single Liberapay username 11 | #issuehunt: # Replace with a single IssueHunt username 12 | #otechie: # Replace with a single Otechie username 13 | #custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | name: "CodeQL" 7 | 8 | on: 9 | push: 10 | branches: [master] 11 | pull_request: 12 | # The branches below must be a subset of the branches above 13 | branches: [master] 14 | schedule: 15 | - cron: '0 9 * * 4' 16 | 17 | jobs: 18 | analyze: 19 | name: Analyze 20 | runs-on: ubuntu-latest 21 | 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | # Override automatic language detection by changing the below list 26 | # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] 27 | language: ['javascript'] 28 | # Learn more... 29 | # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection 30 | 31 | steps: 32 | - name: Checkout repository 33 | uses: actions/checkout@v2 34 | with: 35 | # We must fetch at least the immediate parents so that if this is 36 | # a pull request then we can checkout the head. 37 | fetch-depth: 2 38 | 39 | # If this run was triggered by a pull request event, then checkout 40 | # the head of the pull request instead of the merge commit. 41 | - run: git checkout HEAD^2 42 | if: ${{ github.event_name == 'pull_request' }} 43 | 44 | # Initializes the CodeQL tools for scanning. 45 | - name: Initialize CodeQL 46 | uses: github/codeql-action/init@v1 47 | with: 48 | languages: ${{ matrix.language }} 49 | # If you wish to specify custom queries, you can do so here or in a config file. 50 | # By default, queries listed here will override any specified in a config file. 51 | # Prefix the list here with "+" to use these queries and those in the config file. 52 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 53 | 54 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 55 | # If this step fails, then you should remove it and run the build manually (see below) 56 | - name: Autobuild 57 | uses: github/codeql-action/autobuild@v1 58 | 59 | # ℹ️ Command-line programs to run using the OS shell. 60 | # 📚 https://git.io/JvXDl 61 | 62 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 63 | # and modify them (or add more) to build your code if your project 64 | # uses a compiled language 65 | 66 | #- run: | 67 | # make bootstrap 68 | # make release 69 | 70 | - name: Perform CodeQL Analysis 71 | uses: github/codeql-action/analyze@v1 72 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all 2 | 3 | FILES_MIN = \ 4 | min/asn1-1.0.min.js \ 5 | min/asn1hex-1.1.min.js \ 6 | min/asn1x509-1.0.min.js \ 7 | min/asn1cms-1.0.min.js \ 8 | min/asn1tsp-1.0.min.js \ 9 | min/asn1cades-1.0.min.js \ 10 | min/asn1csr-1.0.min.js \ 11 | min/asn1ocsp-1.0.min.js \ 12 | min/base64x-1.1.min.js \ 13 | min/crypto-1.1.min.js \ 14 | min/ecdsa-modified-1.0.min.js \ 15 | min/ecparam-1.0.min.js \ 16 | min/dsa-2.0.min.js \ 17 | min/keyutil-1.0.min.js \ 18 | min/rsapem-1.1.min.js \ 19 | min/rsasign-1.2.min.js \ 20 | min/x509-1.1.min.js \ 21 | min/jws-3.3.min.js \ 22 | min/jwsjs-2.0.min.js \ 23 | min/x509crl.min.js \ 24 | min/nodeutil-1.0.min.js 25 | 26 | JSDOC_SRC = \ 27 | asn1hex-1.1.js \ 28 | rsapem-1.1.js \ 29 | rsasign-1.2.js \ 30 | x509-1.1.js \ 31 | keyutil-1.0.js \ 32 | asn1-1.0.js \ 33 | asn1x509-1.0.js \ 34 | asn1cms-1.0.js \ 35 | asn1tsp-1.0.js \ 36 | asn1cades-1.0.js \ 37 | asn1csr-1.0.js \ 38 | asn1ocsp-1.0.js \ 39 | crypto-1.1.js \ 40 | ecdsa-modified-1.0.js \ 41 | ecparam-1.0.js \ 42 | dsa-2.0.js \ 43 | base64x-1.1.js \ 44 | jws-3.3.js \ 45 | jwsjs-2.0.js \ 46 | x509crl.js \ 47 | nodeutil-1.0.js 48 | 49 | FILES_EXT_MIN = \ 50 | ext/ec-min.js \ 51 | ext/rsa-min.js \ 52 | ext/rsa2-min.js 53 | 54 | JSRUN=jsrun-jsrsasign.sh 55 | 56 | JSDOCOUTDIR1=_tmp 57 | 58 | APIDOCDIR=api 59 | 60 | jsdoc: 61 | rm -rf $(APIDOCDIR) 62 | mkdir $(APIDOCDIR) 63 | ( \ 64 | cd src; \ 65 | ${JSRUN} $(JSDOC_SRC) \ 66 | -d=../$(APIDOCDIR) -v \ 67 | ) 68 | mv $(APIDOCDIR)/symbols/_global_.html $(APIDOCDIR)/symbols/global__.html 69 | find $(APIDOCDIR) -type f -name "*.html" -print0 | xargs -0 sed -i.bak -e "s/_global_/global__/g" 70 | find $(APIDOCDIR) -type f -name "*.html" -print0 | xargs -0 sed -i.bak -e "s/2012-2020/2012-2023/g" 71 | find $(APIDOCDIR) -type f -name "*.html.bak" -exec rm {} \; 72 | rm -rf ../../_gitpg/jsrsasign/api 73 | cp -r $(APIDOCDIR) ../../_gitpg/jsrsasign/api 74 | 75 | all-min: $(FILES_MIN) 76 | @echo "all min converted." 77 | 78 | all-ext-min: $(FILES_EXT_MIN) 79 | @echo "all ext min converted." 80 | 81 | min/%.min.js: src/%.js 82 | yuicmp $^ -o $@ 83 | 84 | ext/%-min.js: ext/%.js 85 | yuicmp $^ -o $@ 86 | 87 | gitadd-all-doc: 88 | git add api/*.html api/symbols/*.html api/symbols/src/*.html LICENSE.txt 89 | 90 | gitadd-release: 91 | git add ChangeLog.txt Makefile jsrsasign-*-min.js min/*.js src/*.js npm/package.json npm/lib/jsrsasign*.js npm/lib/{header,footer,lib}.js src/*.js test/qunit-do-*.html test/x509crl.html README.md npm/README.md tool/*.html npm_util/*.* npm_util/lib/*.* npm/test/t_*.js 92 | 93 | gitadd: gitadd-all-doc gitadd-release 94 | @echo done 95 | 96 | rsync-test: 97 | rsync -n -av api/ ../../_gitpg/jsrsasign/api 98 | rsync -n -av --include="[a-z]*.js" --exclude="*" src/ ../../_gitpg/jsrsasign/src 99 | rsync -n -av --include="[a-z]*.min.js" --exclude="*" min/ ../../_gitpg/jsrsasign/min 100 | rsync -n -av --include="[a-z]*.js" --exclude="*" ext/ ../../_gitpg/jsrsasign/ext 101 | rsync -n -av --include="[a-z]*.html" --exclude="*" test/ ../../_gitpg/jsrsasign/test 102 | 103 | rsync: 104 | rsync -av api/ ../../_gitpg/jsrsasign/api 105 | rsync -av --include="[a-z]*.js" --exclude="*" src/ ../../_gitpg/jsrsasign/src 106 | rsync -av --include="[a-z]*.min.js" --exclude="*" min/ ../../_gitpg/jsrsasign/min 107 | rsync -av --include="[a-z]*.js" --exclude="*" ext/ ../../_gitpg/jsrsasign/ext 108 | rsync -av --include="[a-z]*.html" --exclude="*" test/ ../../_gitpg/jsrsasign/test 109 | 110 | 111 | -------------------------------------------------------------------------------- /ext/THIRDPARTY_LICENSE.bitcoin.txt: -------------------------------------------------------------------------------- 1 | https://github.com/bitcoinjs/bitcoinjs-lib 2 | 3 | LICENCE: 4 | MIT License 5 | 6 | FILES: 7 | - ../ecdsa-modified.js (modified version of bitcoin-lib/ecdsa.js) 8 | - ec-patch.js (part of bitcoin-lib/ecdsa.js) 9 | 10 | Copyright (c) 2011 Stefan Thomas 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 17 | -------------------------------------------------------------------------------- /ext/THIRDPARTY_LICENSE.cryptojs.txt: -------------------------------------------------------------------------------- 1 | https://code.google.com/p/crypto-js/wiki/License 2 | 3 | LICENSE: 4 | NEW BSD License 5 | 6 | FILES: 7 | ext/cryptojs-312-core-fix.js 8 | ext/cryptojs-312-core-fix-min.js 9 | ext/jsrsasign-*-all-min.js 10 | 11 | Copyright (c) 2009-2013 Jeff Mott 12 | 13 | Permission is hereby granted, free of charge, to any person obtaining 14 | a copy of this software and associated documentation files (the 15 | "Software"), to deal in the Software without restriction, including 16 | without limitation the rights to use, copy, modify, merge, publish, 17 | distribute, sublicense, and/or sell copies of the Software, and to 18 | permit persons to whom the Software is furnished to do so, subject to 19 | the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be 22 | included in all copies or substantial portions of the Software. 23 | 24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 25 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 26 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 27 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 28 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 29 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 30 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | -------------------------------------------------------------------------------- /ext/THIRDPARTY_LICENSE.tomwu.txt: -------------------------------------------------------------------------------- 1 | 2 | The 'RSA-Sign JavaScript Library' (jsrsasig) THRID PARTY LICENSE: 3 | 4 | Apr 30, 2012 5 | 6 | This document contains third party licensing information for 7 | the 'RSA-Sign JavaScript Library'. Where applicable, 8 | the text has not been edited from its original content or spelling. 9 | 10 | ********************************************************* 11 | For Tom Wu's jsbn library - BigInteger and RSA 12 | 13 | base64.js - String encoder for Base64 and Hex 14 | jsbn.js - basic BigInteger class 15 | jsbn2.js - BigInteger class extension 16 | prng4.js - Random number generator 17 | rng.js - Random number generator 18 | rsa.js - RSAKey class for RSA public key encryption. 19 | rsa2.js - RSA class extension for RSA private key decryption. 20 | 21 | http://www-cs-students.stanford.edu/~tjw/jsbn/LICENSE 22 | 23 | ********************************************************* 24 | 25 | Licensing 26 | --------- 27 | 28 | This software is covered under the following copyright: 29 | 30 | /* 31 | * Copyright (c) 2003-2005 Tom Wu 32 | * All Rights Reserved. 33 | * 34 | * Permission is hereby granted, free of charge, to any person obtaining 35 | * a copy of this software and associated documentation files (the 36 | * "Software"), to deal in the Software without restriction, including 37 | * without limitation the rights to use, copy, modify, merge, publish, 38 | * distribute, sublicense, and/or sell copies of the Software, and to 39 | * permit persons to whom the Software is furnished to do so, subject to 40 | * the following conditions: 41 | * 42 | * The above copyright notice and this permission notice shall be 43 | * included in all copies or substantial portions of the Software. 44 | * 45 | * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 46 | * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 47 | * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 48 | * 49 | * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, 50 | * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER 51 | * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF 52 | * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT 53 | * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 54 | * 55 | * In addition, the following condition applies: 56 | * 57 | * All redistributions must retain an intact copy of this copyright notice 58 | * and disclaimer. 59 | */ 60 | 61 | Address all questions regarding this license to: 62 | 63 | Tom Wu 64 | tjw@cs.Stanford.EDU 65 | 66 | -------------------------------------------------------------------------------- /ext/base64-min.js: -------------------------------------------------------------------------------- 1 | /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ 2 | */ 3 | var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var b64pad="=";function hex2b64(d){var b;var e;var a="";for(b=0;b+3<=d.length;b+=3){e=parseInt(d.substring(b,b+3),16);a+=b64map.charAt(e>>6)+b64map.charAt(e&63)}if(b+1==d.length){e=parseInt(d.substring(b,b+1),16);a+=b64map.charAt(e<<2)}else{if(b+2==d.length){e=parseInt(d.substring(b,b+2),16);a+=b64map.charAt(e>>2)+b64map.charAt((e&3)<<4)}}if(b64pad){while((a.length&3)>0){a+=b64pad}}return a}function b64tohex(f){var d="";var e;var b=0;var c;var a;for(e=0;e>2);c=a&3;b=1}else{if(b==1){d+=int2char((c<<2)|(a>>4));c=a&15;b=2}else{if(b==2){d+=int2char(c);d+=int2char(a>>2);c=a&3;b=3}else{d+=int2char((c<<2)|(a>>4));d+=int2char(a&15);b=0}}}}if(b==1){d+=int2char(c<<2)}return d}function b64toBA(e){var d=b64tohex(e);var c;var b=new Array();for(c=0;2*c> 6) + b64map.charAt(c & 63); 13 | } 14 | if(i+1 == h.length) { 15 | c = parseInt(h.substring(i,i+1),16); 16 | ret += b64map.charAt(c << 2); 17 | } 18 | else if(i+2 == h.length) { 19 | c = parseInt(h.substring(i,i+2),16); 20 | ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4); 21 | } 22 | if (b64pad) while((ret.length & 3) > 0) ret += b64pad; 23 | return ret; 24 | } 25 | 26 | // convert a base64 string to hex 27 | function b64tohex(s) { 28 | var ret = "" 29 | var i; 30 | var k = 0; // b64 state, 0-3 31 | var slop; 32 | var v; 33 | for(i = 0; i < s.length; ++i) { 34 | if(s.charAt(i) == b64pad) break; 35 | v = b64map.indexOf(s.charAt(i)); 36 | if(v < 0) continue; 37 | if(k == 0) { 38 | ret += int2char(v >> 2); 39 | slop = v & 3; 40 | k = 1; 41 | } 42 | else if(k == 1) { 43 | ret += int2char((slop << 2) | (v >> 4)); 44 | slop = v & 0xf; 45 | k = 2; 46 | } 47 | else if(k == 2) { 48 | ret += int2char(slop); 49 | ret += int2char(v >> 2); 50 | slop = v & 3; 51 | k = 3; 52 | } 53 | else { 54 | ret += int2char((slop << 2) | (v >> 4)); 55 | ret += int2char(v & 0xf); 56 | k = 0; 57 | } 58 | } 59 | if(k == 1) 60 | ret += int2char(slop << 2); 61 | return ret; 62 | } 63 | 64 | // convert a base64 string to a byte/number array 65 | function b64toBA(s) { 66 | //piggyback on b64tohex for now, optimize later 67 | var h = b64tohex(s); 68 | var i; 69 | var a = new Array(); 70 | for(i = 0; 2*i < h.length; ++i) { 71 | a[i] = parseInt(h.substring(2*i,2*i+2),16); 72 | } 73 | return a; 74 | } 75 | -------------------------------------------------------------------------------- /ext/cj/THIRDPARTY_LICENSE.cryptojs.txt: -------------------------------------------------------------------------------- 1 | https://code.google.com/p/crypto-js/wiki/License 2 | 3 | LICENSE: 4 | NEW BSD License 5 | 6 | FILES: 7 | ext/cryptojs-312-core-fix.js 8 | ext/cryptojs-312-core-fix-min.js 9 | ext/jsrsasign-*-all-min.js 10 | 11 | Copyright (c) 2009-2013 Jeff Mott 12 | 13 | Permission is hereby granted, free of charge, to any person obtaining 14 | a copy of this software and associated documentation files (the 15 | "Software"), to deal in the Software without restriction, including 16 | without limitation the rights to use, copy, modify, merge, publish, 17 | distribute, sublicense, and/or sell copies of the Software, and to 18 | permit persons to whom the Software is furnished to do so, subject to 19 | the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be 22 | included in all copies or substantial portions of the Software. 23 | 24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 25 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 26 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 27 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 28 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 29 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 30 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | -------------------------------------------------------------------------------- /ext/cj/aes_min.js: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 aes.js 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | (function(){for(var q=CryptoJS,x=q.lib.BlockCipher,r=q.algo,j=[],y=[],z=[],A=[],B=[],C=[],s=[],u=[],v=[],w=[],g=[],k=0;256>k;k++)g[k]=128>k?k<<1:k<<1^283;for(var n=0,l=0,k=0;256>k;k++){var f=l^l<<1^l<<2^l<<3^l<<4,f=f>>>8^f&255^99;j[n]=f;y[f]=n;var t=g[n],D=g[t],E=g[D],b=257*g[f]^16843008*f;z[n]=b<<24|b>>>8;A[n]=b<<16|b>>>16;B[n]=b<<8|b>>>24;C[n]=b;b=16843009*E^65537*D^257*t^16843008*n;s[f]=b<<24|b>>>8;u[f]=b<<16|b>>>16;v[f]=b<<8|b>>>24;w[f]=b;n?(n=t^g[g[g[E^t]]],l^=g[g[l]]):n=l=1}var F=[0,1,2,4,8, 8 | 16,32,64,128,27,54],r=r.AES=x.extend({_doReset:function(){for(var c=this._key,e=c.words,a=c.sigBytes/4,c=4*((this._nRounds=a+6)+1),b=this._keySchedule=[],h=0;h>>24]<<24|j[d>>>16&255]<<16|j[d>>>8&255]<<8|j[d&255]):(d=d<<8|d>>>24,d=j[d>>>24]<<24|j[d>>>16&255]<<16|j[d>>>8&255]<<8|j[d&255],d^=F[h/a|0]<<24);b[h]=b[h-a]^d}e=this._invKeySchedule=[];for(a=0;aa||4>=h?d:s[j[d>>>24]]^u[j[d>>>16&255]]^v[j[d>>> 9 | 8&255]]^w[j[d&255]]},encryptBlock:function(c,e){this._doCryptBlock(c,e,this._keySchedule,z,A,B,C,j)},decryptBlock:function(c,e){var a=c[e+1];c[e+1]=c[e+3];c[e+3]=a;this._doCryptBlock(c,e,this._invKeySchedule,s,u,v,w,y);a=c[e+1];c[e+1]=c[e+3];c[e+3]=a},_doCryptBlock:function(c,e,a,b,h,d,j,m){for(var n=this._nRounds,f=c[e]^a[0],g=c[e+1]^a[1],k=c[e+2]^a[2],p=c[e+3]^a[3],l=4,t=1;t>>24]^h[g>>>16&255]^d[k>>>8&255]^j[p&255]^a[l++],r=b[g>>>24]^h[k>>>16&255]^d[p>>>8&255]^j[f&255]^a[l++],s= 10 | b[k>>>24]^h[p>>>16&255]^d[f>>>8&255]^j[g&255]^a[l++],p=b[p>>>24]^h[f>>>16&255]^d[g>>>8&255]^j[k&255]^a[l++],f=q,g=r,k=s;q=(m[f>>>24]<<24|m[g>>>16&255]<<16|m[k>>>8&255]<<8|m[p&255])^a[l++];r=(m[g>>>24]<<24|m[k>>>16&255]<<16|m[p>>>8&255]<<8|m[f&255])^a[l++];s=(m[k>>>24]<<24|m[p>>>16&255]<<16|m[f>>>8&255]<<8|m[g&255])^a[l++];p=(m[p>>>24]<<24|m[f>>>16&255]<<16|m[g>>>8&255]<<8|m[k&255])^a[l++];c[e]=q;c[e+1]=r;c[e+2]=s;c[e+3]=p},keySize:8});q.AES=x._createHelper(r)})(); 11 | -------------------------------------------------------------------------------- /ext/cj/cipher-core_min.js: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 cipher-core.js 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | CryptoJS.lib.Cipher||function(u){var g=CryptoJS,f=g.lib,k=f.Base,l=f.WordArray,q=f.BufferedBlockAlgorithm,r=g.enc.Base64,v=g.algo.EvpKDF,n=f.Cipher=q.extend({cfg:k.extend(),createEncryptor:function(a,b){return this.create(this._ENC_XFORM_MODE,a,b)},createDecryptor:function(a,b){return this.create(this._DEC_XFORM_MODE,a,b)},init:function(a,b,c){this.cfg=this.cfg.extend(c);this._xformMode=a;this._key=b;this.reset()},reset:function(){q.reset.call(this);this._doReset()},process:function(a){this._append(a); 8 | return this._process()},finalize:function(a){a&&this._append(a);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(a){return{encrypt:function(b,c,d){return("string"==typeof c?s:j).encrypt(a,b,c,d)},decrypt:function(b,c,d){return("string"==typeof c?s:j).decrypt(a,b,c,d)}}}});f.StreamCipher=n.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var m=g.mode={},t=function(a,b,c){var d=this._iv;d?this._iv=u:d=this._prevBlock;for(var e= 9 | 0;e>>2]&255}};f.BlockCipher=n.extend({cfg:n.cfg.extend({mode:m,padding:h}),reset:function(){n.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;else c=a.createDecryptor,this._minBufferSize=1; 11 | this._mode=c.call(a,this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var p=f.CipherParams=k.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),m=(g.format={}).OpenSSL={stringify:function(a){var b=a.ciphertext;a=a.salt; 12 | return(a?l.create([1398893684,1701076831]).concat(a).concat(b):b).toString(r)},parse:function(a){a=r.parse(a);var b=a.words;if(1398893684==b[0]&&1701076831==b[1]){var c=l.create(b.slice(2,4));b.splice(0,4);a.sigBytes-=16}return p.create({ciphertext:a,salt:c})}},j=f.SerializableCipher=k.extend({cfg:k.extend({format:m}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var e=a.createEncryptor(c,d);b=e.finalize(b);e=e.cfg;return p.create({ciphertext:b,key:c,iv:e.iv,algorithm:a,mode:e.mode,padding:e.padding, 13 | blockSize:a.blockSize,formatter:d.format})},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);return a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),g=(g.kdf={}).OpenSSL={execute:function(a,b,c,d){d||(d=l.random(8));a=v.create({keySize:b+c}).compute(a,d);c=l.create(a.words.slice(b),4*c);a.sigBytes=4*b;return p.create({key:a,iv:c,salt:d})}},s=f.PasswordBasedCipher=j.extend({cfg:j.cfg.extend({kdf:g}),encrypt:function(a, 14 | b,c,d){d=this.cfg.extend(d);c=d.kdf.execute(c,a.keySize,a.ivSize);d.iv=c.iv;a=j.encrypt.call(this,a,b,c.key,d);a.mixIn(c);return a},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);c=d.kdf.execute(c,a.keySize,a.ivSize,b.salt);d.iv=c.iv;return j.decrypt.call(this,a,b,c.key,d)}})}(); 15 | -------------------------------------------------------------------------------- /ext/cj/core-min.js.ORG: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | var CryptoJS=CryptoJS||function(h,r){var k={},l=k.lib={},n=function(){},f=l.Base={extend:function(a){n.prototype=this;var b=new n;a&&b.mixIn(a);b.hasOwnProperty("init")||(b.init=function(){b.$super.init.apply(this,arguments)});b.init.prototype=b;b.$super=this;return b},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}, 8 | j=l.WordArray=f.extend({init:function(a,b){a=this.words=a||[];this.sigBytes=b!=r?b:4*a.length},toString:function(a){return(a||s).stringify(this)},concat:function(a){var b=this.words,d=a.words,c=this.sigBytes;a=a.sigBytes;this.clamp();if(c%4)for(var e=0;e>>2]|=(d[e>>>2]>>>24-8*(e%4)&255)<<24-8*((c+e)%4);else if(65535>>2]=d[e>>>2];else b.push.apply(b,d);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<< 9 | 32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a=f.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],d=0;d>>2]>>>24-8*(c%4)&255;d.push((e>>>4).toString(16));d.push((e&15).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c>>3]|=parseInt(a.substr(c, 10 | 2),16)<<24-4*(c%8);return new j.init(d,b/2)}},p=m.Latin1={stringify:function(a){var b=a.words;a=a.sigBytes;for(var d=[],c=0;c>>2]>>>24-8*(c%4)&255));return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c>>2]|=(a.charCodeAt(c)&255)<<24-8*(c%4);return new j.init(d,b)}},t=m.Utf8={stringify:function(a){try{return decodeURIComponent(escape(p.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return p.parse(unescape(encodeURIComponent(a)))}}, 11 | q=l.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new j.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=t.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,d=b.words,c=b.sigBytes,e=this.blockSize,f=c/(4*e),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0);a=f*e;c=h.min(4*a,c);if(a){for(var g=0;g>>2]>>>(24-(r%4)*8))&255;q[(n+r)>>>2]|=o<<(24-((n+r)%4)*8)}}else{for(var r=0;r>>2]=p[r>>>2]}}this.sigBytes+=s;return this},clamp:function(){var o=this.words;var n=this.sigBytes;o[n>>>2]&=4294967295<<(32-(n%4)*8);o.length=e.ceil(n/4)},clone:function(){var n=j.clone.call(this);n.words=this.words.slice(0);return n},random:function(p){var o=[];for(var n=0;n>>2]>>>(24-(n%4)*8))&255;q.push((s>>>4).toString(16));q.push((s&15).toString(16))}return q.join("")},parse:function(p){var n=p.length;var q=[];for(var o=0;o>>3]|=parseInt(p.substr(o,2),16)<<(24-(o%8)*4)}return new l.init(q,n/2)}};var d=m.Latin1={stringify:function(q){var r=q.words;var p=q.sigBytes;var n=[];for(var o=0;o>>2]>>>(24-(o%4)*8))&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(p){var n=p.length;var q=[];for(var o=0;o>>2]|=(p.charCodeAt(o)&255)<<(24-(o%4)*8)}return new l.init(q,n)}};var c=m.Utf8={stringify:function(n){try{return decodeURIComponent(escape(d.stringify(n)))}catch(o){throw new Error("Malformed UTF-8 data")}},parse:function(n){return d.parse(unescape(encodeURIComponent(n)))}};var i=b.BufferedBlockAlgorithm=j.extend({reset:function(){this._data=new l.init();this._nDataBytes=0},_append:function(n){if(typeof n=="string"){n=c.parse(n)}this._data.concat(n);this._nDataBytes+=n.sigBytes},_process:function(w){var q=this._data;var x=q.words;var n=q.sigBytes;var t=this.blockSize;var v=t*4;var u=n/v;if(w){u=e.ceil(u)}else{u=e.max((u|0)-this._minBufferSize,0)}var s=u*t;var r=e.min(s*4,n);if(s){for(var p=0;p>> 2] >>> (24 - (i % 4) * 8)) & 0xff; 44 | var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; 45 | var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; 46 | 47 | var triplet = (byte1 << 16) | (byte2 << 8) | byte3; 48 | 49 | for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { 50 | base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); 51 | } 52 | } 53 | 54 | // Add padding 55 | var paddingChar = map.charAt(64); 56 | if (paddingChar) { 57 | while (base64Chars.length % 4) { 58 | base64Chars.push(paddingChar); 59 | } 60 | } 61 | 62 | return base64Chars.join(''); 63 | }, 64 | 65 | /** 66 | * Converts a Base64 string to a word array. 67 | * 68 | * @param {string} base64Str The Base64 string. 69 | * 70 | * @return {WordArray} The word array. 71 | * 72 | * @static 73 | * 74 | * @example 75 | * 76 | * var wordArray = CryptoJS.enc.Base64.parse(base64String); 77 | */ 78 | parse: function (base64Str) { 79 | // Shortcuts 80 | var base64StrLength = base64Str.length; 81 | var map = this._map; 82 | 83 | // Ignore padding 84 | var paddingChar = map.charAt(64); 85 | if (paddingChar) { 86 | var paddingIndex = base64Str.indexOf(paddingChar); 87 | if (paddingIndex != -1) { 88 | base64StrLength = paddingIndex; 89 | } 90 | } 91 | 92 | // Convert 93 | var words = []; 94 | var nBytes = 0; 95 | for (var i = 0; i < base64StrLength; i++) { 96 | if (i % 4) { 97 | var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2); 98 | var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2); 99 | words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8); 100 | nBytes++; 101 | } 102 | } 103 | 104 | return WordArray.create(words, nBytes); 105 | }, 106 | 107 | _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' 108 | }; 109 | }()); 110 | -------------------------------------------------------------------------------- /ext/cj/enc-base64_min.js: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 enc-base64.js 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | (function(){var h=CryptoJS,j=h.lib.WordArray;h.enc.Base64={stringify:function(b){var e=b.words,f=b.sigBytes,c=this._map;b.clamp();b=[];for(var a=0;a>>2]>>>24-8*(a%4)&255)<<16|(e[a+1>>>2]>>>24-8*((a+1)%4)&255)<<8|e[a+2>>>2]>>>24-8*((a+2)%4)&255,g=0;4>g&&a+0.75*g>>6*(3-g)&63));if(e=c.charAt(64))for(;b.length%4;)b.push(e);return b.join("")},parse:function(b){var e=b.length,f=this._map,c=f.charAt(64);c&&(c=b.indexOf(c),-1!=c&&(e=c));for(var c=[],a=0,d=0;d< 8 | e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>>6-2*(d%4);c[a>>>2]|=(g|h)<<24-8*(a%4);a++}return j.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(); 9 | -------------------------------------------------------------------------------- /ext/cj/hmac_min.js: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 hmac.js 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | (function(){var c=CryptoJS,k=c.enc.Utf8;c.algo.HMAC=c.lib.Base.extend({init:function(a,b){a=this._hasher=new a.init;"string"==typeof b&&(b=k.parse(b));var c=a.blockSize,e=4*c;b.sigBytes>e&&(b=a.finalize(b));b.clamp();for(var f=this._oKey=b.clone(),g=this._iKey=b.clone(),h=f.words,j=g.words,d=0;d>>32-h)+f}function k(a,f,g,j,p,h,k){a=a+(f&j|g&~j)+p+k;return(a<>>32-h)+f}function l(a,f,g,j,h,k,l){a=a+(f^g^j)+h+l;return(a<>>32-k)+f}function n(a,f,g,j,h,k,l){a=a+(g^(f|~j))+h+l;return(a<>>32-k)+f}for(var r=CryptoJS,q=r.lib,F=q.WordArray,s=q.Hasher,q=r.algo,a=[],t=0;64>t;t++)a[t]=4294967296*E.abs(E.sin(t+1))|0;q=q.MD5=s.extend({_doReset:function(){this._hash=new F.init([1732584193,4023233417,2562383102,271733878])}, 8 | _doProcessBlock:function(m,f){for(var g=0;16>g;g++){var j=f+g,p=m[j];m[j]=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360}var g=this._hash.words,j=m[f+0],p=m[f+1],q=m[f+2],r=m[f+3],s=m[f+4],t=m[f+5],u=m[f+6],v=m[f+7],w=m[f+8],x=m[f+9],y=m[f+10],z=m[f+11],A=m[f+12],B=m[f+13],C=m[f+14],D=m[f+15],b=g[0],c=g[1],d=g[2],e=g[3],b=h(b,c,d,e,j,7,a[0]),e=h(e,b,c,d,p,12,a[1]),d=h(d,e,b,c,q,17,a[2]),c=h(c,d,e,b,r,22,a[3]),b=h(b,c,d,e,s,7,a[4]),e=h(e,b,c,d,t,12,a[5]),d=h(d,e,b,c,u,17,a[6]),c=h(c,d,e,b,v,22,a[7]), 9 | b=h(b,c,d,e,w,7,a[8]),e=h(e,b,c,d,x,12,a[9]),d=h(d,e,b,c,y,17,a[10]),c=h(c,d,e,b,z,22,a[11]),b=h(b,c,d,e,A,7,a[12]),e=h(e,b,c,d,B,12,a[13]),d=h(d,e,b,c,C,17,a[14]),c=h(c,d,e,b,D,22,a[15]),b=k(b,c,d,e,p,5,a[16]),e=k(e,b,c,d,u,9,a[17]),d=k(d,e,b,c,z,14,a[18]),c=k(c,d,e,b,j,20,a[19]),b=k(b,c,d,e,t,5,a[20]),e=k(e,b,c,d,y,9,a[21]),d=k(d,e,b,c,D,14,a[22]),c=k(c,d,e,b,s,20,a[23]),b=k(b,c,d,e,x,5,a[24]),e=k(e,b,c,d,C,9,a[25]),d=k(d,e,b,c,r,14,a[26]),c=k(c,d,e,b,w,20,a[27]),b=k(b,c,d,e,B,5,a[28]),e=k(e,b, 10 | c,d,q,9,a[29]),d=k(d,e,b,c,v,14,a[30]),c=k(c,d,e,b,A,20,a[31]),b=l(b,c,d,e,t,4,a[32]),e=l(e,b,c,d,w,11,a[33]),d=l(d,e,b,c,z,16,a[34]),c=l(c,d,e,b,C,23,a[35]),b=l(b,c,d,e,p,4,a[36]),e=l(e,b,c,d,s,11,a[37]),d=l(d,e,b,c,v,16,a[38]),c=l(c,d,e,b,y,23,a[39]),b=l(b,c,d,e,B,4,a[40]),e=l(e,b,c,d,j,11,a[41]),d=l(d,e,b,c,r,16,a[42]),c=l(c,d,e,b,u,23,a[43]),b=l(b,c,d,e,x,4,a[44]),e=l(e,b,c,d,A,11,a[45]),d=l(d,e,b,c,D,16,a[46]),c=l(c,d,e,b,q,23,a[47]),b=n(b,c,d,e,j,6,a[48]),e=n(e,b,c,d,v,10,a[49]),d=n(d,e,b,c, 11 | C,15,a[50]),c=n(c,d,e,b,t,21,a[51]),b=n(b,c,d,e,A,6,a[52]),e=n(e,b,c,d,r,10,a[53]),d=n(d,e,b,c,y,15,a[54]),c=n(c,d,e,b,p,21,a[55]),b=n(b,c,d,e,w,6,a[56]),e=n(e,b,c,d,D,10,a[57]),d=n(d,e,b,c,u,15,a[58]),c=n(c,d,e,b,B,21,a[59]),b=n(b,c,d,e,s,6,a[60]),e=n(e,b,c,d,z,10,a[61]),d=n(d,e,b,c,q,15,a[62]),c=n(c,d,e,b,x,21,a[63]);g[0]=g[0]+b|0;g[1]=g[1]+c|0;g[2]=g[2]+d|0;g[3]=g[3]+e|0},_doFinalize:function(){var a=this._data,f=a.words,g=8*this._nDataBytes,j=8*a.sigBytes;f[j>>>5]|=128<<24-j%32;var h=E.floor(g/ 12 | 4294967296);f[(j+64>>>9<<4)+15]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360;f[(j+64>>>9<<4)+14]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360;a.sigBytes=4*(f.length+1);this._process();a=this._hash;f=a.words;for(g=0;4>g;g++)j=f[g],f[g]=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360;return a},clone:function(){var a=s.clone.call(this);a._hash=this._hash.clone();return a}});r.MD5=s._createHelper(q);r.HmacMD5=s._createHmacHelper(q)})(Math); 13 | -------------------------------------------------------------------------------- /ext/cj/pbkdf2_min.js: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 pbkdf2-min.js 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | (function(){var b=CryptoJS,a=b.lib,d=a.Base,m=a.WordArray,a=b.algo,q=a.HMAC,l=a.PBKDF2=d.extend({cfg:d.extend({keySize:4,hasher:a.SHA1,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,f=q.create(c.hasher,a),g=m.create(),d=m.create([1]),l=g.words,r=d.words,n=c.keySize,c=c.iterations;l.lengthb;b++){var c=v+b,f=e[c];e[c]=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360}var c=this._hash.words,f=B.words,d=C.words,n=x.words,q=y.words,p=z.words,w=A.words,t,g,h,j,r,u,k,l,m,s;u=t=c[0];k=g=c[1];l=h=c[2];m=j=c[3];s=r=c[4];for(var a,b=0;80>b;b+=1)a=t+e[v+n[b]]|0,a=16>b?a+((g^h^j)+f[0]):32>b?a+((g&h|~g&j)+f[1]):48>b? 21 | a+(((g|~h)^j)+f[2]):64>b?a+((g&j|h&~j)+f[3]):a+((g^(h|~j))+f[4]),a|=0,a=a<>>32-p[b],a=a+r|0,t=r,r=j,j=h<<10|h>>>22,h=g,g=a,a=u+e[v+q[b]]|0,a=16>b?a+((k^(l|~m))+d[0]):32>b?a+((k&m|l&~m)+d[1]):48>b?a+(((k|~l)^m)+d[2]):64>b?a+((k&l|~k&m)+d[3]):a+((k^l^m)+d[4]),a|=0,a=a<>>32-w[b],a=a+s|0,u=s,s=m,m=l<<10|l>>>22,l=k,k=a;a=c[1]+h+m|0;c[1]=c[2]+j+s|0;c[2]=c[3]+r+u|0;c[3]=c[4]+t+k|0;c[4]=c[0]+g+l|0;c[0]=a},_doFinalize:function(){var e=this._data,d=e.words,b=8*this._nDataBytes,c=8*e.sigBytes; 22 | d[c>>>5]|=128<<24-c%32;d[(c+64>>>9<<4)+14]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360;e.sigBytes=4*(d.length+1);this._process();e=this._hash;d=e.words;for(b=0;5>b;b++)c=d[b],d[b]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360;return e},clone:function(){var d=p.clone.call(this);d._hash=this._hash.clone();return d}});q.RIPEMD160=p._createHelper(d);q.HmacRIPEMD160=p._createHmacHelper(d)})(Math); 23 | -------------------------------------------------------------------------------- /ext/cj/sha1_min.js: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 sha1-min.js 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | (function(){var k=CryptoJS,b=k.lib,m=b.WordArray,l=b.Hasher,d=[],b=k.algo.SHA1=l.extend({_doReset:function(){this._hash=new m.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(n,p){for(var a=this._hash.words,e=a[0],f=a[1],h=a[2],j=a[3],b=a[4],c=0;80>c;c++){if(16>c)d[c]=n[p+c]|0;else{var g=d[c-3]^d[c-8]^d[c-14]^d[c-16];d[c]=g<<1|g>>>31}g=(e<<5|e>>>27)+b+d[c];g=20>c?g+((f&h|~f&j)+1518500249):40>c?g+((f^h^j)+1859775393):60>c?g+((f&h|f&j|h&j)-1894007588):g+((f^h^ 8 | j)-899497514);b=j;j=h;h=f<<30|f>>>2;f=e;e=g}a[0]=a[0]+e|0;a[1]=a[1]+f|0;a[2]=a[2]+h|0;a[3]=a[3]+j|0;a[4]=a[4]+b|0},_doFinalize:function(){var b=this._data,d=b.words,a=8*this._nDataBytes,e=8*b.sigBytes;d[e>>>5]|=128<<24-e%32;d[(e+64>>>9<<4)+14]=Math.floor(a/4294967296);d[(e+64>>>9<<4)+15]=a;b.sigBytes=4*d.length;this._process();return this._hash},clone:function(){var b=l.clone.call(this);b._hash=this._hash.clone();return b}});k.SHA1=l._createHelper(b);k.HmacSHA1=l._createHmacHelper(b)})(); 9 | -------------------------------------------------------------------------------- /ext/cj/sha224.js: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | (function () { 8 | // Shortcuts 9 | var C = CryptoJS; 10 | var C_lib = C.lib; 11 | var WordArray = C_lib.WordArray; 12 | var C_algo = C.algo; 13 | var SHA256 = C_algo.SHA256; 14 | 15 | /** 16 | * SHA-224 hash algorithm. 17 | */ 18 | var SHA224 = C_algo.SHA224 = SHA256.extend({ 19 | _doReset: function () { 20 | this._hash = new WordArray.init([ 21 | 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 22 | 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 23 | ]); 24 | }, 25 | 26 | _doFinalize: function () { 27 | var hash = SHA256._doFinalize.call(this); 28 | 29 | hash.sigBytes -= 4; 30 | 31 | return hash; 32 | } 33 | }); 34 | 35 | /** 36 | * Shortcut function to the hasher's object interface. 37 | * 38 | * @param {WordArray|string} message The message to hash. 39 | * 40 | * @return {WordArray} The hash. 41 | * 42 | * @static 43 | * 44 | * @example 45 | * 46 | * var hash = CryptoJS.SHA224('message'); 47 | * var hash = CryptoJS.SHA224(wordArray); 48 | */ 49 | C.SHA224 = SHA256._createHelper(SHA224); 50 | 51 | /** 52 | * Shortcut function to the HMAC's object interface. 53 | * 54 | * @param {WordArray|string} message The message to hash. 55 | * @param {WordArray|string} key The secret key. 56 | * 57 | * @return {WordArray} The HMAC. 58 | * 59 | * @static 60 | * 61 | * @example 62 | * 63 | * var hmac = CryptoJS.HmacSHA224(message, key); 64 | */ 65 | C.HmacSHA224 = SHA256._createHmacHelper(SHA224); 66 | }()); 67 | -------------------------------------------------------------------------------- /ext/cj/sha224_min.js: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 sha224-min.js 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | (function(){var b=CryptoJS,d=b.lib.WordArray,a=b.algo,c=a.SHA256,a=a.SHA224=c.extend({_doReset:function(){this._hash=new d.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=c._doFinalize.call(this);a.sigBytes-=4;return a}});b.SHA224=c._createHelper(a);b.HmacSHA224=c._createHmacHelper(a)})(); 8 | -------------------------------------------------------------------------------- /ext/cj/sha256_min.js: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 sha256-min.js 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | (function(k){for(var g=CryptoJS,h=g.lib,v=h.WordArray,j=h.Hasher,h=g.algo,s=[],t=[],u=function(q){return 4294967296*(q-(q|0))|0},l=2,b=0;64>b;){var d;a:{d=l;for(var w=k.sqrt(d),r=2;r<=w;r++)if(!(d%r)){d=!1;break a}d=!0}d&&(8>b&&(s[b]=u(k.pow(l,0.5))),t[b]=u(k.pow(l,1/3)),b++);l++}var n=[],h=h.SHA256=j.extend({_doReset:function(){this._hash=new v.init(s.slice(0))},_doProcessBlock:function(q,h){for(var a=this._hash.words,c=a[0],d=a[1],b=a[2],k=a[3],f=a[4],g=a[5],j=a[6],l=a[7],e=0;64>e;e++){if(16>e)n[e]= 8 | q[h+e]|0;else{var m=n[e-15],p=n[e-2];n[e]=((m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3)+n[e-7]+((p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10)+n[e-16]}m=l+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&g^~f&j)+t[e]+n[e];p=((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+(c&d^c&b^d&b);l=j;j=g;g=f;f=k+m|0;k=b;b=d;d=c;c=m+p|0}a[0]=a[0]+c|0;a[1]=a[1]+d|0;a[2]=a[2]+b|0;a[3]=a[3]+k|0;a[4]=a[4]+f|0;a[5]=a[5]+g|0;a[6]=a[6]+j|0;a[7]=a[7]+l|0},_doFinalize:function(){var d=this._data,b=d.words,a=8*this._nDataBytes,c=8*d.sigBytes; 9 | b[c>>>5]|=128<<24-c%32;b[(c+64>>>9<<4)+14]=k.floor(a/4294967296);b[(c+64>>>9<<4)+15]=a;d.sigBytes=4*b.length;this._process();return this._hash},clone:function(){var b=j.clone.call(this);b._hash=this._hash.clone();return b}});g.SHA256=j._createHelper(h);g.HmacSHA256=j._createHmacHelper(h)})(Math); 10 | -------------------------------------------------------------------------------- /ext/cj/sha384.js: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | (function () { 8 | // Shortcuts 9 | var C = CryptoJS; 10 | var C_x64 = C.x64; 11 | var X64Word = C_x64.Word; 12 | var X64WordArray = C_x64.WordArray; 13 | var C_algo = C.algo; 14 | var SHA512 = C_algo.SHA512; 15 | 16 | /** 17 | * SHA-384 hash algorithm. 18 | */ 19 | var SHA384 = C_algo.SHA384 = SHA512.extend({ 20 | _doReset: function () { 21 | this._hash = new X64WordArray.init([ 22 | new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), 23 | new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), 24 | new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), 25 | new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) 26 | ]); 27 | }, 28 | 29 | _doFinalize: function () { 30 | var hash = SHA512._doFinalize.call(this); 31 | 32 | hash.sigBytes -= 16; 33 | 34 | return hash; 35 | } 36 | }); 37 | 38 | /** 39 | * Shortcut function to the hasher's object interface. 40 | * 41 | * @param {WordArray|string} message The message to hash. 42 | * 43 | * @return {WordArray} The hash. 44 | * 45 | * @static 46 | * 47 | * @example 48 | * 49 | * var hash = CryptoJS.SHA384('message'); 50 | * var hash = CryptoJS.SHA384(wordArray); 51 | */ 52 | C.SHA384 = SHA512._createHelper(SHA384); 53 | 54 | /** 55 | * Shortcut function to the HMAC's object interface. 56 | * 57 | * @param {WordArray|string} message The message to hash. 58 | * @param {WordArray|string} key The secret key. 59 | * 60 | * @return {WordArray} The HMAC. 61 | * 62 | * @static 63 | * 64 | * @example 65 | * 66 | * var hmac = CryptoJS.HmacSHA384(message, key); 67 | */ 68 | C.HmacSHA384 = SHA512._createHmacHelper(SHA384); 69 | }()); 70 | -------------------------------------------------------------------------------- /ext/cj/sha384_min.js: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 sha384-min.js 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | (function(){var c=CryptoJS,a=c.x64,b=a.Word,e=a.WordArray,a=c.algo,d=a.SHA512,a=a.SHA384=d.extend({_doReset:function(){this._hash=new e.init([new b.init(3418070365,3238371032),new b.init(1654270250,914150663),new b.init(2438529370,812702999),new b.init(355462360,4144912697),new b.init(1731405415,4290775857),new b.init(2394180231,1750603025),new b.init(3675008525,1694076839),new b.init(1203062813,3204075428)])},_doFinalize:function(){var a=d._doFinalize.call(this);a.sigBytes-=16;return a}});c.SHA384= 8 | d._createHelper(a);c.HmacSHA384=d._createHmacHelper(a)})(); 9 | -------------------------------------------------------------------------------- /ext/cj/x64-core_min.js: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 x64-core-min.js 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | (function(g){var a=CryptoJS,f=a.lib,e=f.Base,h=f.WordArray,a=a.x64={};a.Word=e.extend({init:function(b,c){this.high=b;this.low=c}});a.WordArray=e.extend({init:function(b,c){b=this.words=b||[];this.sigBytes=c!=g?c:8*b.length},toX32:function(){for(var b=this.words,c=b.length,a=[],d=0;dg.length){g.unshift(0)}}return g};var a=this.getX().toBigInteger();var e=this.getY().toBigInteger();var b=d(a,32);if(c){if(e.isEven()){b.unshift(2)}else{b.unshift(3)}}else{b.unshift(4);b=b.concat(d(e,32))}return b};ECPointFp.decodeFrom=function(g,c){var f=c[0];var e=c.length-1;var d=c.slice(1,1+e/2);var b=c.slice(1+e/2,1+e);d.unshift(0);b.unshift(0);var a=new BigInteger(d);var h=new BigInteger(b);return new ECPointFp(g,g.fromBigInteger(a),g.fromBigInteger(h))};ECPointFp.decodeFromHex=function(g,c){var f=c.substr(0,2);var e=c.length-2;var d=c.substr(2,e/2);var b=c.substr(2+e/2,e/2);var a=new BigInteger(d,16);var h=new BigInteger(b,16);return new ECPointFp(g,g.fromBigInteger(a),g.fromBigInteger(h))};ECPointFp.prototype.add2D=function(c){if(this.isInfinity()){return c}if(c.isInfinity()){return this}if(this.x.equals(c.x)){if(this.y.equals(c.y)){return this.twice()}return this.curve.getInfinity()}var g=c.x.subtract(this.x);var e=c.y.subtract(this.y);var a=e.divide(g);var d=a.square().subtract(this.x).subtract(c.x);var f=a.multiply(this.x.subtract(d)).subtract(this.y);return new ECPointFp(this.curve,d,f)};ECPointFp.prototype.twice2D=function(){if(this.isInfinity()){return this}if(this.y.toBigInteger().signum()==0){return this.curve.getInfinity()}var b=this.curve.fromBigInteger(BigInteger.valueOf(2));var e=this.curve.fromBigInteger(BigInteger.valueOf(3));var a=this.x.square().multiply(e).add(this.curve.a).divide(this.y.multiply(b));var c=a.square().subtract(this.x.multiply(b));var d=a.multiply(this.x.subtract(c)).subtract(this.y);return new ECPointFp(this.curve,c,d)};ECPointFp.prototype.multiply2D=function(b){if(this.isInfinity()){return this}if(b.signum()==0){return this.curve.getInfinity()}var g=b;var f=g.multiply(new BigInteger("3"));var l=this.negate();var d=this;var c;for(c=f.bitLength()-2;c>0;--c){d=d.twice();var a=f.testBit(c);var j=g.testBit(c);if(a!=j){d=d.add2D(a?this:l)}}return d};ECPointFp.prototype.isOnCurve=function(){var d=this.getX().toBigInteger();var i=this.getY().toBigInteger();var f=this.curve.getA().toBigInteger();var c=this.curve.getB().toBigInteger();var h=this.curve.getQ();var e=i.multiply(i).mod(h);var g=d.multiply(d).multiply(d).add(f.multiply(d)).add(c).mod(h);return e.equals(g)};ECPointFp.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"};ECPointFp.prototype.validate=function(){var c=this.curve.getQ();if(this.isInfinity()){throw new Error("Point is at infinity.")}var a=this.getX().toBigInteger();var b=this.getY().toBigInteger();if(a.compareTo(BigInteger.ONE)<0||a.compareTo(c.subtract(BigInteger.ONE))>0){throw new Error("x coordinate out of bounds")}if(b.compareTo(BigInteger.ONE)<0||b.compareTo(c.subtract(BigInteger.ONE))>0){throw new Error("y coordinate out of bounds")}if(!this.isOnCurve()){throw new Error("Point is not on the curve.")}if(this.multiply(c).isInfinity()){throw new Error("Point is not a scalar multiple of G.")}return true}; -------------------------------------------------------------------------------- /ext/json-sans-eval-min.js: -------------------------------------------------------------------------------- 1 | /*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval 2 | */ 3 | var jsonParse=(function(){var e="(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)";var j='(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))';var i='(?:"'+j+'*")';var d=new RegExp("(?:false|true|null|[\\{\\}\\[\\]]|"+e+"|"+i+")","g");var k=new RegExp("\\\\(?:([^u])|u(.{4}))","g");var g={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function h(l,m,n){return m?g[m]:String.fromCharCode(parseInt(n,16))}var c=new String("");var a="\\";var f={"{":Object,"[":Array};var b=Object.hasOwnProperty;return function(u,q){var p=u.match(d);var x;var v=p[0];var l=false;if("{"===v){x={}}else{if("["===v){x=[]}else{x=[];l=true}}var t;var r=[x];for(var o=1-l,m=p.length;o=0;){delete D[n[A]]}}}return q.call(C,B,D)};x=s({"":x},"")}return x}})(); -------------------------------------------------------------------------------- /ext/prng4-min.js: -------------------------------------------------------------------------------- 1 | /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ 2 | */ 3 | function Arcfour(){this.i=0;this.j=0;this.S=new Array()}function ARC4init(d){var c,a,b;for(c=0;c<256;++c){this.S[c]=c}a=0;for(c=0;c<256;++c){a=(a+this.S[c]+d[c%d.length])&255;b=this.S[c];this.S[c]=this.S[a];this.S[a]=b}this.i=0;this.j=0}function ARC4next(){var a;this.i=(this.i+1)&255;this.j=(this.j+this.S[this.i])&255;a=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=a;return this.S[(a+this.S[this.i])&255]}Arcfour.prototype.init=ARC4init;Arcfour.prototype.next=ARC4next;function prng_newstate(){return new Arcfour()}var rng_psize=256; -------------------------------------------------------------------------------- /ext/prng4.js: -------------------------------------------------------------------------------- 1 | /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ 2 | */ 3 | // prng4.js - uses Arcfour as a PRNG 4 | 5 | function Arcfour() { 6 | this.i = 0; 7 | this.j = 0; 8 | this.S = new Array(); 9 | } 10 | 11 | // Initialize arcfour context from key, an array of ints, each from [0..255] 12 | function ARC4init(key) { 13 | var i, j, t; 14 | for(i = 0; i < 256; ++i) 15 | this.S[i] = i; 16 | j = 0; 17 | for(i = 0; i < 256; ++i) { 18 | j = (j + this.S[i] + key[i % key.length]) & 255; 19 | t = this.S[i]; 20 | this.S[i] = this.S[j]; 21 | this.S[j] = t; 22 | } 23 | this.i = 0; 24 | this.j = 0; 25 | } 26 | 27 | function ARC4next() { 28 | var t; 29 | this.i = (this.i + 1) & 255; 30 | this.j = (this.j + this.S[this.i]) & 255; 31 | t = this.S[this.i]; 32 | this.S[this.i] = this.S[this.j]; 33 | this.S[this.j] = t; 34 | return this.S[(t + this.S[this.i]) & 255]; 35 | } 36 | 37 | Arcfour.prototype.init = ARC4init; 38 | Arcfour.prototype.next = ARC4next; 39 | 40 | // Plug in your RNG constructor here 41 | function prng_newstate() { 42 | return new Arcfour(); 43 | } 44 | 45 | // Pool size must be a multiple of 4 and greater than 32. 46 | // An array of bytes the size of the pool will be passed to init() 47 | var rng_psize = 256; 48 | -------------------------------------------------------------------------------- /ext/rng-min.js: -------------------------------------------------------------------------------- 1 | /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ 2 | */ 3 | var rng_state;var rng_pool;var rng_pptr;function rng_seed_int(a){rng_pool[rng_pptr++]^=a&255;rng_pool[rng_pptr++]^=(a>>8)&255;rng_pool[rng_pptr++]^=(a>>16)&255;rng_pool[rng_pptr++]^=(a>>24)&255;if(rng_pptr>=rng_psize){rng_pptr-=rng_psize}}function rng_seed_time(){rng_seed_int(new Date().getTime())}if(rng_pool==null){rng_pool=new Array();rng_pptr=0;var t;if(window!==undefined&&(window.crypto!==undefined||window.msCrypto!==undefined)){var crypto=window.crypto||window.msCrypto;if(crypto.getRandomValues){var ua=new Uint8Array(32);crypto.getRandomValues(ua);for(t=0;t<32;++t){rng_pool[rng_pptr++]=ua[t]}}else{if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var z=window.crypto.random(32);for(t=0;t>>8;rng_pool[rng_pptr++]=t&255}rng_pptr=0;rng_seed_time()}function rng_get_byte(){if(rng_state==null){rng_seed_time();rng_state=prng_newstate();rng_state.init(rng_pool);for(rng_pptr=0;rng_pptr 7 | // in your main HTML document. 8 | 9 | var rng_state; 10 | var rng_pool; 11 | var rng_pptr; 12 | 13 | // Mix in a 32-bit integer into the pool 14 | function rng_seed_int(x) { 15 | rng_pool[rng_pptr++] ^= x & 255; 16 | rng_pool[rng_pptr++] ^= (x >> 8) & 255; 17 | rng_pool[rng_pptr++] ^= (x >> 16) & 255; 18 | rng_pool[rng_pptr++] ^= (x >> 24) & 255; 19 | if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; 20 | } 21 | 22 | // Mix in the current time (w/milliseconds) into the pool 23 | function rng_seed_time() { 24 | rng_seed_int(new Date().getTime()); 25 | } 26 | 27 | // Initialize the pool with junk if needed. 28 | if (rng_pool == null) { 29 | rng_pool = new Array(); 30 | rng_pptr = 0; 31 | var t; 32 | if (typeof window !== "undefined" && 33 | (window.crypto !== undefined || 34 | window.msCrypto !== undefined)) { 35 | var crypto = window.crypto || window.msCrypto; 36 | if (crypto.getRandomValues) { 37 | // Use webcrypto if available 38 | var ua = new Uint8Array(32); 39 | crypto.getRandomValues(ua); 40 | for(t = 0; t < 32; ++t) 41 | rng_pool[rng_pptr++] = ua[t]; 42 | } else if (navigator.appName == "Netscape" && navigator.appVersion < "5") { 43 | // Extract entropy (256 bits) from NS4 RNG if available 44 | var z = window.crypto.random(32); 45 | for(t = 0; t < z.length; ++t) 46 | rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; 47 | } 48 | } 49 | while (rng_pptr < rng_psize) { // extract some randomness from Math.random() 50 | t = Math.floor(65536 * Math.random()); 51 | rng_pool[rng_pptr++] = t >>> 8; 52 | rng_pool[rng_pptr++] = t & 255; 53 | } 54 | rng_pptr = 0; 55 | rng_seed_time(); 56 | //rng_seed_int(window.screenX); 57 | //rng_seed_int(window.screenY); 58 | } 59 | 60 | function rng_get_byte() { 61 | if (rng_state == null) { 62 | rng_seed_time(); 63 | rng_state = prng_newstate(); 64 | rng_state.init(rng_pool); 65 | for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) 66 | rng_pool[rng_pptr] = 0; 67 | rng_pptr = 0; 68 | //rng_pool = null; 69 | } 70 | // TODO: allow reseeding after first request 71 | return rng_state.next(); 72 | } 73 | 74 | function rng_get_bytes(ba) { 75 | var i; 76 | for (i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); 77 | } 78 | 79 | function SecureRandom() {} 80 | 81 | SecureRandom.prototype.nextBytes = rng_get_bytes; 82 | -------------------------------------------------------------------------------- /ext/rsa-min.js: -------------------------------------------------------------------------------- 1 | /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ 2 | */ 3 | function parseBigInt(b,a){return new BigInteger(b,a)}function linebrk(c,d){var a="";var b=0;while(b+d=0&&h>0){var f=e.charCodeAt(d--);if(f<128){g[--h]=f}else{if((f>127)&&(f<2048)){g[--h]=(f&63)|128;g[--h]=(f>>6)|192}else{g[--h]=(f&63)|128;g[--h]=((f>>6)&63)|128;g[--h]=(f>>12)|224}}}g[--h]=0;var b=new SecureRandom();var a=new Array();while(h>2){a[0]=0;while(a[0]==0){b.nextBytes(a)}g[--h]=a[0]}g[--h]=2;g[--h]=0;return new BigInteger(g)}function oaep_mgf1_arr(c,a,e){var b="",d=0;while(b.length>24,(d&16711680)>>16,(d&65280)>>8,d&255])));d+=1}return b}function oaep_pad(q,a,f,l){var c=KJUR.crypto.MessageDigest;var o=KJUR.crypto.Util;var b=null;if(!f){f="sha1"}if(typeof f==="string"){b=c.getCanonicalAlgName(f);l=c.getHashLength(b);f=function(i){return hextorstr(o.hashHex(rstrtohex(i),b))}}if(q.length+2*l+2>a){throw"Message too long for RSA"}var k="",e;for(e=0;e0&&a.length>0){this.n=parseBigInt(b,16);this.e=parseInt(a,16)}else{throw"Invalid RSA public key"}}}function RSADoPublic(a){return a.modPowInt(this.e,this.n)}RSAKey.prototype.doPublic=RSADoPublic;RSAKey.prototype.setPublic=RSASetPublic;RSAKey.prototype.type="RSA"; -------------------------------------------------------------------------------- /ext/rsa2-min.js: -------------------------------------------------------------------------------- 1 | /*! (c) Tom Wu, Kenji Urushima | http://www-cs-students.stanford.edu/~tjw/jsbn/ 2 | */ 3 | function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f=a.length){return null}}var e="";while(++f191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}function oaep_mgf1_str(c,a,e){var b="",d=0;while(b.length>24,(d&16711680)>>16,(d&65280)>>8,d&255]));d+=1}return b}function oaep_unpad(o,b,g,p){var e=KJUR.crypto.MessageDigest;var r=KJUR.crypto.Util;var c=null;if(!g){g="sha1"}if(typeof g==="string"){c=e.getCanonicalAlgName(g);p=e.getHashLength(c);g=function(d){return hextorstr(r.hashHex(rstrtohex(d),c))}}o=o.toByteArray();var h;for(h=0;h0&&a.length>0){this.n=parseBigInt(c,16);this.e=parseInt(a,16);this.d=parseBigInt(b,16)}else{throw"Invalid RSA private key"}}}function RSASetPrivateEx(g,d,e,c,b,a,h,f){this.isPrivate=true;this.isPublic=false;if(g==null){throw"RSASetPrivateEx N == null"}if(d==null){throw"RSASetPrivateEx E == null"}if(g.length==0){throw"RSASetPrivateEx N.length == 0"}if(d.length==0){throw"RSASetPrivateEx E.length == 0"}if(g!=null&&d!=null&&g.length>0&&d.length>0){this.n=parseBigInt(g,16);this.e=parseInt(d,16);this.d=parseBigInt(e,16);this.p=parseBigInt(c,16);this.q=parseBigInt(b,16);this.dmp1=parseBigInt(a,16);this.dmq1=parseBigInt(h,16);this.coeff=parseBigInt(f,16)}else{throw"Invalid RSA private key in RSASetPrivateEx"}}function RSAGenerate(b,l){var a=new SecureRandom();var g=b>>1;this.e=parseInt(l,16);var c=new BigInteger(l,16);var d=(b/2)-100;var k=BigInteger.ONE.shiftLeft(d);for(;;){for(;;){this.p=new BigInteger(b-g,1,a);if(this.p.subtract(BigInteger.ONE).gcd(c).compareTo(BigInteger.ONE)==0&&this.p.isProbablePrime(10)){break}}for(;;){this.q=new BigInteger(g,1,a);if(this.q.subtract(BigInteger.ONE).gcd(c).compareTo(BigInteger.ONE)==0&&this.q.isProbablePrime(10)){break}}if(this.p.compareTo(this.q)<=0){var j=this.p;this.p=this.q;this.q=j}var h=this.q.subtract(this.p).abs();if(h.bitLength() 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 27 | 28 | jsjws - supported algorithm table 29 | 30 | 31 | 32 | 33 |
34 |
35 |

jsrsasign: supported algorithm table

36 | TOP | 37 | DOWNLOADS | 38 | TUTORIALS | 39 | API REFERENCE | 40 | DEMOS | 41 |
42 |
43 | 44 | 45 |
46 |
47 | 48 | 49 |
for jsrsasign 4.2.0: LAST UPDATE: 2013-Oct-07
50 |

51 | Here is the list of supported algortihms in jsrsasign. 52 |

53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 71 | 72 | 73 | 74 | 75 | 76 | 79 | 80 | 81 | 82 | 83 | 84 | 88 | 89 | 90 | 91 | 92 | 93 | 97 | 98 | 99 | 100 | 101 | 102 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 |
FunctionAlgorithmNote
Signature algorithmRSA, RSAPSS, ECDSA, DSA 65 | based on 66 | Tom Wu's Lib(RSA), 67 | David Halls's contribution(RSAPSS), 68 | BitCoinJS(ECDSA) and 69 | OpenPGP.js(DSA). 70 |
Message authentication codeHmac{MD5,SHA1,SHA224,SHA256,SHA384,SHA512} 77 | based on CryptoJS 78 |
Message digestMD5,SHA{1,224,256,384,512},RIPEMD160 85 | based on CryptoJS and 86 | SJCL 87 |
Named curves of elliptic curve cryptographysecp256r1,secp256k1,secp384r1 94 | based on BitCoinJS and 95 | Tom Wu's Lib 96 |
key protection algorithm for PKCS#8 encrypted private keyPBKDF2/HmacSHA1/3DES 103 | based on CryptoJS 104 |
key protection algorithm for PKCS#5 encrypted private keyDES-CBC, DES-EDE3-CBC, AES-{128,192,256}-CBCbased on CryptoJS
114 | 115 | Back to TOP. 116 | 117 | 118 | 119 |
120 |
121 | 122 | 123 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /index_jws_gen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/index_jws_gen.png -------------------------------------------------------------------------------- /index_jws_genjs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/index_jws_genjs.png -------------------------------------------------------------------------------- /index_jwsut.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | jsjws Unit Tests 10 | 11 | 12 | 13 | 14 |
15 |
16 |

jsjws Unit Tests

17 | TOP | 18 | DOWNLOADS | 19 | TUTORIALS | 20 | API REFERENCE | 21 | DEMOS | 22 |
23 |
24 | 25 | 26 |
27 |
28 | 29 | 30 |

Unit Tests

31 | Unit tests for jsrsasign are done using QUnit framework. 32 | This may be useful for examples to learn 'jsjws' library. 33 | 37 | 38 | Back to TOP. 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /min/asn1csr-1.0.min.js: -------------------------------------------------------------------------------- 1 | if(typeof KJUR.asn1.csr=="undefined"||!KJUR.asn1.csr){KJUR.asn1.csr={}}KJUR.asn1.csr.CertificationRequest=function(g){var d=KJUR,c=d.asn1,e=c.DERBitString,b=c.DERSequence,a=c.csr,f=c.x509,h=a.CertificationRequestInfo;a.CertificationRequest.superclass.constructor.call(this);this.setByParam=function(i){this.params=i};this.sign=function(){var j=(new h(this.params)).tohex();var k=new KJUR.crypto.Signature({alg:this.params.sigalg});k.init(this.params.sbjprvkey);k.updateHex(j);var i=k.sign();this.params.sighex=i};this.getPEM=function(){return hextopem(this.tohex(),"CERTIFICATE REQUEST")};this.tohex=function(){var l=this.params;var j=new KJUR.asn1.csr.CertificationRequestInfo(this.params);var m=new KJUR.asn1.x509.AlgorithmIdentifier({name:l.sigalg});if(l.sighex==undefined&&l.sbjprvkey!=undefined){this.sign()}if(l.sighex==undefined){throw new Error("sighex or sbjprvkey parameter not defined")}var k=new e({hex:"00"+l.sighex});var i=new b({array:[j,m,k]});return i.tohex()};this.getEncodedHex=function(){return this.tohex()};if(g!==undefined){this.setByParam(g)}};extendClass(KJUR.asn1.csr.CertificationRequest,KJUR.asn1.ASN1Object);KJUR.asn1.csr.CertificationRequestInfo=function(f){var b=KJUR,j=b.asn1,c=j.DERBitString,g=j.DERSequence,i=j.DERInteger,p=j.DERUTF8String,d=j.DERTaggedObject,h=j.ASN1Util.newObject,n=j.csr,e=j.x509,a=e.X500Name,l=e.Extensions,o=e.SubjectPublicKeyInfo,k=n.AttributeList;n.CertificationRequestInfo.superclass.constructor.call(this);this.params=null;this.setByParam=function(q){if(q!=undefined){this.params=q}};this.tohex=function(){var v=this.params;var r=[];r.push(new i({"int":0}));r.push(new a(v.subject));r.push(new o(KEYUTIL.getKey(v.sbjpubkey)));if(v.attrs!=undefined){var u=m(v.attrs);var t=h({tag:{tage:"a0",obj:u}});r.push(t)}else{if(v.extreq!=undefined){var q=new l(v.extreq);var t=h({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[q]}]}}});r.push(t)}else{r.push(new d({tag:"a0",explicit:false,obj:new p({str:""})}))}}var s=new g({array:r});return s.tohex()};this.getEncodedHex=function(){return this.tohex()};function m(s){var w=Error,v=KJUR.asn1.x509.Extensions;var y=[];for(var u=0;u1){l=new BigInteger(n,16)}else{l=null}m=new BigInteger(o,16);this.setPrivate(h,f,j,l,m)};this.setPublic=function(i,h,f,j){this.isPublic=true;this.p=i;this.q=h;this.g=f;this.y=j;this.x=null};this.setPublicHex=function(k,j,i,l){var g,f,m,h;g=new BigInteger(k,16);f=new BigInteger(j,16);m=new BigInteger(i,16);h=new BigInteger(l,16);this.setPublic(g,f,m,h)};this.signWithMessageHash=function(j){var i=this.p;var h=this.q;var m=this.g;var o=this.y;var t=this.x;var l=KJUR.crypto.Util.getRandomBigIntegerMinToMax(BigInteger.ONE.add(BigInteger.ONE),h.subtract(BigInteger.ONE));var u=j.substr(0,h.bitLength()/4);var n=new BigInteger(u,16);var f=(m.modPow(l,i)).mod(h);var w=(l.modInverse(h).multiply(n.add(t.multiply(f)))).mod(h);var v=KJUR.asn1.ASN1Util.jsonToASN1HEX({seq:[{"int":{bigint:f}},{"int":{bigint:w}}]});return v};this.verifyWithMessageHash=function(m,l){var j=this.p;var h=this.q;var o=this.g;var u=this.y;var n=this.parseASN1Signature(l);var f=n[0];var C=n[1];var B=m.substr(0,h.bitLength()/4);var t=new BigInteger(B,16);if(BigInteger.ZERO.compareTo(f)>0||f.compareTo(h)>0){throw"invalid DSA signature"}if(BigInteger.ZERO.compareTo(C)>=0||C.compareTo(h)>0){throw"invalid DSA signature"}var x=C.modInverse(h);var k=t.multiply(x).mod(h);var i=f.multiply(x).mod(h);var A=o.modPow(k,j).multiply(u.modPow(i,j)).mod(j).mod(h);return A.compareTo(f)==0};this.parseASN1Signature=function(f){try{var i=new c(d(f,0,[0],"02"),16);var h=new c(d(f,0,[1],"02"),16);return[i,h]}catch(g){throw new Error("malformed ASN.1 DSA signature")}};this.readPKCS5PrvKeyHex=function(j){var k,i,g,l,m;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[1],"02");i=d(j,0,[2],"02");g=d(j,0,[3],"02");l=d(j,0,[4],"02");m=d(j,0,[5],"02")}catch(f){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(k,i,g,l,m)};this.readPKCS8PrvKeyHex=function(j){var k,i,g,l;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[1,1,0],"02");i=d(j,0,[1,1,1],"02");g=d(j,0,[1,1,2],"02");l=d(j,0,[2,0],"02")}catch(f){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(k,i,g,null,l)};this.readPKCS8PubKeyHex=function(j){var k,i,g,l;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[0,1,0],"02");i=d(j,0,[0,1,1],"02");g=d(j,0,[0,1,2],"02");l=d(j,0,[1,0],"02")}catch(f){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(k,i,g,l)};this.readCertPubKeyHex=function(j,m){var k,i,g,l;if(a(j)===false){throw new Error("not ASN.1 hex string")}try{k=d(j,0,[0,5,0,1,0],"02");i=d(j,0,[0,5,0,1,1],"02");g=d(j,0,[0,5,0,1,2],"02");l=d(j,0,[0,5,1,0],"02")}catch(f){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(k,i,g,l)}}; -------------------------------------------------------------------------------- /min/jwsjs-2.0.min.js: -------------------------------------------------------------------------------- 1 | if(typeof KJUR=="undefined"||!KJUR){KJUR={}}if(typeof KJUR.jws=="undefined"||!KJUR.jws){KJUR.jws={}}KJUR.jws.JWSJS=function(){var c=KJUR,b=c.jws,a=b.JWS,d=a.readSafeJSONString;this.aHeader=[];this.sPayload="";this.aSignature=[];this.init=function(){this.aHeader=[];this.sPayload=undefined;this.aSignature=[]};this.initWithJWS=function(f){this.init();var e=f.split(".");if(e.length!=3){throw"malformed input JWS"}this.aHeader.push(e[0]);this.sPayload=e[1];this.aSignature.push(e[2])};this.addSignature=function(e,h,m,k){if(this.sPayload===undefined||this.sPayload===null){throw"there's no JSON-JS signature to add."}var l=this.aHeader.length;if(this.aHeader.length!=this.aSignature.length){throw"aHeader.length != aSignature.length"}try{var f=KJUR.jws.JWS.sign(e,h,this.sPayload,m,k);var j=f.split(".");var n=j[0];var g=j[2];this.aHeader.push(j[0]);this.aSignature.push(j[2])}catch(i){if(this.aHeader.length>l){this.aHeader.pop()}if(this.aSignature.length>l){this.aSignature.pop()}throw"addSignature failed: "+i}};this.verifyAll=function(h){if(this.aHeader.length!==h.length||this.aSignature.length!==h.length){return false}for(var g=0;g0){this.aHeader=g.headers}else{throw"malformed header"}if(typeof g.payload==="string"){this.sPayload=g.payload}else{throw"malformed signatures"}if(g.signatures.length>0){this.aSignature=g.signatures}else{throw"malformed signatures"}}catch(e){throw"malformed JWS-JS JSON object: "+e}}};this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}};this.isEmpty=function(){if(this.aHeader.length==0){return 1}return 0}}; -------------------------------------------------------------------------------- /min/nodeutil-1.0.min.js: -------------------------------------------------------------------------------- 1 | var fs=require("fs");var JSONC=require("jsonc-parser");var rs=require("jsrsasign");function readFileUTF8(a){return require("fs").readFileSync(a,"utf8")}function readFileHexByBin(a){return rs.rstrtohex(fs.readFileSync(a,"binary"))}function readFile(a){return fs.readFileSync(a,"binary")}function saveFile(c,b){var a=require("fs");a.writeFileSync(c,b,"binary")}function saveFileUTF8(c,b){var a=require("fs");a.writeFileSync(c,b,"utf8")}function saveFileBinByHex(c,a){var b=rs.hextorstr(a);fs.writeFileSync(c,b,"binary")}function readJSON(b){var a=fs.readFileSync(b,"utf8");var c=JSON.parse(a);return c}function readJSONC(b){var a=fs.readFileSync(b,"utf8");var c=JSONC.parse(a);return c}function saveFileJSON(a,b){var c=JSON.stringify(b,null," ");saveFileUTF8(a,c)}function printJSON(a,c){var b="";if(c!=undefined){b=c}console.log(b+JSON.stringify(a,null," "))}; -------------------------------------------------------------------------------- /min/rsapem-1.1.min.js: -------------------------------------------------------------------------------- 1 | RSAKey.getPosArrayOfChildrenFromHex=function(a){return ASN1HEX.getChildIdx(a,0)};RSAKey.getHexValueArrayOfChildrenFromHex=function(f){var n=ASN1HEX;var i=n.getV;var k=RSAKey.getPosArrayOfChildrenFromHex(f);var e=i(f,k[0]);var j=i(f,k[1]);var b=i(f,k[2]);var c=i(f,k[3]);var h=i(f,k[4]);var g=i(f,k[5]);var m=i(f,k[6]);var l=i(f,k[7]);var d=i(f,k[8]);var k=new Array();k.push(e,j,b,c,h,g,m,l,d);return k};RSAKey.prototype.readPrivateKeyFromPEMString=function(d){var c=pemtohex(d);var b=RSAKey.getHexValueArrayOfChildrenFromHex(c);this.setPrivateEx(b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8])};RSAKey.prototype.readPKCS5PrvKeyHex=function(c){var b=RSAKey.getHexValueArrayOfChildrenFromHex(c);this.setPrivateEx(b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8])};RSAKey.prototype.readPKCS8PrvKeyHex=function(e){var c,i,k,b,a,f,d,j;var m=ASN1HEX;var l=m.getVbyListEx;if(m.isASN1HEX(e)===false){throw new Error("not ASN.1 hex string")}try{c=l(e,0,[2,0,1],"02");i=l(e,0,[2,0,2],"02");k=l(e,0,[2,0,3],"02");b=l(e,0,[2,0,4],"02");a=l(e,0,[2,0,5],"02");f=l(e,0,[2,0,6],"02");d=l(e,0,[2,0,7],"02");j=l(e,0,[2,0,8],"02")}catch(g){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(c,i,k,b,a,f,d,j)};RSAKey.prototype.readPKCS5PubKeyHex=function(c){var e=ASN1HEX;var b=e.getV;if(e.isASN1HEX(c)===false){throw new Error("keyHex is not ASN.1 hex string")}var a=e.getChildIdx(c,0);if(a.length!==2||c.substr(a[0],2)!=="02"||c.substr(a[1],2)!=="02"){throw new Error("wrong hex for PKCS#5 public key")}var f=b(c,a[0]);var d=b(c,a[1]);this.setPublic(f,d)};RSAKey.prototype.readPKCS8PubKeyHex=function(b){var c=ASN1HEX;if(c.isASN1HEX(b)===false){throw new Error("not ASN.1 hex string")}if(c.getTLVbyListEx(b,0,[0,0])!=="06092a864886f70d010101"){throw new Error("not PKCS8 RSA public key")}var a=c.getTLVbyListEx(b,0,[1,0]);this.readPKCS5PubKeyHex(a)};RSAKey.prototype.readCertPubKeyHex=function(b,d){var a,c;a=new X509();a.readCertHex(b);c=a.getPublicKeyHex();this.readPKCS8PubKeyHex(c)}; -------------------------------------------------------------------------------- /min/x509crl.min.js: -------------------------------------------------------------------------------- 1 | var X509CRL=function(e){var a=KJUR,f=a.lang.String.isHex,m=ASN1HEX,k=m.getV,b=m.getTLV,h=m.getVbyList,c=m.getTLVbyList,d=m.getTLVbyListEx,i=m.getIdxbyList,g=m.getIdxbyListEx,l=m.getChildIdx,j=new X509();this.hex=null;this.posSigAlg=null;this.posRevCert=null;this.parsed=null;this._setPos=function(){var o=i(this.hex,0,[0,0]);var n=this.hex.substr(o,2);if(n=="02"){this.posSigAlg=1}else{if(n=="30"){this.posSigAlg=0}else{throw new Error("malformed 1st item of TBSCertList: "+n)}}var s=i(this.hex,0,[0,this.posSigAlg+3]);var r=this.hex.substr(s,2);if(r=="17"||r=="18"){var q,p;q=i(this.hex,0,[0,this.posSigAlg+4]);this.posRevCert=null;if(q!=-1){p=this.hex.substr(q,2);if(p=="30"){this.posRevCert=this.posSigAlg+4}}}else{if(r=="30"){this.posRevCert=this.posSigAlg+3}else{if(r=="a0"){this.posRevCert=null}else{throw new Error("malformed nextUpdate or revCert tag: "+r)}}}};this.getVersion=function(){if(this.posSigAlg==0){return null}return parseInt(h(this.hex,0,[0,0],"02"),16)+1};this.getSignatureAlgorithmField=function(){var n=c(this.hex,0,[0,this.posSigAlg],"30");return j.getAlgorithmIdentifierName(n)};this.getIssuer=function(){return j.getX500Name(this.getIssuerHex())};this.getIssuerHex=function(){return c(this.hex,0,[0,this.posSigAlg+1],"30")};this.getThisUpdate=function(){var n=h(this.hex,0,[0,this.posSigAlg+2]);return result=hextorstr(n)};this.getNextUpdate=function(){var o=i(this.hex,0,[0,this.posSigAlg+3]);var n=this.hex.substr(o,2);if(n!="17"&&n!="18"){return null}return hextorstr(k(this.hex,o))};this.getRevCertArray=function(){if(this.posRevCert==null){return null}var o=[];var n=i(this.hex,0,[0,this.posRevCert]);var p=l(this.hex,n);for(var q=0;q 2 | 3 | 4 | 5 | 6 | jsjws: Mobile Top 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

jsjws: Mobile Top

17 |
18 |
19 | The jsjws is a pure JavaScript 20 | library for JSON Web Sign(JWS) and JSON Web Token(JWT) 21 | and has the broardest algorithm support than others. 22 | 23 |

demo

24 | 27 | 28 |

documents

29 | 32 | 33 | Go to PC top page. 34 | 35 |
36 |
37 |

© 2013 @kjur

38 |
39 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /npm/.npmignore: -------------------------------------------------------------------------------- 1 | _test 2 | -------------------------------------------------------------------------------- /npm/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | echo aaa 3 | 4 | aaa: 5 | cat \ 6 | lib/header.js \ 7 | ../jsrsasign-all-min.js \ 8 | lib/footer.js \ 9 | > lib/jsrsasign.js 10 | 11 | -------------------------------------------------------------------------------- /npm/lib/footer.js: -------------------------------------------------------------------------------- 1 | exports.SecureRandom = SecureRandom; 2 | exports.rng_seed_time = rng_seed_time; 3 | 4 | exports.BigInteger = BigInteger; 5 | exports.RSAKey = RSAKey; 6 | exports.ECDSA = KJUR.crypto.ECDSA; 7 | exports.DSA = KJUR.crypto.DSA; 8 | exports.Signature = KJUR.crypto.Signature; 9 | exports.MessageDigest = KJUR.crypto.MessageDigest; 10 | exports.Mac = KJUR.crypto.Mac; 11 | //exports.Cipher = KJUR.crypto.Cipher; 12 | exports.KEYUTIL = KEYUTIL; 13 | exports.ASN1HEX = ASN1HEX; 14 | exports.X509 = X509; 15 | exports.X509CRL = X509CRL; 16 | exports.CryptoJS = CryptoJS; 17 | 18 | // ext/base64.js 19 | exports.b64tohex = b64tohex; 20 | exports.b64toBA = b64toBA; 21 | 22 | // ext/ec*.js 23 | exports.ECFieldElementFp = ECFieldElementFp; 24 | exports.ECPointFp = ECPointFp; 25 | exports.ECCurveFp = ECCurveFp; 26 | 27 | // base64x.js 28 | exports.stoBA = stoBA; 29 | exports.BAtos = BAtos; 30 | exports.BAtohex = BAtohex; 31 | exports.stohex = stohex; 32 | exports.stob64 = stob64; 33 | exports.stob64u = stob64u; 34 | exports.b64utos = b64utos; 35 | exports.b64tob64u = b64tob64u; 36 | exports.b64utob64 = b64utob64; 37 | exports.hex2b64 = hex2b64; 38 | exports.hextob64u = hextob64u; 39 | exports.b64utohex = b64utohex; 40 | exports.utf8tob64u = utf8tob64u; 41 | exports.b64utoutf8 = b64utoutf8; 42 | exports.utf8tob64 = utf8tob64; 43 | exports.b64toutf8 = b64toutf8; 44 | exports.utf8tohex = utf8tohex; 45 | exports.hextoutf8 = hextoutf8; 46 | exports.hextorstr = hextorstr; 47 | exports.rstrtohex = rstrtohex; 48 | exports.hextob64 = hextob64; 49 | exports.hextob64nl = hextob64nl; 50 | exports.b64nltohex = b64nltohex; 51 | exports.hextopem = hextopem; 52 | exports.pemtohex = pemtohex; 53 | exports.hextoArrayBuffer = hextoArrayBuffer; 54 | exports.ArrayBuffertohex = ArrayBuffertohex; 55 | exports.zulutomsec = zulutomsec; 56 | exports.msectozulu = msectozulu; 57 | exports.zulutosec = zulutosec; 58 | exports.zulutodate = zulutodate; 59 | exports.datetozulu = datetozulu; 60 | exports.uricmptohex = uricmptohex; 61 | exports.hextouricmp = hextouricmp; 62 | exports.ipv6tohex = ipv6tohex; 63 | exports.hextoipv6 = hextoipv6; 64 | exports.hextoip = hextoip; 65 | exports.iptohex = iptohex; 66 | exports.ucs2hextoutf8 = ucs2hextoutf8; 67 | exports.encodeURIComponentAll = encodeURIComponentAll; 68 | exports.newline_toUnix = newline_toUnix; 69 | exports.newline_toDos = newline_toDos; 70 | exports.hextoposhex = hextoposhex; 71 | exports.intarystrtohex = intarystrtohex; 72 | exports.strdiffidx = strdiffidx; 73 | exports.oidtohex = oidtohex; 74 | exports.hextooid = hextooid; 75 | exports.strpad = strpad; 76 | exports.bitstrtoint = bitstrtoint; 77 | exports.inttobitstr = inttobitstr; 78 | exports.bitstrtobinstr = bitstrtobinstr; 79 | exports.binstrtobitstr = binstrtobitstr; 80 | exports.isBase64URLDot = isBase64URLDot; 81 | exports.namearraytobinstr = namearraytobinstr; 82 | exports.extendClass = extendClass; 83 | exports.foldnl = foldnl; 84 | exports.b64topem = b64topem; 85 | exports.pemtob64 = pemtob64; 86 | exports.timeogen = timetogen; 87 | exports.aryval = aryval; 88 | exports.inttohex = inttohex; 89 | exports.twoscompl = twoscompl; 90 | 91 | // name spaces 92 | exports.KJUR = KJUR; 93 | exports.crypto = KJUR.crypto; 94 | exports.asn1 = KJUR.asn1; 95 | exports.jws = KJUR.jws; 96 | exports.lang = KJUR.lang; 97 | 98 | exports.VERSION = VERSION; 99 | exports.VERSION_FULL = VERSION_FULL; 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /npm/lib/header.js: -------------------------------------------------------------------------------- 1 | 2 | var navigator = {}; 3 | navigator.userAgent = false; 4 | 5 | var window = {}; 6 | -------------------------------------------------------------------------------- /npm/lib/lib.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/npm/lib/lib.js -------------------------------------------------------------------------------- /npm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsrsasign", 3 | "version": "11.1.0", 4 | "description": "opensource free pure JavaScript cryptographic library supports RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp and CAdES and JSON Web Signature(JWS)/Token(JWT)/Key(JWK).", 5 | "main": "lib/jsrsasign.js", 6 | "scripts": { 7 | "test": "mocha" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/kjur/jsrsasign.git" 12 | }, 13 | "keywords": [ 14 | "crypto", "cryptography", "Cipher", 15 | "RSA", "ECDSA", "DSA", "RSAPSS", 16 | "PKCS#1", "PKCS#5", "PKCS#8", "private key", "public key", 17 | "CSR", "PKCS#10", 18 | "hash function", 19 | "HMac", 20 | "ASN.1", 21 | "certificate", "X.509", "CRL", "OCSP", 22 | "RFC 3161", "Digital Timestamp", "Timestamp", "Time Stamp Token", 23 | "CMS", "Cryptgraphic Message Syntax", "PKCS#7", 24 | "Signature", "Digital Signature", "signing", 25 | "Message Digest", 26 | "JSON Web Token", "JWT", 27 | "JSON Web Signature", "JWS", 28 | "JSON Web Key", "JWK", 29 | "JOSE", "JWA" 30 | ], 31 | "author": "Kenji Urushima", 32 | "homepage": "http://kjur.github.io/jsrsasign/", 33 | "license": "MIT", 34 | "bugs": { 35 | "url": "https://github.com/kjur/jsrsasign/issues" 36 | }, 37 | "dependencies": {}, 38 | "devDependencies": { 39 | "mocha": "*" 40 | }, 41 | "funding": "https://github.com/kjur/jsrsasign#donations", 42 | "badges": { 43 | "list": [ 44 | "githubsponsors", 45 | "crypto" 46 | ], 47 | "config": { 48 | "githubSponsorsUsername": "kjur", 49 | "cryptoURL": "https://github.com/kjur/jsrsasign#cryptocurrency" 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /npm/test/t_base64x.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'); 2 | var rs = require('../lib/jsrsasign.js'); 3 | 4 | describe("base64x", function() { 5 | describe("hextorstr", function() { 6 | it('should return aaa', function() { 7 | assert.equal("aaa", rs.hextorstr("616161")); 8 | }); 9 | }); 10 | describe("utf8tob64u, b64utoutf8", function() { 11 | it('utf8tob64u', function() { 12 | assert.equal(rs.utf8tob64u("あ"), "44GC"); 13 | assert.equal(rs.utf8tob64u("aaa"), "YWFh"); 14 | }); 15 | it('b64utoutf8', function() { 16 | assert.equal(rs.b64utoutf8("44GC"), "あ"); 17 | assert.equal(rs.b64utoutf8("YWFh"), "aaa"); 18 | }); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /npm/test/t_keyutil_getpem.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const rs = require('../lib/jsrsasign.js'); 3 | 4 | // RFC 9500 RSA1024 TEST PRIVATE KEY 5 | let P5P = `-----BEGIN RSA PRIVATE KEY----- 6 | MIICXQIBAAKBgQCw0YNSqI9T1VFvRsIOejZ9feiKz1SgGfbe9Xq5tEzt2yJCsbyg 7 | +xtcuCswNhdqY5A1ZN7G60HbL4/Hh/TlLhFJ4zNHVylz9mDDx3yp4IIcK2lb566d 8 | fTD0B5EQ9Iqub4twLUdLKQCBfyhmJJvsEqKxm4J4QWgI+Brh/Pm3d4piPwIDAQAB 9 | AoGASC6fj6TkLfMNdYHLQqG9kOlPfys4fstarpZD7X+fUBJ/H/7y5DzeZLGCYAIU 10 | +QeAHWv6TfZIQjReW7Qy00RFJdgwFlTFRCsKXhG5x+IB+jL0Grr08KbgPPDgy4Jm 11 | xirRHZVtU8lGbkiZX+omDIU28EHLNWL6rFEcTWao/tERspECQQDp2G5Nw0qYWn7H 12 | Wm9Up1zkUTnkUkCzhqtxHbeRvNmHGKE7ryGMJEk2RmgHVstQpsvuFY4lIUSZEjAc 13 | DUFJERhFAkEAwZH6O1ULORp8sHKDdidyleYcZU8L7y9Y3OXJYqELfddfBgFUZeVQ 14 | duRmJj7ryu0g0uurOTE+i8VnMg/ostxiswJBAOc64Dd8uLJWKa6uug+XPr91oi0n 15 | OFtM+xHrNK2jc+WmcSg3UJDnAI3uqMc5B+pERLq0Dc6hStehqHjUko3RnZECQEGZ 16 | eRYWciE+Cre5dzfZkomeXE0xBrhecV0bOq6EKWLSVE+yr6mAl05ThRK9DCfPSOpy 17 | F6rgN3QiyCA9J/1FluUCQQC5nX+PTU1FXx+6Ri2ZCi6EjEKMHr7gHcABhMinZYOt 18 | N59pra9UdVQw9jxCU9G7eMyb0jJkNACAuEwakX3gi27b 19 | -----END RSA PRIVATE KEY-----`; 20 | 21 | let prvobj = rs.KEYUTIL.getKey(P5P); 22 | 23 | describe("KEYUTIL", function() { 24 | describe("getPEM", function() { 25 | it('encrypted private key PKCS8PRV', function() { 26 | let head = "-----BEGIN ENCRYPTED PRIVATE KEY-----"; 27 | let prvencpem = rs.KEYUTIL.getPEM(prvobj, "PKCS8PRV", "passwd"); 28 | assert.equal(head, prvencpem.substr(0, head.length)); 29 | }); 30 | }); 31 | }); 32 | 33 | -------------------------------------------------------------------------------- /npm/test/t_rsasign.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'); 2 | var rs = require('../lib/jsrsasign.js'); 3 | 4 | // z1.pkcs1.pem 5 | var _Z1PKCS1PEM = (function() {/* 6 | -----BEGIN RSA PRIVATE KEY----- 7 | MIICWwIBAAKBgQDRhGF7X4A0ZVlEg594WmODVVUIiiPQs04aLmvfg8SborHss5gQ 8 | Xu0aIdUT6nb5rTh5hD2yfpF2WIW6M8z0WxRhwicgXwi80H1aLPf6lEPPLvN29EhQ 9 | NjBpkFkAJUbS8uuhJEeKw0cE49g80eBBF4BCqSL6PFQbP9/rByxdxEoAIQIDAQAB 10 | AoGAA9/q3Zk6ib2GFRpKDLO/O2KMnAfR+b4XJ6zMGeoZ7Lbpi3MW0Nawk9ckVaX0 11 | ZVGqxbSIX5Cvp/yjHHpww+QbUFrw/gCjLiiYjM9E8C3uAF5AKJ0r4GBPl4u8K4bp 12 | bXeSxSB60/wPQFiQAJVcA5xhZVzqNuF3EjuKdHsw+dk+dPECQQDubX/lVGFgD/xY 13 | uchz56Yc7VHX+58BUkNSewSzwJRbcueqknXRWwj97SXqpnYfKqZq78dnEF10SWsr 14 | /NMKi+7XAkEA4PVqDv/OZAbWr4syXZNv/Mpl4r5suzYMMUD9U8B2JIRnrhmGZPzL 15 | x23N9J4hEJ+Xh8tSKVc80jOkrvGlSv+BxwJAaTOtjA3YTV+gU7Hdza53sCnSw/8F 16 | YLrgc6NOJtYhX9xqdevbyn1lkU0zPr8mPYg/F84m6MXixm2iuSz8HZoyzwJARi2p 17 | aYZ5/5B2lwroqnKdZBJMGKFpUDn7Mb5hiSgocxnvMkv6NjT66Xsi3iYakJII9q8C 18 | Ma1qZvT/cigmdbAh7wJAQNXyoizuGEltiSaBXx4H29EdXNYWDJ9SS5f070BRbAIl 19 | dqRh3rcNvpY6BKJqFapda1DjdcncZECMizT/GMrc1w== 20 | -----END RSA PRIVATE KEY----- 21 | */}).toString().match(/\/\*([^]*)\*\//)[1]; 22 | 23 | var _hSigAAA = "6f7df91d8f973a0619d525c319337741130b77b21f9667dc7d1d74853b644cbe5e6b0e84aacc2faee883d43affb811fc653b67c38203d4f206d1b838c4714b6b2cf17cd621303c21bac96090df3883e58784a0576e501c10cdefb12b6bf887e548f6b07b09ae80d8416151d7dab7066d645e2eee57ac5f7af2a70ee0724c8e47"; 24 | 25 | describe("rsasign", function() { 26 | describe("z1.pkcs1.pem", function() { 27 | var prv = new rs.RSAKey(); 28 | prv.readPKCS5PrvKeyHex(rs.pemtohex(_Z1PKCS1PEM)); 29 | it('load and sign properly', function() { 30 | assert.equal(1024, prv.n.bitLength()); 31 | assert.equal(_hSigAAA, prv.sign("aaa", "sha1")); 32 | }); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /npm/test/t_sig_rsasha1.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'); 2 | var rs = require('../lib/jsrsasign.js'); 3 | 4 | // z1.pkcs1.pem 5 | var _Z1PKCS1PEM = (function() {/* 6 | -----BEGIN RSA PRIVATE KEY----- 7 | MIICWwIBAAKBgQDRhGF7X4A0ZVlEg594WmODVVUIiiPQs04aLmvfg8SborHss5gQ 8 | Xu0aIdUT6nb5rTh5hD2yfpF2WIW6M8z0WxRhwicgXwi80H1aLPf6lEPPLvN29EhQ 9 | NjBpkFkAJUbS8uuhJEeKw0cE49g80eBBF4BCqSL6PFQbP9/rByxdxEoAIQIDAQAB 10 | AoGAA9/q3Zk6ib2GFRpKDLO/O2KMnAfR+b4XJ6zMGeoZ7Lbpi3MW0Nawk9ckVaX0 11 | ZVGqxbSIX5Cvp/yjHHpww+QbUFrw/gCjLiiYjM9E8C3uAF5AKJ0r4GBPl4u8K4bp 12 | bXeSxSB60/wPQFiQAJVcA5xhZVzqNuF3EjuKdHsw+dk+dPECQQDubX/lVGFgD/xY 13 | uchz56Yc7VHX+58BUkNSewSzwJRbcueqknXRWwj97SXqpnYfKqZq78dnEF10SWsr 14 | /NMKi+7XAkEA4PVqDv/OZAbWr4syXZNv/Mpl4r5suzYMMUD9U8B2JIRnrhmGZPzL 15 | x23N9J4hEJ+Xh8tSKVc80jOkrvGlSv+BxwJAaTOtjA3YTV+gU7Hdza53sCnSw/8F 16 | YLrgc6NOJtYhX9xqdevbyn1lkU0zPr8mPYg/F84m6MXixm2iuSz8HZoyzwJARi2p 17 | aYZ5/5B2lwroqnKdZBJMGKFpUDn7Mb5hiSgocxnvMkv6NjT66Xsi3iYakJII9q8C 18 | Ma1qZvT/cigmdbAh7wJAQNXyoizuGEltiSaBXx4H29EdXNYWDJ9SS5f070BRbAIl 19 | dqRh3rcNvpY6BKJqFapda1DjdcncZECMizT/GMrc1w== 20 | -----END RSA PRIVATE KEY----- 21 | */}).toString().match(/\/\*([^]*)\*\//)[1]; 22 | 23 | var _hSigAAA = "6f7df91d8f973a0619d525c319337741130b77b21f9667dc7d1d74853b644cbe5e6b0e84aacc2faee883d43affb811fc653b67c38203d4f206d1b838c4714b6b2cf17cd621303c21bac96090df3883e58784a0576e501c10cdefb12b6bf887e548f6b07b09ae80d8416151d7dab7066d645e2eee57ac5f7af2a70ee0724c8e47"; 24 | 25 | describe("KJUR.crypto.Signature.sign SHA1withRSA", function() { 26 | describe("z1.pkcs1.pem", function() { 27 | var sig = new rs.KJUR.crypto.Signature({alg: "SHA1withRSA"}); 28 | sig.init(_Z1PKCS1PEM); 29 | sig.updateString("aaa"); 30 | it('load and sign properly', function() { 31 | assert.equal(_hSigAAA, sig.sign()); 32 | }); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /npm_util/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all aaa 2 | 3 | all: 4 | @echo aaa 5 | 6 | aaa: lib/jsrsasign-util.js 7 | 8 | lib/jsrsasign-util.js: lib/header.js ../min/nodeutil-1.0.min.js lib/footer.js 9 | cat $^ > $@ 10 | 11 | -------------------------------------------------------------------------------- /npm_util/README.md: -------------------------------------------------------------------------------- 1 | jsrsasign-util 2 | ========= 3 | 4 | This package provides supplementary functions for 'jsrsasign' such like file I/O utilities. 5 | 6 | Public page is https://kjur.github.io/jsrsasign . 7 | 8 | [github TOP](https://kjur.github.io/jsrsasign/)|[API doc](https://kjur.github.io/jsrsasign/api/)|[Wiki](https://github.com/kjur/jsrsasign/wiki)|[Node sample](https://github.com/kjur/jsrsasign/tree/master/sample_node) 9 | 10 | AVAILABLE FUNCTIONS 11 | ----------------------------- 12 | 13 | - [readFile](https://kjur.github.io/jsrsasign/api/symbols/global__.html#readFile) : read file as binary string 14 | - [readFileHexByBin](https://kjur.github.io/jsrsasign/api/symbols/global__.html#readFileHexByBin) : read file as binary then convert it to hexadecimal string 15 | - [readFileUTF8](https://kjur.github.io/jsrsasign/api/symbols/global__.html#readFileUTF8) : read file as UTF-8 string 16 | - [saveFile](https://kjur.github.io/jsrsasign/api/symbols/global__.html#saveFile) : save file as binary string 17 | - [saveFileBinByHex](https://kjur.github.io/jsrsasign/api/symbols/global__.html#saveFileBinByHex) : convert a hexadecimal string to raw string then save it as file. 18 | 19 | EXAMPLE(1) SIGNATURE 20 | -------------------- 21 | 22 | > var rsu = require('jsrsasign-util'); 23 | > var rawString = rsu.readFile("bar.bin"); 24 | > rsu.saveFileBinByHex("foo.bin", "30143abb..."); 25 | 26 | 27 | -------------------------------------------------------------------------------- /npm_util/lib/footer.js: -------------------------------------------------------------------------------- 1 | 2 | exports.readFileUTF8 = readFileUTF8; 3 | exports.readFileHexByBin = readFileHexByBin; 4 | exports.readFile = readFile; 5 | exports.saveFile = saveFile; 6 | exports.saveFileUTF8 = saveFileUTF8; 7 | exports.saveFileBinByHex = saveFileBinByHex; 8 | exports.readJSON = readJSON; 9 | exports.readJSONC = readJSONC; 10 | exports.saveFileJSON = saveFileJSON; 11 | exports.printJSON = printJSON; 12 | 13 | -------------------------------------------------------------------------------- /npm_util/lib/header.js: -------------------------------------------------------------------------------- 1 | /*! jsrsasign-util-1.0.1 (c) 2016-2020 Kenji Urushima | kjur.github.com/jsrsasign/license 2 | */ 3 | -------------------------------------------------------------------------------- /npm_util/lib/jsrsasign-util.js: -------------------------------------------------------------------------------- 1 | /*! jsrsasign-util-1.0.1 (c) 2016-2020 Kenji Urushima | kjur.github.com/jsrsasign/license 2 | */ 3 | var fs=require("fs");var JSONC=require("jsonc-parser");var rs=require("jsrsasign");function readFileUTF8(a){return require("fs").readFileSync(a,"utf8")}function readFileHexByBin(a){return rs.rstrtohex(fs.readFileSync(a,"binary"))}function readFile(a){return fs.readFileSync(a,"binary")}function saveFile(c,b){var a=require("fs");a.writeFileSync(c,b,"binary")}function saveFileUTF8(c,b){var a=require("fs");a.writeFileSync(c,b,"utf8")}function saveFileBinByHex(c,a){var b=rs.hextorstr(a);fs.writeFileSync(c,b,"binary")}function readJSON(b){var a=fs.readFileSync(b,"utf8");var c=JSON.parse(a);return c}function readJSONC(b){var a=fs.readFileSync(b,"utf8");var c=JSONC.parse(a);return c}function saveFileJSON(a,b){var c=JSON.stringify(b,null," ");saveFileUTF8(a,c)}function printJSON(a,c){var b="";if(c!=undefined){b=c}console.log(b+JSON.stringify(a,null," "))}; 4 | exports.readFileUTF8 = readFileUTF8; 5 | exports.readFileHexByBin = readFileHexByBin; 6 | exports.readFile = readFile; 7 | exports.saveFile = saveFile; 8 | exports.saveFileUTF8 = saveFileUTF8; 9 | exports.saveFileBinByHex = saveFileBinByHex; 10 | exports.readJSON = readJSON; 11 | exports.readJSONC = readJSONC; 12 | exports.saveFileJSON = saveFileJSON; 13 | exports.printJSON = printJSON; 14 | 15 | -------------------------------------------------------------------------------- /npm_util/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsrsasign-util", 3 | "version": "1.0.5", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "jsrsasign-util", 9 | "version": "1.0.5", 10 | "dependencies": { 11 | "jsonc-parser": ">= 0.0.1", 12 | "jsrsasign": ">= 4.8.2" 13 | } 14 | }, 15 | "node_modules/jsonc-parser": { 16 | "version": "3.0.0", 17 | "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", 18 | "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==" 19 | }, 20 | "node_modules/jsrsasign": { 21 | "version": "10.2.0", 22 | "resolved": "https://registry.npmjs.org/jsrsasign/-/jsrsasign-10.2.0.tgz", 23 | "integrity": "sha512-khMrV/10U02DRzmXhjuLQjddUF39GHndaJZ/3YiiKkbyEl1T5M6EQF9nQUq0DFVCHusmd/jl8TWl4mWt+1L5hg==", 24 | "funding": { 25 | "url": "https://github.com/kjur/jsrsasign#donations" 26 | } 27 | } 28 | }, 29 | "dependencies": { 30 | "jsonc-parser": { 31 | "version": "3.0.0", 32 | "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", 33 | "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==" 34 | }, 35 | "jsrsasign": { 36 | "version": "10.2.0", 37 | "resolved": "https://registry.npmjs.org/jsrsasign/-/jsrsasign-10.2.0.tgz", 38 | "integrity": "sha512-khMrV/10U02DRzmXhjuLQjddUF39GHndaJZ/3YiiKkbyEl1T5M6EQF9nQUq0DFVCHusmd/jl8TWl4mWt+1L5hg==" 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /npm_util/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsrsasign-util", 3 | "version": "1.0.5", 4 | "description": "utilities for jsrsasign (kjur.github.io/jsrsasign) such like file utilities", 5 | "main": "lib/jsrsasign-util.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/kjur/jsrsasign.git" 12 | }, 13 | "keywords": [ 14 | "jsrsasign", 15 | "utilities", 16 | "file" 17 | ], 18 | "author": "Kenji Urushima", 19 | "licenses": [ 20 | { 21 | "type": "MIT", 22 | "url": "https://raw.github.com/kjur/jsrsasign/master/LICENSE.txt" 23 | } 24 | ], 25 | "bugs": { 26 | "url": "https://github.com/kjur/jsrsasign/issues" 27 | }, 28 | "dependencies": { 29 | "jsonc-parser": ">= 0.0.1", 30 | "jsrsasign": ">= 4.8.2" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sample-rsasign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample-rsasign.png -------------------------------------------------------------------------------- /sample/css/jquery.nouislider.css: -------------------------------------------------------------------------------- 1 | 2 | /* Functional styling; 3 | * These styles are required for noUiSlider to function. 4 | * You don't need to change these rules to apply your design. 5 | */ 6 | .noUi-target, 7 | .noUi-target * { 8 | -webkit-touch-callout: none; 9 | -webkit-user-select: none; 10 | -ms-touch-action: none; 11 | -ms-user-select: none; 12 | -moz-user-select: none; 13 | -moz-box-sizing: border-box; 14 | box-sizing: border-box; 15 | } 16 | .noUi-base { 17 | width: 100%; 18 | height: 100%; 19 | position: relative; 20 | } 21 | .noUi-origin { 22 | position: absolute; 23 | right: 0; 24 | top: 0; 25 | left: 0; 26 | bottom: 0; 27 | } 28 | .noUi-handle { 29 | position: relative; 30 | z-index: 1; 31 | } 32 | .noUi-stacking .noUi-handle { 33 | /* This class is applied to the lower origin when 34 | its values is > 50%. */ 35 | z-index: 10; 36 | } 37 | .noUi-stacking + .noUi-origin { 38 | /* Fix stacking order in IE7, which incorrectly 39 | creates a new context for the origins. */ 40 | *z-index: -1; 41 | } 42 | .noUi-state-tap .noUi-origin { 43 | -webkit-transition: left 0.3s, top 0.3s; 44 | transition: left 0.3s, top 0.3s; 45 | } 46 | .noUi-state-drag * { 47 | cursor: inherit !important; 48 | } 49 | 50 | /* Slider size and handle placement; 51 | */ 52 | .noUi-horizontal { 53 | height: 8px; 54 | border-radius: 4px; 55 | -webkit-border-radius: 4px; 56 | -moz-border-radius: 4px; 57 | -o-border-radius: 4px; 58 | -ms-border-radius: 4px; 59 | } 60 | .noUi-horizontal .noUi-handle { 61 | width: 25px; 62 | height: 25px; 63 | left: -21px; 64 | top: -8px; 65 | cursor: pointer; 66 | } 67 | .noUi-horizontal.noUi-extended { 68 | padding: 0 15px; 69 | } 70 | .noUi-horizontal.noUi-extended .noUi-origin { 71 | right: -15px; 72 | } 73 | .noUi-vertical { 74 | width: 18px; 75 | } 76 | .noUi-vertical .noUi-handle { 77 | width: 28px; 78 | height: 34px; 79 | left: -6px; 80 | top: -17px; 81 | } 82 | .noUi-vertical.noUi-extended { 83 | padding: 15px 0; 84 | } 85 | .noUi-vertical.noUi-extended .noUi-origin { 86 | bottom: -15px; 87 | } 88 | 89 | /* Styling; 90 | */ 91 | .noUi-background { 92 | background: #e1e4e9; 93 | box-shadow: inset 0px 0px 0px #0076B3, 0px 0px 0px 0px #1B455A, 0px 2px 1px #FFF; 94 | -webkit-box-shadow: inset 0px 0px 0px #0076B3, 0px 0px 0px 0px #1B455A, 0px 2px 1px #FFF; 95 | -moz-box-shadow: inset 0px 0px 0px #0076B3, 0px 0px 0px 0px #1B455A, 0px 2px 1px #FFF; 96 | -o-box-shadow: inset 0px 0px 0px #0076B3, 0px 0px 0px 0px #1B455A, 0px 2px 1px #FFF; 97 | } 98 | .noUi-connect { 99 | background: #4fc1e9; 100 | -webkit-transition: background 450ms; 101 | transition: background 450ms; 102 | } 103 | .noUi-origin { 104 | border-radius: 4px; 105 | -webkit-border-radius: 4px; 106 | -moz-border-radius: 4px; 107 | -o-border-radius: 4px; 108 | } 109 | .noUi-target { 110 | border-radius: 4px; 111 | -webkit-border-radius: 4px; 112 | -moz-border-radius: 4px; 113 | -o-border-radius: 4px; 114 | } 115 | .noUi-target.noUi-connect { 116 | } 117 | /* Handles and cursors; 118 | */ 119 | .noUi-dragable { 120 | cursor: w-resize; 121 | } 122 | .noUi-vertical .noUi-dragable { 123 | cursor: n-resize; 124 | } 125 | .noUi-handle { 126 | border: 1px solid #D9D9D9; 127 | border-radius: 3px; 128 | -webkit-border-radius: 3px; 129 | -moz-border-radius: 3px; 130 | -o-border-radius: 3px; 131 | background: #FFF; 132 | cursor: default; 133 | } 134 | .noUi-active { 135 | } 136 | 137 | /* Handle stripes; 138 | */ 139 | .noUi-handle:before, 140 | .noUi-handle:after { 141 | content: ""; 142 | display: block; 143 | position: absolute; 144 | height: 14px; 145 | width: 1px; 146 | background: #E8E7E6; 147 | left: 5px; 148 | top: 5px; 149 | } 150 | .noUi-handle:after { 151 | left: 17px; 152 | } 153 | .noUi-vertical .noUi-handle:before, 154 | .noUi-vertical .noUi-handle:after { 155 | width: 14px; 156 | height: 1px; 157 | left: 6px; 158 | top: 14px; 159 | } 160 | .noUi-vertical .noUi-handle:after { 161 | top: 17px; 162 | } 163 | 164 | /* Disabled state; 165 | */ 166 | [disabled].noUi-connect, 167 | [disabled] .noUi-connect { 168 | background: #B8B8B8; 169 | } 170 | [disabled] .noUi-handle { 171 | cursor: not-allowed; 172 | } 173 | -------------------------------------------------------------------------------- /sample/images/arrow-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/arrow-left.png -------------------------------------------------------------------------------- /sample/images/arrow-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/arrow-right.png -------------------------------------------------------------------------------- /sample/images/audio.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/audio.jpg -------------------------------------------------------------------------------- /sample/images/audio2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/audio2.jpg -------------------------------------------------------------------------------- /sample/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/close.png -------------------------------------------------------------------------------- /sample/images/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/cloud.png -------------------------------------------------------------------------------- /sample/images/clouds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/clouds.png -------------------------------------------------------------------------------- /sample/images/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/heart.png -------------------------------------------------------------------------------- /sample/images/img_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/img_sprite.png -------------------------------------------------------------------------------- /sample/images/left_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/left_arrow.png -------------------------------------------------------------------------------- /sample/images/likes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/likes.png -------------------------------------------------------------------------------- /sample/images/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/lock.png -------------------------------------------------------------------------------- /sample/images/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/mail.png -------------------------------------------------------------------------------- /sample/images/mail1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/mail1.png -------------------------------------------------------------------------------- /sample/images/menu_1_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/menu_1_left.png -------------------------------------------------------------------------------- /sample/images/menu_1_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/menu_1_right.png -------------------------------------------------------------------------------- /sample/images/menu_2_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/menu_2_left.png -------------------------------------------------------------------------------- /sample/images/menu_3_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/menu_3_left.png -------------------------------------------------------------------------------- /sample/images/menu_3_right.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/menu_3_right.PNG -------------------------------------------------------------------------------- /sample/images/menu_4_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/menu_4_left.png -------------------------------------------------------------------------------- /sample/images/menu_4_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/menu_4_right.png -------------------------------------------------------------------------------- /sample/images/menu_5_1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/menu_5_1.PNG -------------------------------------------------------------------------------- /sample/images/menu_5_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/menu_5_2.png -------------------------------------------------------------------------------- /sample/images/menu_5_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/menu_5_3.png -------------------------------------------------------------------------------- /sample/images/menu_5_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/menu_5_4.png -------------------------------------------------------------------------------- /sample/images/menu_5_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/menu_5_5.png -------------------------------------------------------------------------------- /sample/images/notify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/notify.png -------------------------------------------------------------------------------- /sample/images/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/pause.png -------------------------------------------------------------------------------- /sample/images/pic1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/pic1.jpg -------------------------------------------------------------------------------- /sample/images/pic2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/pic2.jpg -------------------------------------------------------------------------------- /sample/images/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/play.png -------------------------------------------------------------------------------- /sample/images/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/plus.png -------------------------------------------------------------------------------- /sample/images/request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/request.png -------------------------------------------------------------------------------- /sample/images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/search.png -------------------------------------------------------------------------------- /sample/images/serch_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/serch_plus.png -------------------------------------------------------------------------------- /sample/images/set.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/set.png -------------------------------------------------------------------------------- /sample/images/shop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/shop.png -------------------------------------------------------------------------------- /sample/images/sun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/sun.png -------------------------------------------------------------------------------- /sample/images/sun1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/sun1.png -------------------------------------------------------------------------------- /sample/images/sun_cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/sun_cloud.png -------------------------------------------------------------------------------- /sample/images/sun_icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/sun_icon1.png -------------------------------------------------------------------------------- /sample/images/tag_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/tag_close.png -------------------------------------------------------------------------------- /sample/images/temp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/temp.png -------------------------------------------------------------------------------- /sample/images/twit_1_ban.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/twit_1_ban.jpg -------------------------------------------------------------------------------- /sample/images/twit_1_social_dribble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/twit_1_social_dribble.png -------------------------------------------------------------------------------- /sample/images/twit_1_social_dribbleh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/twit_1_social_dribbleh.png -------------------------------------------------------------------------------- /sample/images/twit_1_social_fb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/twit_1_social_fb.png -------------------------------------------------------------------------------- /sample/images/twit_1_social_fbh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/twit_1_social_fbh.png -------------------------------------------------------------------------------- /sample/images/twit_1_social_twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/twit_1_social_twitter.png -------------------------------------------------------------------------------- /sample/images/twit_1_social_twitterh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/twit_1_social_twitterh.png -------------------------------------------------------------------------------- /sample/images/twit_1_social_vimeo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/twit_1_social_vimeo.png -------------------------------------------------------------------------------- /sample/images/twit_1_social_vimeoh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/twit_1_social_vimeoh.png -------------------------------------------------------------------------------- /sample/images/twit_1_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/twit_1_user.png -------------------------------------------------------------------------------- /sample/images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/user.png -------------------------------------------------------------------------------- /sample/images/weather_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/weather_1.jpg -------------------------------------------------------------------------------- /sample/images/weather_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kjur/jsrsasign/58bb24192f501927014b67911bbde8ef27532319/sample/images/weather_2.jpg -------------------------------------------------------------------------------- /sample/js/jquery.circliful.min.js: -------------------------------------------------------------------------------- 1 | (function(a){a.fn.circliful=function(b){var c=a.extend({foregroundColor:"#556b2f",backgroundColor:"#eee",fillColor:false,width:15,dimension:200,size:15,percent:50,animationStep:1},b);return this.each(function(){var F="";var s="";var E="";var v="";var t=0;var e=0;var l=100;var B="";var d="";var D="";var q=0;a(this).addClass("circliful");if(a(this).data("dimension")!=undefined){F=a(this).data("dimension")}else{F=c.dimension}if(a(this).data("width")!=undefined){v=a(this).data("width")}else{v=c.width}if(a(this).data("fontsize")!=undefined){t=a(this).data("fontsize")}else{t=c.size}if(a(this).data("percent")!=undefined){e=a(this).data("percent")/100;l=a(this).data("percent")}else{e=c.percent/100}if(a(this).data("fgcolor")!=undefined){B=a(this).data("fgcolor")}else{B=c.foregroundColor}if(a(this).data("bgcolor")!=undefined){d=a(this).data("bgcolor")}else{d=c.backgroundColor}if(a(this).data("animation-step")!=undefined){q=parseFloat(a(this).data("animation-step"))}else{q=c.animationStep}if(a(this).data("text")!=undefined){s=a(this).data("text");if(a(this).data("icon")!=undefined){D=''}if(a(this).data("type")!=undefined){i=a(this).data("type");if(i=="half"){a(this).append(''+D+s+"");a(this).find(".circle-text-half").css({"line-height":(F/1.45)+"px","font-size":t+"px"})}else{a(this).append(''+D+s+"");a(this).find(".circle-text").css({"line-height":F+"px","font-size":t+"px"})}}else{a(this).append(''+D+s+"");a(this).find(".circle-text").css({"line-height":F+"px","font-size":t+"px"})}}else{if(a(this).data("icon")!=undefined){}}if(a(this).data("info")!=undefined){E=a(this).data("info");if(a(this).data("type")!=undefined){i=a(this).data("type");if(i=="half"){a(this).append(''+E+"");a(this).find(".circle-info-half").css({"line-height":(F*0.9)+"px",})}else{a(this).append(''+E+"");a(this).find(".circle-info").css({"line-height":(F*1.25)+"px",})}}else{a(this).append(''+E+"");a(this).find(".circle-info").css({"line-height":(F*1.25)+"px",})}}a(this).width(F+"px");var h=a("").attr({width:F,height:F}).appendTo(a(this)).get(0);var f=h.getContext("2d");var p=h.width/2;var o=h.height/2;var A=e*360;var G=A*(Math.PI/180);var j=h.width/2.5;var z=2.3*Math.PI;var u=0;var C=false;var m=q===0?l:0;var n=Math.max(q,0);var r=Math.PI*2;var g=Math.PI/2;var i="";var w=false;if(a(this).data("type")!=undefined){i=a(this).data("type");if(i=="half"){var z=2*Math.PI;var u=3.13;var r=Math.PI*1;var g=Math.PI/0.996}}if(a(this).data("fill")!=undefined){w=a(this).data("fill")}else{w=c.fillColor}function k(x){f.clearRect(0,0,h.width,h.height);f.beginPath();f.arc(p,o,j,u,z,false);f.lineWidth=v-1;f.strokeStyle=d;f.stroke();if(w){f.fillStyle=w;f.fill()}f.beginPath();f.arc(p,o,j,-(g),((r)*x)-g,false);f.lineWidth=v;f.strokeStyle=B;f.stroke();if(m') 38 | .description('show dump of ASN.1 DER file') 39 | .parse(process.argv); 40 | 41 | if (program.args.length !== 1) 42 | throw "wrong number of arguments"; 43 | 44 | var file = program.args[0]; 45 | 46 | var bin = rsu.readFile(file); 47 | var hex = rs.rstrtohex(bin); 48 | console.log(rs.ASN1HEX.dump(hex)); 49 | -------------------------------------------------------------------------------- /sample_node/asn1extract: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * asn1extract - extract data at any position from ASN.1 structured data 5 | * 6 | * Copyright (c) 2015-2016 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script extracts descendant ASN.1 structure data from ASN.1 18 | * DER data file by specifying index list in the ASN.1 nested 19 | * structures. 20 | * 21 | * USAGE 22 | * % asn1extract out.der z.req 0 0 0 0 1 23 | * idx = 42 24 | * 04147ae13ee8a0c42a2cb428cbe7a605461940e2a1e9 25 | * OCTETSTRING 7ae13ee8a0c42a2cb428cbe7a605461940e2a1e9 26 | * # write this to out.der. "z.req" is OCSP request. 27 | */ 28 | 29 | var program = require('commander'); 30 | var rs = require('jsrsasign'); 31 | var rsu = require('jsrsasign-util'); 32 | var path = require('path'); 33 | 34 | program 35 | .version('1.0.1 (2016-Sep-11)') 36 | .description('extract arbitrary part of ASN.1 DER data by a list of position') 37 | .usage('[options] ') 38 | .option('-a, --alltlv', 'extract whole ASN.1 TLV structure ') 39 | .option('-v, --vonly', 'extract ASN.1 V value only') 40 | .parse(process.argv); 41 | 42 | if (program.args.length < 3) 43 | throw "wrong number of arguments"; 44 | 45 | var outFile = program.args[0]; 46 | var inFile = program.args[1]; 47 | 48 | var hex; 49 | try { 50 | hex = rsu.readFileHexByBin(inFile); 51 | } catch(ex) { 52 | throw "can't read file: " + inFile; 53 | } 54 | 55 | var idxList = program.args.slice(2); 56 | //console.log("idxList = %j", idxList); 57 | var parseInt10 = function(i) {return parseInt(i, 10);}; 58 | var idxList2 = idxList.map(parseInt10); 59 | //console.log("idxList2 = %j", idxList2); 60 | 61 | var idx = rs.ASN1HEX.getIdxbyList(hex, 0, idxList2); 62 | console.log("idx = %j", idx); 63 | var hExtract = rs.ASN1HEX.getTLV(hex, idx); 64 | console.log(hExtract); 65 | console.log(rs.ASN1HEX.dump(hExtract)); 66 | rsu.saveFileBinByHex(outFile, hExtract); 67 | 68 | -------------------------------------------------------------------------------- /sample_node/asn1extract2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * asn1extract2 - extract data at any position from ASN.1 structured data 5 | * 6 | * Copyright (c) 2020 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script extracts descendant ASN.1 structure data from ASN.1 18 | * DER data file by specifying index list in the ASN.1 nested 19 | * structures. 20 | * 21 | * USAGE 22 | * extract ASN.1 structure specified 0,0,0,1 position 23 | * % asn1extract2 -i in.der -out out.der -l 0,0,0,1 24 | * extract children at the position specified 0,1,0 25 | * % asn1extract2 -i in.der -out out.der -l 0,1,0 26 | * > out.1.der, out.2.der ... 27 | */ 28 | 29 | var program = require('commander'); 30 | var rs = require('jsrsasign'); 31 | var rsu = require('jsrsasign-util'); 32 | var path = require('path'); 33 | 34 | function _getIdxFileName(file, idx) { 35 | var result = file; 36 | var a = file.match(/^(.+)[.]([^.]+)$/); 37 | if (a != undefined) { 38 | result = a[1] + "." + idx + "." + a[2]; 39 | } else { 40 | result = file + "." + idx; 41 | } 42 | return result; 43 | }; 44 | 45 | program 46 | .version('1.0.2 (2020-Jul-29)') 47 | .description('extract arbitrary part of ASN.1 DER data by a list of position') 48 | .usage('[options]') 49 | .option('-i, --in ', 'input DER file') 50 | .option('-o, --out ', 'extracted output DER file') 51 | .option('-l, --list ', 'list of ASN.1 structure positions to extract (ex. 1,0,0)') 52 | .option('-c, --children', 'extract children for specified position') 53 | .option('-v, --vonly', 'extract ASN.1 V value only') 54 | .parse(process.argv); 55 | 56 | //console.log("in=" + program.in); 57 | //console.log("out=" + program.out); 58 | //console.log("list=" + program.list); 59 | if (program.in == undefined || 60 | program.out == undefined || 61 | program.list == undefined) { 62 | throw "wrong arguments: in, out and list shall be specified"; 63 | } 64 | 65 | var outFile = program.out; 66 | var inFile = program.in; 67 | var idxListStr = program.list.split(","); 68 | var idxList = idxListStr.map(function (i) {return parseInt(i, 10);}); 69 | 70 | var hIn; 71 | try { 72 | hIn = rsu.readFileHexByBin(inFile); 73 | } catch(ex) { 74 | throw "can't read file: " + inFile; 75 | } 76 | 77 | //console.log(idxList); 78 | 79 | var idx = rs.ASN1HEX.getIdxbyList(hIn, 0, idxList); 80 | //console.log("idx = %j", idx); 81 | 82 | console.log("program.children=" + JSON.stringify(program.children)); 83 | if (program.children !== true) { 84 | var hExtract; 85 | if (program.vonly !== true) { 86 | hExtract = rs.ASN1HEX.getTLV(hIn, idx); 87 | } else { 88 | hExtract = rs.ASN1HEX.getV(hIn, idx); 89 | if (hIn.substr(idx, 2) == "03") { 90 | hExtract = hExtract.substr(2); // bit string 91 | } 92 | } 93 | //console.log(hExtract); 94 | //console.log(rs.ASN1HEX.dump(hExtract)); 95 | rsu.saveFileBinByHex(outFile, hExtract); 96 | } else { 97 | var idxChildren = rs.ASN1HEX.getChildIdx(hIn, idx); 98 | console.log("idxChildren.length=" + idxChildren.length); 99 | for (var i = 0; i < idxChildren.length; i++) { 100 | var outFileChild = _getIdxFileName(outFile, i + 1); 101 | var hExtract; 102 | if (program.vonly !== true) { 103 | hExtract = rs.ASN1HEX.getTLV(hIn, idxChildren[i]); 104 | } else { 105 | hExtract = rs.ASN1HEX.getV(hIn, idxChildren[i]); 106 | if (hIn.substr(idx, 2) == "03") { 107 | hExtract = hExtract.substr(2); // bit string 108 | } 109 | } 110 | console.log("saving " + outFileChild + " ..."); 111 | rsu.saveFileBinByHex(outFileChild, hExtract); 112 | } 113 | } 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /sample_node/cmssign: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * cmssign - generate CMS signed data 5 | * 6 | * Copyright (c) 2017 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script signes a text or file data by specified private key 18 | * and signature algorithm. 19 | * 20 | * USAGE 21 | * % cmssign aaa.bin a.prv aaa.p7s 22 | */ 23 | 24 | var program = require('commander'); 25 | var rs = require('jsrsasign'); 26 | var rsu = require('jsrsasign-util'); 27 | var path = require('path'); 28 | 29 | program 30 | .version('1.0.0 (2017-Jul-30)') 31 | .usage('[options] [sig alg]') 32 | .description('generate CMS signed data for data file.') 33 | .parse(process.argv); 34 | 35 | if (program.args.length !== 4 && program.args.length !== 5) 36 | throw "wrong number of arguments"; 37 | 38 | var textOrFile = program.args[0]; 39 | var prvFile = program.args[1]; 40 | var certFile = program.args[2]; 41 | var outFile = program.args[3]; 42 | var hashAlg = "SHA256withRSA"; 43 | if (program.args.length === 5) hashAlg = program.args[4]; 44 | 45 | // 1. data to be signed 46 | var hContent = rsu.readFileHexByBin(textOrFile); 47 | 48 | // 2. prv key 49 | var prvPEM = rsu.readFile(prvFile); 50 | 51 | // 3. cert file 52 | var certPEM = rsu.readFile(certFile); 53 | 54 | var sd = rs.KJUR.asn1.cms.CMSUtil.newSignedData({ 55 | content: {hex: hContent}, 56 | certs: [certPEM], 57 | signerInfos: [{ 58 | hashAlg: 'sha256', 59 | sAttr: { 60 | SigningTime: {}, 61 | SigningCertificateV2: {array: [certPEM]} 62 | }, 63 | signerCert: certPEM, 64 | sigAlg: 'SHA256withRSA', 65 | signerPrvKey: prvPEM 66 | }], 67 | 68 | }); 69 | 70 | rsu.saveFileBinByHex(outFile, sd.getContentInfoEncodedHex()); 71 | console.log("generate CMS signed data and save to file done."); 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /sample_node/datadecrypt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * datadecrypt - data decryptor 5 | * 6 | * Copyright (c) 2016 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script decrypts a encrypted binary data file with 18 | * RSA or RSA-OAEP algorithm. 19 | * 20 | * USAGE 21 | * % dataencrypt enc.bin plain.txt rsaprv.pem RSA # with RSA alg 22 | * % dataencrypt enc.bin plain.txt rsaprv.pem RSAOAEP # with RSAOAEP alg 23 | * % dataencrypt enc.bin - rsaprv.pem RSA # output to stdout by '-' 24 | */ 25 | 26 | var program = require('commander'); 27 | var rs = require('jsrsasign'); 28 | var rsu = require('jsrsasign-util'); 29 | var path = require('path'); 30 | 31 | program 32 | .version('1.0.0 (2016-Nov-05)') 33 | .usage('[options] [RSA|RSAOEAP*>]') 34 | .description('encrypt data') 35 | .parse(process.argv); 36 | 37 | if (program.args.length < 3) 38 | throw "wrong number of arguments"; 39 | 40 | var keyObj, inHex, encHex; 41 | var algName = "RSA"; 42 | var keyStr = ""; 43 | var inFileOrHex = program.args[0]; 44 | var outFile = program.args[1]; 45 | var keyFileOrStr = program.args[2]; 46 | if (program.args.length > 3) algName = program.args[3]; 47 | 48 | try { 49 | keyStr = rsu.readFile(keyFileOrStr); 50 | } catch(ex) { 51 | keyStr = keyFileOrStr; 52 | } 53 | 54 | try { 55 | inHex = rs.rstrtohex(rsu.readFile(inFileOrHex)); 56 | } catch(ex) { 57 | inHex = inFileOrHex; 58 | } 59 | 60 | try { 61 | keyObj = rs.KEYUTIL.getKey(keyStr); 62 | } catch(ex) {}; 63 | 64 | if (keyObj instanceof rs.RSAKey && keyObj.isPrivate) { 65 | var plainStr = rs.KJUR.crypto.Cipher.decrypt(inHex, keyObj, algName); 66 | if (outFile === "-") { 67 | process.stdout.write(plainStr); 68 | } else { 69 | rsu.saveFile(outFile, plainStr); 70 | console.log("data decrypted and write to file successfully"); 71 | } 72 | } else { 73 | console.log("data decryption failed"); 74 | } 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /sample_node/dataencrypt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * dataencrypt - data encryptor 5 | * 6 | * Copyright (c) 2016 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script encrypts a plain text or data file with 18 | * RSA or RSA-OAEP algorithm. 19 | * 20 | * USAGE 21 | * % dataencrypt data.txt enc.bin rsapub.pem RSA # with RSA alg 22 | * % dataencrypt data.txt enc.bin rsapub.pem RSAOAEP # with RSA-OEAP alg 23 | * % dataencrypt data.txt enc.bin rsapub.pem RSAOAEP256 24 | * # with RSA/ECB/OAEPWithSHA-256AndMGF1Padding 25 | */ 26 | 27 | var program = require('commander'); 28 | var rs = require('jsrsasign'); 29 | var rsu = require('jsrsasign-util'); 30 | var path = require('path'); 31 | 32 | program 33 | .version('1.0.0 (2016-Nov-05)') 34 | .usage('[options] [RSA|RSAOAEP*]') 35 | .description('encrypt data') 36 | .parse(process.argv); 37 | 38 | if (program.args.length < 3) 39 | throw "wrong number of arguments"; 40 | 41 | var keyObj, inStr, encHex; 42 | var algName = "RSA"; 43 | var keyStr = ""; 44 | var inFileOrStr = program.args[0]; 45 | var outFile = program.args[1]; 46 | var keyFileOrStr = program.args[2]; 47 | if (program.args.length > 3) algName = program.args[3]; 48 | 49 | try { 50 | keyStr = rsu.readFile(keyFileOrStr); 51 | } catch(ex) { 52 | keyStr = keyFileOrStr; 53 | } 54 | 55 | try { 56 | inStr = rsu.readFile(inFileOrStr); 57 | } catch(ex) { 58 | inStr = inFileOrStr; 59 | } 60 | 61 | try { 62 | keyObj = rs.KEYUTIL.getKey(keyStr); 63 | } catch(ex) {}; 64 | 65 | if (keyObj instanceof rs.RSAKey && keyObj.isPublic) { 66 | encHex = rs.KJUR.crypto.Cipher.encrypt(inStr, keyObj, algName); 67 | rsu.saveFileBinByHex(outFile, encHex); 68 | console.log("data encrypted successfully"); 69 | } else { 70 | console.log("data encryption failed"); 71 | } 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /sample_node/datasign: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * datasign - sign text or file 5 | * 6 | * Copyright (c) 2016 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script signes a text or file data by specified private key 18 | * and signature algorithm. 19 | * 20 | * USAGE 21 | * % datasign aaa.txt a.prv a.sig 22 | * % datasign aaa.txt a.prv a256.sig SHA256withRSA 23 | * % datasign "test" a.prv test.sig 24 | * 25 | * Resulted signature can also be verified by OpenSSL. 26 | * % openssl dgst -sha1 -verify a.pub -signature a.sig aaa.txt 27 | */ 28 | 29 | var program = require('commander'); 30 | var rs = require('jsrsasign'); 31 | var rsu = require('jsrsasign-util'); 32 | var path = require('path'); 33 | 34 | program 35 | .version('1.0.0 (2016-Nov-19)') 36 | .usage('[options] [sig alg]') 37 | .description('sign text or file with specified private key and sig algorithm.') 38 | .parse(process.argv); 39 | 40 | if (program.args.length !== 3 && program.args.length !== 4) 41 | throw "wrong number of arguments"; 42 | 43 | var textOrFile = program.args[0]; 44 | var prvFile = program.args[1]; 45 | var outFile = program.args[2]; 46 | var hashAlg = "SHA1withRSA"; 47 | if (program.args.length === 4) hashAlg = program.args[3]; 48 | 49 | // 1. private key 50 | var prvPEM = rsu.readFile(prvFile); 51 | var prv = rs.KEYUTIL.getKey(prvPEM); 52 | //console.log(prv); 53 | 54 | // 2. data to be signed 55 | var text; 56 | try { 57 | text = rsu.readFile(textOrFile); 58 | } catch(ex) { 59 | text = textOrFile; 60 | } 61 | 62 | var sig = new rs.KJUR.crypto.Signature({alg: hashAlg}); 63 | sig.init(prv); 64 | sig.updateString(text); 65 | var sigHex = sig.sign(); 66 | rsu.saveFileBinByHex(outFile, sigHex); 67 | //console.log(sigHex); 68 | console.log("successfully signed"); 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /sample_node/dataverify: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * dataverify - verify signature of text or file 5 | * 6 | * Copyright (c) 2016 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script verifies a signature of a text or file data by 18 | * specified public key and signature algorithm. 19 | * 20 | * USAGE 21 | * % dataverify aaa.txt a.pub a.sig 22 | * % dataverify aaa.txt a.pub a256.sig SHA256withRSA 23 | * % dataverify "test" a.pub test.sig 24 | * 25 | * Resulted signature can also be verified by OpenSSL. 26 | * % openssl dgst -sha1 -verify a.pub -signature a.sig aaa.txt 27 | */ 28 | 29 | var program = require('commander'); 30 | var rs = require('jsrsasign'); 31 | var rsu = require('jsrsasign-util'); 32 | var path = require('path'); 33 | 34 | program 35 | .version('1.0.0 (2016-Nov-19)') 36 | .usage('[options] [sig alg]') 37 | .description('verify signature of text or file with specified public and sig algorithm.') 38 | .parse(process.argv); 39 | 40 | if (program.args.length !== 3 && program.args.length !== 4) 41 | throw "wrong number of arguments"; 42 | 43 | var textOrFile = program.args[0]; 44 | var pubFile = program.args[1]; 45 | var sigFile = program.args[2]; 46 | var hashAlg = "SHA1withRSA"; 47 | if (program.args.length === 4) hashAlg = program.args[3]; 48 | 49 | // 1. public key 50 | var pubPEM = rsu.readFile(pubFile); 51 | var pub = rs.KEYUTIL.getKey(pubPEM); 52 | //console.log(pub); 53 | 54 | // 2. data to be verifid 55 | var text; 56 | try { 57 | text = rsu.readFile(textOrFile); 58 | } catch(ex) { 59 | text = textOrFile; 60 | } 61 | 62 | // 3. load signature 63 | var sigHex = rsu.readFileHexByBin(sigFile); 64 | 65 | var sig = new rs.KJUR.crypto.Signature({alg: hashAlg}); 66 | sig.init(pub); 67 | sig.updateString(text); 68 | var isValid = sig.verify(sigHex); 69 | 70 | if (isValid) { 71 | console.log("signature is valid"); 72 | } else { 73 | console.log("signature is invalid"); 74 | } 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /sample_node/eckey2hex: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * eckey2hex - read PKCS#1/5/8 PEM EC private or public key and show key in hexadecimal 5 | * 6 | * Copyright (c) 2020 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * read PKCS#1/5/8 PEM EC private or public key and show key in hexadecimal 18 | * 19 | * USAGE 20 | * % eckey2hex private.key 21 | * private key = 1234abcd... 22 | * public key = 04abcd... 23 | * % eckey2hex public.key 24 | * public key = 04abcd... 25 | */ 26 | 27 | var program = require('commander'); 28 | var rs = require('jsrsasign'); 29 | var rsu = require('jsrsasign-util'); 30 | var path = require('path'); 31 | 32 | program 33 | .version('1.0.0 (2020-APr-12)') 34 | .description('read EC key and show key in hexadecimal string') 35 | .usage(' ec-key-file') 36 | .parse(process.argv); 37 | 38 | if (program.args.length != 1) 39 | throw "wrong number of arguments"; 40 | 41 | var inFile = program.args[program.args.length - 1]; 42 | 43 | var pem; 44 | try { 45 | pem = rsu.readFile(inFile); 46 | } catch (ex) { 47 | throw "can't read file: " + inFile 48 | } 49 | 50 | var key = rs.KEYUTIL.getKey(pem); 51 | if (key instanceof rs.KJUR.crypto.ECDSA) { 52 | if (key.prvKeyHex != null) 53 | console.log("private key = " + key.prvKeyHex); 54 | if (key.pubKeyHex != null) 55 | console.log("public key = " + key.pubKeyHex); 56 | } 57 | 58 | -------------------------------------------------------------------------------- /sample_node/gencsr: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * gencsr - generate keypair and CSR, then save them to files. 5 | * 6 | * Copyright (c) 2016 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script generates RSA and EC public key pair and 18 | * CSR(Certificate Signing Request), then save them as: 19 | * - PKCS#8 PEM public key file 20 | * - PKCS#8 PEM encrypted private key file 21 | * - PEM CSR file 22 | * 23 | * USAGE 24 | * Genearte yyy.{pub,prv,csr} by default 25 | * (RSA 2048 with password "passwd" and CSR for /C=US/O=TEST) 26 | * % gencsr yyy 27 | * RSA 1024 with password "secret" and CSR for /C=US/O=T1/CN=mydomain.com 28 | * % gencsr -s 1024 -p secret -d /C=US/O=T1/CN=mydomain.com yyy 29 | * EC curve secp256k1 30 | * % gencsr -a EC -c secp256k1 yyy 31 | */ 32 | 33 | var program = require('commander'); 34 | var rs = require('jsrsasign'); 35 | var rsu = require('jsrsasign-util'); 36 | var path = require('path'); 37 | 38 | program 39 | .version('1.0.2 (2016-Sep-11)') 40 | .description('generate keypair and CSR, then save them to FILEHEAD.{pub,prv,csr}') 41 | .usage('[options] [file head]') 42 | .option('-a, --keyalg ', 'public key algorithm. default=RSA', "RSA") 43 | .option('-s, --size ', 'RSA key size. default=2048', "2048") 44 | .option('-c, --curve ', 'EC curve name. default=secp256r1', 'secp256r1') 45 | .option('-d, --dn ', 'subject DN for CSR. default=/C=US/O=TEST', '/C=US/O=TEST') 46 | .option('-p, --pass ', 'password for PKCS#8 private key. default=passwd', 'passwd') 47 | .parse(process.argv); 48 | 49 | //console.log("program.args.length=" + program.args.length); 50 | 51 | if (program.args.length !== 1) 52 | throw "wrong number of args" 53 | 54 | var head = program.args[0]; 55 | var dn = program.dn; 56 | var keyalg = program.keyalg; 57 | var keyopt, sigalg; 58 | if (program.keyalg === "RSA") { 59 | keyopt = parseInt(program.size); 60 | sigalg = "SHA256withRSA"; 61 | } else { 62 | keyopt = program.curve; 63 | sigalg = "SHA256withECDSA"; 64 | } 65 | var pass = program.pass; 66 | 67 | var pubFile = head + ".pub"; 68 | var prvFile = head + ".prv"; 69 | var csrFile = head + ".csr"; 70 | 71 | console.log("generating keypair..."); 72 | var kp = rs.KEYUTIL.generateKeypair(keyalg, keyopt); 73 | console.log("done."); 74 | var prvKey = kp.prvKeyObj; 75 | var pubKey = kp.pubKeyObj; 76 | 77 | var csr = rs.asn1.csr.CSRUtil.newCSRPEM({ 78 | subject: {str: dn}, 79 | sbjpubkey: pubKey, 80 | sigalg: sigalg, 81 | sbjprvkey: prvKey 82 | }); 83 | 84 | rsu.saveFile(pubFile, rs.KEYUTIL.getPEM(pubKey)); 85 | rsu.saveFile(prvFile, rs.KEYUTIL.getPEM(prvKey, "PKCS8PRV", pass)); 86 | rsu.saveFile(csrFile, csr); 87 | console.log("all save done."); 88 | 89 | 90 | -------------------------------------------------------------------------------- /sample_node/genjwk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * genjwk - generate keypair then save them as RFC 7517 JSON Web Key(JWK) files. 5 | * 6 | * Copyright (c) 2016 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script generates RSA or EC public key pair, then 18 | * plain RFC 7517 JSON Web Key(JWK) format. 19 | * - JWK private key 20 | * - JWK public key 21 | * 22 | * USAGE 23 | * Genearte yyy.{pub.jwk,prv.jwk} for EC P-256. 24 | * % genjwk EC P-256 yyy 25 | * Genearte xxx.{pub.jwk,prv.jwk} for RSA 2048bit 26 | * % genjwk RSA 2048 xxx 27 | */ 28 | 29 | var program = require('commander'); 30 | var rs = require('jsrsasign'); 31 | var rsu = require('jsrsasign-util'); 32 | var path = require('path'); 33 | 34 | program 35 | .version('1.0.1 (2016-Sep-11)') 36 | .description('generate keypair, then save them as JWK files') 37 | .usage('[options] [RSA|EC] [RSASIZE|CURVE] [file head]') 38 | .parse(process.argv); 39 | 40 | //console.log("program.args.length=" + program.args.length); 41 | 42 | if (program.args.length !== 3) 43 | throw "wrong number of args" 44 | 45 | var keyalg = program.args[0]; 46 | var keyopt = program.args[1]; 47 | var head = program.args[2]; 48 | 49 | var pubFile = head + ".pub.jwk"; 50 | var prvFile = head + ".prv.jwk"; 51 | 52 | console.log("generating keypair..."); 53 | var kp = rs.KEYUTIL.generateKeypair(keyalg, keyopt); 54 | console.log("keypair generated..."); 55 | var prvKey = kp.prvKeyObj; 56 | var pubKey = kp.pubKeyObj; 57 | var prvJWK = rs.KEYUTIL.getJWKFromKey(prvKey); 58 | var pubJWK = rs.KEYUTIL.getJWKFromKey(pubKey); 59 | 60 | rsu.saveFile(pubFile, JSON.stringify(pubJWK, null, 2)); 61 | rsu.saveFile(prvFile, JSON.stringify(prvJWK, null, 2)); 62 | 63 | console.log("all save done."); 64 | 65 | -------------------------------------------------------------------------------- /sample_node/jwktopkcs8: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * jwktopkcs8 - convert JWK file to PKCS#8 private/public key 5 | * 6 | * Copyright (c) 2016 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script converts from RFC 7517 JSON Web Key (JWK) file to 18 | * PEM PKCS#8 RSA/ECC private/public key file. 19 | * 20 | * USAGE 21 | * % jwktopkcs8 [INPUT JWK KEY FILE] [OUTPUT PKCS8 FILE] 22 | * % jwktopkcs8 aaa.prv.jwk aaa.prv.p8 23 | */ 24 | 25 | var program = require('commander'); 26 | var rs = require('jsrsasign'); 27 | var rsu = require('jsrsasign-util'); 28 | var path = require('path'); 29 | 30 | program 31 | .version('1.0.1 (2016-Sep-11)') 32 | .description('convert JWK to PEM PKCS#8 private/public key') 33 | .usage('[INPUT JWK KEY] [OUTPUT PKCS8]') 34 | .parse(process.argv); 35 | 36 | if (program.args.length !== 2) 37 | throw "wrong number of args" 38 | 39 | var inFile = program.args[0]; 40 | var outFile = program.args[1]; 41 | 42 | var sJWK = rsu.readFile(inFile); 43 | var jwk = rs.jws.JWS.readSafeJSONString(sJWK); 44 | var key = rs.KEYUTIL.getKey(jwk); 45 | var pem; 46 | if (key.isPublic) { 47 | pem = rs.KEYUTIL.getPEM(key); 48 | } else { 49 | pem = rs.KEYUTIL.getPEM(key, "PKCS8PRV"); 50 | } 51 | rsu.saveFile(outFile, pem); 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /sample_node/jwssign: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * jwssign - sign JWS by header/payload file or string 5 | * 6 | * Copyright (c) 2015-2016 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script generates a JWS(JSON Web Signatures) file. 18 | * 19 | * USAGE 20 | * % jwssign '{}' '{"fruit":"apple"}' jws.out -t utf8 -p pass -f HS256 21 | * % jwssign '{}' '{"fruit":"apple"}' jws.out -t hex -p 616161 -f HS256 #pass is 'aaa' 22 | * % jwssign '{}' '{"fruit":"apple"}' jws.out -k prv.pem -f RS256 23 | * % jwssign '{}' '{"fruit":"apple"}' jws.out -k prv.pem -f PS256 24 | */ 25 | 26 | var program = require('commander'); 27 | var rs = require('jsrsasign'); 28 | var rsu = require('jsrsasign-util'); 29 | var path = require('path'); 30 | var JWS = rs.jws.JWS; 31 | 32 | program 33 | .version('1.0.1 (2016-Sep-11)') 34 | .usage('[options] ') 35 | .description('sign JWS by header/payload file or string') 36 | .option('-t, --passtype ', 'Hmac(HS*) pass type', 'utf8') 37 | .option('-p, --pass ', 'Hmac(HS*) password in specfied type', 'passwd') 38 | .option('-k, --prvkey ', 'private key file (ex. PKCS#8 PEM)') 39 | .option('-f, --forcealg ', 'overwrite alg in header (ex. HS512)') 40 | .parse(process.argv); 41 | 42 | if (program.args.length !== 3) 43 | throw "wrong number of arguments"; 44 | var outFile = program.args[2]; 45 | 46 | var sHeader, pHeader, sPayload; 47 | var pass, prvKeyObj; 48 | 49 | /* 50 | * Read Header and Payload 51 | */ 52 | 53 | try { 54 | var inFile = program.args[0]; 55 | sHeader = rsu.readFile(inFile); 56 | } catch(ex) { 57 | sHeader = program.args[0] // as string 58 | } 59 | 60 | try { 61 | var inFile = program.args[1]; 62 | sPayload = rsu.readFile(inFile); 63 | } catch(ex) { 64 | sPayload = program.args[1] // as string 65 | } 66 | 67 | pHeader = JWS.readSafeJSONString(sHeader); 68 | if (pHeader === null) 69 | throw "error: not safe JSON header: " + sHeader; 70 | 71 | /* 72 | * pass, prvkey and sigalg check 73 | */ 74 | if (program.forcealg !== undefined && pHeader.alg !== program.forcealg) { 75 | pHeader.alg = program.forcealg; 76 | sHeader = JSON.stringify(pHeader); 77 | } 78 | 79 | pass = {}; 80 | if (! JWS.inArray(program.passtype, ['utf8', 'hex', 'b64', 'b64u'])) 81 | throw "unsupported HS* password type: " + program.passtype; 82 | if (program.passtype !== undefined && program.pass !== undefined) 83 | pass[program.passtype] = program.pass; 84 | 85 | if (program.prvkey !== undefined) { 86 | var prvPEM = rsu.readFile(program.prvkey); 87 | prvKeyObj = rs.KEYUTIL.getKey(prvPEM); 88 | } 89 | 90 | if (prvKeyObj === undefined && ! pHeader.alg.match(/^HS/)) 91 | throw "sigalg shall be HS* in header for hmac password"; 92 | 93 | if (prvKeyObj !== undefined && prvKeyObj instanceof rs.RSAKey && 94 | ! pHeader.alg.match(/^[PR]S/)) 95 | throw "sigalg shall be PS* or RS* in header for RSA key"; 96 | 97 | if (prvKeyObj !== undefined && prvKeyObj instanceof rs.crypto.ECDSA && 98 | ! pHeader.alg.match(/^ES/)) 99 | throw "sigalg shall be ES* in header for ECDSA key: " + pHeader.alg; 100 | 101 | /* 102 | * sign JWS 103 | */ 104 | var sJWS 105 | if (prvKeyObj === undefined) { 106 | sJWS = JWS.sign(pHeader.alg, sHeader, sPayload, pass); 107 | } else { 108 | sJWS = JWS.sign(pHeader.alg, sHeader, sPayload, prvKeyObj); 109 | } 110 | 111 | if (outFile === "-") 112 | console.log(sJWS); 113 | else 114 | rsu.saveFile(outFile, sJWS); 115 | 116 | 117 | -------------------------------------------------------------------------------- /sample_node/jwsview: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * jwsview - JWS(JSON Web Signatures) viewer 5 | * 6 | * Copyright (c) 2016 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script shows parsed JWS(JSON Web Signature) file. 18 | * 19 | * USAGE 20 | * % jwsview aaa.jws 21 | * 22 | * *** JWS Header *** 23 | * { 24 | * "alg": "RS256" 25 | * } 26 | * *** JWS Payload *** 27 | * { 28 | * "fruit": "apple" 29 | * } 30 | * *** JWS Signature *** 31 | * 4d4a17e560c2b945f342e0fbd6a10... 32 | */ 33 | 34 | var program = require('commander'); 35 | var rs = require('jsrsasign'); 36 | var rsu = require('jsrsasign-util'); 37 | 38 | program 39 | .version('1.0.0 (2016-Nov-05)') 40 | .usage('[options] ') 41 | .description('convert any PEM file to binary') 42 | .parse(process.argv); 43 | 44 | if (program.args.length !== 1) 45 | throw "wrong number of arguments"; 46 | 47 | var inFile = program.args[0]; 48 | 49 | var jws = rsu.readFile(inFile); 50 | var a = jws.split(/\./); 51 | 52 | var oHead = rs.KJUR.jws.JWS.readSafeJSONString(rs.b64utoutf8(a[0])); 53 | console.log("*** JWS Header ***"); 54 | console.log(JSON.stringify(oHead, null, 2)); 55 | 56 | var oPayload = rs.KJUR.jws.JWS.readSafeJSONString(rs.b64utoutf8(a[1])); 57 | console.log("*** JWS Payload ***"); 58 | console.log(JSON.stringify(oPayload, null, 2)); 59 | 60 | console.log("*** JWS Signature ***"); 61 | console.log(rs.b64utohex(a[2])); 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /sample_node/pemtobin: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * pemtobin - convert any PEM to binary file 5 | * 6 | * Copyright (c) 2015-2020 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script converts any PEM to binary file 18 | * 19 | * USAGE 20 | * % pemtobin aaa.pem aaa.bin 21 | */ 22 | 23 | var program = require('commander'); 24 | var rs = require('jsrsasign'); 25 | var rsu = require('jsrsasign-util'); 26 | 27 | program 28 | .version('0.0.3 (2020-May-31)') 29 | .usage('[options] ') 30 | .description('convert any PEM file to binary') 31 | .parse(process.argv); 32 | 33 | if (program.args.length !== 2) 34 | throw "wrong number of arguments"; 35 | 36 | var inFile = program.args[0]; 37 | var outFile = program.args[1]; 38 | 39 | var pem = rsu.readFile(inFile); 40 | var hex = rs.pemtohex(pem); 41 | rsu.saveFileBinByHex(outFile, hex); 42 | 43 | -------------------------------------------------------------------------------- /sample_node/pemtojwk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * pemtojwk - convert PEM PKCS#5/#8 private/public key to JWK file 5 | * 6 | * Copyright (c) 2016 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script converts from PEM PKCS#5/#8 RSA/ECC private/public 18 | * key file to RFC 7517 JSON Web Key (JWK) file. 19 | * 20 | * USAGE 21 | * % pemtojwk [INPUT PEM KEY FILE] [OUTPUT JWK FILE] 22 | * % pemtojwk aaa.prv.pem aaa.prv.jwk 23 | */ 24 | 25 | var program = require('commander'); 26 | var rs = require('jsrsasign'); 27 | var rsu = require('jsrsasign-util'); 28 | var path = require('path'); 29 | 30 | program 31 | .version('1.0.1 (2016-Sep-11)') 32 | .description('convert PEM PKCS#5/#8 private/public key to JWK') 33 | .usage('[INPUT PEM KEY] [OUTPUT JWK]') 34 | .parse(process.argv); 35 | 36 | if (program.args.length !== 2) 37 | throw "wrong number of args" 38 | 39 | var inFile = program.args[0]; 40 | var outFile = program.args[1]; 41 | 42 | var pem = rsu.readFile(inFile); 43 | var key = rs.KEYUTIL.getKey(pem); 44 | var jwk = rs.KEYUTIL.getJWKFromKey(key); 45 | rsu.saveFile(outFile, JSON.stringify(jwk, null, 2)); 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /sample_node/showcert: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * showcert - show X.509 binary or PEM certificate 5 | * 6 | * Copyright (c) 2015-2016 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script shows DER binary or PEM X.509 certificate. 18 | * 19 | * USAGE 20 | * % showcert comodo_ee1.cer 21 | * Basic Fields 22 | * serial number: 00d09282634303a97fadf55568a48ca87e 23 | * ... snip ... 24 | * X509v3 Extensions: 25 | * authorityKeyIdentifier : 26 | * ... snip ... 27 | * signature algorithm: SHA256withRSA 28 | * signature: 64228b84fd2f3bcf... 29 | */ 30 | 31 | var program = require('commander'); 32 | var rs = require('jsrsasign'); 33 | var rsu = require('jsrsasign-util'); 34 | 35 | program 36 | .version('0.0.2 (2016-Sep-11)') 37 | .usage('[options] ') 38 | .description('show X.509 binary or PEM certificate') 39 | .parse(process.argv); 40 | 41 | if (program.args.length !== 1) 42 | throw "wrong number of arguments"; 43 | 44 | var file = program.args[0]; 45 | 46 | var data = rsu.readFile(file); 47 | var pem; 48 | if (data.substr(0, 5) === "-----") { 49 | pem = data; 50 | } else { 51 | var hex = rs.rstrtohex(data); 52 | pem = rs.asn1.ASN1Util.getPEMStringFromHex(hex, "CERTIFICATE"); 53 | } 54 | 55 | var x = new rs.X509(); 56 | x.readCertPEM(pem); 57 | console.log(x.getInfo()); 58 | 59 | -------------------------------------------------------------------------------- /sample_node/tsr2certs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * tsr2certs - extract certificates from RFC 3161 timestamp response or token 5 | * 6 | * Copyright (c) 2020 Kenji Urushima (kenji.urushima@gmail.com) 7 | * 8 | * This software is licensed under the terms of the MIT License. 9 | * https://kjur.github.io/jsrsasign/license 10 | * 11 | * The above copyright and license notice shall be 12 | * included in all copies or substantial portions of the Software. 13 | * 14 | * Please use '-h' option for this script usage. 15 | * --------------------------------------------------------- 16 | * DESCRIPTION 17 | * This script extracts DER certificates from DER timestamp response 18 | * or token. 19 | * 20 | * USAGE 21 | * tsr2certs [-t|--tst] inputFile 22 | * 23 | * EXAMPLE 24 | * % tsr2certs tsr.der // extract from timestamp response 25 | * writing number of certs: 2 26 | * tsr.der.1.cer 27 | * tsr.der.2.cer 28 | * 29 | * % tsr2certs -t tst.der // extract from timestamp token with -t 30 | */ 31 | 32 | var program = require('commander'); 33 | var rs = require('jsrsasign'); 34 | var rsu = require('jsrsasign-util'); 35 | 36 | program 37 | .version('1.0.2 (2020-Mar-31)') 38 | .description('extract certificate files from RFC 3161 timestamp response or token') 39 | .usage('[options] ') 40 | .option('-t, --tst', 'extract from timstamp token not response') 41 | .parse(process.argv); 42 | 43 | if (program.args.length != 1 && program.args.length != 2) 44 | throw "wrong number of arguments"; 45 | 46 | var inFile = program.args[program.args.length - 1]; 47 | 48 | var hex; 49 | try { 50 | hex = rsu.readFileHexByBin(inFile); 51 | } catch(ex) { 52 | throw "can't read file: " + inFile; 53 | } 54 | 55 | // string idx of [0]certificates of timestamp token 56 | if (! program.tst) { 57 | var idxCerts = rs.ASN1HEX.getIdxbyList(hex, 0, [1, 1, 0, 3], "a0"); // tsr 58 | } else { 59 | var idxCerts = rs.ASN1HEX.getIdxbyList(hex, 0, [1, 0, 3], "a0"); // tst 60 | } 61 | var idxList = rs.ASN1HEX.getChildIdx(hex, idxCerts); 62 | console.log("writing number of certs: " + idxList.length); 63 | for (var i = 0; i < idxList.length; i++) { 64 | var outFile = inFile + "." + (i + 1) + ".cer"; 65 | var hCert = rs.ASN1HEX.getTLV(hex, idxList[i]); 66 | rsu.saveFileBinByHex(outFile, hCert); 67 | console.log(outFile); 68 | } 69 | 70 | /* 71 | extract certs from tsr 72 | asn1extract cert1out.der tsr.der 1 1 0 3 0 # 1st cert 73 | asn1extract cert2out.der tsr.der 1 1 0 3 1 # 2nd cert 74 | */ 75 | 76 | -------------------------------------------------------------------------------- /test/qunit-do-asn1-oidhex.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | QUnit for ASN1Util.oidHexToInt/IntToHex in 'asn1.js' 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 43 | 44 | 45 | 46 |
47 |
test markup
48 | 49 | 50 | -------------------------------------------------------------------------------- /test/qunit-do-base64x-class.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | QUnit for extendClass in 'base64x.js' 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 43 | 44 | 45 | 46 |
47 |
test markup
48 | 49 |

50 | TOP | 51 | TEST INDEX | 52 | base64x | 53 | base64x-class | 54 |

55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /test/qunit-do-crypto-md.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | QUnit for KJUR.crypto.MessageDigest 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 52 | 53 | 54 | 55 |
56 |
test markup
57 | QUnit for 58 | INDEX | 59 | 60 |

© 2016 Kenji Urushima

61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /test/qunit-do-crypto-sjcl.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | QUnit for 'crypto.js' with sjcl 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 83 | 84 | 85 | 86 |
87 |
test markup
88 | 89 | 90 | -------------------------------------------------------------------------------- /test/qunit-do-ecparam.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | QUnit for 'ecparam-1.0.js' 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 79 | 80 | 81 | 82 |
83 |
test markup
84 | 85 |

86 | ECC related QUnit test pages: 87 | crypto.js | 88 | crypto.js Signature class for ECDSA | 89 | ecdsa-modified.js | 90 | ecparam.js | 91 |

92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /test/qunit-do-jws-intdate.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | QUnit for 'jws.js' IntDate class methods 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 71 | 72 | 73 | 74 |
75 |
test markup
76 | TEST INDEX | 77 | sign/verify | 78 | sign/verify slow | 79 | IntDate | 80 | 81 | 82 | -------------------------------------------------------------------------------- /test/qunit-do-jws-util.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | QUnit for 'jws.js' utility methods 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 52 | 53 | 54 | 55 |
56 |
test markup
57 | TEST INDEX | 58 | 59 | 60 | -------------------------------------------------------------------------------- /test/qunit-do-jws.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | QUnit sign() and verify() test of 'jws.js' 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 30 | 31 | 32 | 33 |
34 |
test markup
35 |

36 | TOP | 37 | TEST INDEX | 38 | asynmetric key(RS/PS/ES) sign/verify | 39 | Hmac(HS) sign/verify | 40 | sign/verify slow | 41 | IntDate | 42 |

43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /test/qunit-do-keyutil-gen.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | QUnit for KEYUTIL keypair generator 'keyutil.js' 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 89 | 90 | 91 | 92 |
93 |
test markup
94 | TOP | 95 | TEST INDEX | 96 | keyutil | 97 | keyutil-eprv | 98 | keyutil-pub | 99 | keyutil-gen | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /test/qunit-do-keyutil-pairpem.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | QUnit for KEYUTIL generateKeypair and getPEM 'keyutil.js' 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 42 | 43 | 44 | 45 |
46 |
test markup
47 | TEST INDEX | 48 | QUnit for 49 | keyutil | 50 | keyutil-eprv | 51 | keyutil-pub | 52 | keyutil-gen | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /test/qunit-do-package-jwths.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | QUnit sign() and verify() test of 'jws.js' 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 33 | 34 | 35 | 36 |
37 |
test markup
38 |

39 | TOP | 40 | TEST INDEX | 41 | asynmetric key(RS/PS/ES) sign/verify | 42 | Hmac(HS) sign/verify | 43 | sign/verify slow | 44 | IntDate | 45 |

46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /test/qunit-do-rsagenkeylen.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | QUnit for RSAKey genarated key length test 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 38 | 39 | 40 | 41 |
42 |
test markup
43 | 44 |

45 | TOP | 46 | TEST INDEX | 47 |

48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /test/qunit-do-x509-hex2dn.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | QUnit for 'x509' hex2dn, hex2rdn 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 38 | 39 | 40 | 41 |
42 |
test markup
43 | TEST INDEX | 44 | x509-hex2dn | 45 | asn1x509 | 46 | asn1x509-multirdn | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /tool/tool_b64udec.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Online Base64URL decoder 9 | 10 | 11 | 31 | 32 | 33 | 34 | 35 | 36 |
37 |
38 |

Online Base64URL decoder

39 |

Convert Base64URL, Base64 and Hex online to UTF-8 string.

40 |
41 |
42 | 43 | 44 |
45 |
46 | 47 |
48 |

(Step1) Fill a string to be decoded.

49 | 50 | 51 |

(Step2) Convert String.

52 | convert from to: 53 |
62 | 63 |
64 |

Decoded Result

65 | 66 | 67 | 68 | 69 |
70 | 71 | 72 |
73 |
74 | 75 | 76 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /tool/tool_b64uenc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Online Base64URL encoder 9 | 10 | 11 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |
26 |

Online Base64URL encoder

27 |

Convert UTF-8 string to Base64URL, Base64 and Hex online.

28 |
29 |
30 | 31 | 32 |
33 |
34 | 35 |
36 |

(Step1) Input any UTF-8 string here.

37 | 44 | NOTE: You can input any UTF-8 string including CJK(Chinese, Japanese Kanji, Korean) or ISO Latin characters. 45 | 46 |

(Step2) Convert String.

47 |
48 | 49 |
50 |

Encoded Result

51 | 52 |

Base64 URL encoded string

53 | 54 | 55 |

Base64 encoded string

56 | 57 | 58 |

Hexadecimal encoded string

59 | 60 | 61 |
62 | 63 | 64 |
65 |
66 | 67 | 68 | 77 | 78 | 79 | 80 | --------------------------------------------------------------------------------