Closed pedroserretti closed 6 months ago
It seems your RSA private key is not valid in PEM format.
I suggest checking chaveBytes
first, maybe something was wrong.
import 'dart:convert';
print(utf8.decode(chaveBytes));
And it should be like the following in text form:
-----BEGIN PRIVATE KEY-----
MIICdwIBADA....(omitted)
-----END PRIVATE KEY-----
It seems your RSA private key is not valid in PEM format.
I suggest checking
chaveBytes
first, maybe something was wrong.import 'dart:convert'; print(utf8.decode(chaveBytes));
And it should be like the following in text form:
-----BEGIN PRIVATE KEY----- MIICdwIBADA....(omitted) -----END PRIVATE KEY-----
Hi, thanks for the reply!
My certificate look like this:
Can i send you my certificate with my private key and my sign code? In private or an email?
PS: The byte when the problem occurs is "160"
Maybe this can help.
Thanks in advance.
It seems your RSA private key is not valid in PEM format.
I suggest checking
chaveBytes
first, maybe something was wrong.import 'dart:convert'; print(utf8.decode(chaveBytes));
And it should be like the following in text form:
-----BEGIN PRIVATE KEY----- MIICdwIBADA....(omitted) -----END PRIVATE KEY-----
Another information for you.
I checked my certificate at: https://www.sslshopper.com/certificate-key-matcher.html
Hi, since the stack trace shows the error is from ninja
and ninja_asn1
, I suggest you go to their issue tracker to post an issue instead.
Thanks.
I'm doing a function that i'm signing a XML. Before i was testing with the same certificate, and it does successfully.
Now, i'm doing some tests, but unfortunally, when i test with another certificate, it occurs a new error, in ASN1.parse function. Can anyone help me with this??
That's my CallStack:
0 ASN1Object.parse (package:ninja_asn1/src/ninja_asn1_base.dart:120:9)
1 ASN1Sequence.parse (package:ninja_asn1/src/ninja_asn1_base.dart:211:33)
2 new ASN1Sequence.decode (package:ninja_asn1/src/ninja_asn1_base.dart:180:70)
3 new RSAPrivateKey.fromASN1 (package:ninja/asymmetric/rsa/rsa.dart:271:32)
4 new RSAPrivateKey.fromPEM (package:ninja/asymmetric/rsa/rsa.dart:325:26)
5 RSASHA1.getSignature (package:xml_crypto/src/signed_xml.dart:980:31)
6 SignedXml._calculateSignatureValue (package:xml_crypto/src/signed_xml.dart:291:16)
7 SignedXml.computeSignature (package:xml_crypto/src/signed_xml.dart:659:7)
8 FNfeNfceGerais.assinarDocumento (package:vip12/funcoes/nfeNfce/fNfeNfceGerais.dart:67:15)
e: UnimplementedError message: null
That's urgent, please, someone help me, i need answers!