SecurityHeaderElement header = (SecurityHeaderElement) pshList.get(j);
if(id.equals(header.getId())){
if(header instanceof NamespaceContextInfo){
return new StreamWriterData(header,((NamespaceContextInfo)header).getInscopeNSContext());
}else{
throw new URIReferenceException("Cannot derefernce this MessagePart and use if for any crypto operation " +
"as the message part is not cached");
}
}
}
// looking into buffered headers for - (Should be used only for getting the key)
// What will happen when encrypting the content but signing the entire element? Can go wrong
ArrayList bufList = securityContext.getBufferedSecurityHeaders();
for(int j=0; j< bufList.size() ; j++){
SecurityHeaderElement header = (SecurityHeaderElement) bufList.get(j);
if(id.equals(header.getId())){
if(header instanceof NamespaceContextInfo){
return new StreamWriterData(header,((NamespaceContextInfo)header).getInscopeNSContext());
}else{
throw new URIReferenceException("Cannot derefernce this MessagePart and use if for any crypto operation " +
"as the message part is not cached");
}
}
}