Click here to Skip to main content
15,896,063 members
Home / Discussions / C#
   

C#

 
GeneralRe: VS2017/2019 VSIX broken - I need a favor Pin
honey the codewitch8-Jun-19 5:43
mvahoney the codewitch8-Jun-19 5:43 
QuestionC# mp4 stream reader Pin
nicko134-Jun-19 9:13
nicko134-Jun-19 9:13 
AnswerRe: C# mp4 stream reader Pin
OriginalGriff4-Jun-19 19:06
mveOriginalGriff4-Jun-19 19:06 
GeneralRe: C# mp4 stream reader Pin
nicko135-Jun-19 7:46
nicko135-Jun-19 7:46 
AnswerRe: C# mp4 stream reader Pin
Gerry Schmitz5-Jun-19 5:52
mveGerry Schmitz5-Jun-19 5:52 
GeneralRe: C# mp4 stream reader Pin
nicko135-Jun-19 7:59
nicko135-Jun-19 7:59 
QuestionDataProtection API Pin
Super Lloyd2-Jun-19 21:22
Super Lloyd2-Jun-19 21:22 
AnswerRe: DataProtection API Pin
Kornfeld Eliyahu Peter2-Jun-19 22:35
professionalKornfeld Eliyahu Peter2-Jun-19 22:35 
Quote:
To unprotect a previously-protected piece of data, pass the protected data to the Unprotect method. (There are byte[]-based and string-based overloads for developer convenience.) If the protected payload was generated by an earlier call to Protect on this same IDataProtector, the Unprotect method will return the original unprotected payload. If the protected payload has been tampered with or was produced by a different IDataProtector, the Unprotect method will throw CryptographicException.

The concept of same vs. different IDataProtector ties back to the concept of purpose. If two IDataProtector instances were generated from the same root IDataProtectionProvider but via different purpose strings in the call to IDataProtectionProvider.CreateProtector, then they are considered different protectors, and one will not be able to unprotect payloads generated by the other.

These two paragraphs tell me that you 'unprotect' a 'payload' you need the same DataProtector used to 'protect' it...
So the question is how do you re-create the DataProtector? I think (and I just reading it) that the 'purpose string' is for that...
You can send the same string array (certificate id?) as purpose string and get back a DataProtector of the same behavior over-and-over-again...
However it is not clear if you can re-create the IDataProtectionProvider (father of all)... You should test it and write a useful sample (as those of Microsoft are useless)...
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012

AnswerRe: DataProtection API Pin
Eddy Vluggen2-Jun-19 22:50
professionalEddy Vluggen2-Jun-19 22:50 
GeneralMy thoughts on C# Pin
Brian_TheLion1-Jun-19 15:43
Brian_TheLion1-Jun-19 15:43 
GeneralRe: My thoughts on C# Pin
Dave Kreskowiak1-Jun-19 16:06
mveDave Kreskowiak1-Jun-19 16:06 
GeneralRe: My thoughts on C# Pin
Brian_TheLion1-Jun-19 18:16
Brian_TheLion1-Jun-19 18:16 
GeneralRe: My thoughts on C# Pin
Luc Pattyn2-Jun-19 3:38
sitebuilderLuc Pattyn2-Jun-19 3:38 
GeneralRe: My thoughts on C# Pin
Brian_TheLion2-Jun-19 15:07
Brian_TheLion2-Jun-19 15:07 
GeneralRe: My thoughts on C# Pin
Luc Pattyn2-Jun-19 15:41
sitebuilderLuc Pattyn2-Jun-19 15:41 
GeneralRe: My thoughts on C# Pin
Brian_TheLion2-Jun-19 16:09
Brian_TheLion2-Jun-19 16:09 
GeneralRe: My thoughts on C# Pin
Dave Kreskowiak2-Jun-19 5:27
mveDave Kreskowiak2-Jun-19 5:27 
GeneralRe: My thoughts on C# Pin
Brian_TheLion2-Jun-19 14:25
Brian_TheLion2-Jun-19 14:25 
GeneralRe: My thoughts on C# Pin
Dave Kreskowiak2-Jun-19 15:42
mveDave Kreskowiak2-Jun-19 15:42 
GeneralRe: My thoughts on C# Pin
Brian_TheLion2-Jun-19 16:30
Brian_TheLion2-Jun-19 16:30 
GeneralRe: My thoughts on C# Pin
Dave Kreskowiak2-Jun-19 17:26
mveDave Kreskowiak2-Jun-19 17:26 
GeneralRe: My thoughts on C# Pin
Brian_TheLion2-Jun-19 17:46
Brian_TheLion2-Jun-19 17:46 
GeneralRe: My thoughts on C# Pin
Dave Kreskowiak3-Jun-19 2:37
mveDave Kreskowiak3-Jun-19 2:37 
GeneralRe: My thoughts on C# Pin
#realJSOP2-Jun-19 4:29
professional#realJSOP2-Jun-19 4:29 
GeneralRe: My thoughts on C# Pin
Dave Kreskowiak2-Jun-19 5:44
mveDave Kreskowiak2-Jun-19 5:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.