Пример #1
0
    public void Decrypt(SecretKeyEncryption ske, byte[] key)
    {
        KpCommon.ThrowIfNull(this.InnerMessageEnc);
        var bytes = ToBytes(this.InnerMessageEnc);

        bytes                = ske.Decrypt(bytes !, key);
        this.InnerMessage    = GrpcMsgPack.DynDes <Types.Inner>(bytes !);
        this.InnerMessageEnc = ByteString.Empty;
    }
Пример #2
0
    public void Encrypt(SecretKeyEncryption ske, byte[] key)
    {
        KpCommon.ThrowIfNull(this.InnerMessage);
        var bytes = GrpcMsgPack.DynSer(this.InnerMessage);

        bytes = ske.Encrypt(bytes, key);
        this.InnerMessageEnc = FromBytes(bytes);
        this.InnerMessage    = null;
    }