Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing implementation to parse eu dgc certs #15

Merged
merged 7 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 24 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Files and directories created by pub
.packages
.pub/
build/
packages
# Remove the following pattern if you wish to check in your lock file
pubspec.lock
.dart_tool

# Files created by dart2js
*.dart.js
*.part.js
*.js.deps
*.js.map
*.info.json

# Directory created by dartdoc
doc/api/

# JetBrains IDEs
.idea/
*.iml
*.ipr
*.iws
# Files and directories created by pub
.packages
.pub/
build/
packages
# Remove the following pattern if you wish to check in your lock file
pubspec.lock
.dart_tool
# Files created by dart2js
*.dart.js
*.part.js
*.js.deps
*.js.map
*.info.json
# Directory created by dartdoc
doc/api/
# JetBrains IDEs
.idea/
*.iml
*.ipr
*.iws
24 changes: 12 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "x509",
"request": "launch",
"type": "dart"
}
]
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "x509",
"request": "launch",
"type": "dart"
}
]
}
81 changes: 47 additions & 34 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,47 @@
# Changelog

## 0.2.2

- Compatible with version `0.3.0` of `crypto_keys`

## 0.2.1

- Parse pem certificates

## 0.2.0

- Migrate null safety

## 0.1.4

- Bump `asn1lib` to 0.8.1.
- Support GeneralNames for using by Issuer/Subject Alternative Name

## 0.1.3

- Support for CertificatePolicies, CrlDistributionPoints and AuthorityInformationAccess extensions

## 0.1.2

- Support for EC keys

## 0.1.1

- Bugfix parsing strings stored as ASN1UTF8String

## 0.1.0

- Initial version
# Changelog
## 0.2.5

- Be more leniant towards unknown OIDs -- treat as Unknown, but do not fail
- Parse DGC issuer OIDs
- Parse more types of algo's

## 0.2.4

- Add extention https://oidref.com/2.23.136.1.1.6.2 handling

## 0.2.3

- Extra features / bugfixes for EHN DGC parsing. (Digital Green Certificate)

## 0.2.2

- Compatible with version `0.3.0` of `crypto_keys`

## 0.2.1

- Parse pem certificates

## 0.2.0

- Migrate null safety

## 0.1.4

- Bump `asn1lib` to 0.8.1.
- Support GeneralNames for using by Issuer/Subject Alternative Name

## 0.1.3

- Support for CertificatePolicies, CrlDistributionPoints and AuthorityInformationAccess extensions

## 0.1.2

- Support for EC keys

## 0.1.1

- Bugfix parsing strings stored as ASN1UTF8String

## 0.1.0

- Initial version
48 changes: 24 additions & 24 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
Copyright (c) 2020, Rik Bellens.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2020, Rik Bellens.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# x509

Dart library for parsing and working with X.509 certificates.


## Usage

A simple usage example:

import 'package:x509/x509.dart';
import 'dart:io';

main() {
var cert = parsePem(new File('cert.pem').readAsStringSync());

print(cert);
}

## Features and bugs

Please file feature requests and bugs at the [issue tracker][tracker].

[tracker]: https://github.com/appsup-dart/x509/issues
# x509
Dart library for parsing and working with X.509 certificates.
## Usage
A simple usage example:
import 'package:x509/x509.dart';
import 'dart:io';
main() {
var cert = parsePem(new File('cert.pem').readAsStringSync());
print(cert);
}
## Features and bugs
Please file feature requests and bugs at the [issue tracker][tracker].
[tracker]: https://github.com/appsup-dart/x509/issues
28 changes: 14 additions & 14 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Defines a default set of lint rules enforced for
# projects at Google. For details and rationale,
# see https://github.com/dart-lang/pedantic#enabled-lints.
include: package:pedantic/analysis_options.yaml

# For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
# Uncomment to specify additional rules.
# linter:
# rules:
# - camel_case_types

analyzer:
# exclude:
# - path/to/excluded/files/**
# Defines a default set of lint rules enforced for
# projects at Google. For details and rationale,
# see https://github.com/dart-lang/pedantic#enabled-lints.
include: package:pedantic/analysis_options.yaml
# For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
# Uncomment to specify additional rules.
# linter:
# rules:
# - camel_case_types
analyzer:
# exclude:
# - path/to/excluded/files/**
30 changes: 15 additions & 15 deletions example/main.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import 'package:x509/x509.dart';
import 'dart:io';

void main() {
var cert =
"-----BEGIN CERTIFICATE-----\nMIIDHDCCAgSgAwIBAgIIcYRws2sTxJkwDQYJKoZIhvcNAQEFBQAwMTEvMC0GA1UE\nAxMmc2VjdXJldG9rZW4uc3lzdGVtLmdzZXJ2aWNlYWNjb3VudC5jb20wHhcNMjEw\nNDA2MDkyMDIwWhcNMjEwNDIyMjEzNTIwWjAxMS8wLQYDVQQDEyZzZWN1cmV0b2tl\nbi5zeXN0ZW0uZ3NlcnZpY2VhY2NvdW50LmNvbTCCASIwDQYJKoZIhvcNAQEBBQAD\nggEPADCCAQoCggEBAMoRTVdYXX6kW8oEplmvw5K2LnN3TSxdU2E4r3LKwY5wWEOI\nEJkgXq5mj+1D/AESJRE8eveVAKlR5/vBITPuJT99agjG/4vr9CNdEZjPc/TmqFmX\nwldeX/oE89LIoSuBKR/g3CRI17Z/0V/ZaeLwNlWz/A/L6+MEfEbgAIiSxXFkctXL\nTIWf3Ith24OTN8hVCgCaUWVLuY+FGprUnqQOqn1lpbtb1fgTSI/JAGXu6wsESyc3\nxslD2e4VyBQ1i+JoW3/VKydlODd3THydFRBHGPdJQkLH4ccDh2kQ4sWQ4vjupSsk\nBKMAvLqftpvVUo6LogEXNRmmI6sjluRlEvYk14kCAwEAAaM4MDYwDAYDVR0TAQH/\nBAIwADAOBgNVHQ8BAf8EBAMCB4AwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwIwDQYJ\nKoZIhvcNAQEFBQADggEBADFwIJVQERKO+x8Fx01ySjgSG6Rb81a17WQSCP2dlYmK\nFBvwaKK5tGVDt3RUnMgM5myEY11TX8yBF8UstxkqtMTzJh+K1hV6lC11YRqWzodq\nmJUBDuU39MYcRgoQn7szodBckdUGQlkTZti7xLApewkDpmR3Wx0KQBQpGt20Oaoq\nB2a5DVq4KsRirPtS71QvekM9Aars7pKrVNhxvXgkIMpiUAj3GJR5NAsJD0tsa9LM\nLvo31/AE1VKiRJ9ta21m15wO4CJyAiWvRbRiHDN9b9oXuJwUlzUgT0GFWHayt56e\nCYTU00dPphNMO1O07aqHq2O44/wPXYtQGDlHsg4sCeM=\n-----END CERTIFICATE-----\n";
var v = parsePem(cert).first as X509Certificate;
print(v.publicKey);
return;

var certRequest = parsePem(File('test/files/csr.pem').readAsStringSync())
.first as CertificationRequest;

print(certRequest.certificationRequestInfo.subject);
}
import 'package:x509/x509.dart';
import 'dart:io';
void main() {
var cert =
"-----BEGIN CERTIFICATE-----\nMIIDHDCCAgSgAwIBAgIIcYRws2sTxJkwDQYJKoZIhvcNAQEFBQAwMTEvMC0GA1UE\nAxMmc2VjdXJldG9rZW4uc3lzdGVtLmdzZXJ2aWNlYWNjb3VudC5jb20wHhcNMjEw\nNDA2MDkyMDIwWhcNMjEwNDIyMjEzNTIwWjAxMS8wLQYDVQQDEyZzZWN1cmV0b2tl\nbi5zeXN0ZW0uZ3NlcnZpY2VhY2NvdW50LmNvbTCCASIwDQYJKoZIhvcNAQEBBQAD\nggEPADCCAQoCggEBAMoRTVdYXX6kW8oEplmvw5K2LnN3TSxdU2E4r3LKwY5wWEOI\nEJkgXq5mj+1D/AESJRE8eveVAKlR5/vBITPuJT99agjG/4vr9CNdEZjPc/TmqFmX\nwldeX/oE89LIoSuBKR/g3CRI17Z/0V/ZaeLwNlWz/A/L6+MEfEbgAIiSxXFkctXL\nTIWf3Ith24OTN8hVCgCaUWVLuY+FGprUnqQOqn1lpbtb1fgTSI/JAGXu6wsESyc3\nxslD2e4VyBQ1i+JoW3/VKydlODd3THydFRBHGPdJQkLH4ccDh2kQ4sWQ4vjupSsk\nBKMAvLqftpvVUo6LogEXNRmmI6sjluRlEvYk14kCAwEAAaM4MDYwDAYDVR0TAQH/\nBAIwADAOBgNVHQ8BAf8EBAMCB4AwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwIwDQYJ\nKoZIhvcNAQEFBQADggEBADFwIJVQERKO+x8Fx01ySjgSG6Rb81a17WQSCP2dlYmK\nFBvwaKK5tGVDt3RUnMgM5myEY11TX8yBF8UstxkqtMTzJh+K1hV6lC11YRqWzodq\nmJUBDuU39MYcRgoQn7szodBckdUGQlkTZti7xLApewkDpmR3Wx0KQBQpGt20Oaoq\nB2a5DVq4KsRirPtS71QvekM9Aars7pKrVNhxvXgkIMpiUAj3GJR5NAsJD0tsa9LM\nLvo31/AE1VKiRJ9ta21m15wO4CJyAiWvRbRiHDN9b9oXuJwUlzUgT0GFWHayt56e\nCYTU00dPphNMO1O07aqHq2O44/wPXYtQGDlHsg4sCeM=\n-----END CERTIFICATE-----\n";
var v = parsePem(cert).first as X509Certificate;
print(v.publicKey);
return;
var certRequest = parsePem(File('test/files/csr.pem').readAsStringSync())
.first as CertificationRequest;
print(certRequest.certificationRequestInfo.subject);
}