generate_authority_key.py Source

#!/usr/bin/env python3
import os
from jwcrypto.jwk import JWK
def main():
    authority_key = JWK.generate(kty='EC', crv='P-256')
    with open('authority_key.pub', 'w') as pubkey:
        pubkey.write(authority_key.export_public())
    with open('authority_key.priv', 'w') as privkey:
        privkey.write(authority_key.export_private())
if __name__ == '__main__':
    main()