Skip to content

Commit

Permalink
add SetPrivateKeyPKCS8
Browse files Browse the repository at this point in the history
  • Loading branch information
mdigger committed Oct 5, 2016
1 parent f78fd98 commit e9c9bf0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jwt.go
Expand Up @@ -64,6 +64,12 @@ func (pt *ProviderToken) LoadPrivateKey(filename string) error {
if err != nil {
return err
}
return pt.SetPrivateKeyPKCS8(data)
}

// SetPrivateKeyPKCS8 adds to the ProviderToken private key in the format of
// PKCS8.
func (pt *ProviderToken) SetPrivateKeyPKCS8(data []byte) error {
block, data := pem.Decode(data)
if block != nil {
data = block.Bytes
Expand Down

0 comments on commit e9c9bf0

Please sign in to comment.