|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package wireguard |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"bytes" |
|
|
|
|
"encoding/base64" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -16,6 +17,11 @@ func (k BinaryKey) IsZero() bool {
|
|
|
|
|
return len(k) == 0 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Equal checks if two keys are identical
|
|
|
|
|
func (k BinaryKey) Equal(alter BinaryKey) bool { |
|
|
|
|
return bytes.Equal(k, alter) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// BinaryKeyFromBase64 decodes a base64-based string into
|
|
|
|
|
// a [BinaryKey]
|
|
|
|
|
func BinaryKeyFromBase64(data string) (BinaryKey, error) { |
|
|
|
|