You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by sahul <vs...@gowebtop.com> on 2009/08/20 09:30:23 UTC

how to store user certificates in apacheds ldap using jndi

hi i am trying to store user certificate for a user in apacheds using the
below statement

File usercertFile=new File("C:/Documents and
Settings/Desktop/Certificates/aaa.cer");
attributes.put("userCertificate",usercertFile);

when i use the above statement i am getting the
InvalidAttributeValueException
For adding the cn,sn attributes i am using the same statement
attributes.put("sn",surname); which is working fine. I am giving the error
consolee message below

Operation failed: javax.naming.directory.InvalidAttributeValueException:
Malformed 'userCertificate' attribute value;

-- 
View this message in context: http://www.nabble.com/how-to-store-user-certificates-in-apacheds-ldap-using-jndi-tp25057284p25057284.html
Sent from the Apache Directory Project mailing list archive at Nabble.com.


Re: how to store user certificates in apacheds ldap using jndi

Posted by Emmanuel Lecharny <el...@apache.org>.
sahul wrote:
> hi i am trying to store user certificate for a user in apacheds using the
> below statement
>
> File usercertFile=new File("C:/Documents and
> Settings/Desktop/Certificates/aaa.cer");
> attributes.put("userCertificate",usercertFile);
>   
use "userCertificate;binary". It may work better.
> when i use the above statement i am getting the
> InvalidAttributeValueException
> For adding the cn,sn attributes i am using the same statement
> attributes.put("sn",surname); which is working fine. I am giving the error
> consolee message below
>
> Operation failed: javax.naming.directory.InvalidAttributeValueException:
> Malformed 'userCertificate' attribute value;
>
>   


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: how to store user certificates in apacheds ldap using jndi

Posted by Emmanuel Lecharny <el...@apache.org>.
Stefan Seelmann wrote:
> sahul wrote:
>   
>> File usercertFile=new File("C:/Documents and
>> Settings/Desktop/Certificates/aaa.cer");
>> attributes.put("userCertificate",usercertFile);
>>     
>
> You can't add the File object to the attributes, but the content of the
> file as byte[]. You could use
>   org.apache.commons.io.FileUtils.readFileToByteArray(File)
> to read the file.
>   
Yeah, you are probably right Kiran.
> Kind Regards,
> Stefan
>
>
>   


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: how to store user certificates in apacheds ldap using jndi

Posted by Stefan Seelmann <se...@apache.org>.
sahul wrote:
> File usercertFile=new File("C:/Documents and
> Settings/Desktop/Certificates/aaa.cer");
> attributes.put("userCertificate",usercertFile);

You can't add the File object to the attributes, but the content of the
file as byte[]. You could use
  org.apache.commons.io.FileUtils.readFileToByteArray(File)
to read the file.

Kind Regards,
Stefan