Beispiel #1
0
 public static void Encode(XdrDataOutputStream stream, SurveyRequestMessage encodedSurveyRequestMessage)
 {
     NodeID.Encode(stream, encodedSurveyRequestMessage.SurveyorPeerID);
     NodeID.Encode(stream, encodedSurveyRequestMessage.SurveyedPeerID);
     Uint32.Encode(stream, encodedSurveyRequestMessage.LedgerNum);
     Curve25519Public.Encode(stream, encodedSurveyRequestMessage.EncryptionKey);
     SurveyMessageCommandType.Encode(stream, encodedSurveyRequestMessage.CommandType);
 }
        public static AuthCert Decode(XdrDataInputStream stream)
        {
            AuthCert decodedAuthCert = new AuthCert();

            decodedAuthCert.Pubkey     = Curve25519Public.Decode(stream);
            decodedAuthCert.Expiration = Uint64.Decode(stream);
            decodedAuthCert.Sig        = Signature.Decode(stream);
            return(decodedAuthCert);
        }
        public static Curve25519Public Decode(XdrDataInputStream stream)
        {
            Curve25519Public decodedCurve25519Public = new Curve25519Public();
            int keysize = 32;

            decodedCurve25519Public.Key = new byte[keysize];
            stream.Read(decodedCurve25519Public.Key, 0, keysize);
            return(decodedCurve25519Public);
        }
Beispiel #4
0
        public static SurveyRequestMessage Decode(XdrDataInputStream stream)
        {
            SurveyRequestMessage decodedSurveyRequestMessage = new SurveyRequestMessage();

            decodedSurveyRequestMessage.SurveyorPeerID = NodeID.Decode(stream);
            decodedSurveyRequestMessage.SurveyedPeerID = NodeID.Decode(stream);
            decodedSurveyRequestMessage.LedgerNum      = Uint32.Decode(stream);
            decodedSurveyRequestMessage.EncryptionKey  = Curve25519Public.Decode(stream);
            decodedSurveyRequestMessage.CommandType    = SurveyMessageCommandType.Decode(stream);
            return(decodedSurveyRequestMessage);
        }
 public static void Encode(XdrDataOutputStream stream, AuthCert encodedAuthCert)
 {
     Curve25519Public.Encode(stream, encodedAuthCert.Pubkey);
     Uint64.Encode(stream, encodedAuthCert.Expiration);
     Signature.Encode(stream, encodedAuthCert.Sig);
 }
        public static void Encode(XdrDataOutputStream stream, Curve25519Public encodedCurve25519Public)
        {
            int keysize = encodedCurve25519Public.Key.Length;

            stream.Write(encodedCurve25519Public.Key, 0, keysize);
        }