Validating Archive Link secKey from C#

All,
I have written a archive link service using C#, and all is working great except when security is enabled. I have been reading around and the most fesible solution appears to be using BouncyCastle to do the validation, however I keep getting the error 'message-digest attribute value does not match calculated value'.
The querystring is:
?info&pVersion=0045&contRep=IT&docId=001&accessMode=R&authId=CN%3DSAPHTTPCS000.pse,OU%3DI0020112593,OU%3DSAPWebAS,O%3DSAPTrustCommunity,C%3DDE&expiration=20100528121019&secKey=MIIBWQYJKoZIhvcNAQcCoIIBSjCCAUYCAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3DQEHATGCASUwggEhAgEBMHYwcTELMAkGA1UEBhMCREUxHDAaBgNVBAoTE1NBUCBUcnVzdCBDb21tdW5pdHkxEzARBgNVBAsTClNBUCBXZWIgQVMxFDASBgNVBAsTC0kwMDIwMTEyNTkzMRkwFwYDVQQDExBTQVBIVFRQQ1MwMDAucHNlAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xMDA1MjgxMDEwMTlaMCMGCSqGSIb3DQEJBDEWBBTYx2fOt9K%2Fdui50Fz8sEgMiZSj1TAJBgcqhkjOOAQDBC8wLQIVAJ3iEzSAz%2BCHSmr7x6k7rrhrWhy3AhRQlSwXVnfYSp1%2FnWZc80R%2FXaAFWw%3D%3D
Which gives me the following string to validate with: IT001rCN=SAPHTTPCS000.pse,OU=I0020112593,OU=SAPWebAS,O=SAPTrustCommunity,C=DE20100528121019
(note: I have tried leavng the accessMode parameter in the same case as URL with no avail)
Here is the code I am trying to use to validate the values
byte[] auth = System.Text.Encoding.ASCII.GetBytes(authString.ToString());
                    Org.BouncyCastle.Cms.CmsSignedData csd = new Org.BouncyCastle.Cms.CmsSignedData(new Org.BouncyCastle.Cms.CmsProcessableByteArray(auth), sk);
                    Org.BouncyCastle.Cms.SignerInformationStore store = csd.GetSignerInfos();
                    System.Collections.ICollection signers = store.GetSigners();
                    foreach (Org.BouncyCastle.Cms.SignerInformation sinfo in signers)
                        try
                            //Sometimes failures error
                            if (!sinfo.Verify(cert)) return false;
                        catch(Exception ex) { return false; }
                    return true;
The error occurs on the sinfo.Verify line.
Any ideas where I am going wrong would be greatly appreciated.

Hi,
I am also facing the same problem.
Everything seems to be in line with SAP documentation, but the secKey is still not validating properly.
First I compute the hash from the message. The text form of message is similar on both sides of communication (SAP and Content Server). Then the message goes to be signed. It results in PKCS#7 message encoded with base64 sent in secKey by SAP.
On CS side I decode secKey and parse PKCS7 message. I find there messageDigest and the message itself. There is a first confusion: should the messageDigest or the message be the subject for verification? I put both of them to verification and it fails all the time.
Has anyone any ideas what can be wrong in this way?

Similar Messages

  • Can Archive Link be used to store the docs from SAP R/3 to KM Repository

    Hi All,
    Could you please advice whether archive link can be used to store documents from SAP R/3 enviroment to KM Repository. I have verified the storage types that archive link can support (Like HTTP Content Server) . But i couldn't see any storage type out there which is compatible with KM Content storage.
    If it is not possible, Could you please advice is there any way to store the documents from SAP R/3 environment to KM Repository.  
    Thanks,
    Sudheer.

    Hi Vivek,
    until now I haven't found a solution in detail, but some ways to verify the connection.
    I wrote about a tool that export the pdf to the filesystem, this wont be able at this time, it must developed, because a function will place the data in a sap table and from this point there we can export it on the filesystem after we've develop some abap code.
    I thought that was already available, but that what i found was the Report RSTXPDFT4 in the sap system, with this you can transfer spool to pdf and store the file in dialog on a filesystem, there will webdav be able to use, but it must be batch.
    So I search to a new way, I try to set the repository for rooms from persitence from db to fsdb, this works, but with our patch sp9 there are some errors, so i must patch it to sp 15/16 first.
    I'm able to make the netshare on windows, so the repository is reachable with an unc Path. If the report, that must be written can access such unc path (normaly thats works in the same domain) we can store the Files in the room workspace document folder an the portal synch job can make the rest. >IN the sap system there must be a table to map the rooms to the responsable folder.
    This way should be work, but it isn't fine for productive, I heard from a way to transfer the data with  java. In CRm System there should be a fnction from sap CRM_ISA_ORDER_CONVERT_TO_PDF and the isa use the java-stream to transform it in pdf, but this is nothing for me, that must be checked from a java developer, a colleague of my will check this.
    Best regards
    Thorsten

  • Problem viewing .xlsx and .xlsm file in DMS using Display from Archive Link

    Hello All,
    We are using IXOS as a content server for storing the documents through SAP Archive Link.
    We are not storing any documents in SAP DMS.
    The client has an requirement to manage .xlsx and .xlsm documents.
    1. xlsx - We defined a new document class xlsx under SAP NetWeaver ..-> ArchvieLink  and made the required mime and sheet settings. This allows to upload a .xlsx file to IXOS server succesfully (using Check in Archive) link.
    But whenever we try to view the file using "Display from Archive", the browser gives a warning message that the file is in different format than xls. Do you want to still open (Standard Excel application message). On clicking yes, the file opens in .xls format instead of .xlsx.
    The client doesn't want to change the format to .xls. What can be done to preserve the .xlsx files.
    2. xlsm - Any clue as to does SAP ECC 6.0 support this file type for DMS? And if how the config settings are to be done?
    I will be grateful any help.
    Thanks.
    Ketki

    Hi Ketki,
    based on your description I think that maybe SAP note 1289314 could help here and made sure that the local copy also has extension XLSX or XLSM.
    Best regards,
    Christoph

  • How to extract attachment from ABAP proxy and store in archive link....

    Hi Experts,
    I need to consume an incoming email attachment in the ABAP Proxy program (POP Mail  --> PI --> ABAP Proxy) and then store this file in the IBM content management server through the Archvie Link connection.
    Any idea how to implement this piece of code in ABAP?
    Regards,
    Shobhit

    Hi Shobhit
    You can get the files from Sender Mail adapter. In proxy implement the method of protocol IF_WSPROTOCOL_ATTACHMENTS as said above.
    Archive Link supports HTTP, RFC etc depends on the system you are going to use for archiving. For your case you have IBM server i think you have to do HTTP synchronous. This will be like an interface again for you.
    Why are you using ERP system in middle. I think you can directly dump data to IBM server.
    Thanks
    Gaurav

  • Valid period for stored documents (Archive Link)

    Hello,
    Can someone please confirm if the stored documents within Archive Link can be retrieved after more than 10 years or is there an expire date setting?
    Thanks.

    SAP does not work like "Mission Impossible", that a document disappears itself after a certain time.
    If you archive documents, then it is still up to you, when you want to dispose this archive.
    E.g. you have to keep financial data for 10 years as requested by law.
    But you want keep your database small and want have a good performance.
    So you decide to archive everything what is older than e.g. 2 years.
    The older documents are written to an archive file and deleted from the table spaces.
    The archive can stay in the SAP file system (quickest access) or in an external archive system like IXOS.
    You have to make sure that you keep this archive with data older than 2 years for another 8 year to comply with the legal requirement.
    If the 10 years have past, then you archive the archive information (this has the info where your archive is located)  itself  and remove the indexes to the archived documents that are older than 10 years.
    Then you take the disk from the IXOS system and destroy it.
    If you dont archive the archive infos (SARA for BC_ARCHIVE) and dont destroy the archive files then you may be able to access the data far beyond the 10 years.

  • Get photo from archive link and link into WDA Image UI

    Hi guys,
    I have employee photos stored in archive link under PREL HRICOLFOTO object.
    The question is: how can I get the image and link it on an image UI element on WDA?
    I have read some posts but, to be honest, I don't understand very well.
    I'm trying use ARCHIV_GET_CONNECTIONS function module to obtain ARC_DOC_ID field, but I don't know which is the following step.
    Can anyone help me?
    Thank you.

    More info about the issue...
    In fact, I can see the temporary file created on ICM cache, but when I try to open the file is not appearing the photo, it is appearing the string. I put my source code:
    <pre>
    <code>
    <B>* Get ARC_DOC_ID string from archive link for the employee 10002 </B>
      CALL FUNCTION 'ARCHIV_GET_CONNECTIONS'
       EXPORTING
         objecttype               = 'PREL'
         object_id                = '10002'
         until_ar_date            = sy-datum
       TABLES
         connections              = lt_connections
      PARAMETER                =
       EXCEPTIONS
         nothing_found            = 1
         OTHERS                   = 2.
      DATA: gx_mimetype TYPE string VALUE 'image/jpeg'.
      DATA: l_image TYPE xstring.
      DATA: converter TYPE REF TO cl_abap_conv_out_ce.
    ****Create the cached response object that we will insert our content into
      DATA: cached_response TYPE REF TO if_http_response.
      CREATE OBJECT cached_response
        TYPE
          cl_http_response
        EXPORTING
          add_c_msg        = 1.
      TRY. " ignore, if compression can not be switched on
          CALL METHOD cached_response->set_compression
            EXPORTING
              OPTIONS = cached_response->co_compress_based_on_mime_type
            EXCEPTIONS
              OTHERS  = 1.
        CATCH cx_root.
      ENDTRY.
    ****set the data and the headers
      DATA: l_app_type TYPE string.
      DATA: l_xstring TYPE xstring,
            i_cache_timeout  TYPE i VALUE '60'.
      READ TABLE lt_connections INTO ls_connections INDEX 1.
    <B>* On this part I try to convert STRING (ARC_DOC_ID) into XSTRING, I don't know if it is correct or not!!!!</B>
    *-- Convert
      converter = cl_abap_conv_out_ce=>create( encoding = 'DEFAULT' ).
      converter->reset( ).
      CALL METHOD converter->write
        EXPORTING
          data = ls_connections-arc_doc_id.
    <B>* Store on l_image xstring converted!!!!!!</B>
      l_image = converter->get_buffer( ).
      cached_response->set_data( l_image ).
      l_app_type = gx_mimetype.
      cached_response->set_header_field( name  = if_http_header_fields=>content_type
                                         value = l_app_type ).
    ****Set the Response Status
      cached_response->set_status( code = 200 reason = 'OK' ).
    ****Set the Cache Timeout - 60 seconds - we only need this in the cache
    ****long enough to build the page and allow the Image on the Client to request it.
      cached_response->server_cache_expire_rel( expires_rel = i_cache_timeout ).
      DATA: r_url TYPE string.
      DATA: i_path TYPE string VALUE '/sap/public/bc/webdynpro',
            i_format TYPE string VALUE 'JPG'.
    ****Create a unique URL for the object
      DATA: guid TYPE guid_32.
      CALL FUNCTION 'GUID_CREATE'
        IMPORTING
          ev_guid_32 = guid.
      CONCATENATE i_path '/' guid '.' i_format INTO r_url.
    ****Cache the URL
      cl_http_server=>server_cache_upload( url      = r_url
                                           response = cached_response ).
      " bind the generated url with the image uielement attribute
      DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA ls_context TYPE wd_this->element_context.
      DATA lv_url LIKE ls_context-foto.
    get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    set single attribute
      lo_el_context->set_attribute(
        EXPORTING
          name =  `FOTO`
          value = r_url ).</code></pre>
    Thank you
    Edited by: vanbelal on Apr 22, 2010 9:39 AM

  • Retrieve ALV documents from archive link

    Dear experts,
    When retrieve SAP ALV reports printed to archive link using document type D01, class ALF (Internal Format for Stored Print Lists), MIME type is application/x-alf, the layout in the document viewer is changed. The layout does not correspond to ALV layout but looks like a HTM format.
    Does anyone have an idea what causes this issue?
    Thanks in advance!
    Kind Regards,
    Rene Balduk

    hi
    just have a look at this documentation
    http://help.sap.com/saphelp_nw04/helpdata/en/f5/9561fbf3b111d1955b0000e82deb58/frameset.htm
    it will answer all your queries
    regards
    Aakash Banga

  • Input file not a valid archive

    Hi
    Originally the application was written in CVI 6.0. I have now created a completly new project and workspace and added all the files.
    The compilation works fine. But the error message I get when linking (build) is " error: Input file is not a valid archive: 'c:\Projects\........\bin\i7000.lib'. "
    With another library I get the same problem: "uart.lib"
    The other lib-files just work fine.
    I saw in an old post a solution: to just recreate the project which I did. But it didn't work in my case.
    Any help? 
    Cheers Andreas
    Solved!
    Go to Solution.

     Hi Maha
    Thanks for your investigations.
    The LIBs I use "i7000.lib" resp. "i7000.dll" and "uart.lib" resp. "uart.dll" have an age of about 10 years AND are from a vendor/manufacturer that doesn't support these LIBs anymore.
    So first of all we don't have access to the original c code and therefore can't compile/build any new LIB. And most probably they were not made with CVI.
    Then as a second thought: these LIB/DLLs follow the standard and conventions of a microsoft LIB/DLL. So this should be some standard interface, even for CVI.
    Third, I think there are 1000s of such old (Microsoft standard) libraries still in use all over the industry. Therefore I cannot understand why CVI 2013 is not capabable of linking them to the rest of the code.
    Maybe I miss something in my thoughts. Like you mention already an older CVI is not a solution for us. Do you see maybe the possibility of another workaround?
    For your understanding I attach the 2 LIBs in a zip-file. Maybe it helps?
    Anyway have a nice wekend.
    Andreas
    Attachments:
    i7000.zip ‏96 KB

  • Since downloading Firefox 4, I am having problems archiving gmail conversations from my inbox view. Also, when I go to enter a new event in google calendar, I now have to click the cursor in the box to type the event (it used to let me just start typing).

    Since downloading Firefox 4, I am having problems archiving gmail conversations from my inbox view (either one or several conversations) as it says "No Conversations Selected" when I have selected one or several. Also, when I go to enter a new event in google calendar, I have to click the cursor in the box to type the event (it used to let me just start typing) or else it flips out and starts jumping to day view or another month. Does anyone know how to fix either of these?

    I have had this problem; but while trying to fix another problem, I reset my preferences for Firefox and it fixed this problem as well. To reset preferences, follow this link: http://support.mozilla.com/en-US/kb/Resetting%20preferences

  • Queries related to DMS and Archive link

    Hi Experts,
    1. Is it possible to link documents in MIGO or FB03 through Archive link with documents already stored via OAWD or CV01N.
    2. Can we use any single transaction code for reporting purpose where we can find all the documents stored via DMS and Archive link.
    Kind Regards,
    Vikas

    Hi,
    Christoph already answered that question in regard to document info records.
    Regarding documents from OAWD, your question is a bit surprising. The main idea of OAWD is to trigger a workflow for linking an external document to a SAP object (document in FB03 or whatever). This is done via ArchiveLink, so all documents linked via OAWD will appear in transactions like MIGO or FB03. Once more, please refer to the documentation:
    [Storage Scenarios with Integration of SAP Business Workflow|http://help.sap.com/saphelp_nw73/helpdata/en/4c/f3ee755e21458ae10000000a42189b/frameset.htm]
    regards,
    Juan

  • Mass upload of documents through SAP Archive Link

    Hi Experts,
    Our client is having a requirement, to upload legacy (old) data from third party tool to DMS Content server through Archive link. Tool is implemented and it works fine for attaching individual document along with SAP Object like, Purchase Order, material, etc.
    We dont have any idea as how to upload bulk of drawings for material, need your advice on this.
    Regards,

    Hi,
    I am trying to get more info on how to bulk upload employee documentation through SAP Archive Link' OpenText Enterprise Scan into the categories in OAWD. Once the documents are in Enterprise Scan the Administrator needs to link these to the categories in SAP. This is a manual process - is there a way to bulk upload these documentation to the right categories? Since these documents vary I am not sure that OCR will be a help.
    Pleae could you help in this regard.
    Thank you.
    Regards,
    -- Gustav de Bruyn

  • Archive Link Documents

    Hi Experts ,
    I am currently working on the Web UI component GS_CM . The requirement is to display the name , description and the  created by fields entered by the user during the upload process correctly on the web UI. The user would click the advanced button and then click the attachment button in the advanced assignment block to upload documents. These documents are added as archive link documents.  In the current state only the extension name ( E.g. xls ) is displayed. The data entered by the user is being populated correctly but I am not able to figure out where the attributes are being set and where wrong information is being picked up . Could anyone with experience in attachments and who has worked with the component GS_CM please help me out? Could this be a standard issue? Any reference to SAP notes would be really helpful.
    Also is there an API that would fetch the information directly from the database?
    Thanks.
    P.S: These attached documents are added within a single folder within the Archive link folder. Hence the view for the advanced assignment block has a context node with a tree structure. It is this mode which holds the name , description and the user name.

    I assume you have read http://scn.sap.com/docs/DOC-27791 ?
    First you must have Services for Objects enabled. Then you will need further enhancement to "Store Business Documents" if yo are truly using "archivelink" documents. If you use create attachment you will just be writting to the SOFFCONT1 table in SAP.
    You are spamming all the old threads on this site. This is considered very bad form.
    Please be more specific in what you have attempted to implement and you are more likely to get truly helpful answers.

  • Attachment list in ME23N using SAP Archive link not working

    Hello Everyone,
    We are using Documentum as our document management system and have linked it to SAP through Archive link to link scanned Invoices against purchase orders.
    After we run a query to link a PDF document to a purchase order in Documentum and then Login to ECC and tcode "ME23" and display the purchase order->Environment->Display Originals the document attached to the purchase order is getting displayed in Document viewer. But we want to display the document in "ME23N" and also against the Invoice document in "MIR4".
    Can anyone please help me in finding a way to display the document in ME23N. I would greatly appreciate your help.
    Regards,
    Gopal.

    Do a search. There are plenty of posts which cover the configuration of DMS and ArchiveLink as separate issues. Its not something you could add as a single post, its an entire module in itself.
    On the issue of versioning, some products do support versioning with ArchiveLink but TRIM is not one of them. To get versioning on TRIM, you would need to use SAP DMS using TRIM as a repository. Open Text supports ArchiveLink with versioning with a product called Extended ECM which is designed to give similar functionality to SAP DMS but driven from the Open Text product as opposed to the SAP DMS. I.e. you create documents and publish them to SAP rather than creating them in SAP and storing them in the 3rd party content server.
    Edited by: Athol Hill on Oct 6, 2010 9:45 AM

  • Outlook Password prompt for Linked Mailboxes from certain Domain

    Hello,
    As part of a migration project, I'm trying to connect Outlook with Linked Mailboxes from users in a trusted domain.
    I'm able to create the linked mailbox on the Exchange 2013 (CU7) server without any issue, but when I try to configure Outlook for these mailboxes, it is prompting for credentials permanently and won't start. Log on to OWA with the same user from the trusted
    domain is working fine.
    I'm able to configure Linked mailboxes from another trusted domain without any problems.
    I've already recreated the trust between these two domains (validation tells everything is ok)
    DNS is configured with conditional forwarders in both domains and name resolution looks ok to me (ping and nslookup)
    When I look at the LinkedMasterAccount of the mailboxes from this domain, I can see that there is only the SID (S-1-5-21-4033829......). The other linked mailboxes (from the other domain where it's working) are showing the Account name (domain\user)
    Internal and External ClientAuthenticationMethod of OutlookAnywhere is set to NTLM
    Infos:
    DomainA: Domainlevel 2012 - Exchange 2013 - Forest trust to Domain B and C
    DomainB: Domainlevel 2008 - Exchange 2010 - Forest trust to Domain A - Outlook for linked Mailboxes of DomainA works fine
    DomainC: Domainlevel 2008 - Forest trust to Domain A --> can't connect Outlook to LinkedMailboxes of this domain.
    Is there anything else I can check?

    Hi,
    Please check whether the server is configured to only accept NTLM version 2 and reject NTLM and LM, and the Outlook client computer is not configured with the same LAN Mananger authentication level.
    Check DC, Start -> Programs -> Administrative Tools -> Security Options -> Note the LAN Manager authentication level.
    Check DC's policies, Start -> Programs -> Administrative Tools -> expand Security Settings\Local Policies -> Security Options -> Note the Lan Manager authentication level.
    IMPORTANT: You may also have to check policies that are linked at the site/domain/organizational unit levels to determine where the LAN Manager authentication level must be configured. Configure the LAN Manager authentication level to "Send
    NTLMv2 response only". If you want to implement NTLM version 2 in your network, make sure that all computers in the domain are set to use this authentication level.
    Thanks
    Mavis Huang
    TechNet Community Support

  • Archive Link and SBO

    Hi all,
    do you know if its possible to use archive link with SAP Buisness One?
    We want to connect SAP Business One and the document management system from hyperdoc.
    Thanks for help.
    Best Regards,
    Thilo

    Hi Thilo,
    If you want to link SBO with other system, SDK might be the only option.  Post you message to SDK forum, someone may already done so.
    Regards,
    Gordon

Maybe you are looking for

  • Can't locate or create iTunes folder...

    Okay, so... I downloaded iTunes, worked great. I have all my music on an external hard drive, and that's where the "iTunes" folder was located. My first mistake was trying to get the "my music" folder that comes with vista to link to my external hard

  • Want to reinstall OS X -- recommendation for back up appllication data?

    Hi, I want to reinstall OS X on my iMac. But I need to backup some Apple application data first so I can restore it later. Specifically, all the email in Mail.app, all the songs/albumart/otherdata for iTunes, and the data in Address Book. Can someone

  • Downlod bex query in xml

    Hi all, I need to download a bex query in xml format. How can do it? Best regard Gianmarco

  • Why the HELL did a company I once trusted hide McAfee crapware in its install?!!!!!!!!!!!!!!!!!!!

    Why the [profanity deleted] did a company I once trusted hide McAfee crapware in its install?!!!!!!!!!!!!!!!!!!! I will never trust Adobe again!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Uninstall, Uninstall, UNINSTALL!!!!!!!!

  • Start up and fan issues

    Last week, when I was adjusting permissions for a folder, I selected the wrong folder (the hard drive actually) and changed permissions to all read and write. As soon as I realize what I done wrong, after about 5 minutes, I cancelled. It didn't seem