forked from root/acme.js
working der generation
This commit is contained in:
parent
2e0549af5a
commit
1b01c2c413
3
app.js
3
app.js
|
@ -43,6 +43,9 @@ function run() {
|
||||||
};
|
};
|
||||||
console.log('opts', opts);
|
console.log('opts', opts);
|
||||||
Keypairs.generate(opts).then(function (results) {
|
Keypairs.generate(opts).then(function (results) {
|
||||||
|
var der = x509.packPkcs8(results.private);
|
||||||
|
console.log(der)
|
||||||
|
// Pem.encode(x509.packPkcs8(privateJwk))
|
||||||
$('.js-jwk').innerText = JSON.stringify(results, null, 2);
|
$('.js-jwk').innerText = JSON.stringify(results, null, 2);
|
||||||
//
|
//
|
||||||
$('.js-loading').hidden = true;
|
$('.js-loading').hidden = true;
|
||||||
|
|
|
@ -66,8 +66,10 @@
|
||||||
<summary>ACME Account Response</summary>
|
<summary>ACME Account Response</summary>
|
||||||
<pre><code class="js-acme-account-response"> </code></pre>
|
<pre><code class="js-acme-account-response"> </code></pre>
|
||||||
</details>
|
</details>
|
||||||
|
<script src="./lib/bluecrypt-encoding.js"></script>
|
||||||
<script src="./lib/ecdsa.js"></script>
|
<script src="./lib/ecdsa.js"></script>
|
||||||
|
<script src="./lib/asn1-packer.js"></script>
|
||||||
|
<script src="./lib/x509.js"></script>
|
||||||
<script src="./lib/rsa.js"></script>
|
<script src="./lib/rsa.js"></script>
|
||||||
<script src="./lib/keypairs.js"></script>
|
<script src="./lib/keypairs.js"></script>
|
||||||
<script src="./lib/acme.js"></script>
|
<script src="./lib/acme.js"></script>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(function (exports) {
|
(function (exports) {
|
||||||
|
|
||||||
var Enc = exports.BluecryptEncoding = {};
|
var Enc = exports.Enc = {};
|
||||||
|
|
||||||
Enc.bufToBin = function (buf) {
|
Enc.bufToBin = function (buf) {
|
||||||
var bin = '';
|
var bin = '';
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
var x = Enc.base64ToHex(jwk.x);
|
var x = Enc.base64ToHex(jwk.x);
|
||||||
var y = Enc.base64ToHex(jwk.y);
|
var y = Enc.base64ToHex(jwk.y);
|
||||||
var objId = ('P-256' === jwk.crv) ? OBJ_ID_EC : OBJ_ID_EC_384;
|
var objId = ('P-256' === jwk.crv) ? OBJ_ID_EC : OBJ_ID_EC_384;
|
||||||
return Enc.hexToUint8(
|
return Enc.hexToBuf(
|
||||||
ASN1('30'
|
ASN1('30'
|
||||||
, ASN1.UInt('01')
|
, ASN1.UInt('01')
|
||||||
, ASN1('04', d)
|
, ASN1('04', d)
|
||||||
|
@ -141,7 +141,7 @@
|
||||||
var x = Enc.base64ToHex(jwk.x);
|
var x = Enc.base64ToHex(jwk.x);
|
||||||
var y = Enc.base64ToHex(jwk.y);
|
var y = Enc.base64ToHex(jwk.y);
|
||||||
var objId = ('P-256' === jwk.crv) ? OBJ_ID_EC : OBJ_ID_EC_384;
|
var objId = ('P-256' === jwk.crv) ? OBJ_ID_EC : OBJ_ID_EC_384;
|
||||||
return Enc.hexToUint8(
|
return Enc.hexToBuf(
|
||||||
ASN1('30'
|
ASN1('30'
|
||||||
, ASN1.UInt('00')
|
, ASN1.UInt('00')
|
||||||
, ASN1('30'
|
, ASN1('30'
|
||||||
|
@ -159,7 +159,7 @@
|
||||||
var x = Enc.base64ToHex(jwk.x);
|
var x = Enc.base64ToHex(jwk.x);
|
||||||
var y = Enc.base64ToHex(jwk.y);
|
var y = Enc.base64ToHex(jwk.y);
|
||||||
var objId = ('P-256' === jwk.crv) ? OBJ_ID_EC : OBJ_ID_EC_384;
|
var objId = ('P-256' === jwk.crv) ? OBJ_ID_EC : OBJ_ID_EC_384;
|
||||||
return Enc.hexToUint8(
|
return Enc.hexToBuf(
|
||||||
ASN1('30'
|
ASN1('30'
|
||||||
, ASN1('30'
|
, ASN1('30'
|
||||||
, OBJ_ID_EC_PUB
|
, OBJ_ID_EC_PUB
|
||||||
|
|
Loading…
Reference in New Issue