How to create RSAPublicKeySpec from byte[]

Hi,
another question: i've the public key encoded in ascii format on disk. How can i create the RSAPublicKeySpec from that byte[] array? i don't have the modulus and exponent...
thanks
Luca

Take a look at java.security.KeyFactory.generatePublic(KeySpec) and java.security.spec.X509EncodedKeySpec.
Grant

Similar Messages

  • How to create short from byte[2]

    Hi, my problem is, that once i wrote application which was able to add echo to a wav file in c++ :
    #include<iostream>
    #include<string>
    #include<cstdio>
    using namespace std;
    int write=0;
    int read=0;
    void insert(short int * tablica,short int element,int value);
    void read_out(short int * liczba,short int * tablica,int value);
    int main(){
    FILE * file_in;
    FILE * file_out;
    char header[44];
    file_in = fopen("output.wav","rb");
    cout<<"wprowadz dlugosc echa: "<<endl;
    int echo;
    int count=0;
    cin>>echo;
    short int * fifo=new short int[echo];
    short int sample;
    short int temp;
    file_out = fopen("new.wav","wb");
    fread(header,44,1,file_in);
    fwrite(header,44,1,file_out);
    for(int p=0;p<echo-2;p++)
    insert(fifo,0,echo);
    while(fread(&sample,2,1,file_in))
    read_out(&temp,fifo,echo);
    temp = temp/3 + sample/2;
    insert(fifo,temp,echo);
    fwrite(&temp,2,1,file_out);
    fclose(file_out);
    fclose(file_in);
    delete fifo;
    return 0;
    void insert(short int * tablica,short int element,int value)
    tablica[write%value]=element;
    write++;
    void read_out(short int * liczba,short int * tablica,int value)
    (*liczba)=tablica[read%value];
    read++;
    }as You see above it's very simple, and I wrote it ages ago, and now I need to prepare a presentation for a JUG meeting, and it's gonna be about all java support for different kinds of sound. That's why I wanna write application to manipulate some sort of sound files ( in this case a .wav file).
    My problem is that when I repeat this code in Java it works differently. first problem, is that I read samples form wav using FileInputStreamReader, and it reads either bytes or ints , and I need to read shorts, cause it's 16bit wav file. So I'm reading via FileInputStreamReader every 2 bytes, and trying to convert it to short using bit shifts, but it never works. Does anyone knows how to read stream to short type, or how to convert bytes[2] to short safely? Thanks in advance.

    I was having a very similar problem converting a byte array to a double array. Please see this thread:
    http://forums.sun.com/thread.jspa?threadID=5438070&tstart=0
    The method suggested by captfoss in that thread and in this thread should work, but it doesn't seem to work correctly. Instead, I had to handle each bit on an individual basis to get the correct result, like this:
                                    int d = 0;
                                    for (int j = 0; j < 8; j++) {
                                        if (((data[2*i] >>> j) & 1) == 1) {
                                            d += (int) Math.pow(2, j);
                                    for (int j = 0; j < 7; j++) {
                                        if (((data[2*i+1] >>> j) & 1) == 1) {
                                            d += (int) Math.pow(2, j+8);
                                    if (((data[2*i+1] >>> 7) & 1) == 1) {
                                        d -= Math.pow(2, 15);
                                    wave.get(lastD) = d;
    wave is a double array, so it casts d to a double in the last line.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to create database from .sql file

    how to create database from .sql file..?? i put the sintax query in a sql file.. and i want to call it in java code..
    ho to do it..??

    why do you want to do this from java?
    i just don't see the point.
    find your dba and have him/her run it for you

  • How to create data_block from procedure ?

    hi all
    can anyone to help me :
    how to create data_block from procedure ?
    i want to join 2 or 3 table and use order by
    then show some field in my form
    i can not use view because order by can not use in view
    please send sample code for this procedure
    thanks.

    1) >i can not use view because order by can not use in view
    SQL>create or replace view V_test as
      2  select * from (
      3  select 1 id from dual union
      4  select 2 id from dual union
      5  select 3 id from dual union
      6  select 4 id from dual union
      7  select 5 id from dual union
      8  select 6 id from dual ) t
      9  order by t.id
    10  /
    View created.
    SQL>select * from v_test;
            ID
             1
             2
             3
             4
             5
             6
    6 rows selected.2). >how to create data_block from procedure?
    You must create procedure and use ref cursor.

  • How to create report from report painter??

    Hi,
    how to create report from report painter?? from transaction code GRR1

    Select the library that you want report to create.  GRR1
    You select what to list in coulumns and what to lisr in rows. You could select characteristics or key figures.
    You can use variable both in defininig row and coulmn or in general selection.
    You can also use sets as variable or as constant. These sets can be your master data groups or sets in GS02.
    You can use formulas.

  • How to Create PDF from Illustrator CS3 by using applescript?

    Hi Guys,
    Do some one knows how to create PDF from Illustrator CS3 by using apple script. If know, please give me the scripting.
    HARI

    Have you tried File>Scripts>SaveDocsAsPDF? There should be a folder of sample scripts installed in your AICS3 folder and a folder of documentation which contains an Illustrator AppleScript Reference which has examples.

  • How to create "convert from PDF to Word?"

    How to create "convert from PDF to Word?"

    Good day,
    To use the ExportPDF service, simply visit http://exportpdf.acrobat.com and click 'Sign in' at the top right corner.  Enter your Adobe ID (email address) credentials to log into the service.  As ExportPDF is web-based, you simply utilize the tool through your web browser.  After you're logged in, you should see the ExportPDF interface, with a button saying 'Select PDF file..' to get the process started.
    Please let us know if you have any questions.
    Kind regards,
    David

  • How to create Analysis from two different subject areas with diff models

    Hello,
    I have problem with create analysis from two different areas with two different models (Model Star and Snowflakes) build in BI Admin tools.
    First Model A = Subject Area A have one fact tables (with measures) and three dimensions tables (Model Star)
    Second Model B = Subject Area B have one fact table (no measures) and five dimensions tables (Model Snowflakes).
    I'm looking solutions how I can give good results. In this case I can't use UNION, INTERSECT etc., because this models haven't the same number column and data type?
    whether it is possible to do in OBIEE?
    Please help me
    Kind regard
    robix

    Hi
    One thing to understand is that if your are imagining having two Subject Areas (SAs) displayed and then dragging columns from each into your Request without any preparation, then no, that can't be done. You would need to do a join in the BMM layer and expose the column from the second Subject Area in the presentation layer.
    But if you indeed interested in UNION (or intersect) queries, then do this:
    Build your first query in the first SA in the usual manner. Note the number of columns and the data types of each column.
    Now at the bottom of the Criteria workspace, there is a button called "Combine with similar request." Click it.
    Select your second SA. You will note that the outlines of the columns in your first query appear. This is to remind you that the number of columns in this second query must be the same as in the first. It also shows the data type of each column for the same reason.
    Once you select your columns and your filters, click on result. (Oh, you will also need to decide what kind of combination you want -- click on the dropdown.) The result will be a new Request that has data from both SAs in the query and combined in the manner you select (union, intersect, etc.)
    That should give you a start.
    http://obiee101.blogspot.in/2010/08/obiee-combine-with-similar-request.html -- Read this link this is good one to understand with screen shots. -- OBIEE 10g
    http://oraclebiee11g.blogspot.in/2011/01/querying-across-multiple-subject-areas.html -- OBIEE 11g
    Award Points it is useful.
    Thanks
    satya

  • How to create reports from my existing web application on Java/J2EE with Oracle Client 10g as the backend?? Help sought for

    Our company has developed an  Web Application and we are also looking out for the development of reports using Business Objects Exterprise XI Release 2 and for this purporse I do require some help from the forum who can literally show me how to get on and working on creating the reports.

    Thats why I thought I should make the following chain in the keystore, possibly in this order.
    1. My private key (simply generated in the server)
    2. Import Root certificates from NS
    3. Import Trusted certificate issued by NS
    Then when I sign with my private key surely an association will be formed to the trusted authority certificate. The problem I'm having is when I first made my private key I used openSSL as it was only intended for HTTPS. Now I need to create a keystore so I can use jarsigner to sign the jar file, and I can't see how to create a keystore using my existing private key. Surely if I created a new key and self sign, then import the trusted certificate the association will fail, as the private key will not be the same 1 that I used to make the CSR when applying for the trusted certificate.

  • HOW TO - Create new from clipboard and process multiple files - please help

    Need help - have new version of photoshop on trial only ATM...
    Want to know - HOW TO:
    1. Create new from clipbaord
    2. Process multiple files
    Please help.

    For clipboard copy, I start with File > New and the size will be set to what's in the clipboard. Then once the new file is opened, Edit > Paste will place the clipboard contents as a layer in the new document.
    You must remember to use the command Layer > Flatten Image of you want to save as jpeg or any other file format that doesn't support layers.
    For processing multiple files,
    File > Automate > Batch or
    File > Scripts > Image Processor...
    Check the User guide or google information for those commands if you have specific needs.
    Gene

  • How can create schema from this document.

    Thank you for reply~
    The following is that I have.
    <?xml version='1.0'?>
    <conference>
    <proceedings key="AlbenR00">
    <pro_book>
    <editor>Lauralee Alben</editor>
    <editor>Michael Rigsby</editor>
    <title>Envisioning the E-Quarium: Strategic Design Planning for the Monterey Bay Aquarium''s Website.</title>
    <pages>452-454</pages>
    <year>2000</year>
    <booktitle>Symposium on Designing Interactive Systems</booktitle>
    <series> <--declared with ANY in DTD
    <href>db/conf/eld.htm</href>
    <source>Information Retrieval</source>
    </series>
    </pro_book>
    </proceedings>
    </conference>
    I want to create DB schema from this document, but because I don't know how the document is stored in Oracle8i with object-relational schema when the document has more two level deep.
    (In sample of XSU,all XML documents has only one level deep.)
    Would you create schema from above simple document,please? It will be very helpful to me!!
    Thank you for reading my e-mail.

    Just stop using it and remove any data from your profile that you don't want there. You can't actually remove your account or your old posts from the server.
    If you have registered to have notification emails sent to you, click 'My Stuff' at top right, select 'Preferences' , then in the next page select the 'Email Notification Preferences' tab and click all the 'No' radio buttons. Then click 'Save'.
    If you already have notifications set on some threads you will still get emails from them. Click on your username at the top, then under 'Actions' in the right sidebar, select "'Manage email notifications.' This will show the threads you've set up notifications on in the past. Select those you want to stop and click the 'Remove Selected Notifications' button at bottom.

  • How to Create Hierarchy From Flat file Structure

    Hi Gurus,
    There is a scenario for me regarding the Hierarchy.
    Required Hierarchy structure - Region>Director>Manager-->Sales id
    I have flat file which gives the info like user id , sales id , manager id, director id.
    But the transaction data Flat file has structure with sales id, region id, sales amt, sales qty.
    Note : Region id is another Master Data.
    How i can create hierarchy from the first flat file which doesnot have region info in that but it is available in the transaction data Flat file.
    Is there anyway we can create hierarchy based on the first Flat file structure which contains more that 1,00,000 records.
    Try to Suggest me in this regard .
    This is urgent.
    Regards,
    Mano

    Hi Mano,
                    Defining the source system from which to load data
    Choose the source system tree File  ® Create.
           2.      Defining the InfoSource for which you want to load data
    Optional: choose InfoSource Tree ® Root (InfoSources) ® Create Application Components.
    Choose InfoSource Tree ® Your Application Component ® Other Functions  ® Create InfoSource 3.x ® Direct Update.
    Choose an InfoObject from the proposal list, and specify a name and a description.
           3.      Assigning the source system to the InfoSource
    Choose InfoSource Tree ® Your Application Component ® Your InfoSource ® Assign Source System. The transfer structure maintenance screen appears.
    The system automatically generates DataSources for the three different data types to which you can load data.
    &#9675;       Attributes
    &#9675;       Texts
    &#9675;       Hierarchies (if the InfoObject has access to hierarchies)
    The system automatically generates the transfer structure, the transfer rules, and the communication structure (for attributes and texts).
           4.      Maintaining the transfer structure / transfer rules
    Select the DataSource for uploading hierarchies.
    IDoc transfer method: The system automatically generates a proposal for the DataSource and the transfer structure. This consists of an entry for the InfoObject for which hierarchies are loaded. With this transfer method, the structure is converted to the structure of the PSA during loading, which affects performance.
    PSA transfer method: The transfer methods and the communication structure are also generated here.
           5.      Maintaining the hierarchy
    Choose Hierarchy Maintenance, and specify a technical name and a description of the hierarchy
    Hope this helps
    Regards
    Karthik
    Assign points if Helpful

  • How to create BP from existing vendors optionally?

    Hi,
    how can I create RE business partners from existing vendors for some optional vendors only?
    Does the vendor synchronization (Cross-Application Components - Master Data Synchronization - Customer/Vendor Integration) mean that a BP is created for each vendor in the specific account group?
    I've tried to define the configuration settings but haven't found the solution for this yet. Please advise.
    - BP grouping assigned to number range
    - one FI account group is assigned to BP grouping
    - BP role (BP role category, BP view) defined
    - in Vendor role link, is the assignment of Role category "optional"?
    Thanks!

    Hi,
    thanks for your comment.  I need to check this option too. 
    However, in this case this does not seem like the best option regarding the workload of users. If they have already xxx vendors in FICO, it does not seem like a very efficient way to create those first also as BP, and then link these records.
    It would be much easier to only create the BP based on vendor data with FLBPC1, and save the double work.
    Based on SAP documentation, I've understood that FLBPC1 Create BP from vendor is meant for this purpose, so I would like to use this option.
    Please advise. Has anyone used FLBPC1 Create BP from vendor successfully?
    Thanks!

  • How to create ldapusers from DSCC

    hi
    I have installed and configured sun java directory server enterprise edition6 successfully. Also i have uploaded /etc/passwd and /etc/shadow file from Ldap clients.I can login by that users.My problem is by directory server control center, I have created some users.But by these users i cant login to the clients.
    I want to how to create ldap users from DSCC.

    You can't create groups in the contacts app on the iPad. You can do it in iCloud.com using a web browser on your computer, but you will not be able to email to those groups with the mail app on the iPad. The functionality doesn't exist in iOS with the built in apps.
    There are third party email apps that will allow you to do this. Look at one of these.
    MailShot- Group Email Done Right! for iPhone, iPod touch, and iPad ...
    Group Email! Mail Client with Attachments and Cloud Services for ...

  • How to Create PR from exeternal SQL Server through IDOC

    Dear all,
    I am in trouble while creating PR from exeternal SQL Server through IDOC . although I have created PR from TCODE we19 giving input as well as from function writen below
    My scnerio is from external system(Sql) want to send data to sap to create PR return PR No to SQl Server
    Not having idea how to do
    Basic Type for Idoc : PREQCR01
    Message Type       : PREQCR
    Function Module    : BAP_Idoc_Input1
    Thanxs in Advance

    if you have XI installed,
    than it would be easy,
    just use JDBC channel->XI->SAP IDOC.
    otherwise,
    you can export the table from the SQL to CSV file,
    and import it with LSMW with IDOC PREQCR01.

Maybe you are looking for

  • Ipod Touch 4G IOS 5.0.1 Stuck on Apple Logo

    This morning I woke up and downloaded a large game and a message came up and it said running out of disk space and it would'nt let me stop the download so I rebooted it and my Ipod the apple logo stayed. So i plugged it in to itunes and hit restore a

  • What is/are the diagram just one step before coding?

    My question above is quite clear. I would like to know what is/are the diagram (in UML) one step before coding? The sequence diagram for coding, does it need to include details? i mean detail here is implementation detal. For example, if my GUI is us

  • Very Strange exception in JMS in JBoss, EJB3

    My Client program is: env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NameingContextFactory"); env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:jnp.interfaces"); env.put(Context.PROVIDER_URL,"jnp://localhost:1099"); QueueConnectionFacto

  • Comments (Sticky Notes) Compatibility Across Platforms

    If I "Enable for commenting and analysis in Adobe Reader" whilst in Acrobat Pro running on a Mac, I can open the subsequent PDF file in Adobe Reader on a Mac and add Sticky Notes without a problem. If I open the same file on a Windows platform, using

  • Country Settings won't let me install Spotify Music

    Hello everyone I used to have Spotify on my Iphone. This April I bought the Samsung Galaxy S5 and Spotify worked properly until the new Update (Spotify Music) arrived. Since then I can't install the app because of my country situation. I didn't move