T
TC
Hey All,
I posted this to the Crypto users group and forgot to add the VB.Net users
group. I apologize for any confusion.
I have been testing a try / catch / finally block and purposely raising
exceptions and I've noticed that if an exception of "Length of the data to
decrypt is invalid." is raised with the CryptoStream object, later this
exception will get raised a second time and thrown to the caller when trying
to close the stream in a Finally block.
For example:
Try
' Do tasks that cause CryptoStream to throw invalid length while
decrypting
Catch ex as CryptographicException
' Handle exception here
Finally
If Not MemStream is Nothing then
' No 2nd exception thrown here
MemStream.Close()
End If
If Not CrypStream is Nothing then
' Exception thrown a 2nd time
CrypStream.Close()
End If
Has anyone else experienced the above?
If so, how to address the problem or is this a bug?
I posted this to the Crypto users group and forgot to add the VB.Net users
group. I apologize for any confusion.
I have been testing a try / catch / finally block and purposely raising
exceptions and I've noticed that if an exception of "Length of the data to
decrypt is invalid." is raised with the CryptoStream object, later this
exception will get raised a second time and thrown to the caller when trying
to close the stream in a Finally block.
For example:
Try
' Do tasks that cause CryptoStream to throw invalid length while
decrypting
Catch ex as CryptographicException
' Handle exception here
Finally
If Not MemStream is Nothing then
' No 2nd exception thrown here
MemStream.Close()
End If
If Not CrypStream is Nothing then
' Exception thrown a 2nd time
CrypStream.Close()
End If
Has anyone else experienced the above?
If so, how to address the problem or is this a bug?