Closed CyberDepot closed 4 years ago
Hello @CyberDepot
This package is not for GENERATING X509 certificates. This package only helps you doing the following things :
So for me it looks like you want to create a self signed certificate, is this right ?
In case somebody come accross this. Here is an example to generate a X509 certificate using basic_utils v5.4.2
:
final keyPair = CryptoUtils.generateRSAKeyPair();
final privateKey = keyPair.privateKey as RSAPrivateKey;
final publicKey = keyPair.publicKey as RSAPublicKey;
final dn = {
'CN': 'Mr A.',
'O': '',
'OU': '',
'L': '',
'S': '',
'C': '',
};
final csr = X509Utils.generateRsaCsrPem(dn, privateKey, publicKey);
// this is the certificate in PEM format
final certificate = X509Utils.generateSelfSignedCertificate(keyPair.privateKey, csr, 30);
In case somebody come accross this. Here is an example to generate a X509 certificate using
basic_utils v5.4.2
:final keyPair = CryptoUtils.generateRSAKeyPair(); final privateKey = keyPair.privateKey as RSAPrivateKey; final publicKey = keyPair.publicKey as RSAPublicKey; final dn = { 'CN': 'Mr A.', 'O': '', 'OU': '', 'L': '', 'S': '', 'C': '', }; final csr = X509Utils.generateRsaCsrPem(dn, privateKey, publicKey); // this is the certificate in PEM format final certificate = X509Utils.generateSelfSignedCertificate(keyPair.privateKey, csr, 30);
thank you, i check it
Hi, Thank you for this library i use X509Utils version ^2.6.2
i need to generate a certificate and keep public key on the certificate for share to other i want to use certificate for sign, verifiy sign and key exchange i wnat to give the certificate to customers (certificate with public key) i want to generate a qr code for sharing certificate then when i sign a string and send for them, customers will find out if I signed it or not or i want to use asymmetric encryption with certificate, i encrypt a string with certificate private key and send for customers and they can decrypt string with my certificate (if i give to them In the form of qr code)
i see the web, you examples, issues and you test but i cant decrypt pem certificate and find public key
i use this code
i generate certificate and check this on this link https://www.sslchecker.com/csr/decode
i put the certificate for you
i try to decode certificate with this code
but give me this error
i use from this website and generate a certificate https://www.samltool.com/self_signed_certs.php
when i use CSR thats give me error but when i use X.509 cert thats work very good so i put X.509 cert for you
i dont know what is the problem but i need to generate a certificate Just like the top X.509 cert certificate if you know a package for generate this type please say to me if toy can help me to generate this certificate i will be very grateful please help me for solved the problem thank you