Implement first client command
The client can now talk to the old Perl signer implementation. Running socat has been documented in README.md. Commonly used I/O code has been moved to the shared/io.go file.
This commit is contained in:
parent
5aa557c9aa
commit
65855152ce
6 changed files with 287 additions and 84 deletions
|
@ -22,6 +22,8 @@ type SignerRequest struct {
|
|||
Content3 string
|
||||
}
|
||||
|
||||
const protocolVersion = 1
|
||||
|
||||
func SignerRequestFromData(lengthBytes []byte, blockData []byte, checkSum byte) (*SignerRequest, error) {
|
||||
headerLength := decode24BitLength(blockData[0:3])
|
||||
headerBytes := blockData[3 : 3+headerLength]
|
||||
|
@ -76,5 +78,9 @@ func (r SignerRequest) Serialize() []byte {
|
|||
}
|
||||
|
||||
func NewNulRequest() *SignerRequest {
|
||||
return &SignerRequest{Version: 1, Action: ActionNul, Content1: time.Now().UTC().Format("010203042006.05")}
|
||||
return &SignerRequest{
|
||||
Version: protocolVersion,
|
||||
Action: ActionNul,
|
||||
Content1: time.Now().UTC().Format("010203042006.05"),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue