Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Content Server error

Hi All,

I am trying to write a Java utility that will create a document using Content Server HTTP API in a repository with security turned on. I use SAP SSF classes to calculate the secKey value for my request, but everytime I get HTTP 401 error and the Content server log contains following error:

Security SsfVerify failed rc=12, lasterror=18, decoding error for, PSE=
?\C:\Program Files\SAP\Content Server\Security\ZT1.pse,"

My algorithm is following: first I calculate the MD5 hash of the parameters:

byte[] digest = null;
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(param.getBytes());
digest = md.digest();

Then I sign it using SAP SSF classes:

ByteArrayInputStream bais = new ByteArrayInputStream(digest);
		
// create object of ssf data
ISsfData data = null;

try {
    data = new SsfDataPKCS7(bais);
    KeyStore keystore = KeyStore.getInstance("PKCS12");
    keystore.load(new FileInputStream("c:\\work\\PKI\\CS_NW1.p12"), "pwd".toCharArray());		      
    SsfProfileKeyStore profile = new SsfProfileKeyStore(keystore, "cs_nw1", "pwd");
    boolean res = data.sign(profile);
		    
    if (!res) {
        System.out.println("Creation of signature failed");
    } else {
	ByteArrayOutputStream baos = new ByteArrayOutputStream();
	data.writeTo(baos);
	result = Base64.encodeBase64URLSafeString(baos.toByteArray());
   }
		    
} catch (Exception e) {
   e.printStackTrace();
}

Is anyone here who has experience with the Content Server HTTP API in combination with digital signatures and could help me with my problem?

Many thanks in advance!

Best regards,

Tomas

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question