Options

SHA1 Encoding

rocatisrocatis Member Posts: 163
edited 2014-11-17 in NAV Three Tier
I'm searching for a component to do SHA1 encoding of a string (to be used with a webservice).

Using the automation server mscorlib.dll I have access to some SHA1 Classes, but none of them have any Methods or Properties.

Using the DotNet assembly System.Security, I believe I should be able to find something called System.Security.Cryptography.Sha1, but it isn't there.

Finally I tried to find an external (3rd party) component, but they're all very old, not downloadable, won't run on 64 bit etc. etc.

In short: help! Best solution gets a beer on Techdays! :D
Brian Rocatis
Senior NAV Developer
Elbek & Vejrup

Comments

  • Options
    thegunzothegunzo Member Posts: 274
    @rocatis

    System.Security.Cryptography.Sha1 is in mscorlib
    OBJECT Codeunit 50111 SH1
    {
    OBJECT-PROPERTIES
    {
    Date=13.11.14;
    Time=15:53:31;
    Modified=Yes;
    Version List=Dynamics.is;
    }
    PROPERTIES
    {
    OnRun=BEGIN
    SH1.Create;
    END;

    }
    CODE
    {
    VAR
    SH1@1100408000 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Security.Cryptography.SHA1";

    BEGIN
    END.
    }
    }
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
  • Options
    rocatisrocatis Member Posts: 163
    Well, it's the right component! (although you need to use "SH1 := SH1.Create").

    Unfortunately, the ComputeHash method, which I believe is the one to use, returns an unsupported variable type (byte array).

    So I'm basically back to square one :(
    Brian Rocatis
    Senior NAV Developer
    Elbek & Vejrup
  • Options
    rocatisrocatis Member Posts: 163
    Brian Rocatis
    Senior NAV Developer
    Elbek & Vejrup
Sign In or Register to comment.