@Override public void setValue(Object value) { setBooleanValue((Boolean) value); }
/** * Allocates the attribute objects for this class and adds them to the * attribute table. * * @preconditions * @postconditions */ @Override protected void allocateAttributes() { super.allocateAttributes(); sensitive = new BooleanAttribute(Attribute.SENSITIVE); encrypt = new BooleanAttribute(Attribute.ENCRYPT); decrypt = new BooleanAttribute(Attribute.DECRYPT); sign = new BooleanAttribute(Attribute.SIGN); verify = new BooleanAttribute(Attribute.VERIFY); wrap = new BooleanAttribute(Attribute.WRAP); unwrap = new BooleanAttribute(Attribute.UNWRAP); extractable = new BooleanAttribute(Attribute.EXTRACTABLE); alwaysSensitive = new BooleanAttribute(Attribute.ALWAYS_SENSITIVE); neverExtractable = new BooleanAttribute(Attribute.NEVER_EXTRACTABLE); checkValue = new ByteArrayAttribute(Attribute.CHECK_VALUE); wrapWithTrusted = new BooleanAttribute(Attribute.WRAP_WITH_TRUSTED); trusted = new BooleanAttribute(Attribute.TRUSTED); wrapTemplate = new AttributeArray(Attribute.WRAP_TEMPLATE); unwrapTemplate = new AttributeArray(Attribute.UNWRAP_TEMPLATE); putAttributesInTable(this); }
return super.equals(other) && this.subject.equals(other.subject) && this.sensitive.equals(other.sensitive) && this.secondaryAuth.equals(other.secondaryAuth) && this.authPinFlags.equals(other.authPinFlags) && this.decrypt.equals(other.decrypt) && this.sign.equals(other.sign) && this.signRecover.equals(other.signRecover) && this.unwrap.equals(other.unwrap) && this.extractable.equals(other.extractable) && this.alwaysSensitive.equals(other.alwaysSensitive) && this.neverExtractable.equals(other.neverExtractable) && this.wrapWithTrusted.equals(other.wrapWithTrusted) && this.unwrapTemplate.equals(other.unwrapTemplate) && this.alwaysAuthenticate.equals(other.alwaysAuthenticate);
@Override protected byte[] digestSecretKey0(long mechanism) throws P11TokenException { if (! (signingKey instanceof SecretKey)) { throw new P11TokenException("could not digest asymmetric key"); } Boolean bv = ((SecretKey) signingKey).getExtractable().getBooleanValue(); if (bv != null && !bv.booleanValue()) { throw new P11TokenException("could not digest unextractable key"); } bv = ((SecretKey) signingKey).getNeverExtractable().getBooleanValue(); if (bv != null && bv.booleanValue()) { throw new P11TokenException("could not digest unextractable key"); } return ((IaikP11Slot) slot).digestKey(mechanism, this); }
/** * The overriding of this method should ensure that the objects of this * class work correctly in a hashtable. * * @return The hash code of this object. * @preconditions * @postconditions */ @Override public int hashCode() { return token.hashCode() ^ private_.hashCode() ^ modifiable.hashCode() ^ label.hashCode(); }
/** * Returns a string representation of the current object. The * output is only for debugging purposes and should not be used for other * purposes. * * @return A string presentation of this object for debugging output. */ @Override public String toString() { String superToString = super.toString(); return Util.concatObjectsCap(superToString.length() + 100, superToString, "\n Pixel X: ", pixelX.getValueString(), "\n Pixel Y: ", pixelY.getValueString(), "\n Resolution: ", resolution.getValueString(), "\n Char Rows: ", charRows.getValueString(), "\n Char Columns: ", charColumns.getValueString(), "\n Color: ", color.getValueString(), "\n Bits per Pixel: ", bitsPerPixel.getValueString(), "\n Char sets:", toString(charSets), "\n Encoding methods: ", toString(encodingMethods), "\n Mime Types: ", toString(mimeTypes)); }
@Override protected byte[] digestSecretKey0(long mechanism) throws P11TokenException { if (! (signingKey instanceof SecretKey)) { throw new P11TokenException("could not digest asymmetric key"); } Boolean bv = ((SecretKey) signingKey).getExtractable().getBooleanValue(); if (bv != null && !bv.booleanValue()) { throw new P11TokenException("could not digest unextractable key"); } bv = ((SecretKey) signingKey).getNeverExtractable().getBooleanValue(); if (bv != null && bv.booleanValue()) { throw new P11TokenException("could not digest unextractable key"); } return ((IaikP11Slot) slot).digestKey(mechanism, this); }
/** * The overriding of this method should ensure that the objects of this * class work correctly in a hashtable. * * @return The hash code of this object. * @preconditions * @postconditions */ @Override public int hashCode() { return resetOnInit.hashCode() ^ hasReset.hashCode() ^ value.hashCode(); }
private static void setKeyAttributes(final String label, final long keyType, final P11NewKeyControl control, final PublicKey publicKey, final PrivateKey privateKey) { if (privateKey != null) { privateKey.getToken().setBooleanValue(true); privateKey.getLabel().setCharArrayValue(label.toCharArray()); privateKey.getKeyType().setLongValue(keyType); privateKey.getSign().setBooleanValue(true); privateKey.getPrivate().setBooleanValue(true); privateKey.getSensitive().setBooleanValue(true); privateKey.getExtractable().setBooleanValue(control.isExtractable()); } if (publicKey != null) { publicKey.getToken().setBooleanValue(true); publicKey.getLabel().setCharArrayValue(label.toCharArray()); publicKey.getKeyType().setLongValue(keyType); publicKey.getVerify().setBooleanValue(true); publicKey.getModifiable().setBooleanValue(Boolean.TRUE); } }
/** * Allocates the attribute objects for this class and adds them to the * attribute table. * * @preconditions * @postconditions */ @Override protected void allocateAttributes() { super.allocateAttributes(); subject = new ByteArrayAttribute(Attribute.SUBJECT); sensitive = new BooleanAttribute(Attribute.SENSITIVE); secondaryAuth = new BooleanAttribute(Attribute.SECONDARY_AUTH); authPinFlags = new LongAttribute(Attribute.AUTH_PIN_FLAGS); decrypt = new BooleanAttribute(Attribute.DECRYPT); sign = new BooleanAttribute(Attribute.SIGN); signRecover = new BooleanAttribute(Attribute.SIGN_RECOVER); unwrap = new BooleanAttribute(Attribute.UNWRAP); extractable = new BooleanAttribute(Attribute.EXTRACTABLE); alwaysSensitive = new BooleanAttribute(Attribute.ALWAYS_SENSITIVE); neverExtractable = new BooleanAttribute(Attribute.NEVER_EXTRACTABLE); wrapWithTrusted = new BooleanAttribute(Attribute.WRAP_WITH_TRUSTED); unwrapTemplate = new AttributeArray(Attribute.UNWRAP_TEMPLATE); alwaysAuthenticate = new BooleanAttribute(Attribute.ALWAYS_AUTHENTICATE); putAttributesInTable(this); }
&& this.sensitive.equals(other.sensitive) && this.encrypt.equals(other.encrypt) && this.decrypt.equals(other.decrypt) && this.sign.equals(other.sign) && this.verify.equals(other.verify) && this.wrap.equals(other.wrap) && this.unwrap.equals(other.unwrap) && this.extractable.equals(other.extractable) && this.alwaysSensitive.equals(other.alwaysSensitive) && this.neverExtractable.equals(other.neverExtractable) && this.checkValue.equals(other.checkValue) && this.wrapWithTrusted.equals(other.wrapWithTrusted) && this.trusted.equals(other.trusted) && this.wrapTemplate.equals(other.wrapTemplate) && this.unwrapTemplate.equals(other.unwrapTemplate);
/** * The overriding of this method should ensure that the objects of this * class work correctly in a hashtable. * * @return The hash code of this object. * @preconditions * @postconditions */ @Override public int hashCode() { return keyType.hashCode() ^ local.hashCode(); }
private void setKeyAttributes(P11NewKeyControl control, PublicKey publicKey, PrivateKey privateKey) { if (privateKey != null) { privateKey.getToken().setBooleanValue(true); if (!newObjectConf.isIgnoreLabel()) { privateKey.getLabel().setCharArrayValue(control.getLabel().toCharArray()); privateKey.getPrivate().setBooleanValue(true); privateKey.getExtractable().setBooleanValue(control.getExtractable()); privateKey.getSensitive().setBooleanValue(control.getSensitive()); switch (usage) { case DECRYPT: privateKey.getDecrypt().setBooleanValue(TRUE); break; case DERIVE: privateKey.getDerive().setBooleanValue(TRUE); break; case SIGN: privateKey.getSign().setBooleanValue(TRUE); break; case SIGN_RECOVER: privateKey.getSignRecover().setBooleanValue(TRUE); break; case UNWRAP: privateKey.getUnwrap().setBooleanValue(TRUE); break; default:
/** * Allocates the attribute objects for this class and adds them to the * attribute table. * * @preconditions * @postconditions */ @Override protected void allocateAttributes() { super.allocateAttributes(); token = new BooleanAttribute(Attribute.TOKEN); private_ = new BooleanAttribute(Attribute.PRIVATE); modifiable = new BooleanAttribute(Attribute.MODIFIABLE); label = new CharArrayAttribute(Attribute.LABEL); putAttributesInTable(this); }
/** * Compares all member variables of this object with the other object. * Returns only true, if all are equal in both objects. * * @param otherObject * The other object to compare to. * @return True, if other is an instance of this class and all member * variables of both objects are equal. False, otherwise. * @preconditions * @postconditions */ @Override public boolean equals(Object otherObject) { if (this == otherObject) { return true; } else if (!(otherObject instanceof PublicKey)) { return false; } PublicKey other = (PublicKey) otherObject; return super.equals(other) && this.subject.equals(other.subject) && this.encrypt.equals(other.encrypt) && this.verify.equals(other.verify) && this.verifyRecover.equals(other.verifyRecover) && this.wrap.equals(other.wrap) && this.trusted.equals(other.trusted) && this.wrapTemplate.equals(other.wrapTemplate); }
/** * The overriding of this method should ensure that the objects of this * class work correctly in a hashtable. * * @return The hash code of this object. */ @Override public int hashCode() { return pixelX.hashCode() ^ pixelY.hashCode() ^ resolution.hashCode() ^ charRows.hashCode() ^ charColumns.hashCode() ^ color.hashCode() ^ bitsPerPixel.hashCode() ^ charSets.hashCode() ^ encodingMethods.hashCode() ^ mimeTypes.hashCode(); }
template.getKeyType().setLongValue(keyType); template.getToken().setBooleanValue(true); template.getLabel().setCharArrayValue(label.toCharArray()); template.getSign().setBooleanValue(true); template.getSensitive().setBooleanValue(true); template.getExtractable().setBooleanValue(control.isExtractable()); template.getValue().setByteArrayValue(keyValue);
/** * Allocates the attribute objects for this class and adds them to the * attribute table. * * @preconditions * @postconditions */ @Override protected void allocateAttributes() { super.allocateAttributes(); subject = new ByteArrayAttribute(Attribute.SUBJECT); encrypt = new BooleanAttribute(Attribute.ENCRYPT); verify = new BooleanAttribute(Attribute.VERIFY); verifyRecover = new BooleanAttribute(Attribute.VERIFY_RECOVER); wrap = new BooleanAttribute(Attribute.WRAP); trusted = new BooleanAttribute(Attribute.TRUSTED); wrapTemplate = new AttributeArray(Attribute.WRAP_TEMPLATE); putAttributesInTable(this); }
/** * Compares all member variables of this object with the other object. * Returns only true, if all are equal in both objects. * * @param otherObject * The other object to compare to. * @return True, if other is an instance of this class and all member * variables of both objects are equal. False, otherwise. * @preconditions * @postconditions */ @Override public boolean equals(Object otherObject) { if (this == otherObject) { return true; } else if (!(otherObject instanceof Storage)) { return false; } Storage other = (Storage) otherObject; return super.equals(other) && this.token.equals(other.token) && this.private_.equals(other.private_) && this.modifiable.equals(other.modifiable) && this.label.equals(other.label); }
newCertTemp.getToken().setBooleanValue(true); newCertTemp.getCertificateType().setLongValue(CertificateType.X_509_PUBLIC_KEY);