Ошибка возврата новых ящиков CoSign: не удалось создать и подписать ошибку 90030389
Мы модернизируем наши CoSign коробки. Я тестирую наш код с новой коробкой.
Весь пользовательский код создания и обновления работает нормально. Код подписи получает эту ошибку:
08: 52: 15,663 gvl.ArxCoSignService addSignedSignatureFieldToPdfEDoc, исключение: java.lang.Exception: не удалось создать и подписать ошибку 90030389
Руководство разработчика API-интерфейсов CoSign Signature: Приложение E: просто сказано: 90030389 = SAPI_ERR_SIGN_HASH_CRYPT_SIGN_HASH, Проблема создания хеш-значения.
Это код подписи, который сейчас не работает.
private addSignedSignatureFieldToPdfEDoc(byte[] fileBytes, String user, String password,
Boolean invisible, page, xLocation, yLocation, width, height,
appMask, String dateMask, String timeMask, String reason) throws Exception {
DssSignResult result
try {
def sigTypeURL = 'http://arx.com/SAPIWS/DSS/1.0/signature-field-create-sign'
DSS dsService = new DSSLocator()
DSSSoap arxService = dsService.getDSSSoap(new URL(arxEndpointDSS))
RequestBaseTypeOptionalInputs optionalInputs = new RequestBaseTypeOptionalInputs()
// Set signature type (create field + sign)
optionalInputs.setSignatureType(new URI(sigTypeURL))
// Set userName and password
RequestBaseTypeOptionalInputsClaimedIdentity cosignUser = new RequestBaseTypeOptionalInputsClaimedIdentity()
NameIdentifierType userName = new NameIdentifierType(user)
userName.setNameQualifier(domain)
cosignUser.setName(userName)
String coSignPassword = encodePasswordForCosign(user)
cosignUser.setSupportingInfo(new CoSignAuthDataType(coSignPassword, null, signPass))
optionalInputs.setClaimedIdentity(cosignUser)
// Set signature field settings
SAPISigFieldSettingsType sapiSigField = new SAPISigFieldSettingsType()
sapiSigField.setTimeFormat(new TimeDateFormatType(ExtendedTimeFormatEnum.GMT, dateMask, timeMask))
sapiSigField.setName('Signature1')
sapiSigField.setDependencyMode(DependencyModeEnum.Independent)
sapiSigField.setSignatureType(SignatureTypeEnum.Digital)
sapiSigField.setAppearanceMask(new UnsignedInt(appMask))
sapiSigField.setLabelsMask(new UnsignedInt(appMask))
sapiSigField.setFlags(new UnsignedInt(0))
sapiSigField.setEmptyFieldLabel('')
sapiSigField.setInvisible(invisible)
if (!invisible) {
// log.debug 'addSignedSignatureFieldToPdfEDoc, Setting signature field location'
sapiSigField.setPage(page)
sapiSigField.setX(xLocation)
sapiSigField.setY(yLocation)
sapiSigField.setHeight(height)
sapiSigField.setWidth(width)
}
optionalInputs.setSAPISigFieldSettings(sapiSigField)
List<ConfValueType> config = new ArrayList<ConfValueType>()
// Set the reason
// log.debug 'addSignedSignatureFieldToPdfEDoc, Setting the reason'
if (reason != null && reason.trim().length() > 0) {
ConfValueType ct = new ConfValueType()
ct.setStringValue(reason)
ct.setConfValueID(ConfIDEnum.Reason)
config.add(ct)
}
if (config.size() > 0) {
optionalInputs.setConfigurationValues(config.toArray(new ConfValueType[0]))
}
// Set flags
optionalInputs.setFlags(new UnsignedInt(0))
// Set return PDF tail only
optionalInputs.setReturnPDFTailOnly(new Boolean(true))
RequestBaseTypeInputDocuments inputDocs = new RequestBaseTypeInputDocuments()
DocumentType myDoc = new DocumentType()
DocumentTypeBase64Data docBytes = new DocumentTypeBase64Data(fileBytes)
docBytes.setMimeType('application/pdf')
myDoc.setBase64Data(docBytes)
inputDocs.setDocument(myDoc)
// Make the call
SignRequest signRequest = new SignRequest()
signRequest.setOptionalInputs(optionalInputs)
signRequest.setInputDocuments(inputDocs)
result = arxService.dssSign(signRequest)
// Check result
ResponseBaseTypeResult rc = result.getResult()
String resultMessage = rc.getResultMajor().toString()
if (resultMessage.compareTo(coSignSuccessMessage) != 0) {
throw new Exception(rc.getResultMessage().get_value())
}
// Return the signature
SignatureObjectType sig = result.getSignatureObject()
SignatureObjectTypeBase64Signature sig64 = sig.getBase64Signature()
return sig64.get_value()
} catch (java.rmi.RemoteException e) {
log.error 'addSignedSignatureFieldToPdfEDoc, RemoteException: ' + e
throw e
} catch (Exception e) {
log.error 'addSignedSignatureFieldToPdfEDoc, Exception: ' + e
throw e
}
}
Я предполагаю, что нам может потребоваться обновить некоторые файлы JAR. Вот текущий импорт.
//ARX Imports and Includes
import _0._2.SPML.tc.names.oasis.AddRequestType
import _0._2.SPML.tc.names.oasis.AddResponseType
import _0._2.SPML.tc.names.oasis.DeleteRequestType
import _0._2.SPML.tc.names.oasis.ExecutionModeType
import _0._2.SPML.tc.names.oasis.PSOIdentifierType
import _0._2.SPML.tc.names.oasis.PSOType
import _0._2.SPML.tc.names.oasis.ResponseType
import _0._2.SPML.tc.names.oasis.ReturnDataType
import _0._2.SPML.tc.names.oasis.StatusCodeType
import password._0._2.SPML.tc.names.oasis.SetPasswordRequestType
import assertion._0._1.SAML.tc.names.oasis.NameIdentifierType
import schema.core._0._1.dss.tc.names.oasis.*
import search._0._2.SPML.tc.names.oasis.SearchRequestType
import search._0._2.SPML.tc.names.oasis.SearchResponseType
import com.arx.SAPIWS.DSS._1_0.*
import com.arx.SAPIWS.DSS._1_0.DSSLocator
import com.arx.SAPIWS.SPML._1_0.CoSignLogonData
import com.arx.SAPIWS.SPML._1_0.SPML
import com.arx.SAPIWS.SPML._1_0.SPMLLocator
import com.arx.SAPIWS.SPML._1_0.SPMLSoap
import com.arx.SAPIWS.SPML._1_0.UserKindEnum
import com.arx.SAPIWS.SPML._1_0.UserRecord
Любая помощь в решении этой проблемы будет принята с благодарностью.