-2

In the context of Security Cryptography X509Certificates, I've came across this in one of the projects code.

X509Store store = new X509Store("MY", StoreLocation.CurrentUser);
store.Open(OpenFlags.OpenExistingOnly | OpenFlags.ReadWrite);

What is this "|" pipe means here?

Jason
  • 1,680
  • 3
  • 13
  • 16

2 Answers2

5

It's a bitwise OR operator. In this case, it is used to combine flags. Meaning you open the store in Read/Write mode and only if it already exists. There's more explanation on bitwise operators on MSDN.

gretro
  • 1,934
  • 15
  • 25
0

The binary Or operator is arithmetic OR between two integers, and with a Flags enum, combines the two flags into one value.

MSDN Flags Enum

NetMage
  • 26,163
  • 3
  • 34
  • 55