You are in the process of creating an application that will be used to forward confidential information to Domain.com’s business partners.
In a bid to improve the security of your production environment, you install digital certificates for publishing all assemblies in the application.
You need to confirm that every assembly belongs to the same publisher, based on that publisher’s digital certificate.
You are asked to confirm that the current assembly belongs to a certain publisher.
What should you do?
A.
Use the following code:
public bool CheckPolicy (X509Certificate cert){
PublisherMembershipCondition policy = new PublisherMembershipCondition(cert);
return policy.Check(Assembly.GetCallAssembly().Evidence);
}
B.
Use the following code:
public bool CheckPolicy (X509Certificate cert){
Publisher pub = new Publisher(cert);
return pub.Verify(AppDomain.CurrentDomain.Evidence);
}
C.
Use the following code:
public bool CheckPolicy (X509Certificate cert){
Publisher pub = new Publisher(cert);
return pub.Check(appDomain.CurrentDomain.Evidence);
}
D.
Use the following code:
public bool CheckPolicy (X509Certificate cert){
PublisherMembershipCondition policy = new PublisherMembershipCondition (cert);
return policy.Verify(Assembly.GetCallAssembly().Evidence);
}