コード例 #1
0
        public byte[] GetPayload(byte[] secureBuffer, int startIndex = 0)
        {
            using (var reader = new SecureBufferReader(secureBuffer, startIndex))
            {
                byte[] iv = reader.ReadIv();
                byte[] encryptedPayload = reader.ReadPayload();

                return(DecryptPayload(encryptedPayload, iv));
            }
        }
コード例 #2
0
        public bool IsSecureDataValid(byte[] secureBuffer, int startIndex = 0)
        {
            using (var reader = new SecureBufferReader(secureBuffer, startIndex))
            {
                ushort spi       = reader.ReadSpi();
                byte[] authData  = reader.ReadAuthenticatedData();
                byte[] storedIcv = reader.ReadStoredIcv();

                return(IsSpiValid(spi) && IsIcvValid(authData, storedIcv));
            }
        }