directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Enrique Rodriguez" <enriqu...@gmail.com>
Subject Re: how I should insert a Digital Certification into userCertificate attribute?
Date Fri, 31 Aug 2007 21:00:04 GMT
On 8/31/07, legolas wood <legolas.w@gmail.com> wrote:
> Hi
> Thank you for reading my post,
> Can some one give me a hint about inserting a Digital certification into
> userCertificate attribute?

Once you have your cert as an X509Certificate, you can call
X509Certificate#getEncoded, which will return the ASN.1 DER format of
the cert.  You can then use JNDI to write this to ApacheDS.  Make sure
you set the following JNDI environment property client-side so that
the 'userCertificate' is properly handled as binary:

        env.put( "java.naming.ldap.attributes.binary", "userCertificate" );

IIRC, 'userCertificate' is known to ApacheDS as a binary value so you
don't need this to write the value, but you will need it to read the
value as binary.

Enrique

Mime
View raw message