2018-10-31 11:17:51 +01:00
|
|
|
package shared
|
|
|
|
|
2021-01-04 14:15:12 +01:00
|
|
|
const (
|
|
|
|
ProtocolVersion = 1
|
2020-04-17 19:39:01 +02:00
|
|
|
|
2021-01-04 14:15:12 +01:00
|
|
|
HandshakeByte = 0x02
|
|
|
|
AckByte = 0x10
|
|
|
|
ResendByte = 0x11
|
|
|
|
|
|
|
|
MagicTrailer = "rie4Ech7"
|
|
|
|
|
|
|
|
LengthFieldSize = 3
|
|
|
|
CheckSumFieldSize = 1
|
|
|
|
TrailerFieldSize = len(MagicTrailer)
|
|
|
|
)
|
|
|
|
|
2021-01-04 20:39:35 +01:00
|
|
|
type Action byte
|
2021-01-04 14:15:12 +01:00
|
|
|
|
|
|
|
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"
|
|
|
|
}
|
|
|
|
}
|
2021-01-04 20:39:35 +01:00
|
|
|
|
|
|
|
type CryptoSystemRootId byte
|
|
|
|
|
|
|
|
type CertificateProfileId byte
|
|
|
|
|
|
|
|
type MessageDigestAlgorithmId byte
|
|
|
|
|
|
|
|
type CryptoSystemId byte
|