You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
///
/// Decode the given [bytes] into an [RSAPrivateKey].
///
static RSAPrivateKey rsaPrivateKeyFromDERBytes(Uint8List bytes) {
var asn1Parser = ASN1Parser(bytes);
var topLevelSeq = asn1Parser.nextObject() as ASN1Sequence;
//ASN1Object version = topLevelSeq.elements[0];
//ASN1Object algorithm = topLevelSeq.elements[1];
var privateKey = topLevelSeq.elements![2];
asn1Parser = ASN1Parser(privateKey.valueBytes);
var pkSeq = asn1Parser.nextObject() as ASN1Sequence;
var modulus = pkSeq.elements![1] as ASN1Integer; <------------------------ Error Parsing
//ASN1Integer publicExponent = pkSeq.elements[2] as ASN1Integer;
var privateExponent = pkSeq.elements![3] as ASN1Integer;
var p = pkSeq.elements![4] as ASN1Integer;
var q = pkSeq.elements![5] as ASN1Integer;
//ASN1Integer exp1 = pkSeq.elements[6] as ASN1Integer;
//ASN1Integer exp2 = pkSeq.elements[7] as ASN1Integer;
//ASN1Integer co = pkSeq.elements[8] as ASN1Integer;
var rsaPrivateKey = RSAPrivateKey(
modulus.integer!, privateExponent.integer!, p.integer, q.integer);
return rsaPrivateKey;
}
Any idea ?
Thx
The text was updated successfully, but these errors were encountered:
No, i didn't find a solution. I commented on my control in my app.
I published without the control the certificate and private key on the server and it worked. So I think the key is good otherwise the server wouldn't be able to manage the certificate.
I have this error
type 'ASN1OctetString' is not a subtype of type 'ASN1Integer' in type cast
when i try to control validity of a private keyI create my certificate with certbot CLI
certbot certonly --manual --domain example.com --preferred-challenges dns
This command will request a certificate to Let's Encrypt about example.com and will require to prove the ownership of the domain with a DNS challenge.
The certificate can be found at:
/etc/letsencrypt/live/example.com/cert.pem
and the key at:/etc/letsencrypt/live/example.com/privatekey.pem
To control my private key, i used this method
And it seems not working in the line
Any idea ?
Thx
The text was updated successfully, but these errors were encountered: