represent private key with byte slice

This commit is contained in:
Christopher Tarry 2022-05-14 15:06:52 -04:00
parent 8c095fc96a
commit 9bcd331a50
2 changed files with 4 additions and 4 deletions

View File

@ -35,8 +35,8 @@ type Key struct {
} }
// Creates a new CDM object with the specified device information. // Creates a new CDM object with the specified device information.
func NewCDM(privateKey string, clientID []byte, initData []byte) (CDM, error) { func NewCDM(privateKey, clientID, initData []byte) (CDM, error) {
block, _ := pem.Decode([]byte(privateKey)) block, _ := pem.Decode(privateKey)
if block == nil || (block.Type != "PRIVATE KEY" && block.Type != "RSA PRIVATE KEY") { if block == nil || (block.Type != "PRIVATE KEY" && block.Type != "RSA PRIVATE KEY") {
return CDM{}, errors.New("failed to decode device private key") return CDM{}, errors.New("failed to decode device private key")
} }

File diff suppressed because one or more lines are too long