From e4c4d0b9eb301a8e12e6d4ab22f79f52d40af164 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sun, 11 Dec 2022 14:05:37 +0100 Subject: [PATCH] Regenerate msgpackgen definitions --- pkg/messages/resolver.msgpackgen.go | 1635 +++++++++++++++++++++++---- 1 file changed, 1446 insertions(+), 189 deletions(-) diff --git a/pkg/messages/resolver.msgpackgen.go b/pkg/messages/resolver.msgpackgen.go index c9c37e5..61c3dbb 100644 --- a/pkg/messages/resolver.msgpackgen.go +++ b/pkg/messages/resolver.msgpackgen.go @@ -7,6 +7,7 @@ import ( msgpack "github.com/shamaton/msgpackgen/msgpack" dec "github.com/shamaton/msgpackgen/msgpack/dec" enc "github.com/shamaton/msgpackgen/msgpack/enc" + "time" ) // RegisterGeneratedResolver registers generated resolver. @@ -56,36 +57,6 @@ func ___encodeAsArray(i interface{}) ([]byte, error) { return nil, fmt.Errorf("%s size / offset different %d : %d", "CAInfoCommand", size, offset) } return b, err - case ErrorResponse: - encoder := enc.NewEncoder() - size, err := ___calcArraySizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder) - if err != nil { - return nil, err - } - encoder.MakeBytes(size) - b, offset, err := ___encodeArrayErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder, 0) - if err != nil { - return nil, err - } - if size != offset { - return nil, fmt.Errorf("%s size / offset different %d : %d", "ErrorResponse", size, offset) - } - return b, err - case *ErrorResponse: - encoder := enc.NewEncoder() - size, err := ___calcArraySizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder) - if err != nil { - return nil, err - } - encoder.MakeBytes(size) - b, offset, err := ___encodeArrayErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder, 0) - if err != nil { - return nil, err - } - if size != offset { - return nil, fmt.Errorf("%s size / offset different %d : %d", "ErrorResponse", size, offset) - } - return b, err case FetchCRLCommand: encoder := enc.NewEncoder() size, err := ___calcArraySizeFetchCRLCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder) @@ -266,6 +237,156 @@ func ___encodeAsArray(i interface{}) ([]byte, error) { return nil, fmt.Errorf("%s size / offset different %d : %d", "SignCertificateResponse", size, offset) } return b, err + case RevokeCertificateCommand: + encoder := enc.NewEncoder() + size, err := ___calcArraySizeRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeArrayRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "RevokeCertificateCommand", size, offset) + } + return b, err + case *RevokeCertificateCommand: + encoder := enc.NewEncoder() + size, err := ___calcArraySizeRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeArrayRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "RevokeCertificateCommand", size, offset) + } + return b, err + case RevokeCertificateResponse: + encoder := enc.NewEncoder() + size, err := ___calcArraySizeRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeArrayRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "RevokeCertificateResponse", size, offset) + } + return b, err + case *RevokeCertificateResponse: + encoder := enc.NewEncoder() + size, err := ___calcArraySizeRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeArrayRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "RevokeCertificateResponse", size, offset) + } + return b, err + case SignOpenPGPCommand: + encoder := enc.NewEncoder() + size, err := ___calcArraySizeSignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeArraySignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "SignOpenPGPCommand", size, offset) + } + return b, err + case *SignOpenPGPCommand: + encoder := enc.NewEncoder() + size, err := ___calcArraySizeSignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeArraySignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "SignOpenPGPCommand", size, offset) + } + return b, err + case SignOpenPGPResponse: + encoder := enc.NewEncoder() + size, err := ___calcArraySizeSignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeArraySignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "SignOpenPGPResponse", size, offset) + } + return b, err + case *SignOpenPGPResponse: + encoder := enc.NewEncoder() + size, err := ___calcArraySizeSignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeArraySignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "SignOpenPGPResponse", size, offset) + } + return b, err + case ErrorResponse: + encoder := enc.NewEncoder() + size, err := ___calcArraySizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeArrayErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "ErrorResponse", size, offset) + } + return b, err + case *ErrorResponse: + encoder := enc.NewEncoder() + size, err := ___calcArraySizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeArrayErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "ErrorResponse", size, offset) + } + return b, err } return nil, nil } @@ -303,36 +424,6 @@ func ___encodeAsMap(i interface{}) ([]byte, error) { return nil, fmt.Errorf("%s size / offset different %d : %d", "CAInfoCommand", size, offset) } return b, err - case ErrorResponse: - encoder := enc.NewEncoder() - size, err := ___calcMapSizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder) - if err != nil { - return nil, err - } - encoder.MakeBytes(size) - b, offset, err := ___encodeMapErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder, 0) - if err != nil { - return nil, err - } - if size != offset { - return nil, fmt.Errorf("%s size / offset different %d : %d", "ErrorResponse", size, offset) - } - return b, err - case *ErrorResponse: - encoder := enc.NewEncoder() - size, err := ___calcMapSizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder) - if err != nil { - return nil, err - } - encoder.MakeBytes(size) - b, offset, err := ___encodeMapErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder, 0) - if err != nil { - return nil, err - } - if size != offset { - return nil, fmt.Errorf("%s size / offset different %d : %d", "ErrorResponse", size, offset) - } - return b, err case FetchCRLCommand: encoder := enc.NewEncoder() size, err := ___calcMapSizeFetchCRLCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder) @@ -513,6 +604,156 @@ func ___encodeAsMap(i interface{}) ([]byte, error) { return nil, fmt.Errorf("%s size / offset different %d : %d", "SignCertificateResponse", size, offset) } return b, err + case RevokeCertificateCommand: + encoder := enc.NewEncoder() + size, err := ___calcMapSizeRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeMapRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "RevokeCertificateCommand", size, offset) + } + return b, err + case *RevokeCertificateCommand: + encoder := enc.NewEncoder() + size, err := ___calcMapSizeRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeMapRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "RevokeCertificateCommand", size, offset) + } + return b, err + case RevokeCertificateResponse: + encoder := enc.NewEncoder() + size, err := ___calcMapSizeRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeMapRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "RevokeCertificateResponse", size, offset) + } + return b, err + case *RevokeCertificateResponse: + encoder := enc.NewEncoder() + size, err := ___calcMapSizeRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeMapRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "RevokeCertificateResponse", size, offset) + } + return b, err + case SignOpenPGPCommand: + encoder := enc.NewEncoder() + size, err := ___calcMapSizeSignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeMapSignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "SignOpenPGPCommand", size, offset) + } + return b, err + case *SignOpenPGPCommand: + encoder := enc.NewEncoder() + size, err := ___calcMapSizeSignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeMapSignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "SignOpenPGPCommand", size, offset) + } + return b, err + case SignOpenPGPResponse: + encoder := enc.NewEncoder() + size, err := ___calcMapSizeSignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeMapSignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "SignOpenPGPResponse", size, offset) + } + return b, err + case *SignOpenPGPResponse: + encoder := enc.NewEncoder() + size, err := ___calcMapSizeSignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeMapSignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "SignOpenPGPResponse", size, offset) + } + return b, err + case ErrorResponse: + encoder := enc.NewEncoder() + size, err := ___calcMapSizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeMapErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "ErrorResponse", size, offset) + } + return b, err + case *ErrorResponse: + encoder := enc.NewEncoder() + size, err := ___calcMapSizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder) + if err != nil { + return nil, err + } + encoder.MakeBytes(size) + b, offset, err := ___encodeMapErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, encoder, 0) + if err != nil { + return nil, err + } + if size != offset { + return nil, fmt.Errorf("%s size / offset different %d : %d", "ErrorResponse", size, offset) + } + return b, err } return nil, nil } @@ -543,20 +784,6 @@ func ___decodeAsArray(data []byte, i interface{}) (bool, error) { return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) } return true, err - case *ErrorResponse: - decoder := dec.NewDecoder(data) - offset, err := ___decodeArrayErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, decoder, 0) - if err == nil && offset != decoder.Len() { - return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) - } - return true, err - case **ErrorResponse: - decoder := dec.NewDecoder(data) - offset, err := ___decodeArrayErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, decoder, 0) - if err == nil && offset != decoder.Len() { - return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) - } - return true, err case *FetchCRLCommand: decoder := dec.NewDecoder(data) offset, err := ___decodeArrayFetchCRLCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, decoder, 0) @@ -641,6 +868,76 @@ func ___decodeAsArray(data []byte, i interface{}) (bool, error) { return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) } return true, err + case *RevokeCertificateCommand: + decoder := dec.NewDecoder(data) + offset, err := ___decodeArrayRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case **RevokeCertificateCommand: + decoder := dec.NewDecoder(data) + offset, err := ___decodeArrayRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case *RevokeCertificateResponse: + decoder := dec.NewDecoder(data) + offset, err := ___decodeArrayRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case **RevokeCertificateResponse: + decoder := dec.NewDecoder(data) + offset, err := ___decodeArrayRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case *SignOpenPGPCommand: + decoder := dec.NewDecoder(data) + offset, err := ___decodeArraySignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case **SignOpenPGPCommand: + decoder := dec.NewDecoder(data) + offset, err := ___decodeArraySignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case *SignOpenPGPResponse: + decoder := dec.NewDecoder(data) + offset, err := ___decodeArraySignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case **SignOpenPGPResponse: + decoder := dec.NewDecoder(data) + offset, err := ___decodeArraySignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case *ErrorResponse: + decoder := dec.NewDecoder(data) + offset, err := ___decodeArrayErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case **ErrorResponse: + decoder := dec.NewDecoder(data) + offset, err := ___decodeArrayErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err } return false, nil } @@ -662,20 +959,6 @@ func ___decodeAsMap(data []byte, i interface{}) (bool, error) { return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) } return true, err - case *ErrorResponse: - decoder := dec.NewDecoder(data) - offset, err := ___decodeMapErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, decoder, 0) - if err == nil && offset != decoder.Len() { - return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) - } - return true, err - case **ErrorResponse: - decoder := dec.NewDecoder(data) - offset, err := ___decodeMapErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, decoder, 0) - if err == nil && offset != decoder.Len() { - return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) - } - return true, err case *FetchCRLCommand: decoder := dec.NewDecoder(data) offset, err := ___decodeMapFetchCRLCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, decoder, 0) @@ -760,6 +1043,76 @@ func ___decodeAsMap(data []byte, i interface{}) (bool, error) { return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) } return true, err + case *RevokeCertificateCommand: + decoder := dec.NewDecoder(data) + offset, err := ___decodeMapRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case **RevokeCertificateCommand: + decoder := dec.NewDecoder(data) + offset, err := ___decodeMapRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case *RevokeCertificateResponse: + decoder := dec.NewDecoder(data) + offset, err := ___decodeMapRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case **RevokeCertificateResponse: + decoder := dec.NewDecoder(data) + offset, err := ___decodeMapRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case *SignOpenPGPCommand: + decoder := dec.NewDecoder(data) + offset, err := ___decodeMapSignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case **SignOpenPGPCommand: + decoder := dec.NewDecoder(data) + offset, err := ___decodeMapSignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case *SignOpenPGPResponse: + decoder := dec.NewDecoder(data) + offset, err := ___decodeMapSignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case **SignOpenPGPResponse: + decoder := dec.NewDecoder(data) + offset, err := ___decodeMapSignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case *ErrorResponse: + decoder := dec.NewDecoder(data) + offset, err := ___decodeMapErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err + case **ErrorResponse: + decoder := dec.NewDecoder(data) + offset, err := ___decodeMapErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(*v, decoder, 0) + if err == nil && offset != decoder.Len() { + return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len()) + } + return true, err } return false, nil } @@ -865,107 +1218,6 @@ func ___decodeMapCAInfoCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f8 return offset, err } -// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.ErrorResponse -func ___calcArraySizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v ErrorResponse, encoder *enc.Encoder) (int, error) { - size := 0 - size += encoder.CalcStructHeaderFix(1) - size += encoder.CalcString(v.Message) - return size, nil -} - -// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.ErrorResponse -func ___calcMapSizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v ErrorResponse, encoder *enc.Encoder) (int, error) { - size := 0 - size += encoder.CalcStructHeaderFix(1) - size += encoder.CalcStringFix(7) - size += encoder.CalcString(v.Message) - return size, nil -} - -// encode from git.cacert.org/cacert-gosigner/pkg/messages.ErrorResponse -func ___encodeArrayErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v ErrorResponse, encoder *enc.Encoder, offset int) ([]byte, int, error) { - var err error - offset = encoder.WriteStructHeaderFixAsArray(1, offset) - offset = encoder.WriteString(v.Message, offset) - return encoder.EncodedBytes(), offset, err -} - -// encode from git.cacert.org/cacert-gosigner/pkg/messages.ErrorResponse -func ___encodeMapErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v ErrorResponse, encoder *enc.Encoder, offset int) ([]byte, int, error) { - var err error - offset = encoder.WriteStructHeaderFixAsMap(1, offset) - offset = encoder.WriteStringFix("message", 7, offset) - offset = encoder.WriteString(v.Message, offset) - return encoder.EncodedBytes(), offset, err -} - -// decode to git.cacert.org/cacert-gosigner/pkg/messages.ErrorResponse -func ___decodeArrayErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v *ErrorResponse, decoder *dec.Decoder, offset int) (int, error) { - offset, err := decoder.CheckStructHeader(1, offset) - if err != nil { - return 0, err - } - { - var vv string - vv, offset, err = decoder.AsString(offset) - if err != nil { - return 0, err - } - v.Message = vv - } - return offset, err -} - -// decode to git.cacert.org/cacert-gosigner/pkg/messages.ErrorResponse -func ___decodeMapErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v *ErrorResponse, decoder *dec.Decoder, offset int) (int, error) { - keys := [][]byte{ - {uint8(0x6d), uint8(0x65), uint8(0x73), uint8(0x73), uint8(0x61), uint8(0x67), uint8(0x65)}, // message - } - offset, err := decoder.CheckStructHeader(1, offset) - if err != nil { - return 0, err - } - count := 0 - for count < 1 { - var dataKey []byte - dataKey, offset, err = decoder.AsStringBytes(offset) - if err != nil { - return 0, err - } - fieldIndex := -1 - for i, key := range keys { - if len(dataKey) != len(key) { - continue - } - fieldIndex = i - for dataKeyIndex := range dataKey { - if dataKey[dataKeyIndex] != key[dataKeyIndex] { - fieldIndex = -1 - break - } - } - if fieldIndex >= 0 { - break - } - } - switch fieldIndex { - case 0: - { - var vv string - vv, offset, err = decoder.AsString(offset) - if err != nil { - return 0, err - } - v.Message = vv - } - count++ - default: - return 0, fmt.Errorf("unknown key[%s] found", string(dataKey)) - } - } - return offset, err -} - // calculate size from git.cacert.org/cacert-gosigner/pkg/messages.FetchCRLCommand func ___calcArraySizeFetchCRLCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v FetchCRLCommand, encoder *enc.Encoder) (int, error) { size := 0 @@ -2190,3 +2442,1008 @@ func ___decodeMapSignCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd } return offset, err } + +// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.RevokeCertificateCommand +func ___calcArraySizeRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v RevokeCertificateCommand, encoder *enc.Encoder) (int, error) { + size := 0 + size += encoder.CalcStructHeaderFix(3) + size += encoder.CalcString(v.IssuerID) + if v.Serial != nil { + s, err := encoder.CalcSliceLength(len(v.Serial), true) + if err != nil { + return 0, err + } + size += s + for _, vv := range v.Serial { + size += encoder.CalcByte(vv) + } + } else { + size += encoder.CalcNil() + } + size += encoder.CalcString(v.Reason) + return size, nil +} + +// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.RevokeCertificateCommand +func ___calcMapSizeRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v RevokeCertificateCommand, encoder *enc.Encoder) (int, error) { + size := 0 + size += encoder.CalcStructHeaderFix(3) + size += encoder.CalcStringFix(9) + size += encoder.CalcString(v.IssuerID) + size += encoder.CalcStringFix(13) + if v.Serial != nil { + s, err := encoder.CalcSliceLength(len(v.Serial), true) + if err != nil { + return 0, err + } + size += s + for _, vv := range v.Serial { + size += encoder.CalcByte(vv) + } + } else { + size += encoder.CalcNil() + } + size += encoder.CalcStringFix(6) + size += encoder.CalcString(v.Reason) + return size, nil +} + +// encode from git.cacert.org/cacert-gosigner/pkg/messages.RevokeCertificateCommand +func ___encodeArrayRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v RevokeCertificateCommand, encoder *enc.Encoder, offset int) ([]byte, int, error) { + var err error + offset = encoder.WriteStructHeaderFixAsArray(3, offset) + offset = encoder.WriteString(v.IssuerID, offset) + if v.Serial != nil { + offset = encoder.WriteSliceLength(len(v.Serial), offset, true) + for _, vv := range v.Serial { + offset = encoder.WriteByte(vv, offset) + } + } else { + offset = encoder.WriteNil(offset) + } + offset = encoder.WriteString(v.Reason, offset) + return encoder.EncodedBytes(), offset, err +} + +// encode from git.cacert.org/cacert-gosigner/pkg/messages.RevokeCertificateCommand +func ___encodeMapRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v RevokeCertificateCommand, encoder *enc.Encoder, offset int) ([]byte, int, error) { + var err error + offset = encoder.WriteStructHeaderFixAsMap(3, offset) + offset = encoder.WriteStringFix("issuer_id", 9, offset) + offset = encoder.WriteString(v.IssuerID, offset) + offset = encoder.WriteStringFix("serial_number", 13, offset) + if v.Serial != nil { + offset = encoder.WriteSliceLength(len(v.Serial), offset, true) + for _, vv := range v.Serial { + offset = encoder.WriteByte(vv, offset) + } + } else { + offset = encoder.WriteNil(offset) + } + offset = encoder.WriteStringFix("reason", 6, offset) + offset = encoder.WriteString(v.Reason, offset) + return encoder.EncodedBytes(), offset, err +} + +// decode to git.cacert.org/cacert-gosigner/pkg/messages.RevokeCertificateCommand +func ___decodeArrayRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v *RevokeCertificateCommand, decoder *dec.Decoder, offset int) (int, error) { + offset, err := decoder.CheckStructHeader(3, offset) + if err != nil { + return 0, err + } + { + var vv string + vv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + v.IssuerID = vv + } + if !decoder.IsCodeNil(offset) { + var vv []byte + var vvl int + vvl, offset, err = decoder.SliceLength(offset) + if err != nil { + return 0, err + } + vv = make([]byte, vvl) + for vvi := range vv { + var vvv byte + vvv, offset, err = decoder.AsByte(offset) + if err != nil { + return 0, err + } + vv[vvi] = vvv + } + v.Serial = vv + } else { + offset++ + } + { + var vv string + vv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + v.Reason = vv + } + return offset, err +} + +// decode to git.cacert.org/cacert-gosigner/pkg/messages.RevokeCertificateCommand +func ___decodeMapRevokeCertificateCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v *RevokeCertificateCommand, decoder *dec.Decoder, offset int) (int, error) { + keys := [][]byte{ + {uint8(0x69), uint8(0x73), uint8(0x73), uint8(0x75), uint8(0x65), uint8(0x72), uint8(0x5f), uint8(0x69), uint8(0x64)}, // issuer_id + {uint8(0x73), uint8(0x65), uint8(0x72), uint8(0x69), uint8(0x61), uint8(0x6c), uint8(0x5f), uint8(0x6e), uint8(0x75), uint8(0x6d), uint8(0x62), uint8(0x65), uint8(0x72)}, // serial_number + {uint8(0x72), uint8(0x65), uint8(0x61), uint8(0x73), uint8(0x6f), uint8(0x6e)}, // reason + } + offset, err := decoder.CheckStructHeader(3, offset) + if err != nil { + return 0, err + } + count := 0 + for count < 3 { + var dataKey []byte + dataKey, offset, err = decoder.AsStringBytes(offset) + if err != nil { + return 0, err + } + fieldIndex := -1 + for i, key := range keys { + if len(dataKey) != len(key) { + continue + } + fieldIndex = i + for dataKeyIndex := range dataKey { + if dataKey[dataKeyIndex] != key[dataKeyIndex] { + fieldIndex = -1 + break + } + } + if fieldIndex >= 0 { + break + } + } + switch fieldIndex { + case 0: + { + var vv string + vv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + v.IssuerID = vv + } + count++ + case 1: + if !decoder.IsCodeNil(offset) { + var vv []byte + var vvl int + vvl, offset, err = decoder.SliceLength(offset) + if err != nil { + return 0, err + } + vv = make([]byte, vvl) + for vvi := range vv { + var vvv byte + vvv, offset, err = decoder.AsByte(offset) + if err != nil { + return 0, err + } + vv[vvi] = vvv + } + v.Serial = vv + } else { + offset++ + } + count++ + case 2: + { + var vv string + vv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + v.Reason = vv + } + count++ + default: + return 0, fmt.Errorf("unknown key[%s] found", string(dataKey)) + } + } + return offset, err +} + +// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.RevokeCertificateResponse +func ___calcArraySizeRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v RevokeCertificateResponse, encoder *enc.Encoder) (int, error) { + size := 0 + size += encoder.CalcStructHeaderFix(3) + size += encoder.CalcString(v.IssuerID) + if v.Serial != nil { + s, err := encoder.CalcSliceLength(len(v.Serial), true) + if err != nil { + return 0, err + } + size += s + for _, vv := range v.Serial { + size += encoder.CalcByte(vv) + } + } else { + size += encoder.CalcNil() + } + size += encoder.CalcTime(v.RevokedAt) + return size, nil +} + +// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.RevokeCertificateResponse +func ___calcMapSizeRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v RevokeCertificateResponse, encoder *enc.Encoder) (int, error) { + size := 0 + size += encoder.CalcStructHeaderFix(3) + size += encoder.CalcStringFix(9) + size += encoder.CalcString(v.IssuerID) + size += encoder.CalcStringFix(13) + if v.Serial != nil { + s, err := encoder.CalcSliceLength(len(v.Serial), true) + if err != nil { + return 0, err + } + size += s + for _, vv := range v.Serial { + size += encoder.CalcByte(vv) + } + } else { + size += encoder.CalcNil() + } + size += encoder.CalcStringFix(10) + size += encoder.CalcTime(v.RevokedAt) + return size, nil +} + +// encode from git.cacert.org/cacert-gosigner/pkg/messages.RevokeCertificateResponse +func ___encodeArrayRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v RevokeCertificateResponse, encoder *enc.Encoder, offset int) ([]byte, int, error) { + var err error + offset = encoder.WriteStructHeaderFixAsArray(3, offset) + offset = encoder.WriteString(v.IssuerID, offset) + if v.Serial != nil { + offset = encoder.WriteSliceLength(len(v.Serial), offset, true) + for _, vv := range v.Serial { + offset = encoder.WriteByte(vv, offset) + } + } else { + offset = encoder.WriteNil(offset) + } + offset = encoder.WriteTime(v.RevokedAt, offset) + return encoder.EncodedBytes(), offset, err +} + +// encode from git.cacert.org/cacert-gosigner/pkg/messages.RevokeCertificateResponse +func ___encodeMapRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v RevokeCertificateResponse, encoder *enc.Encoder, offset int) ([]byte, int, error) { + var err error + offset = encoder.WriteStructHeaderFixAsMap(3, offset) + offset = encoder.WriteStringFix("issuer_id", 9, offset) + offset = encoder.WriteString(v.IssuerID, offset) + offset = encoder.WriteStringFix("serial_number", 13, offset) + if v.Serial != nil { + offset = encoder.WriteSliceLength(len(v.Serial), offset, true) + for _, vv := range v.Serial { + offset = encoder.WriteByte(vv, offset) + } + } else { + offset = encoder.WriteNil(offset) + } + offset = encoder.WriteStringFix("revoked_at", 10, offset) + offset = encoder.WriteTime(v.RevokedAt, offset) + return encoder.EncodedBytes(), offset, err +} + +// decode to git.cacert.org/cacert-gosigner/pkg/messages.RevokeCertificateResponse +func ___decodeArrayRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v *RevokeCertificateResponse, decoder *dec.Decoder, offset int) (int, error) { + offset, err := decoder.CheckStructHeader(3, offset) + if err != nil { + return 0, err + } + { + var vv string + vv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + v.IssuerID = vv + } + if !decoder.IsCodeNil(offset) { + var vv []byte + var vvl int + vvl, offset, err = decoder.SliceLength(offset) + if err != nil { + return 0, err + } + vv = make([]byte, vvl) + for vvi := range vv { + var vvv byte + vvv, offset, err = decoder.AsByte(offset) + if err != nil { + return 0, err + } + vv[vvi] = vvv + } + v.Serial = vv + } else { + offset++ + } + { + var vv time.Time + vv, offset, err = decoder.AsDateTime(offset) + if err != nil { + return 0, err + } + v.RevokedAt = vv + } + return offset, err +} + +// decode to git.cacert.org/cacert-gosigner/pkg/messages.RevokeCertificateResponse +func ___decodeMapRevokeCertificateResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v *RevokeCertificateResponse, decoder *dec.Decoder, offset int) (int, error) { + keys := [][]byte{ + {uint8(0x69), uint8(0x73), uint8(0x73), uint8(0x75), uint8(0x65), uint8(0x72), uint8(0x5f), uint8(0x69), uint8(0x64)}, // issuer_id + {uint8(0x73), uint8(0x65), uint8(0x72), uint8(0x69), uint8(0x61), uint8(0x6c), uint8(0x5f), uint8(0x6e), uint8(0x75), uint8(0x6d), uint8(0x62), uint8(0x65), uint8(0x72)}, // serial_number + {uint8(0x72), uint8(0x65), uint8(0x76), uint8(0x6f), uint8(0x6b), uint8(0x65), uint8(0x64), uint8(0x5f), uint8(0x61), uint8(0x74)}, // revoked_at + } + offset, err := decoder.CheckStructHeader(3, offset) + if err != nil { + return 0, err + } + count := 0 + for count < 3 { + var dataKey []byte + dataKey, offset, err = decoder.AsStringBytes(offset) + if err != nil { + return 0, err + } + fieldIndex := -1 + for i, key := range keys { + if len(dataKey) != len(key) { + continue + } + fieldIndex = i + for dataKeyIndex := range dataKey { + if dataKey[dataKeyIndex] != key[dataKeyIndex] { + fieldIndex = -1 + break + } + } + if fieldIndex >= 0 { + break + } + } + switch fieldIndex { + case 0: + { + var vv string + vv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + v.IssuerID = vv + } + count++ + case 1: + if !decoder.IsCodeNil(offset) { + var vv []byte + var vvl int + vvl, offset, err = decoder.SliceLength(offset) + if err != nil { + return 0, err + } + vv = make([]byte, vvl) + for vvi := range vv { + var vvv byte + vvv, offset, err = decoder.AsByte(offset) + if err != nil { + return 0, err + } + vv[vvi] = vvv + } + v.Serial = vv + } else { + offset++ + } + count++ + case 2: + { + var vv time.Time + vv, offset, err = decoder.AsDateTime(offset) + if err != nil { + return 0, err + } + v.RevokedAt = vv + } + count++ + default: + return 0, fmt.Errorf("unknown key[%s] found", string(dataKey)) + } + } + return offset, err +} + +// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.SignOpenPGPCommand +func ___calcArraySizeSignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v SignOpenPGPCommand, encoder *enc.Encoder) (int, error) { + size := 0 + size += encoder.CalcStructHeaderFix(5) + size += encoder.CalcString(v.IssuerID) + size += encoder.CalcString(v.ProfileName) + if v.PublicKey != nil { + s, err := encoder.CalcSliceLength(len(v.PublicKey), true) + if err != nil { + return 0, err + } + size += s + for _, vv := range v.PublicKey { + size += encoder.CalcByte(vv) + } + } else { + size += encoder.CalcNil() + } + size += encoder.CalcString(v.CommonName) + if v.EmailAddresses != nil { + s, err := encoder.CalcSliceLength(len(v.EmailAddresses), false) + if err != nil { + return 0, err + } + size += s + for _, vv := range v.EmailAddresses { + size += encoder.CalcString(vv) + } + } else { + size += encoder.CalcNil() + } + return size, nil +} + +// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.SignOpenPGPCommand +func ___calcMapSizeSignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v SignOpenPGPCommand, encoder *enc.Encoder) (int, error) { + size := 0 + size += encoder.CalcStructHeaderFix(5) + size += encoder.CalcStringFix(9) + size += encoder.CalcString(v.IssuerID) + size += encoder.CalcStringFix(12) + size += encoder.CalcString(v.ProfileName) + size += encoder.CalcStringFix(10) + if v.PublicKey != nil { + s, err := encoder.CalcSliceLength(len(v.PublicKey), true) + if err != nil { + return 0, err + } + size += s + for _, vv := range v.PublicKey { + size += encoder.CalcByte(vv) + } + } else { + size += encoder.CalcNil() + } + size += encoder.CalcStringFix(2) + size += encoder.CalcString(v.CommonName) + size += encoder.CalcStringFix(15) + if v.EmailAddresses != nil { + s, err := encoder.CalcSliceLength(len(v.EmailAddresses), false) + if err != nil { + return 0, err + } + size += s + for _, vv := range v.EmailAddresses { + size += encoder.CalcString(vv) + } + } else { + size += encoder.CalcNil() + } + return size, nil +} + +// encode from git.cacert.org/cacert-gosigner/pkg/messages.SignOpenPGPCommand +func ___encodeArraySignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v SignOpenPGPCommand, encoder *enc.Encoder, offset int) ([]byte, int, error) { + var err error + offset = encoder.WriteStructHeaderFixAsArray(5, offset) + offset = encoder.WriteString(v.IssuerID, offset) + offset = encoder.WriteString(v.ProfileName, offset) + if v.PublicKey != nil { + offset = encoder.WriteSliceLength(len(v.PublicKey), offset, true) + for _, vv := range v.PublicKey { + offset = encoder.WriteByte(vv, offset) + } + } else { + offset = encoder.WriteNil(offset) + } + offset = encoder.WriteString(v.CommonName, offset) + if v.EmailAddresses != nil { + offset = encoder.WriteSliceLength(len(v.EmailAddresses), offset, false) + for _, vv := range v.EmailAddresses { + offset = encoder.WriteString(vv, offset) + } + } else { + offset = encoder.WriteNil(offset) + } + return encoder.EncodedBytes(), offset, err +} + +// encode from git.cacert.org/cacert-gosigner/pkg/messages.SignOpenPGPCommand +func ___encodeMapSignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v SignOpenPGPCommand, encoder *enc.Encoder, offset int) ([]byte, int, error) { + var err error + offset = encoder.WriteStructHeaderFixAsMap(5, offset) + offset = encoder.WriteStringFix("issuer_id", 9, offset) + offset = encoder.WriteString(v.IssuerID, offset) + offset = encoder.WriteStringFix("profile_name", 12, offset) + offset = encoder.WriteString(v.ProfileName, offset) + offset = encoder.WriteStringFix("public_key", 10, offset) + if v.PublicKey != nil { + offset = encoder.WriteSliceLength(len(v.PublicKey), offset, true) + for _, vv := range v.PublicKey { + offset = encoder.WriteByte(vv, offset) + } + } else { + offset = encoder.WriteNil(offset) + } + offset = encoder.WriteStringFix("cn", 2, offset) + offset = encoder.WriteString(v.CommonName, offset) + offset = encoder.WriteStringFix("email_addresses", 15, offset) + if v.EmailAddresses != nil { + offset = encoder.WriteSliceLength(len(v.EmailAddresses), offset, false) + for _, vv := range v.EmailAddresses { + offset = encoder.WriteString(vv, offset) + } + } else { + offset = encoder.WriteNil(offset) + } + return encoder.EncodedBytes(), offset, err +} + +// decode to git.cacert.org/cacert-gosigner/pkg/messages.SignOpenPGPCommand +func ___decodeArraySignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v *SignOpenPGPCommand, decoder *dec.Decoder, offset int) (int, error) { + offset, err := decoder.CheckStructHeader(5, offset) + if err != nil { + return 0, err + } + { + var vv string + vv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + v.IssuerID = vv + } + { + var vv string + vv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + v.ProfileName = vv + } + if !decoder.IsCodeNil(offset) { + var vv []byte + var vvl int + vvl, offset, err = decoder.SliceLength(offset) + if err != nil { + return 0, err + } + vv = make([]byte, vvl) + for vvi := range vv { + var vvv byte + vvv, offset, err = decoder.AsByte(offset) + if err != nil { + return 0, err + } + vv[vvi] = vvv + } + v.PublicKey = vv + } else { + offset++ + } + { + var vv string + vv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + v.CommonName = vv + } + if !decoder.IsCodeNil(offset) { + var vv []string + var vvl int + vvl, offset, err = decoder.SliceLength(offset) + if err != nil { + return 0, err + } + vv = make([]string, vvl) + for vvi := range vv { + var vvv string + vvv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + vv[vvi] = vvv + } + v.EmailAddresses = vv + } else { + offset++ + } + return offset, err +} + +// decode to git.cacert.org/cacert-gosigner/pkg/messages.SignOpenPGPCommand +func ___decodeMapSignOpenPGPCommand_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v *SignOpenPGPCommand, decoder *dec.Decoder, offset int) (int, error) { + keys := [][]byte{ + {uint8(0x69), uint8(0x73), uint8(0x73), uint8(0x75), uint8(0x65), uint8(0x72), uint8(0x5f), uint8(0x69), uint8(0x64)}, // issuer_id + {uint8(0x70), uint8(0x72), uint8(0x6f), uint8(0x66), uint8(0x69), uint8(0x6c), uint8(0x65), uint8(0x5f), uint8(0x6e), uint8(0x61), uint8(0x6d), uint8(0x65)}, // profile_name + {uint8(0x70), uint8(0x75), uint8(0x62), uint8(0x6c), uint8(0x69), uint8(0x63), uint8(0x5f), uint8(0x6b), uint8(0x65), uint8(0x79)}, // public_key + {uint8(0x63), uint8(0x6e)}, // cn + {uint8(0x65), uint8(0x6d), uint8(0x61), uint8(0x69), uint8(0x6c), uint8(0x5f), uint8(0x61), uint8(0x64), uint8(0x64), uint8(0x72), uint8(0x65), uint8(0x73), uint8(0x73), uint8(0x65), uint8(0x73)}, // email_addresses + } + offset, err := decoder.CheckStructHeader(5, offset) + if err != nil { + return 0, err + } + count := 0 + for count < 5 { + var dataKey []byte + dataKey, offset, err = decoder.AsStringBytes(offset) + if err != nil { + return 0, err + } + fieldIndex := -1 + for i, key := range keys { + if len(dataKey) != len(key) { + continue + } + fieldIndex = i + for dataKeyIndex := range dataKey { + if dataKey[dataKeyIndex] != key[dataKeyIndex] { + fieldIndex = -1 + break + } + } + if fieldIndex >= 0 { + break + } + } + switch fieldIndex { + case 0: + { + var vv string + vv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + v.IssuerID = vv + } + count++ + case 1: + { + var vv string + vv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + v.ProfileName = vv + } + count++ + case 2: + if !decoder.IsCodeNil(offset) { + var vv []byte + var vvl int + vvl, offset, err = decoder.SliceLength(offset) + if err != nil { + return 0, err + } + vv = make([]byte, vvl) + for vvi := range vv { + var vvv byte + vvv, offset, err = decoder.AsByte(offset) + if err != nil { + return 0, err + } + vv[vvi] = vvv + } + v.PublicKey = vv + } else { + offset++ + } + count++ + case 3: + { + var vv string + vv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + v.CommonName = vv + } + count++ + case 4: + if !decoder.IsCodeNil(offset) { + var vv []string + var vvl int + vvl, offset, err = decoder.SliceLength(offset) + if err != nil { + return 0, err + } + vv = make([]string, vvl) + for vvi := range vv { + var vvv string + vvv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + vv[vvi] = vvv + } + v.EmailAddresses = vv + } else { + offset++ + } + count++ + default: + return 0, fmt.Errorf("unknown key[%s] found", string(dataKey)) + } + } + return offset, err +} + +// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.SignOpenPGPResponse +func ___calcArraySizeSignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v SignOpenPGPResponse, encoder *enc.Encoder) (int, error) { + size := 0 + size += encoder.CalcStructHeaderFix(1) + if v.SignatureData != nil { + s, err := encoder.CalcSliceLength(len(v.SignatureData), true) + if err != nil { + return 0, err + } + size += s + for _, vv := range v.SignatureData { + size += encoder.CalcByte(vv) + } + } else { + size += encoder.CalcNil() + } + return size, nil +} + +// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.SignOpenPGPResponse +func ___calcMapSizeSignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v SignOpenPGPResponse, encoder *enc.Encoder) (int, error) { + size := 0 + size += encoder.CalcStructHeaderFix(1) + size += encoder.CalcStringFix(14) + if v.SignatureData != nil { + s, err := encoder.CalcSliceLength(len(v.SignatureData), true) + if err != nil { + return 0, err + } + size += s + for _, vv := range v.SignatureData { + size += encoder.CalcByte(vv) + } + } else { + size += encoder.CalcNil() + } + return size, nil +} + +// encode from git.cacert.org/cacert-gosigner/pkg/messages.SignOpenPGPResponse +func ___encodeArraySignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v SignOpenPGPResponse, encoder *enc.Encoder, offset int) ([]byte, int, error) { + var err error + offset = encoder.WriteStructHeaderFixAsArray(1, offset) + if v.SignatureData != nil { + offset = encoder.WriteSliceLength(len(v.SignatureData), offset, true) + for _, vv := range v.SignatureData { + offset = encoder.WriteByte(vv, offset) + } + } else { + offset = encoder.WriteNil(offset) + } + return encoder.EncodedBytes(), offset, err +} + +// encode from git.cacert.org/cacert-gosigner/pkg/messages.SignOpenPGPResponse +func ___encodeMapSignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v SignOpenPGPResponse, encoder *enc.Encoder, offset int) ([]byte, int, error) { + var err error + offset = encoder.WriteStructHeaderFixAsMap(1, offset) + offset = encoder.WriteStringFix("signature_data", 14, offset) + if v.SignatureData != nil { + offset = encoder.WriteSliceLength(len(v.SignatureData), offset, true) + for _, vv := range v.SignatureData { + offset = encoder.WriteByte(vv, offset) + } + } else { + offset = encoder.WriteNil(offset) + } + return encoder.EncodedBytes(), offset, err +} + +// decode to git.cacert.org/cacert-gosigner/pkg/messages.SignOpenPGPResponse +func ___decodeArraySignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v *SignOpenPGPResponse, decoder *dec.Decoder, offset int) (int, error) { + offset, err := decoder.CheckStructHeader(1, offset) + if err != nil { + return 0, err + } + if !decoder.IsCodeNil(offset) { + var vv []byte + var vvl int + vvl, offset, err = decoder.SliceLength(offset) + if err != nil { + return 0, err + } + vv = make([]byte, vvl) + for vvi := range vv { + var vvv byte + vvv, offset, err = decoder.AsByte(offset) + if err != nil { + return 0, err + } + vv[vvi] = vvv + } + v.SignatureData = vv + } else { + offset++ + } + return offset, err +} + +// decode to git.cacert.org/cacert-gosigner/pkg/messages.SignOpenPGPResponse +func ___decodeMapSignOpenPGPResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v *SignOpenPGPResponse, decoder *dec.Decoder, offset int) (int, error) { + keys := [][]byte{ + {uint8(0x73), uint8(0x69), uint8(0x67), uint8(0x6e), uint8(0x61), uint8(0x74), uint8(0x75), uint8(0x72), uint8(0x65), uint8(0x5f), uint8(0x64), uint8(0x61), uint8(0x74), uint8(0x61)}, // signature_data + } + offset, err := decoder.CheckStructHeader(1, offset) + if err != nil { + return 0, err + } + count := 0 + for count < 1 { + var dataKey []byte + dataKey, offset, err = decoder.AsStringBytes(offset) + if err != nil { + return 0, err + } + fieldIndex := -1 + for i, key := range keys { + if len(dataKey) != len(key) { + continue + } + fieldIndex = i + for dataKeyIndex := range dataKey { + if dataKey[dataKeyIndex] != key[dataKeyIndex] { + fieldIndex = -1 + break + } + } + if fieldIndex >= 0 { + break + } + } + switch fieldIndex { + case 0: + if !decoder.IsCodeNil(offset) { + var vv []byte + var vvl int + vvl, offset, err = decoder.SliceLength(offset) + if err != nil { + return 0, err + } + vv = make([]byte, vvl) + for vvi := range vv { + var vvv byte + vvv, offset, err = decoder.AsByte(offset) + if err != nil { + return 0, err + } + vv[vvi] = vvv + } + v.SignatureData = vv + } else { + offset++ + } + count++ + default: + return 0, fmt.Errorf("unknown key[%s] found", string(dataKey)) + } + } + return offset, err +} + +// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.ErrorResponse +func ___calcArraySizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v ErrorResponse, encoder *enc.Encoder) (int, error) { + size := 0 + size += encoder.CalcStructHeaderFix(1) + size += encoder.CalcString(v.Message) + return size, nil +} + +// calculate size from git.cacert.org/cacert-gosigner/pkg/messages.ErrorResponse +func ___calcMapSizeErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v ErrorResponse, encoder *enc.Encoder) (int, error) { + size := 0 + size += encoder.CalcStructHeaderFix(1) + size += encoder.CalcStringFix(7) + size += encoder.CalcString(v.Message) + return size, nil +} + +// encode from git.cacert.org/cacert-gosigner/pkg/messages.ErrorResponse +func ___encodeArrayErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v ErrorResponse, encoder *enc.Encoder, offset int) ([]byte, int, error) { + var err error + offset = encoder.WriteStructHeaderFixAsArray(1, offset) + offset = encoder.WriteString(v.Message, offset) + return encoder.EncodedBytes(), offset, err +} + +// encode from git.cacert.org/cacert-gosigner/pkg/messages.ErrorResponse +func ___encodeMapErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v ErrorResponse, encoder *enc.Encoder, offset int) ([]byte, int, error) { + var err error + offset = encoder.WriteStructHeaderFixAsMap(1, offset) + offset = encoder.WriteStringFix("message", 7, offset) + offset = encoder.WriteString(v.Message, offset) + return encoder.EncodedBytes(), offset, err +} + +// decode to git.cacert.org/cacert-gosigner/pkg/messages.ErrorResponse +func ___decodeArrayErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v *ErrorResponse, decoder *dec.Decoder, offset int) (int, error) { + offset, err := decoder.CheckStructHeader(1, offset) + if err != nil { + return 0, err + } + { + var vv string + vv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + v.Message = vv + } + return offset, err +} + +// decode to git.cacert.org/cacert-gosigner/pkg/messages.ErrorResponse +func ___decodeMapErrorResponse_e587a81c7cb163b35488bdef0f58c292f99f4bd65a81377f81e5b18c3d86855d(v *ErrorResponse, decoder *dec.Decoder, offset int) (int, error) { + keys := [][]byte{ + {uint8(0x6d), uint8(0x65), uint8(0x73), uint8(0x73), uint8(0x61), uint8(0x67), uint8(0x65)}, // message + } + offset, err := decoder.CheckStructHeader(1, offset) + if err != nil { + return 0, err + } + count := 0 + for count < 1 { + var dataKey []byte + dataKey, offset, err = decoder.AsStringBytes(offset) + if err != nil { + return 0, err + } + fieldIndex := -1 + for i, key := range keys { + if len(dataKey) != len(key) { + continue + } + fieldIndex = i + for dataKeyIndex := range dataKey { + if dataKey[dataKeyIndex] != key[dataKeyIndex] { + fieldIndex = -1 + break + } + } + if fieldIndex >= 0 { + break + } + } + switch fieldIndex { + case 0: + { + var vv string + vv, offset, err = decoder.AsString(offset) + if err != nil { + return 0, err + } + v.Message = vv + } + count++ + default: + return 0, fmt.Errorf("unknown key[%s] found", string(dataKey)) + } + } + return offset, err +}