/** * {@inheritDoc} * * When a signature is added, a default content reference that uses the ID of this object will be * created and added to the signature at the time of signing. See {@link SAMLObjectContentReference} * for the default digest algorithm and transforms that will be used. These default values may be * changed prior to marshalling this object. */ public void setSignature(@Nullable final Signature newSignature) { if(newSignature != null && newSignature.getContentReferences().isEmpty()) { newSignature.getContentReferences().add(new SAMLObjectContentReference(this)); } super.setSignature(newSignature); }