I need generate "GenerateSharedSecret", but sRemKey(PeerPublicKey) is not valid.
what is the correct format? I need interoperabilty with others systems. DER or PEM ???
Thank's
function TECGGateCipher.ECCTMSSharedKey( const sRemKey : AnsiString ):AnsiString;
var ecc : TECCEncSign;
begin
ecc := TECCEncSign.Create;
try
ecc.ECCType:= p256;
ecc.OutputFormat:= base64;
ecc.Unicode:= noUni;
ecc.GenerateKeys();
Result := ecc.GenerateSharedSecret( sRemKey );
finally
ecc.Free;
end;
end;
Hello,
Do you have sample of PEM public key that I can use to test? The correct format is the same that is generated by ecc.GenerateKeys(), the raw public key in fact.
I can consider coding an import function from PEM format.
-----BEGIN PUBLIC KEY-----
MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEZrqbp0e/V2LkQ4XcuBkeBvZfWAIGOrr1
1HESZLtX2qeG9cQe1hJ1Cd42nKoMtnPFAwL/itJitBZZFXcf6a9uYQ==
-----END PUBLIC KEY-----
@Carrillo_Gomez_Edwin
These are not feature requests but technical support questions.
Please post technical support questions in the proper TMS Cryptography category.
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE+SbHqv3I79Be6cr6d+JBzwvSfNHn
OLU/Z3hInzeTInYzjPgskcHwpWJa79tcM8EBoczDZAXeH6hSwQOoX768pw==
-----END PUBLIC KEY-----
your public keys look shorter:
BD7CFp6xMq96iqOMmKFgC9QjbzNt58VIToK1EhSvzCEgD23XMjkodaJ5Or0uRyRdcEXwbiASfVRPOmAfAuCjaCA=
your public keys begin with "B" ever, but openssl with "M" ever.
@Carrillo_Gomez_Edwin
These are not feature requests but technical support questions.
Please post technical support questions in the proper TMS Cryptography category.
As I said previously, our public key is the raw public key. If you use https://lapo.it/asn1js/ to decode the ASN.1 encoded public key, we use the BIT STRING sequence, beginning by 04 in hexadecimal.
I will code a function to extract the key from a PEM key format. I will keep you informed.