Skip to content

DanielSoCra/dart-x509csr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Make X.509 RSA Certificate Signing Requests (CSR).

We include helper functions for generating Keypairs and outputting associated PEMs.

Usage

A simple usage example:

import 'package:x509csr/x509csr.dart';

import "package:pointycastle/export.dart";
import 'package:asn1lib/asn1lib.dart';

main(List<String> arguments) {
  AsymmetricKeyPair keyPair = rsaGenerateKeyPair();

  ASN1ObjectIdentifier.registerFrequentNames();
  Map<String, String> dn = {
    "CN": "www.davidjanes.com",
    "O": "Consensas",
    "L": "Toronto",
    "ST": "Ontario",
    "C": "CA",
  };

  ASN1Object encodedCSR = makeRSACSR(dn, keyPair.privateKey, keyPair.publicKey);

  print(encodeCSRToPem(encodedCSR));
  print(encodeRSAPublicKeyToPem(keyPair.publicKey));
  print(encodeRSAPrivateKeyToPem(keyPair.privateKey));
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

About

Create X.509 Certificate Signing Requests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 100.0%