Skip to content

Commit

Permalink
PublicKeySignature added to more CTR formats.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahzf committed May 6, 2024
1 parent eca6166 commit e54a4e9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,41 @@
"meterInfo": {
"firmwareVersion": "123",
"type": "eHZ IW8E EMH",
"manufacturer": "EMH"
"manufacturer": "EMH",
"publicKeySignatures": [
{
"signer": "Open Charging Cloud",
"publicKey": "04a8ff0d82107922522e004a167cc658f0eef408c5020f98e7a2615be326e61852666877335f4f8d9a0a756c26f0c9fb3f401431416abb5317cc0f5d714d3026fe",
"timestamp": "2019-06-30T00:00:00Z",
"comment": { "en": "Hello world!" },
"notBefore": "2018-11-04T16:47:01Z",
"notAfter": "2023-03-12T13:54:12Z",
"operations": {
"signCertificates": false,
"signMeterValues": true
},
"revocationURIs": [],
"algorithm": "secp256k1",
"format": "DER",
"value": "303502181dce9223416d64e5362bc8eb46eddf23adcb74382b602e1f021900eca85b1a48bc1f64d25951e947c7e48fa0b070b82e2cae41"
},
{
"signer": "chargeIT mobility",
"publicKey": "04a8ff0d82107922522e004a167cc658f0eef408c5020f98e7a2615be326e61852666877335f4f8d9a0a756c26f0c9fb3f401431416abb5317cc0f5d714d3026fe",
"timestamp": "2019-06-30T00:00:00Z",
"comment": { "en": "Hello world!" },
"notBefore": "2018-11-04T16:47:01Z",
"notAfter": "2023-03-12T13:54:12Z",
"operations": {
"signCertificates": false,
"signMeterValues": true
},
"revocationURIs": [],
"algorithm": "secp256k1",
"format": "DER",
"value": "303502181dce9223416d64e5362bc8eb46eddf23adcb74382b602e1f021900eca85b1a48bc1f64d25951e947c7e48fa0b070b82e2cae41"
}
]
},
"connectorInfo": {
"type": "Typ-2 Socket",
Expand Down
4 changes: 2 additions & 2 deletions src/ts/Alfen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,14 +622,14 @@ export class AlfenCrypt01 extends ACrypt {
try
{

cryptoResult.publicKey = meter.publicKeys[0]?.value?.toLowerCase();
cryptoResult.publicKey = meter.publicKeys[0]?.value;
cryptoResult.publicKeyFormat = meter.publicKeys[0]?.format;
cryptoResult.publicKeySignatures = meter.publicKeys[0]?.signatures;

try
{

const publicKey = chargyLib.buf2hex(this.chargy.base32Decode(cryptoResult.publicKey?.toUpperCase(), 'RFC4648'));
const publicKey = chargyLib.buf2hex(this.chargy.base32Decode(cryptoResult.publicKey, 'RFC4648'));
let result = false;

switch (meter?.publicKeys[0]?.algorithm ?? "")
Expand Down

0 comments on commit e54a4e9

Please sign in to comment.