Refactor signer code into command and package

This commit is contained in:
Jan Dittberner 2021-01-04 14:15:12 +01:00
parent 3a2578ae55
commit 38566f35ef
13 changed files with 476 additions and 276 deletions

View file

@ -2,27 +2,6 @@ package datastructures
import "encoding/binary"
type Action uint8
const (
ActionNul = Action(0)
ActionSign = Action(1)
ActionRevoke = Action(2)
)
func (a Action) String() string {
switch a {
case ActionNul:
return "NUL"
case ActionSign:
return "SIGN"
case ActionRevoke:
return "REVOKE"
default:
return "unknown"
}
}
func encode24BitLength(data []byte) []byte {
lengthBytes := make([]byte, 4)
binary.BigEndian.PutUint32(lengthBytes, uint32(len(data)))