Sha1 to base64 key format needed

Hello All,
I am new to Java and trying to get my arms around the various places to find new classes for various functions.
I am trying to find a class that will convert a seed string using SHA1 into a base64 string. I have done some heavy trolling through many google pointers but I have not found exactly what I am looking for.
In perl I would use something like the following two lines:
use Digest::SHA1 qw(sha1_base64);
$base64digeststring = sha1_base64("foobar");
Does anybody have any stubs of code for this?
Thanks,
Mark

I java it is two seperate steps. The first is to SHA-1 digest the input and then to base64 encode the resulting digest.
MessageDigest md = MessageDigest.getInstance("SHA1");
byte[] digest = md.digest(input.getBytes("ASCII"));
String enc = Base64.encode(digest);
The above example assumes you have a Base64.class which you probably don't. MessageDigest on the other hand is included in the base jdk and jre so that line should work fine for you out of the box. So in short what you really need to find is a Base64 encoder/decoder class(es).
There is one that is packaged with Sun's JDK in the sun.misc package. Problem with using that is that it only exists on Sun's JVMs (aka IBM jvm would result in your app failing). However, if you search for Base64 and Java you should find numerous open source impls you can use..
Enjoy..

Similar Messages

  • Convert message content to base64 code format.

    Hi,
    While sending the file to the target directory ,need to convert the content to base64 code format.How we  can achieve this.
    Regards,
    Hymavathi

    this is a duplicate thread :convert message content to base64 code format.
    Please close this one.

  • I forgotten my bit locker password and recovery key.i need help .................

    i lost my bit locker password and i lost recovery key,i need help ..please help ......such important things are there in my e drive....pls mail me [email address redacted]

    Unfortunately if you lose the password and the recovery key you are not able to decrypt and access the information, that is the sole purpose of BitLocker.
    Blogging about Windows for IT pros at
    www.theexperienceblog.com

  • Date format needs to be in selection screen mm/dd/yyyy but in alv output ..

    hi
    i need help on displaying date in alv output
    date format needs to be in selection screen mm/dd/yyyy but in alv output ..it should be displayed as yyyymmdd
    regards
    Nishant

    hi,
    you are passing the value to ALv using an internal table.
    so store the format  YYYYMMDD date in the internal table and pass it to ALV.
    use the below FM
    DD/MM/YYYY -> YYYYMMDD
    <b>CONVERSION_EXIT_PDATE_INPUT</b>
    rgds
    Anver

  • I have forgotten which key I need to press to offer the option of switching from Windows 7 to Mac os. Can anybody help?  Many thanks.

    Can anybody advise me on which key I need to press on start up to be given the option of switching from Windows 7 to Mac OS?
    Many thanks.
    John

    "option"

  • Hierarchy  column display image(Triangle) format need to be changed in obiee11g

    Hi ALL,
    Hierarchy  column display image(Triangle) format need to changed
    For Mobile users of obiee11g, the triangle symbol image is big in size while viewing in mobile phone,i have two issues
    1. I need to reduce the size of triangle image
    2.Need to reduce the spacing between triangle image and the text
    Expecting the  the response ASAP
    Thanks,
    Bala

    Hi ALL,
    Hierarchy  column display image(Triangle) format need to changed
    For Mobile users of obiee11g, the triangle symbol image is big in size while viewing in mobile phone,i have two issues
    1. I need to reduce the size of triangle image
    2.Need to reduce the spacing between triangle image and the text
    Expecting the  the response ASAP
    Thanks,
    Bala

  • Why it won't let me install key please need help

    I bought this photoshop elements yrs ago and have never used it would like to try it now but am hoping it is compatable w/my new pc HP touch screen 520-1070 also why wont it let me install registration key please need help

    First try going to appleid.apple.com and reset your password.
    After resetting you password, log into your account, at same site and go to manage my account.
    Verify any info on account. Add/remove any relavant data. Remove any duplicate email address, make sure you have an additonal email aside from your apple id.
    After verifying all this info, try accessing the app store with new password to update apps.
    If unable to at this point and you can verify your identity with the serial number of a apple product registerd to you, verify your apple id, and the billing info on your account; you can call support at 1-800-APL-CARE and ask to speak to account security to reset security questions.

  • DP content source location not written to database - Invalid path \\server\share format needed - 80070002

    Hi All, i just wanted to ask if anyone else had experienced this issue yet?
    We have ~200 Pull DP's and for some time have been having issues with OSD Task Sequences randomly failing with the error 80070002.
    More specifically:
    Invalid path. \\server\share format needed
    Failed to find an available source location
    Our Task sequence is configured to access content directly from the DP.  We checked the PackageShare$ and validation state and both were fine.  Next we inspected WMI (root\sccmdp:SMS_PackagesInContLib) and this was fine as well.  Until today,
    we had been redistributing the failing package to remediate, but this is very time consuming with some of the large WIMs and Driver Packages, especially over some very slow WAN links.
    Today I decided to explore this a little further by examining the Database..This led me to the table ContentDPMap and the two columns in particular 'URL' and 'URLSubPath'.
    I noticed that the packages we were having issues with had a URL of the ServerName in UNC format, and a URLSubPath of just '\'.  Other packages had a fully qualified UNC path to the package for URL and a full sub path for URLSubPath.
    When we queried the DB further, we revealed 1190 packages to be in this state (for packages supposed to be in the share) out of a total of 42,000 records.
    The query we used for this was:
    select ContentID,ServerName,AccessType,URL,URLSubPath,URLProtocol,vpkg.Name from ContentDPMap as cdpm
    join v_Package as vpkg on vpkg.PackageID = cdpm.ContentID
    where cdpm.AccessType = 2 --UNCProtocol
    and cdpm.URLSubPath not like '%SMS%' --Packages with issues only have a '\'
    and vpkg.PkgFlags = (vpkg.PkgFlags | 0x80) --Limit to only show packages with the 'Copy To Package Share' flag set
    Also of note, when a package is marked with a State = 2 the values for URL/URLSubPath are NULL. (State =2 is In Progress).
    So my question:
    Firstly, has anyone else encountered this?
    Secondly - how should I fix it - we tested in our DEV and found that updating the entries remediates the issue with Clients not being able to locate content, but realise this is is an unsupported method.
    I will also log this on Connect as it appears to me to be a Bug.
    Cheers,
    David

    Our Task sequence is configured to access content directly from the DP.  We checked the PackageShare$ and validation state and both were fine.  Next we inspected WMI (root\sccmdp:SMS_PackagesInContLib) and this was fine as well.  Until today,
    we had been redistributing the failing package to remediate, but this is very time consuming with some of the large WIMs and Driver Packages, especially over some very slow WAN links.
    Hi,
    So redistributing the failed package could resolve this issue?
    How about using prestaged content to distribute these large contents?
    Best Regards,
    Joyce
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • AS3 keyboard key formatting

    I have a keyboard function:
    function createKeyboard()
    var counter:Number = 0;
    var alphabet_array:Array = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "BACK");
    for (var j:Number = 0; j<4; j++)
    for (var i:Number=0; i<8; i++)
    if (counter < alphabet_array.length)
    var mc:MovieClip = new MovieClip();
    var mcText:TextField = new TextField();
    var mcTextFormat = new TextFormat();
    // Format
    mcTextFormat.bold = false;
    mcTextFormat.font = "Arial";
    mcTextFormat.size = 18;
    // Bind the format
    mcText.setTextFormat(mcTextFormat);
    mcText.text = alphabet_array[counter];
    mcText.textColor = 0xFFFFFF;
    mcText.background = true;
    mcText.backgroundColor = 0x333333;
    // Add the text to the movie clip
    mc.addChild(mcText);
    mc.width = 80;
    mc.height = 80;
    mc.x = (mc.width+3)*i;
    mc.y = (mc.height+3)*j;
    // Don't assign the prefix 'key_' to the back button
    if (counter ==  26)
    mc.name = "BACK";
    else
    mc.name = "key_" + alphabet_array[counter];
    keyboard[counter] = addChild(mc);
    counter++;
    I need to make the keys look more visually pleasing than the current black square with white lettering. Any suggestions how?
    Thanks

    First, your code is very inefficient. Suggested code below make it more streamlined (faster and with less redundancies).
    Pay attention to the loop that generates keys - there are no nested loops; positioning calculations accomplished based on numCols (number of columns) variable and modulo operator; no need for counter.
    Per Ned's suggestion, bevel filter is applied to keys' background. You will also benefit from studying how graphics can be drawn by code (function keyMaker).
    Read comments:
    var keyboard:Array = [];
    createKeyboard();
    function createKeyboard():void {
         var alphabet_array:Array = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "BACK");
         // number of columns in the grid
         var numCols:int = 8;
         // declare variable once and reuse it in the loop
         var key:Sprite;
         for (var i:int = 0; i < alphabet_array.length; i++) {
              key = keyMaker(alphabet_array[i]);
              // x position calculated based on modulo
              key.x = (i % numCols) * (key.width + 3);
              // y position calculated, again, based on numCols
              key.y = int(i / numCols) * (key.height + 3);
              addChild(key);
              keyboard.push(key);
    // creates individual key
    function keyMaker(letter:String):Sprite {
         var mcTextFormat = new TextFormat();
         mcTextFormat.bold = false;
         mcTextFormat.font = "Arial";
         mcTextFormat.size = 14;
         mcTextFormat.color = 0xFFFFFF;
         var mcText:TextField = new TextField();
         mcText.defaultTextFormat = mcTextFormat;
         mcText.text = letter;
         mcText.autoSize = "left";
         mcText.multiline = mcText.wordWrap = false;
         mcText.text = letter;
         mcText.x = mcText.y = 6;
         var s:Sprite = new Sprite();
         // draw background separately so that we can apply filter to it
         var backGround:Shape = new Shape();
         var g:Graphics = backGround.graphics;
         g.beginFill(0x808080);
         Graphics(g).drawRoundRect(0, 0, 80, 80, 10);
         g.endFill();
         backGround.filters = [bevelFilter()];
         s.addChild(backGround);
         s.addChild(mcText);
         return s;
    // bevel filter
    function bevelFilter():BevelFilter {
         var bevel:BevelFilter = new BevelFilter();
         bevel.distance = 5;
         bevel.angle = 45;
         bevel.highlightColor = 0xA3A3A3;
         bevel.highlightAlpha = 0.8;
         bevel.shadowColor = 0x666666;
         bevel.shadowAlpha = 0.8;
         bevel.blurX = 2;
         bevel.blurY = 2;
         bevel.strength = 3;
         bevel.quality = BitmapFilterQuality.HIGH;
         bevel.type = BitmapFilterType.INNER;
         bevel.knockout = false;
         return bevel;

  • Can't Repair Disk. Format needed?!

    Hi, I Have the black macbook i got about 2 years ago. just recently whenever i use anything like finder, firefox or even safari i would get the hanging balloon thing for a long time. Good thing i have bootcamp with windows 7 or else my computer with out totally out of use. I've tried booting from a snow leopard dvd and ran disk utilities but it says disk can't be repaired and i have to format. So my question is there a fix for the hanging? so if i really have to format am i able to save my windows 7 bootcamp, and just format the osx?

    I've tried booting from a snow leopard dvd and ran disk utilities but it says disk can't be repaired and i have to format.
    What does Disk Utility say is the problem? There should be some indication of this in the log or in the First Aid window if you have "Show Details" checked.
    As others have suggested, there are more powerful disk repair utilities than Disk Utility on the market. Disk Warrior is considered by many to be the best single-purpose one; TechTools Pro is another favorite. But be advised that there is no guarantee these utilities will repair the problem -- some damage is too extensive even for them to repair.
    If you do a full reformat of the drive (this is done from the "Partitions" tab in Disk Utility), you will erase all partitions, both the OS X & Boot Camp/Windows ones. If this is required, you must backup each partition separately. SuperDuper! is excellent for cloning OS X partitions; some Windows utility may be better for the Windows one.
    However, if the damage is just to the file system of the OS X partition but does not extend to the partition scheme of the drive, you will just need to erase & set the file system format of the OS X partition (this is done from the "Erase" tab in Disk Utility) to recover. This will still erase the OS X partition, so you must still back it up, but it should leave the Windows partition untouched.
    As an aside, you should always have a good backup strategy for everything you can't afford to lose, whether on the OS X or Windows side.

  • Mail formating need help

    hi
    when i am executing the programe and checking in the SAP outbox then the values are not printing in correct format, values are correct but the structure SOLISTI1 over here it has 255 Char so in the sap outbox its printing the first header line then spaces will be up to 255 char and then prints 1st item level and then takes some pace and print in next line after 255 char, but here i need to print the entire values in correct display format.
    the problem is when i am printing 1st line the sap oubbox is not 255 char long so it cuts in the midle and spaces will be continued next line and after spaces the 2nd item level is printing up, i need the solution for this plz.

    Hi olytigs;
    WARNING I just received word from the IBM CERT Team that the security for Microsoft Live has been breached. Their recommendation is to have nothing to do with it until Microsoft is able to redo the security. At the present time the hackers are to defeat the Microsoft Live security one third of the time.
    Allan

  • How to show the variable values in key format in the information tab

    Dear all
      in the information tab of the query, we can see all the filters and the variable value. But we can only see the infoobject <b>text</b> of this variable, how can we do if the user needs to see the <b>key</b> of this variable?

    I've referred to the Web API, and find a way to display some specified variable, but since this is the standard webtemplate and we need to show all the possbible variable used in the query. Anybody has better solution?
    <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="GET_ITEM"/>
             <param name="NAME" value="StaticFilter"/>
             <param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_TEXT_ELEMENTS"/>
             <param name="DATA_PROVIDER" value="DP"/>
             <param name="CAPTION" value="SAP_BW_TEXT?program=SAPLRRSV&amp;key=722"/>
             <param name="GENERATE_LINKS" value=""/>
             <param name="WIDTH" value="330"/>
             <param name="ELEMENT_TYPE_100" value="VARIABLE_KEY" />
             <param name="ELEMENT_NAME_100" value="0P_WBSO"/>
             <param name="ELEMENT_TYPE_101" value="VARIABLE_KEY" />
             <param name="ELEMENT_NAME_101" value="0P_PRJ"/>
             ITEM:            FILTERS
    </object>

  • ACH format needs a new field - AR customer number

    Hi Gurus: The standard ACH format I am using via the Payment medium workbench does not have the customer number in it. The client wants the customer number on the ACH payment medium file that is sent to the bank.
    Can anyone please guide me on how to update this to the same ACH format? It needs to be just after the amount field...
    thanks so much
    Brian

    Dear grahul
    Check the enhancement SAPMF02D and the exits in it.
    Also check the BADI's
    CUSTOMER_ADDRSCR_CHG Change Address Screen in the Master Data Maintenance
    CUSTOMER_ADD_DATA Additional Data at Customers
    Check this link also
    Re: Screen exit for XD01
    Thanks&Regards
    Raghu.k

  • Date Format (Need result in date format)

    Dear ,
    i have worked on this query which produce result in error, infact i need result in date format and this format 'MON-YY'. :
    select to_date( EFFECTIVE_DATE,'MON-YY' ) as MON_YY FROM GL_JE_LINES
    but now EFFECTIVE_DATE is like this format '12/31/2008'

    I tell again: a date has no internal format.
    There is only a default output-format for date-objects wich is used as default output format and for implicit date conversions.
    If you want to know the actual nls_date_format for your session you can use:
    select * from nls_session_parameters where parameter='NLS_DATE_FORMAT';You can change it for your session with:
    alter session set nls_date_format='<your_new_date_format>';Please take a look at:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams122.htm
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements004.htm#sthref405
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements003.htm#BABGIGCJ
    The internal storage of a date-object does not depend on the actual value of NLS_DATE_FORMAT.
    This will only used for output and for implicit conversions e.g. with to_date or to_char without explicit format.
    To select a date from a table is also an implicit conversion to character, because you want to see characters on your screen.
    Edited by: hm on 29.12.2010 04:20

  • What keys are needed to load an applet?

    Dear
    I'm really a newbie to Javacard.
    I really appreciate if you can explain in a little bit detail.
    My question is
    1) I guess I need 3 keys (MAC,ENC,XXX) to authenticate with Javacard in the beginning.
    That means I believe every single Javacard has different keys. Is it right?
    2) Is it possible to get a CIN when I make a secure channel in the very beginning?
    If it is , how can I get it?
    I'm looking forward to your help

    Well,
    If you have a dollar to spend - here it is
    3 keys should be provided by the card manufacturer. They should explain to you how to use it. These are 16byte long DES-ECB keys and yes, each card manufacturer normally has possibility to change them for every card or group of the cards. This process is normally called card personalization. Additionally , CM state could be manipulated, cryptographic features as well as the card communication protocol settings ...
    Authentication with the keys is described in GlobalPlatform spec and you can easily learn lot about it by using some tools like JCOP Tools 3.0 ...
    Another personalization is done on the application level. This is something where user can place his "this-specific-application" data in the card. It can be connected to the GlobalPIN implementation or any other security implementation ... but this is something what can't be specified - too many applications outside. Of course, this part of the personalization is not must.

Maybe you are looking for

  • Red interference during capture with FCP 5.1.4

    I have FCP version 5.1.4 . I am using OSX 10.6 snow leopard (Macbook Pro). Have captured and edited without any problems. All of a sudden I am getting an interference during capture. This interference comes in the form of a bright red color which sud

  • Difference between Reporting Services Sharepoint Mode and Reporting Services Add In for Sharepoint 2013

    Hi, We are building company site with Sharepoint 2013 Enterprise Edition and were wondering what is the difference between Reporting Services Sharepoint Mode and Reporting Services Add In for Sharepoint 2013? What are the roles/purposes of each one?

  • Jumping to First & Last Pages of a PDF Doc.

    I am using Acrobat 9 Pro with Windows XP Pro. In Acrobat 8 Standard, I was able to jump to the first or last pages of a documents without have to use the page navigation arrows. Can I jump to the first and last pages of a PDF doc. in Acrobat 9 Pro? I

  • Site differences in FireFox from IE 7

    I am developing a new site for a research doctor for breast cancer. I have a template and I am using css. The site so for renders find and look right in IE7 but if you see the larger bar at botton in green and the spacing on the left sife at bottom.

  • Are these lines indicating sub querues of a report - in a log

    [2012-03-09T15:50:04.000+00:00] [OracleBIServerComponent] [TRACE:2] [USER-29] [] [ecid: d01cd216d41a2bc8:bf26dbb:13549056e05:-8000-00000000005b8cad] [tid: 44ded940] [requestid: 7ee0096] [sessionid: 7ee0000] [username: -2327690837] -------------------