Skip to content

Instantly share code, notes, and snippets.

@hfossli
hfossli / SHA256-Bridging-Header.h
Last active July 1, 2024 02:01
AES 256 in swift 4 with CommonCrypto
#import <CommonCrypto/CommonCrypto.h>
@milhomem
milhomem / clientCert.android.java
Last active April 18, 2024 21:18
How to connect using Client Certificate in Android with OkHttp
KeyStore keyStore = KeyStore.getInstance("PKCS12");
FileInputStream clientCertificateContent = new FileInputStream("/path/to/publicAndPrivateKey.p12");
keyStore.load(clientCertificateContent, "private key password".toCharArray());
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
keyManagerFactory.init(keyStore, "private key password".toCharArray());
FileInputStream myTrustedCAFileContent = new FileInputStream("/path/to/embedded/CA-Chain.pem");
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
X509Certificate myCAPublicKey = (X509Certificate) certificateFactory.generateCertificate(myTrustedCAFileContent);
@axross
axross / material_design_less_color_schema.less
Created August 29, 2014 02:00
less color schema of google material design
//
// Colors
//
@red50: #fde0dc;
@red100: #f9bdbb;
@red200: #f69988;
@red300: #f36c60;
@red400: #e84e40;
@red500: #e51c23;
@red600: #dd191d;