Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"en-US,en;q\u003d0.5", "gen_ut":1600806429, "reponame":"libwebsockets", "desc":"libwebsockets lightweight C networking library", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets", "f":3, "items": [ { "schema":"libjg2-1", "oid":{ "oid": "9bff4d84eddb7f793c04947c259a948523641920", "alias": [ "refs/heads/master"]},"tree": [ { "name": "CMakeLists.txt","mode": "33188", "size":625}, { "name": "README.md","mode": "33188", "size":2726}, { "name": "main.c","mode": "33188", "size":4542}],"s":{"c":1600806429,"u": 372}} ,{"schema":"libjg2-1", "cid":"75067103f43c1195c8c8fc5c2b1cf736", "oid":{ "oid": "9bff4d84eddb7f793c04947c259a948523641920", "alias": [ "refs/heads/master"]},"blobname": "minimal-examples/crypto/minimal-crypto-x509/README.md", "blob": "# lws minimal example for X509\n\nThe example shows how to:\n\n - confirm one PEM cert or chain (-c) was signed by a trusted PEM cert (-t)\n - convert a certificate public key to JWK\n - convert a certificate public key and its private key PEM to a private JWK\n\nThe examples work for EC and RSA certs and on mbedtls and OpenSSL the same.\n\nNotice the logging is on stderr, and only the JWK is output on stdout.\n\n## build\n\n```\n $ cmake . \u0026\u0026 make\n```\n\n## usage\n\nCommandline option|Meaning\n---|---\n-d \u003cloglevel\u003e|Debug verbosity in decimal, eg, -d15\n-c \u003cPEM certificate path\u003e|Required PEM Certificate(s) to operate on... may be multiple concatednated PEM\n-t \u003cPEM certificate path\u003e|Single PEM trusted certificate\n-p \u003cPEM private key path\u003e|Optional private key matching certificate given in -c. If given, only the private JWK is printed to stdout\n\nExample for confirming trust relationship. Notice the PEM in -c must contain not only\nthe final certificate but also the certificates for any intermediate CAs.\n\n```\n $ ./lws-crypto-x509 -c ec-cert.pem -t ca-cert.pem\n[2019/01/02 20:31:13:2031] USER: LWS X509 api example\n[2019/01/02 20:31:13:2032] NOTICE: Creating Vhost 'default' (serving disabled), 1 protocols, IPv6 off\n[2019/01/02 20:31:13:2043] NOTICE: main: certs loaded OK\n[2019/01/02 20:31:13:2043] NOTICE: main: verified OK \u003c\u003c\u003c\u003c\u003d\u003d\u003d\u003d\u003d\u003d\n[2019/01/02 20:31:13:2045] NOTICE: Cert Public JWK\n{\u0022crv\u0022:\u0022P-521\u0022,\u0022kty\u0022:\u0022EC\u0022,\u0022x\u0022:\u0022_uRNBbIbm0zhk8v6ujvQX9924264ZkqJhit0qamAoCegzuJbLf434kN7_aFEt6u-QWUu6-N1R8t6OlvrLo2jrNY\u0022,\u0022y\u0022:\u0022AU-29XpNyB7e5e3s5t0ylzGEnF601A8A7Tx8m8xxngARZX_bn22itGJ3Y57BTcclPMoG80KjWAMnRVtrKqrD_aGD\u0022}\n\n[2019/01/02 20:31:13:2045] NOTICE: main: OK\n```\n\nExample creating JWKs for public and public + private cert + PEM keys:\n\n```\n $ ./lws-crypto-x509 -c ec-cert.pem -p ec-key.pem\n[2019/01/02 20:14:43:4966] USER: LWS X509 api example\n[2019/01/02 20:14:43:5225] NOTICE: Creating Vhost 'default' (serving disabled), 1 protocols, IPv6 off\n[2019/01/02 20:14:43:5707] NOTICE: lws_x509_public_to_jwk: EC key\n[2019/01/02 20:24:59:9514] USER: LWS X509 api example\n[2019/01/02 20:24:59:9741] NOTICE: Creating Vhost 'default' (serving disabled), 1 protocols, IPv6 off\n[2019/01/02 20:25:00:1261] NOTICE: lws_x509_public_to_jwk: key type 408 \u0022id-ecPublicKey\u0022\n[2019/01/02 20:25:00:1269] NOTICE: lws_x509_public_to_jwk: EC key\n[2019/01/02 20:25:00:2097] NOTICE: Cert + Key Private JWK\n{\u0022crv\u0022:\u0022P-521\u0022,\u0022d\u0022:\u0022AU3iQSKfPskMTW4ZncrYLhipUYzLYty2XhemTQ_nSuUB1vB76jHmOYUTRXFBLkVCW8cQYyMa5dMa3Bvv-cdvH0IB\u0022,\u0022kty\u0022:\u0022EC\u0022,\u0022x\u0022:\u0022_uRNBbIbm0zhk8v6ujvQX9924264ZkqJhit0qamAoCegzuJbLf434kN7_aFEt6u-QWUu6-N1R8t6OlvrLo2jrNY\u0022,\u0022y\u0022:\u0022AU-29XpNyB7e5e3s5t0ylzGEnF601A8A7Tx8m8xxngARZX_bn22itGJ3Y57BTcclPMoG80KjWAMnRVtrKqrD_aGD\u0022}\n\n[2019/01/02 20:25:00:2207] NOTICE: main: OK\n```\n\n","s":{"c":1600806429,"u": 183}} ],"g": 2192,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 1, "si": 0, "db":0, "di":1, "sat":0, "lfc": "0000"}