npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@line100/certification

v0.2.3

Published

## install * use `bun` as ts runtime * `npm i -g @line100/certification`

Downloads

38

Readme

certification

install

  • use bun as ts runtime
  • npm i -g @line100/certification

usage

create root

cert-node create -v --name root --payload '{}' --output root.cert.node
secret Uint8Array: len = 64, digest = VJc1s5o6qftt8g==
[ "root" ] {
  pubkey: "mRiGgzYhvatSt0wM4l/wOzkVOzxTZp5/3te5tLkPd6E=",
  boxkey: "MhjGMTnJ6j8qNQ58x8Yhq+6Gl5A/FbaRH6K3OI08+BA=",
  payload: {},
  start: 1695223377071,
  expiration: 1726759377071
}
-- certification --
pmRwYXRogWRyb290ZXN0YXJ0GwAAAYqzL+yvZmJveGtleVggMhjGMTnJ6j8qNQ58x8Yhq+6Gl5A/FbaRH6K3OI08+BBmcHVia2V5WCCZGIaDNiG9q1K3TAziX/A7ORU7PFNmnn/e17m0uQ93oWdwYXlsb2FkoGpleHBpcmF0aW9uGwAAAZIK4Riv

create sub node from root

cert-node create -v --name app --parent root.cert.node --payload '{}' --output app.cert.node 
[ "root", "app" ] {
  pubkey: "CtWlxOJbWSTw0uhc0Mge1WLT5YEdwcTXsnHLj9gVNag=",
  boxkey: "kKW4gxpxFygnyUaKb98pcRZhnt1jhp6W0VXESjCS3Dw=",
  payload: {},
  start: 1695223493372,
  expiration: 1726759493372
}
[ "root" ] {
  pubkey: "mRiGgzYhvatSt0wM4l/wOzkVOzxTZp5/3te5tLkPd6E=",
  boxkey: "MhjGMTnJ6j8qNQ58x8Yhq+6Gl5A/FbaRH6K3OI08+BA=",
  payload: {},
  start: 1695223377071,
  expiration: 1726759377071
}
-- certification --
qGRwYXRogmRyb290Y2FwcGVzdGFydBsAAAGKszGy/GZib3hrZXlYIJCluIMacRcoJ8lGim/fKXEWYZ7dY4aeltFVxEowktw8ZnBhcmVudKZkcGF0aIFkcm9vdGVzdGFydBsAAAGKsy/sr2Zib3hrZXlYIDIYxjE5yeo/KjUOfMfGIavuhpeQPxW2kR+itziNPPgQZnB1YmtleVggmRiGgzYhvatSt0wM4l/wOzkVOzxTZp5/3te5tLkPd6FncGF5bG9hZKBqZXhwaXJhdGlvbhsAAAGSCuEYr2ZwdWJrZXlYIArVpcTiW1kk8NLoXNDIHtVi0+WBHcHE17Jxy4/YFTWoZ3BheWxvYWSgamV4cGlyYXRpb24bAAABkgri3vxqcGFyZW50X3NpZ1hAE6KD/5JFuSHifVe9BsJ/i0oCN1zlzRazFfcZR04tmEwazeyZgDrkmgK1NtDtHCMftUryyPYIqOmRGVeRJjJeDQ==

show node info

cert-node show app.cert.node
secret Uint8Array: len = 64, digest = BWAa29AvvHECdA==
[ "root", "app" ] {
  pubkey: "CtWlxOJbWSTw0uhc0Mge1WLT5YEdwcTXsnHLj9gVNag=",
  boxkey: "kKW4gxpxFygnyUaKb98pcRZhnt1jhp6W0VXESjCS3Dw=",
  payload: {},
  start: 1695223493372,
  expiration: 1726759493372
}
[ "root" ] {
  pubkey: "mRiGgzYhvatSt0wM4l/wOzkVOzxTZp5/3te5tLkPd6E=",
  boxkey: "MhjGMTnJ6j8qNQ58x8Yhq+6Gl5A/FbaRH6K3OI08+BA=",
  payload: {},
  start: 1695223377071,
  expiration: 1726759377071
}
-- certification --
qGRwYXRogmRyb290Y2FwcGVzdGFydBsAAAGKszGy/GZib3hrZXlYIJCluIMacRcoJ8lGim/fKXEWYZ7dY4aeltFVxEowktw8ZnBhcmVudKZkcGF0aIFkcm9vdGVzdGFydBsAAAGKsy/sr2Zib3hrZXlYIDIYxjE5yeo/KjUOfMfGIavuhpeQPxW2kR+itziNPPgQZnB1YmtleVggmRiGgzYhvatSt0wM4l/wOzkVOzxTZp5/3te5tLkPd6FncGF5bG9hZKBqZXhwaXJhdGlvbhsAAAGSCuEYr2ZwdWJrZXlYIArVpcTiW1kk8NLoXNDIHtVi0+WBHcHE17Jxy4/YFTWoZ3BheWxvYWSgamV4cGlyYXRpb24bAAABkgri3vxqcGFyZW50X3NpZ1hAE6KD/5JFuSHifVe9BsJ/i0oCN1zlzRazFfcZR04tmEwazeyZgDrkmgK1NtDtHCMftUryyPYIqOmRGVeRJjJeDQ==

API

// Generated by dts-bundle-generator v8.0.1

export type Certification = {
        pubkey: Uint8Array;
        boxkey: Uint8Array;
        path: string[];
        payload: {
                [i: string]: any;
        };
        /** 生效时间 */
        start: number;
        /** 过期时间 */
        expiration: number;
        parent?: Certification;
        parent_sig?: Uint8Array;
};
/**
 * 客户端使用的cert store,可以用来存放多个端的root以及sub密钥
 * * 可同时使用多个root
 * * 放入多个证书,并记录密钥过期时间
 */
export declare class CertStore {
        private readonly rootSet;
        private pubkeys;
        private boxkeys;
        /**
         * 初始化key store时,需要放入root密钥,
         * * root密钥可能存在多个
         * @param rootKeys
         */
        constructor(rootKeys: Uint8Array[]);
        /**
         * 确认签名公钥是否在store中
         * @param pubkey
         * @param cb
         * @returns
         */
        validatePubkey(pubkey: Uint8Array, cb?: (cert: Certification) => boolean): boolean;
        /**
         * 确认box公钥是否在store中
         * @param boxkey
         * @param cb
         * @returns
         */
        validateBoxkey(boxkey: Uint8Array, cb?: (cert: Certification) => boolean): boolean;
        /**
         * 将二进制格式的证书保存,无法到达root的证书无效
         * @param cert
         */
        putCertificationBytes(bytes: Uint8Array): {
                ok?: true;
                error?: string;
        };
        /**
         * 将证书保存,无法到达root的证书无效
         * @param cert
         */
        putCertification(cert: Certification): {
                ok?: true;
                error?: string;
        };
}

export {};