1
votes

I want to set password in active directory using using java/spring ldap api. AD schema for attribut userPassword says Octet string. How can I generate any password to octet string ?

If I have password "tempPassword" - how can I convert to octet string ?

1
SNMP4J offers OctetString, does that help you? - Glains
@Glains this is just wrapper for byte array: byte[] getValue() - MariuszS
That's what octet string means. - Tom Blodget

1 Answers

1
votes

Octet string are just bytes:

byte[] octetString = "tempPassword".getBytes(StandardCharsets.US_ASCII);
System.out.println(new BigInteger(1, octetString).toString(16));