Skip to content

Instantly share code, notes, and snippets.

@luckenzo
luckenzo / PinManager.java
Created November 29, 2018 11:53
Sample code for TLS implementation on Android apps
public class PinManager implements X509TrustManager {
/* Get a default keystore instance or specify your keystore type e.g., BKS */
KeyStore ks = KeyStore.getInstance(KeyStore. getDefaultType());
private String keyAlgorithm;
private PublicKey storedPubKey;
private String serial;
String alias = "myCert";