mirror of
https://github.com/chris124567/hulu
synced 2024-11-24 17:17:30 +00:00
represent private key with byte slice
This commit is contained in:
parent
8c095fc96a
commit
9bcd331a50
@ -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
Loading…
Reference in New Issue
Block a user