(derKey []byte)
| 71 | } |
| 72 | |
| 73 | func parsePrivateKeyBlock(derKey []byte) (crypto.PrivateKey, error) { |
| 74 | // Try each of 2 key formats and take the first one that successfully parses. |
| 75 | if key, err := x509.ParseECPrivateKey(derKey); err == nil { |
| 76 | return key, nil |
| 77 | } |
| 78 | |
| 79 | if keyInterface, err := x509.ParsePKCS8PrivateKey(derKey); err == nil { |
| 80 | return typeSupportedPKCS8key(keyInterface) |
| 81 | } |
| 82 | |
| 83 | return nil, errors.New("signingalgorithm: couldn't parse private key.") |
| 84 | } |
| 85 | |
| 86 | // parseEncryptedPrivateKeyBlock reads the passphrase to decrypt an encrypted private key from either |
| 87 | // WEB_BUNDLE_SIGNING_PASSPHRASE environment variable or if not set, it prompts a passphrase from the user. |
no test coverage detected