/** * Sets the value of this node. * * @param value the value for this node */ public void setValue( Value value ) { this.value = value; this.bytes = value.getBytes(); }
/** * Sets the value of this node. * * @param value the value for this node */ public void setValue( Value value ) { this.value = value; this.bytes = value.getBytes(); }
/** * Sets the value of this node. * * @param value the value for this node */ public void setValue( Value value ) { this.value = value; this.bytes = value.getBytes(); }
byte[] binVal = attrVal.getBytes(); sb.append( Strings.utf8ToString( binVal ) ).append( '/' ).append( Strings.dumpBytes( binVal ) ) .append( "'\n" );
/** * Get keys. * @throws IOException e * @return keys */ public List<EncryptionKey> getKeys() throws IOException { Iterator<Value> iterator1 = entry.get(KerberosAttribute.KRB5_KEY_AT).iterator(); List<EncryptionKey> keys = new ArrayList<>(); while (iterator1.hasNext()) { byte[] encryKey = iterator1.next().getBytes(); EncryptionKey key = new EncryptionKey(); key.decode(encryKey); key.setKvno(1); // TODO: kvno should be correctly stored and retrieved keys.add(key); } return keys; }
/** * Get keys. * @throws IOException e * @return keys */ public List<EncryptionKey> getKeys() throws IOException { Iterator<Value> iterator1 = entry.get(KerberosAttribute.KRB5_KEY_AT).iterator(); List<EncryptionKey> keys = new ArrayList<>(); while (iterator1.hasNext()) { byte[] encryKey = iterator1.next().getBytes(); EncryptionKey key = new EncryptionKey(); key.decode(encryKey); key.setKvno(1); // TODO: kvno should be correctly stored and retrieved keys.add(key); } return keys; }
/** * {@inheritDoc} */ @Override public byte[] getBytes() throws LdapInvalidAttributeValueException { Value value = get(); if ( !isHumanReadable() && ( value != null ) ) { return value.getBytes(); } String message = I18n.err( I18n.ERR_13214_VALUE_EXPECT_BYTES ); LOG.error( message ); throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, message ); }
/** * @return representation of value, escaped for use in a filter if required */ public String getEscapedValue() { if ( value != null ) { return escapeFilterValue( value.getAttributeType(), value.getBytes() ); } else { return escapeFilterValue( null, bytes ); } }
/** * @return representation of value, escaped for use in a filter if required */ public String getEscapedValue() { if ( value != null ) { return escapeFilterValue( value.getAttributeType(), value.getBytes() ); } else { return escapeFilterValue( null, bytes ); } }
/** * @return representation of value, escaped for use in a filter if required */ public String getEscapedValue() { if ( value != null ) { return escapeFilterValue( value.getAttributeType(), value.getBytes() ); } else { return escapeFilterValue( null, bytes ); } }
/** * {@inheritDoc} */ @Override public byte[] getBytes() throws LdapInvalidAttributeValueException { Value value = get(); if ( !isHumanReadable() && ( value != null ) ) { return value.getBytes(); } String message = I18n.err( I18n.ERR_13214_VALUE_EXPECT_BYTES ); LOG.error( message ); throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, message ); }
/** * {@inheritDoc} */ @Override public byte[] getBytes() throws LdapInvalidAttributeValueException { Value value = get(); if ( !isHumanReadable() && ( value != null ) ) { return value.getBytes(); } String message = I18n.err( I18n.ERR_13214_VALUE_EXPECT_BYTES ); LOG.error( message ); throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, message ); }
/** * Displays security warning messages if any possible secutiry issue is found. * @throws Exception if there are failures parsing and accessing internal structures */ protected void showSecurityWarnings() throws Exception { // Warn if the default password is not changed. boolean needToChangeAdminPassword = false; Dn adminDn = getDnFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN ); Entry adminEntry = partitionNexus.lookup( new LookupOperationContext( adminSession, adminDn ) ); Value<?> userPassword = adminEntry.get( SchemaConstants.USER_PASSWORD_AT ).get(); needToChangeAdminPassword = Arrays.equals( PartitionNexus.ADMIN_PASSWORD_BYTES, userPassword.getBytes() ); if ( needToChangeAdminPassword ) { LOG.warn( "You didn't change the admin password of directory service " + "instance '" + instanceId + "'. " + "Please update the admin password as soon as possible " + "to prevent a possible security breach." ); } }
/** * @return representation of value, escaped for use in a filter if required */ public String getEscapedValue() { if ( value.isHumanReadable() ) { return escapeFilterValue( value.getValue() ); } else { return escapeFilterValue( value.getAttributeType(), value.getBytes() ); } }
/** * @return representation of value, escaped for use in a filter if required */ public String getEscapedValue() { if ( value.isHumanReadable() ) { return escapeFilterValue( value.getValue() ); } else { return escapeFilterValue( value.getAttributeType(), value.getBytes() ); } }
/** * @return representation of value, escaped for use in a filter if required */ public String getEscapedValue() { if ( value.isHumanReadable() ) { return escapeFilterValue( value.getValue() ); } else { return escapeFilterValue( value.getAttributeType(), value.getBytes() ); } }
/** * @see Object#toString() */ public String toString() { return "CompareContext for Dn '" + getDn().getName() + "'" + ( ( oid != null ) ? ", oid : <" + oid + ">" : "" ) + ( ( value != null ) ? ", value :'" + ( ( value.isHumanReadable() ) ? value.getValue() : ( ( !value.isHumanReadable() ) ? Strings.dumpBytes( value.getBytes() ) : "unknown value type" ) ) + "'" : "" ); } }
/** * {@inheritDoc} */ @Override public boolean compare( Dn dn, String attributeName, Value value ) throws LdapException { CompareRequest compareRequest = new CompareRequestImpl(); compareRequest.setName( dn ); compareRequest.setAttributeId( attributeName ); if ( value.isHumanReadable() ) { compareRequest.setAssertionValue( value.getValue() ); } else { compareRequest.setAssertionValue( value.getBytes() ); } CompareResponse compareResponse = compare( compareRequest ); return processResponse( compareResponse ); }
/** * {@inheritDoc} */ @Override public boolean compare( Dn dn, String attributeName, Value value ) throws LdapException { CompareRequest compareRequest = new CompareRequestImpl(); compareRequest.setName( dn ); compareRequest.setAttributeId( attributeName ); if ( value.isHumanReadable() ) { compareRequest.setAssertionValue( value.getValue() ); } else { compareRequest.setAssertionValue( value.getBytes() ); } CompareResponse compareResponse = compare( compareRequest ); return processResponse( compareResponse ); }
/** * {@inheritDoc} */ @Override public boolean compare( Dn dn, String attributeName, Value value ) throws LdapException { CompareRequest compareRequest = new CompareRequestImpl(); compareRequest.setName( dn ); compareRequest.setAttributeId( attributeName ); if ( value.isHumanReadable() ) { compareRequest.setAssertionValue( value.getValue() ); } else { compareRequest.setAssertionValue( value.getBytes() ); } CompareResponse compareResponse = compare( compareRequest ); return processResponse( compareResponse ); }