|
15 | 15 | package cmd |
16 | 16 |
|
17 | 17 | import ( |
18 | | - "crypto/x509" |
19 | | - "encoding/pem" |
20 | 18 | "fmt" |
21 | 19 | "os" |
22 | 20 | "strconv" |
@@ -260,20 +258,20 @@ func init() { |
260 | 258 | } |
261 | 259 |
|
262 | 260 | func parsePrivateKeyFromPath(path string) ([]byte, error) { |
263 | | - if _, err := os.Stat(path); err != nil { |
264 | | - return nil, fmt.Errorf("private key file not found: %s", credentialsPrivateKeyPath) |
265 | | - } |
| 261 | + // if _, err := os.Stat(path); err != nil { |
| 262 | + // return nil, fmt.Errorf("private key file not found: %s", credentialsPrivateKeyPath) |
| 263 | + // } |
266 | 264 | keyContents, err := os.ReadFile(path) |
267 | 265 | if err != nil { |
268 | 266 | return nil, fmt.Errorf("failed to read private key file: %w", err) |
269 | 267 | } |
270 | | - pemBlock, _ := pem.Decode(keyContents) |
271 | | - if pemBlock == nil { |
272 | | - return nil, fmt.Errorf("failed to decode PEM block") |
273 | | - } |
274 | | - if _, err := x509.ParsePKCS1PrivateKey(pemBlock.Bytes); err != nil { |
275 | | - return nil, fmt.Errorf("failed to parse private key: %w", err) |
276 | | - } |
| 268 | + // pemBlock, _ := pem.Decode(keyContents) |
| 269 | + // if pemBlock == nil { |
| 270 | + // return nil, fmt.Errorf("failed to decode PEM block") |
| 271 | + // } |
| 272 | + // if _, err := x509.ParsePKCS1PrivateKey(pemBlock.Bytes); err != nil { |
| 273 | + // return nil, fmt.Errorf("failed to parse private key: %w", err) |
| 274 | + // } |
277 | 275 | return keyContents, nil |
278 | 276 | } |
279 | 277 |
|
|
0 commit comments