Skip to main content

Posts

Showing posts from 2018

X509Certificate2 releases resources

kalau dah lepas pakai X509Certificate2, release le dari memory selepas dipakai. kalau buat sistem hi-speed dan loading certificate beribu-ribu kali, lama2 memory pon habis. cert.Reset(); //buang isi kandungan cert yang load tadi source:  https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate2.reset?redirectedfrom=MSDN&view=netframework-4.7.2

Macam2 cerita pasal OPENSSL

USEFUL OPENSSL ONE-LINERS As a follow up for the certificate authority posting, here are some (hopefully) useful openssl one-liners: # creating a key openssl genrsa -aes256 -out user.key 4096 # creating a certificate signing request openssl req -sha256 -new -key user.key -out user.csr # signing the certificate signing request with a certificate authority openssl ca -config ca.config -out user.crt -infiles user.csr # creating a self sigend certificate openssl req -sha256 -new -x509 -key user.key -out user.crt # verify if the ca.crt has really signed user.crt openssl verify -CAfile ca.crt user.crt # decrypting the key openssl rsa -in user.key -out user.key.decrypted # creating a pkcs#7 format certificate in DER format openssl crl2pkcs7 -nocrl -certfile user.crt -certfile ca.crt -outform DER -out user.p7c # creating a pkcs#12 format certificate (IIS) openssl pkcs12 -export -in user.crt -inkey user.key -out server.pkcs12 # checking the data of a key openssl rsa -noout...