-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,450
  • 2
  • 12
  • 15

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,906
  • 18
  • 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
  • 24,279
  • 3
  • 31
  • 50