fabiomsr / okhttp-peer-certificate-extractor Goto Github PK
View Code? Open in Web Editor NEWThis tool extracts peer certificates from given certificates.
License: Apache License 2.0
This tool extracts peer certificates from given certificates.
License: Apache License 2.0
hi
i am unable to pick my certificate file from resources1
folder
help me in doing this
i tried by the way you provided in test but it throw errors.
URL certificateUrl = CommonMethods.class.getResource("/mycert.cer");
File certificate = new File(certificateUrl.toURI());
String peerCertificate = PeerCertificateExtractor.extract(certificate);
Currently my app crashes due to java.util.Base64
missing. I think it should be android.util.Base64
?
# pin.sh
CERT="$1"
if [ -z "$CERT" ]; then
echo 'usage: pin.sh CERT.pem'
echo
echo 'example:'
echo
echo ' $ openssl s_client -showcerts -connect google.com:443 </dev/null > google.pem'
echo ' depth=1 C = US, O = Google Trust Services, CN = GTS CA 1O1'
echo ' verify return:1'
echo ' depth=0 C = US, ST = California, L = Mountain View, O = Google LLC, CN = *.google.com'
echo ' verify return:1'
echo ' DONE'
echo ' $ ./pin.sh google.pem'
echo ' sha256/xG5DOW4qfP5Rkg21faMmkxUHNSlfL5OASmHYtD1dWyY='
exit 1;
fi
echo -n 'sha256/'; printf '\'x$(openssl x509 -in $CERT -noout -sha256 -fingerprint | cut -f 2 -d = | sed 's/:/\\x/g') | base64
# maybe a bit more readable, at the price of needing python:
# echo -n sha256/
#openssl x509 -in "$CERT" -noout -sha256 -fingerprint | cut -f 2 -d = | python -c 'import binascii; print(binascii.b2a_base64(binascii.unhexlify(input().replace(":",""))))'
this is public domain. do with it what you will. hope it helps someone out.
most systems have base64 installed. all of them have awk and cut. and if you're already working with certs you certainly have openssl installed, so this should be widely compatible, easy to install, and fast.
I have my .pem file placed in assets folder.
how can I create a java file from it ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.