- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for parseECPrivateKey (0.28 sec)
-
src/crypto/x509/sec1.go
PublicKey asn1.BitString `asn1:"optional,explicit,tag:1"` } // ParseECPrivateKey parses an EC private key in SEC 1, ASN.1 DER form. // // This kind of key is commonly encoded in PEM blocks of type "EC PRIVATE KEY". func ParseECPrivateKey(der []byte) (*ecdsa.PrivateKey, error) { return parseECPrivateKey(nil, der) } // MarshalECPrivateKey converts an EC private key to SEC 1, ASN.1 DER form. //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 13 17:09:47 UTC 2023 - 4.6K bytes - Viewed (0) -
src/crypto/x509/sec1_test.go
} func TestParseECPrivateKey(t *testing.T) { for i, test := range ecKeyTests { derBytes, _ := hex.DecodeString(test.derHex) key, err := ParseECPrivateKey(derBytes) if err != nil { t.Fatalf("#%d: failed to decode EC private key: %s", i, err) } serialized, err := MarshalECPrivateKey(key) if err != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Feb 27 19:34:12 UTC 2019 - 5.4K bytes - Viewed (0) -
src/crypto/x509/pkcs8.go
var privKey pkcs8 if _, err := asn1.Unmarshal(der, &privKey); err != nil { if _, err := asn1.Unmarshal(der, &ecPrivateKey{}); err == nil { return nil, errors.New("x509: failed to parse private key (use ParseECPrivateKey instead for this key format)") } if _, err := asn1.Unmarshal(der, &pkcs1PrivateKey{}); err == nil { return nil, errors.New("x509: failed to parse private key (use ParsePKCS1PrivateKey instead for this key format)")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 13 17:09:47 UTC 2023 - 5.8K bytes - Viewed (0) -
src/crypto/x509/pkcs8_test.go
var pkcs8MismatchKeyTests = []struct { hexKey string errorContains string }{ {hexKey: hexPKCS8TestECKey, errorContains: "use ParseECPrivateKey instead"}, {hexKey: hexPKCS8TestPKCS1Key, errorContains: "use ParsePKCS1PrivateKey instead"}, } func TestPKCS8MismatchKeyFormat(t *testing.T) { for i, test := range pkcs8MismatchKeyTests {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sat Nov 19 16:45:10 UTC 2022 - 9K bytes - Viewed (0) -
security/pkg/pki/util/crypto.go
kb, _ := pem.Decode(keyBytes) if kb == nil { return nil, fmt.Errorf("invalid PEM-encoded key") } switch kb.Type { case blockTypeECPrivateKey: key, err := x509.ParseECPrivateKey(kb.Bytes) if err != nil { return nil, fmt.Errorf("failed to parse the ECDSA private key: %v", err) } return key, nil case blockTypeRSAPrivateKey: key, err := x509.ParsePKCS1PrivateKey(kb.Bytes)
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Tue Jun 04 13:00:07 UTC 2024 - 5.3K bytes - Viewed (0) -
src/crypto/x509/pkcs1.go
return nil, asn1.SyntaxError{Msg: "trailing data"} } if err != nil { if _, err := asn1.Unmarshal(der, &ecPrivateKey{}); err == nil { return nil, errors.New("x509: failed to parse private key (use ParseECPrivateKey instead for this key format)") } if _, err := asn1.Unmarshal(der, &pkcs8{}); err == nil { return nil, errors.New("x509: failed to parse private key (use ParsePKCS8PrivateKey instead for this key format)") }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 13 17:09:47 UTC 2023 - 4.7K bytes - Viewed (0) -
src/crypto/x509/platform_test.go
t.Fatalf("failed to parse test root: %s", err) } der, err = os.ReadFile(rootKeyPath) if err != nil { t.Fatalf("failed to read test key: %s", err) } b, _ = pem.Decode(der) testRootKey, err := ParseECPrivateKey(b.Bytes) if err != nil { t.Fatalf("failed to parse test key: %s", err) } if _, err := testRoot.Verify(VerifyOptions{}); err != nil { t.Skipf("test root is not in trust store, skipping (err: %q)", err) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Feb 20 17:18:29 UTC 2024 - 7.2K bytes - Viewed (0)