Java code to generate certificate pins