Skip to content

Commit

Permalink
update crypto.go
Browse files Browse the repository at this point in the history
  • Loading branch information
yiirs committed Aug 20, 2022
1 parent ffe21ea commit 8245183
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,8 @@ func (pk *PrivateKey) Sign(hash crypto.Hash, data []byte) ([]byte, error) {
}

// NewPrivateKeyFromPemBlock returns new private key with pem block.
func NewPrivateKeyFromPemBlock(b []byte) (*PrivateKey, error) {
block, _ := pem.Decode(b)
func NewPrivateKeyFromPemBlock(pemBlock []byte) (*PrivateKey, error) {
block, _ := pem.Decode(pemBlock)

if block == nil {
return nil, errors.New("no PEM data is found")
Expand Down Expand Up @@ -541,8 +541,8 @@ func (pk *PublicKey) Verify(hash crypto.Hash, data, signature []byte) error {
}

// NewPublicKeyFromPemBlock returns new public key with pem block.
func NewPublicKeyFromPemBlock(b []byte) (*PublicKey, error) {
block, _ := pem.Decode(b)
func NewPublicKeyFromPemBlock(pemBlock []byte) (*PublicKey, error) {
block, _ := pem.Decode(pemBlock)

if block == nil {
return nil, errors.New("no PEM data is found")
Expand Down

0 comments on commit 8245183

Please sign in to comment.