Skip to content

Instantly share code, notes, and snippets.

@solarfly73
Created August 15, 2017 18:07
Show Gist options
  • Save solarfly73/c49591c5c06d22a23fa24020db86b2e1 to your computer and use it in GitHub Desktop.
Save solarfly73/c49591c5c06d22a23fa24020db86b2e1 to your computer and use it in GitHub Desktop.
foo
func ParsePKCS8PrivateKey(der []byte, v ...[]byte) (interface{}, error) {
// No password provided, assume the private key is unencrypted
if v == nil || len(v[0]) == 0 {
return x509.ParsePKCS8PrivateKey(der)
}
// Use the password provided to decrypt the private key
password := v[0]
var privKey encryptedPrivateKeyInfo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment