Figure 2. Generate NULL Values With Mismatched Passwords, Certificates, or Keys.
The sample project's Encrypt All Card Numbers by User/Issuer lets you encrypt card numbers with a different method and owner for each issuer. As an example, Visa cards are encrypted by a passphrase for the VisaAdmin user and AMEX cards by a certificate owned by the AmexAdmin user. Clicking on the DataGridView's first row selector decrypts the card number; clicking on the second row selector returns a NULL (DbNull) value to the CardNumber column because the VisaAdmin user's decryption method doesn't correspond to the certificate required for AMEX cards.