Skip to content

Commit

Permalink
Allowing PKCS8 Private keys
Browse files Browse the repository at this point in the history
  • Loading branch information
kingcdavid committed Jun 13, 2023
1 parent 9ca28b7 commit 90fea3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash

# Copyright (c) 2019-2021 GMO GlobalSign Pte. Ltd.
#
#
# Licensed under the MIT License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
#
# https://opensource.org/licenses/MIT
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Check, build, test the hvclient.
# Check, build, test the hvclient.
gofumports -d ./. &&
golint ./... &&
go build ./... &&
Expand Down
6 changes: 5 additions & 1 deletion internal/pki/pem.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ func PrivateKeyFromFileWithPassword(filename, password string) (interface{}, err
return rsakey, nil
}

return nil, errors.New("unsupported private key type")
if rsakey, err := x509.ParsePKCS8PrivateKey(keybytes); err == nil {
return rsakey, nil
}

return nil, errors.New("unsupported private key type DAVE")
}

// PublicKeyFromFile reads a PEM-encoded file and returns the public key it
Expand Down

0 comments on commit 90fea3c

Please sign in to comment.