Non-compliant DSA signature of the J2SE

In J2SE, I use this:

Signature signature = Signature.getInstance( "DSA" );
signature.initSign( privatekey );
signature.update( "asdf".getBytes() );
byte[] result = signature.sign();

And get the following bytes of signature

30 2c 02 14 48 4d 0c 5b b3 e4 05 53 31 e7 1e 54
db da ef fb f3 c6 6d ea 02 14 2a 0e ae 78 95 ab
85 8b ee 24 4d ae 7f ac ad ff 61 e4 39 ae

In BlackBerry, I have this:

DSASignatureSigner signer = new DSASignatureSigner( privatekey );
signer.update( "asdf".getBytes() );

byte[] r = new byte[signer.getRLength()];
byte[] s = new byte[signer.getSLength()];
signer.sign( r, 0, s, 0 );

But I just need a byte array not R and S.

Here's what I get for r:

5d 82 fc 95 70 c1 84 74 ef 04 00 66 ec c1 ea 34
4e 2b 95 3d

And s:

0a be dd 81 3e 73 52 47 a5 52 03 03 c7 e4 6f 1b
a6 d5 02 ae

I found this page describing how to combine the two tables, but the bytes match in all cases.

http://orlingrabbe.com/dsa_java.htm

I also found these pages of RIM:

http://www.BlackBerry.com/developers/docs/7.0.0api/NET/rim/device/API/crypto/doc-files/signatures.ht...

http://www.BlackBerry.com/developers/docs/6.0.0api/NET/rim/device/API/crypto/doc-files/encoders.html...

So I tried this:

EncodedSignature signature = SignatureEncoder.encode( signer, "X509" );
byte[] signatureData = signature.getEncodedSignature();

But I got the following:

30 09 06 07 2a 86 48 ce 38 04 03 03 2f 00 30 2c
02 14 22 92 4c 4b 08 04 17 4e 61 8e f6 e9 59 21
79 48 75 08 f0 00 02 14 6e ff a6 e6 84 9c ec b5
18 91 ec 11 84 25 e4 fb f8 b0 69 c4

Any ideas on how to get the same results as normal JAVA?

Well, it's good now. The signature is not constant, so that threw me when I posted above. Here is what I have at the moment and it does not work for me. I don't know if there's a way shorter, but here's what I have:

DSACryptoSystem cryptoSystem = new DSACryptoSystem( p, q, g );
DSAPrivateKey privatekey = new DSAPrivateKey( cryptoSystem, x );

DSASignatureSigner signer = new DSASignatureSigner( privatekey, new SHA1Digest() );
signer.update( "asdf".getBytes() );

byte[] r = new byte[signer.getRLength()];
byte[] s = new byte[signer.getSLength()];
signer.sign( r, 0, s, 0 );

ASN1OutputStream asn1Output = new ASN1OutputStream();
ASN1OutputStream sequence = new ASN1OutputStream();
sequence.writeInteger( r );
sequence.writeInteger( s );
asn1Output.writeSequence( sequence );

byte[] result = asn1Output.toByteArray();

Hope that helps someone

EDIT: oh dang, I double posted

Tags: BlackBerry Developers

Similar Questions

  • Satellite Pro 4200: ACPI BIOS non-compliant system - NTLDR is missing

    Toshiba Satellite Pro 4200 series, ACPI BIOS non-compliant system

    I have an old Toshiba Satellite Pro 4200 series, I tried to install win98 2000 and xp, but it never completes the whole upward, I get these messages;

    ACPI BIOS non-compliant system
    and
    NTLDR is missing

    I have looked for a bios update but can't find one for the 4200, can anyone help?

    Thank you

    Hello

    Have you tried to reinstall the OS using the Toshiba Recovery CD?
    "I found the troubleshooting of Microsoft on the NTLDR is missing ' error message.

    Please check this:
    http://support.Microsoft.com/kb/318728

  • non-compliant message MBCA 2.0

    Hello
    I'm under the MBCA 2.0 on a virtual server to Server 2003 R2 (ent) 32-bit
    I get a message "no information update or correction required there for servername.
    This means that the server is authorized to V2V or it means something else.
    The message is listed under non-compliant
    Thank you
    FL

    Hello

    Please post your question in Server TechNet Forums.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    See you soon.

  • Boot From San host non-compliant profile

    So I just finished working through all the mistakes and customization of a new profile of the host, but I always have a problem with the host saying non-compliant. The host boots San and has a local SSD. These two discs are throwing errors of "host State does not match specification: naa:XXX of device settings need to be reset." I've completed the steps in KB 2002488, but it has not fixed the problem.

    Any help would be greatly appreciated.

    In the 'toggle the profile Configuration"under storage, expand and disable everything that has naa.xxx in it.  Here's the way mine is set up.

  • UH... substitute result compliant non-compliant

    When we create an exception to compliance, we can select to replace non-compliant to compliant results or replace non-compliant results consistent.  Under what circumstances we would cancel the results in line with non-compliant.

    An example might be where you have a requirement to have a certain product anti-virus installed on all servers. However, this A / V is known to conflict with an application installed on a handful of servers, create an exception in line for servers than when they do not have A / V product installed. Good enough so far, but it's always a problem if the A / V output is actually installed on one of the servers excepted, so create you a second exception replace non-compliant in these cases.

  • Several facts with some non-compliant sizes

    Hi, in our data mart, I have multiple fact tables. The fact of JOBS table includes the dimensions of time, employee, org and employment.

    Other fact tables include these 4 dimensions consistent basis, more specific dimensions to the fact. For example, BENEFITS includes a dimension 'plan type', etc.

    When reporting, I want counts of the fact table basic JOBS will appear always - even if other data in the report contains the dimensions of "non-compliant". For example, I would like a report listing periods of time, used account (as the result of EMPLOYMENT) and joined County employee (as a result of the BENEFITS), something like this:

    Month advantage Plan registered EMP EMP
    Jan 2009 health insurance 10 000 8 000
    Jan 2009 401 k Plan 10 000 4 000
    Jan 2009 AD & D 10 000 1 000

    When I try to produce this report, because the "benefit plan" is not a dimension linked to the JOBS data, the column of EMP comes out blank. Yes, I can add a total row to the bottm show... but I really want the 10,000 is displayed on each line (also because I want to calculate a % of the people listed on the total population).

    What is the best way to achieve this? Also, as I have 4 or 5 other tables of facts, and each of them have their own 'personal' dimensions in addition to those in line.

    Thanks in advance!
    Scott

    @ASFK

    What I was referring to was on the measure itself, not the LTS it is mapped to the content tab.

  • Fill in the Signature of the IOM UPA table field

    The IOM UPA table has a SIGNATURE field that you can use for storing the digital signature of the snapshot (for purposes of non-repudiation).
    Default - the value of this field is "NULL" in the database.
    Have found no documentation on how this field is filled in.
    At any fact a use of this feature of non-repudiation.

    Thank you
    Chetan

    I guess that this field is NOT used anywhere in the implementation of the IOM... Is perhaps a feature that is coming in the next version, but also just as I know, this field is not used.

  • I added an image as a signature that works very well if a new message an email, however, the signature of the image is not added when I reply to an e-mail message?

    I added an image as a signature when a set my e-mail account. This image is added successfully when I compose a new email. When I reply to an e-mail message, the image is not added, and I have to manually copy it from a newly formed email. I assumed that there should be a way around this?

    Account settings of GOTO and look under the section Composition & addressing. There are two check boxes to include signatures in the responses and transfers.

  • [BCU] Error signature in the password file...

    Hey guys,.

    I use Configuration BIOS HP (BCU v. 4.0.13.1) utility to change the configuration of the BIOS.

    So I implemented a new password of BIOS with the HPQPswd tool.

    Everything worked well. Password is enabled.

    After that, I tried to make some changes to the boot order.

    "But every time, the weather with a config file, or with the command ' / setvalue:"Filename.txt "/cspwdfile:"filename.bin"", the following error message:

    < ERROR msg = "" Error Signature in the file password: Password.bin "/ >"

    < ERROR msg = 'BCU return the value' real '10' = translated = "10" / >

    If anyone can help me with this?

    Thanks for your response!

    Greetings,

    KKlein

    Hi Klein,

    According to the guide on the website of manageability http://hp.com/go/clientmanagement BCU, error code = 10 back which means "Password valid unplanned".

    I suggest you try the following:

    1 re create the bin file from password

    2 provide the full path to the bin file from password

    example:

    BIOSConfigUtility.exe /setconfig: "filename.txt" /cspwdfile:"c:\myshare\password.bin"

    where:

    Password.bin is located in c:\myshare

    Thank you.

  • Non-us Xoom will get the 3.1 update, which includes SD support this week

    Non-us Xoom will get the 3.2 update which includes SD support this week

    I asked a psychic, she could not be more precise, she needs a photo of Matt without funky shades, the update could start tomorrow.

  • Signature "by the account" does not work correctly

    Features: iPhone 6 iOS available 9.2 41.1 GB

    I have configured and you can send from multiple e-mail accounts (6 including iCloud) on my iPhone.

    My problem: the signature "by the account" feature does not work correctly. I enable this feature, create distinct signatures, choose to send other than the default e-mail account. However, the default signature in the message, followed two copies of the signature on behalf of which I want to send the message below. I deleted and readded to each email account and of the signature, but find the same result.

    Having this problem as well, or very close.  I can't get the HTML signatures to work (IE, appear) when

    I sent mail from an account that has a.

    This question to a while back in older iOS and has been fixed, now it's back...

    I often crash parameters when you try to paste a HTML signature in place and when

    I have a y arrive, it does not show in the email project.  When I add a text character

    at the signing, he sometimes shows up.  Very erratic...

  • The new XP installation error. The signature for the family Windows XP Setup is not valid. The error code is fffffc0d

    I'm doing a fresh install of Windows XP Edition family on a new hard drive.  I get the same error message indicating that the product catalog can not be installed. I reformatted and retryed with the same result. I tried a different HARD disk, but got the same trouble. I also tried installing XP Pro after a reformat and got the same error. The first error window says "the signature for the family Windows XP Setup is not valid. The error code is fffffc0d", and the second says" error: the system cannot find message for message number 0xfffffc0d text in the file for syssetup.dll fatal error messages: Setup failed to install the product catalogs. " Any directive or ideas would be greatly appreciated. THX

    Hello

    I suggest you try the steps from the link below and check if it helps.

    http://support.Microsoft.com/kb/307153

    Hope this information is useful.

  • startuprepairV2 with signature of the problem 01: autofailover__

    I have windows vista. Do not start with repair unable to resolve the startup problem. PC just loop around Startup Repair continuously to try to restart again. System Restore does not work and "last good configuration does not work either. Gone through all the options available on the screen, without success, so now completely blocked. Vista installation disc supplied with the machine.
    The problem is listed as:

    Problem event name: startuprepairV2
    Signature of the problem 01: autofailover
    Signature of the problem 02: 6.0.6000.16386.6.0.6000.16386
    03:6 problem signature
    Signature of the 04:1638424 problem
    Signature of the problem 05: no cause root
    Signature of the 06 problem: no cause root
    Signature of the problem 07:0
    Signature of issue 08: 1
    Signature of the 09 problem: System Restore
    Signature of the problem 10:0
    OS version: 6.0.6000.2.0.0.256.1
    locale ID: 1033

    Any ideas?

    How to do a startup repair disk:

    Download the ISO on the link provided and make a record of repair time it starts.

    Go to your Bios/Setup, or the Boot Menu at startup and change the Boot order to make the DVD/CD drive 1st in the boot order, then reboot with the disk in the drive.

    At the startup/power on you should see at the bottom of the screen either F2 or DELETE, go to Setup/Bios or F12 for the Boot Menu.

    When you have changed that, insert the Bootable disk you did in the drive and reboot.

    http://www.bleepingcomputer.com/tutorials/tutorial148.html

    Link above shows what the process looks like and a manual, it load the repair options.

    NeoSmart containing the content of the Windows Vista DVD 'Recovery Centre', as we refer to him. It cannot be used to install or reinstall Windows Vista, and is just a Windows PE interface to recovering your PC. Technically, we could re-create this installation with downloadable media media freely from Microsoft (namely the Microsoft WAIK, several gigabyte download); but it is pretty darn decent of Microsoft to present Windows users who might not be able to create such a thing on their own.

    Read all the info on the website on how to create and use it.

    http://NeoSmart.net/blog/2008/Windows-Vista-recovery-disc-download/

    ISO Burner: http://www.snapfiles.com/get/active-isoburner.html

    It's a very good Vista startup repair disk.

    You can do a system restart tool, system, etc it restore.

    It is NOT a disc of resettlement.

    And the 32-bit is what normally comes on a computer, unless 64-bit.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    How to get Vista recovery Media or the Vista recovery Partition on your computer back to factory settings.

    There is no Vista free download legal available.

    Contact your computer manufacturer and ask them to send a recovery disk/s Vista set.

    Normally, they do this for a cost of $ small.

    In addition, ask them if you have a recovery Partition on your computer/laptop to restore it to factory settings.

    See if a manual provided with the computer or go to the manufacturer's website, email or you can call for information on how to make a recovery.

    Normally, you have to press F10 or F11 at startup to start the recovery process...

    Another way I've seen on some models is press F8 and go to a list of startup options, and launch a recovery of standards of plant with it, by selecting the repair option.

    Ask them if you can also make recovery disk/s for the recovery Partition in case of a system Crash or hard drive failure.

    They will tell you how to do this.

    Every computer manufacturer has their own way of making recovery disk/s.

    Or borrow a good Microsoft Vista DVD (not Dell, HP, etc).
    A good Vista DVD contains all versions of Vista.
    The product key determines which version of Vista is installed.

    There are 2 disks of Vista: one for 32-bit operating system, and one for 64-bit operating system.

    If install a cleaning is required with a good DVD of Vista (not HP, Dell recovery disks):

    Go to your Bios/Setup, or the Boot Menu at startup and change the Boot order to make the DVD/CD drive 1st in the boot order, then reboot with the disk in the drive.

    At the startup/power on you should see at the bottom of the screen either F2 or DELETE, go to Setup/Bios or F12 for the Boot Menu

    http://support.Microsoft.com/default.aspx/KB/918884

    MS advice on the conduct of clean install.

    http://www.theeldergeekvista.com/vista_clean_installation.htm

    A tutorial on the use of a clean install

    http://www.winsupersite.com/showcase/winvista_install_03.asp

    Super Guide Windows Vista Installation

    After installation > go to the website of the manufacturer of your computer/notebook > drivers and downloads Section > key in your model number > get latest Vista drivers for it > download/install them.

    See you soon.

    Mick Murphy - Microsoft partner

  • Just installed via Steam Fable III. Just after authentication and signature in the game finished

    Just installed via Steam Fable III. Just after authentication and signature in the game finished. Solutions?

    original title: Fable III does not start yet. Solution?

    Hello
    You can try to fix the game and check if it helps. If the problem persists then try to uninstall and reinstall the game.
    http://Windows.Microsoft.com/en-us/Windows-Vista/uninstall-or-change-a-program

  • Signature of the problem 05: AutoFailover

    Having a problem with Windows 7

    I turned on the machine and everything worked normally. I had to go out for a few minutes and when I got home my screen was empty, but the machine was still on. After checking all the cables, I stopped the power and tried to reload. Function returned monitor but machine entered the Startup Repair. Startup Repair couldn't fix. I tried to restore with no luck. I tried a few suggestions on the forum and no luck. I get the following message:

    Signature of the problem

    Problem event name: StartupRepairOffline

    Signature of the problem 01: 6.1.7600.16385

    Signature of the problem 02: 6.1.7600.16385

    Signature of the problem 03: unknown

    Signature of the 04:21201026 problem

    Signature of the problem 05: AutoFailover

    Signature of the 06:23 problem

    Signature of the problem 07: CorruptFile

    The system version: 6.1.7600.2.0.0.256.1

    Locale ID: 1033

    Any help would be greatly appreciated.

    Hi Gary,.

    Thanks for posting your query in Microsoft Community.

    I appreciate the efforts made in the patches that you tried. From now on, I would ask you refer to the suggestions in the article below and check the status.

    Why my screen is black when I start Windows 7?

    Hope this information is useful. Please feel free to answer in the case where you are facing in the future other problems with Windows.

Maybe you are looking for