mirror of
https://github.com/jonasroussel/dart_jsonwebtoken.git
synced 2025-08-24 21:23:39 +08:00
v2.9.1
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
## 2.9.1
|
||||
|
||||
- Adding a new class factory `ECPublicKey.cert`
|
||||
|
||||
## 2.9.0
|
||||
|
||||
- Adding `basic_utils` package to handle PEM & key parsing
|
||||
|
@ -116,6 +116,15 @@ class ECPublicKey extends JWTKey {
|
||||
ECPublicKey.clone(ECPublicKey _key) : key = _key.key;
|
||||
ECPublicKey.bytes(Uint8List bytes)
|
||||
: key = CryptoUtils.ecPublicKeyFromDerBytes(bytes);
|
||||
ECPublicKey.cert(String pem) {
|
||||
final x509 = X509Utils.x509CertificateFromPem(pem);
|
||||
final bytes = x509.tbsCertificate?.subjectPublicKeyInfo.bytes;
|
||||
if (bytes == null) {
|
||||
throw JWTParseException('x509 Certificate parsing failed');
|
||||
}
|
||||
|
||||
key = CryptoUtils.ecPublicKeyFromDerBytes(hexToUint8List(bytes));
|
||||
}
|
||||
}
|
||||
|
||||
/// For EdDSA algorithm, in sign method
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: dart_jsonwebtoken
|
||||
description: A dart implementation of the famous javascript library 'jsonwebtoken' (JWT).
|
||||
version: 2.9.0
|
||||
version: 2.9.1
|
||||
repository: https://github.com/jonasroussel/dart_jsonwebtoken
|
||||
homepage: https://github.com/jonasroussel/dart_jsonwebtoken#readme
|
||||
|
||||
|
Reference in New Issue
Block a user