Coder Social home page Coder Social logo

Account import/export about manuale HOT 5 OPEN

veeti avatar veeti commented on June 12, 2024
Account import/export

from manuale.

Comments (5)

szepeviktor avatar szepeviktor commented on June 12, 2024

@veeti Is it for moving from certbot to manuale?

from manuale.

veeti avatar veeti commented on June 12, 2024

Any client that you can get the account key out of. I don't know if this is really necessary as you can just create a new account, but would be nice to have.

from manuale.

szepeviktor avatar szepeviktor commented on June 12, 2024

certbot/certbot#3568

from manuale.

szepeviktor avatar szepeviktor commented on June 12, 2024

I've found a script, upgraded it to PEP8
https://gist.github.com/JonLundy/f25c99ee0770e19dc595

#!/usr/bin/python

import sys
import json
import base64
import binascii
with open(sys.argv[1]) as fp:
    pkey = json.load(fp)


def enc(data):
    missing_padding = 4 - len(data) % 4
    if missing_padding:
        data += b'=' * missing_padding
    return '0x'+binascii.hexlify(base64.b64decode(data, b'-_')).upper()

for k, v in pkey.items():
    if k == 'kty':
        continue
    pkey[k] = enc(v.encode())

print "asn1=SEQUENCE:private_key\n[private_key]\nversion=INTEGER:0"
print "n=INTEGER:{}".format(pkey[u'n'])
print "e=INTEGER:{}".format(pkey[u'e'])
print "d=INTEGER:{}".format(pkey[u'd'])
print "p=INTEGER:{}".format(pkey[u'p'])
print "q=INTEGER:{}".format(pkey[u'q'])
print "dp=INTEGER:{}".format(pkey[u'dp'])
print "dq=INTEGER:{}".format(pkey[u'dq'])
print "qi=INTEGER:{}".format(pkey[u'qi'])
./jwk-convert.py private_key.json > private-key.asn1
openssl asn1parse -genconf private-key.asn1 -noout -out private-key.der
openssl rsa -inform DER -in private-key.der -outform PEM -out private-key.key

from manuale.

szepeviktor avatar szepeviktor commented on June 12, 2024

Success!

  1. Join PEM lines to fit into JSON
  2. Modify uri's end "reg/1222333"

$ manuale info

Requesting account data...
{
...
...

from manuale.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.