It's a bit complex, and you have know to which component (by Oid string)
you want to retrieve a value for (i.e. you can enumerate then all, one by
one, or tell if one doesn't exist).
For example, if you have a given X500DistinguishedName object "dname", you
can get the organization name from the object as follows:
AsnEncodedData asnEncodedData = new AsnEncodedData(new Oid("2.5.4.10"),
dname.RawData);
String organizationName = asnEncodedData.Format(false); // false == !
multiline
If that component isn't in the raw data, Format() seems to send back a hex
version of all the raw byte data, sometimes delimited with spaces,
sometimes not.
The docs for the Platform SDK function CertStrToName contain a list of
ASN.1 object identifier notation strings. The OIDs normally associated
with the X500DistinguishedName object are included in that list.
On Fri, 23 Jun 2006 09:53:30 +0100, James Berry <[EMAIL PROTECTED]>
wrote:
>Given an X500DistinguishedName object, it seems there must be a good way
>(other than regular expressions) to retrieve the individual components -
>ie, CN, O, C etc
>
>Can anyone help?
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com