Sending public key to not java application

Hi,
I'm trying to send through a socket connection a public key encoded on X.509 standard, but the key.getEncoded() method returns a array of bytes,How can I convert this array of bytes to a sequence of characters that can be readable by any not java application???Is possible to make this public key readable for any not java application??How can I do that??
How can I send the public key to a not java application??
Thanks.

Thanks for helping, but if I use Base64 encoding does the client have to use a base64 decoder before having to use the public key??
The major problem is that my client is a perl application that uses openSSL, I think it will not understand the key if I send it in Base64(the perl application uses a openSSL API to make the received public key in X.509 back to public key)...

Similar Messages

  • ArchiveLink security: sending public key certificate by SCMS_HTTP_PUT_CERT

    Hello!
    I have a question which I asked on ESA and Security forums and didn't get answer.
    I am trying to do a test program to check ArchiveLink security features. Namely, I am calling the function SCMS_HTTP_PUT_CERT which is supposed to send a public key certificate via HTTP. However, when I catch this call and want to import the certificate by using the function SSFC_PUT_CERTIFICATE, I get error message <i>SSF kernel error: invalid parameter</i>.
    Does anyone have experience with this?
    For more detailed description of my attempt, please see ArchiveLink security: sending public key certificate.
    Thanks and regards,
    Igor

    Hi
    SCMS_HTTP_PUT_CERT is used to send sap public key to Content server application. The  content server application makes use of this key to verify the incoming request ie the Content Server uses the public key to check URIs and signatures.
    SAP uses the Public/Private key security concept while communicating with Content server. Basically when SAP communicates with Content server it will be sending GET, PUT, POST requests. The URL from SAP will have field called secKey which contains the security key. secKey ensures that a URL cannot be changed after it has been generated by the SAP system. The private key is used by SAP to generate the secKey.
    The content server application will use the public key provided via SCMS_HTTP_PUT_CERT to check the URL and will be able to detect if the URL has been tampered.
    Refer SAP Content Server HTTP 4.5 Interface documentation  section Security for more details.
    http://help.sap.com/saphelp_nw04/helpdata/en/9b/e8c186eaf811d195580000e82deb58/frameset.htm
    Hope this helps
    Cheers,
    Samanjay
    Message was edited by:
            Samanjay Shenoy

  • AD CS Web Enrollment Error - "public key does not meet the minimum size required"

    I've installed a standalone root CA and a enterprise subordinate CA in our environment - both are Windows 2008 R2. Everything is working except for Web Enrollment using a custom User template. I duplicated the default User template and choose
    2003 Compatible for the new one. I changed the minimum key length to 2048 and set the validity period to 2 years.
    We'd like to avoid using the Advanced Certificate Request page, so I modified certrqtp.inc to point to the new template:
    Else
    ' Request types for enterprise
    rgAvailReqTypes(0,FIELD_TEMPLATE)="User-custom"
    rgAvailReqTypes(0,FIELD_FRIENDLYNAME)=L_UserTemplateCert_Text
    rgAvailReqTypes(0,FIELD_CSPLIST)="Microsoft Enhanced Cryptographic Provider v1.0?Microsoft Base Cryptographic Provider v1.0"
    rgAvailReqTypes(0,FIELD_CSPLIST2)="Microsoft Base Cryptographic Provider v1.0?Microsoft Enhanced Cryptographic Provider v1.0"
    rgAvailReqTypes(0,FIELD_EXPORTABLE)="True"
    nAvailReqTypes=1
    End If
    I also ran into this issue where Web Enrollment jumps straight to the Advanced page if the original User template isn't present on the CA:
    http://social.technet.microsoft.com/Forums/en/winserversecurity/thread/9ab514bc-1f9f-424e-b70d-705874d9c623
    So I have both User templates loaded on the CA, and I get this error back when attempting a certificate request using IE 8 or 9:
    Your certificate request was denied.
    Your Request Id is 25. The disposition message is "Denied by Policy Module".
    Contact your administrator for further information.
    Looking at the CA's Failed Requests section, I see this error:
    The public key does not meet the minimum size required by the specified certificate template. 0x80094811 (-2146875375)
    I double-checked our custom template and it does specify 2048 as the minimum key size.
    Also, when trying with Chrome 11.0, I get an extra option during enrollment asking for a key size (1024 or 2048). When I choose 2048, the certificate request succeeds. I don't get the key size option when using IE, though.
    We'd like to get this working with IE if possible. Any ideas?

    We had the same error message. The problem turned out to be on the requesting computer, not the server. When we went to renew a cert in IIS on a server it was generating a 1028-bit key request. Since the minimum on the server was set to 2048-bit
    the request failed. So, there's two ways to handle this. You can change the certificate template on the server to have a minimum set to 1024-bit or you can have IIS submit a new request for a certificate and choose 2048-bit as the size of the key during the
    wizard. We opted to have IIS request a 2048-bit key. The same would apply for whatever computer, device, or software you are using to form the certificate request.
    Your message is pretty old, but I am running on the same problem right now. I've added a custom template to select (with 2048) minimum length, but the webpage from the IIS by default provides just 1024-bit. Where can i optimize the IIS to use a 2048-bit
    key when requesting the certificate?
    When I open the same site with Firefox for example, i got a listed option (Medium / High Strength) to choose for the encryption. It seems that the high strength is >= 2048-bit.

  • Can anybody tell me how to send/receive  the sms from java application

    Hi All,
    Can any body tell me, how to send/receive the sms from java application to mobile phones.
    I have installed the jsms engine and when i try to connect to the mobile device ,the jsms server is giving
    the following error.
    Cannot connect to GSM Device, error : -11

    Which jsms? Google finds several.
    Try the website where you downloaded it.

  • Can any body tell me, how to send/receive the sms from java application

    Hi All,
    Can any body tell me, how to send/receive the sms from java application to mobile phones.
    I have installed the jsms engine and when i try to connect to the mobile device ,the jsms server is giving
    the following error.
    Cannot connect to GSM Device, error : -11

    The best place to ask your question is at the JSMS website, forum or mailing list since this is no error that directly comes from a class belonging to the core Java classes.

  • How to grab global shortcuts keys in a java application?

    Hi!
    Does anybody know if it's possible to get the focus to a Java application, when it is not selected, using a keyboard shortcut key?
    I've written a java application that provides shortcuts keys (like CTRL-M...) for accessing to some operations. For using those keys combinations my application has to be focused between the other opened applications on the operating system (Linux 7.3), as it should be in a normal behaviour... but, I would need that the operation associated to the shortcut key could be executed even if another application had the focus...
    Is it possible? How this could be done?
    Thanks in advance four your interest and your answers.

    Unfortunately shortcuts will work only if your app is focused.
    Denis

  • Importing public key certificate from external application

    Hello!
    I am trying to implement the following scenario:
    1. External client application sends it's public key certificate to SAP WAS
    2. SAP imports this certificate into its PSE
    3. External client application sends digitally signed messages to SAP (with <i>secKey</i> HTTP call parameter)
    4. SAP checks this signature and does whatever further action.
    For simplicity reason, I emulated this "external app" by using the ArchiveLink interface of the very same SAP system. So, I have one system which is at the same time client and server, but the communication works via HTTP.
    I started with step 1: The ArchiveLink (in my case "external app") uses the function SCMS_HTTP_PUT_CERT to send the public key certificate to the client via HTTP. It worked well - I received the message with HTTP service and it contained some binary content as expected (valid public key certificate - I suppose).
    Unfortunately, I was unsuccessfull with step 2: How to import the received certificate into my PSE?
    I debugged the STRUST transaction and saw that it uses the function SSFP_PUTCERTIFICATE to import public key certificate into SAP's own PSE. However, when I try to use it, I get error <i>No temporary PSE available</i>. I also tried to <i>encode-base64</i> this message with the same result. What does this mean?
    Does anyone has experience with this? Please share it.
    Thanks in advance and kind regards,
    Igor

    The key point was understanding the cleverly named parameter PROFILE in the function SSFC_PUT_CERTIFICATE. You'd never guess: it's a path to a PSE where you want to put the certificate, in my case: C:\usr\sap\NSP\DVEBMGS00\sec\SAPSYS.pse. There's one more step: updating database with the file system PSE.
    So, the test sequence that works is:
    1. SSFP_GETSAPCERTIFICATE
    2. SSFC_PUT_CERTIFICATE
    3. SSFPSE_STORE
    Regards,
    Igor
    P.S. Am I the only one playing with these things? I keep getting 0 replies to my questions.

  • I want to send an email  from my java application

    i want to send an email from my java application

    Then do so...
    You'll probably want to use the JavaMail API (http://java.sun.com/products/javamail) to do that.

  • IOS 6.1 S/MIME public key does not install

    Hi;
    After an upgrade I am not able to install the key from an email. Previously this worked fine, and I would "view" the certificate and install the profile as it is called. But, now it does actually show the "intstall" button, but you cann not get it to press or install. The certificate is marked as trusted. Which I beleive indicates they have the chain correct.
    The same person sends email to my Macbook and Apple Mail collects the key and put that into Keychain. So, it must be something on iOS6.1??

    Thank you for the update!
    Next I would recommend backing up your iPad to iTunes and restoring the device with this article
    iOS: How to back up and restore your content
    http://support.apple.com/kb/HT1766
    If the issue persists then thank you for using the Apple Support Community. Due to the nature of your issue you may find more information by using another one of Apple's support resources - https://expresslane.apple.com/GetproductgroupList.action.
    Take care,
    Sterling

  • Java-Application send a param value to a JSP

    Hi All
    I'd like to ask you if can possible to send a param value from Java-Application to JSP file, If yes please provide me with any example or notes. I know that there are a contribution for a communication with an applet to JSP, but with application i don't know.
    Thank you

    Check this out...
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets5.html#73895

  • Unable to retrieve public key and signature.

    Hi,
    I'am trying to send public key and signature from one client to another via server.
    Both pub_key and signature are encrypted into base64. But i cant retrieve them correctly in server side.
    I'am using ECDSA to sign message key_length 224bit. Sending and retrieving data via sockets.
    SEND DATA FUNCTION Client.java
    private static PrintWriter      output_stream = null;
    private static Scanner      input_stream           = null;
    private static void send_message(String message)
         if(user_name != null
              && message_text_area.getText().equals(SERVER_CLOSED) == false
              && message_text_area.getText().equals(SERVER_CONNECTED) == false
              && message_text_area.getText().equals(MAX_USERS_ONLINE) == false
              && message_text_area.getText().equals(CONNECTION_CLOSED) == false
              && message_text_area.getText().equals(GET_USER) == false
              && message_text_area.getText().equals(REMOVE_USER) == false
              && message_text_area.getText().equals(USER_EXISTS) == false
              && message_text_area.getText().equals(USER_NICK) == false){   
             String signature = new BASE64Encoder().encode(ecdsa_parameters.sign_message(SESSION_KEY_PAIR.getPrivate(), message_text_area.getText().trim()));
             String public_key = new BASE64Encoder().encode(SESSION_KEY_PAIR.getPublic().getEncoded());
             if (signature != null && SESSION_KEY_PAIR != null){
              synchronized(output_stream)
                  output_stream.println(USER_NICK);
                  output_stream.println(user_name);
                  output_stream.println(user_nick);
                  output_stream.println(message_text_area.getText().trim());
                        //PUblic key and signature in base64
                        output_stream.println(public_key);     
                  output_stream.println(signature);
                    //length and data of them
              System.out.println(public_key.length());
              System.out.println(signature.length());          
              System.out.println(public_key);
              System.out.println(signature);
              append_message(user_nick+": "+message_text_area.getText().trim());
              message_text_area.setText(null);
             }else{
              append_message("E_C_002: Unable to generate keys or signature.");
         }else{
             append_message("User is not selected or incorrect message");
        }HANDLER.JAVA (SERVER SIDE RETRIEVE)
    private Scanner           input_data           = null;
    private PrintStream      output_data           = null;
    if(recieved_data.equals(USER_NICK)){
                   String user_name = input_data.nextLine();
                   String user_nick = input_data.nextLine();
                   String message = input_data.nextLine();
                   String public_key = "";
                   for (int i=0; i<5; i++){
                       if(i == 0){
                        public_key = public_key+""+input_data.next();
                       }else{
                        public_key = public_key+"\n"+input_data.next();
                   String signature = "";
                   for (int i=0; i<2; i++){
                       if(i == 0){
                        signature = signature+""+input_data.next();
                       }else{
                        signature = signature+"\n"+input_data.next();
                            //output length and data of key and signature
                   System.out.println(public_key.length());
                   System.out.println(signature.length());
                   System.out.println(public_key);
                   System.out.println(signature);
                   Server.users_messages.addElement(user_name+""+SEPARATOR+""+user_nick+""+SEPARATOR+""+message+""+SEPARATOR+""+public_key+""+SEPARATOR+""+signature);               
              }It seems that length of key and signature in server side are different form client.
    Maybe I'am missing something that correspond sending data in base64????
    All project is here http://fmf.vtu.lt/~knugmanov/Elliptic%20curve%20cryptography%20instant%20messenger.rar
    (import into eclypse).
    For ECC I use iaik classes.
    Thanks in adv.
    Kiril

    here is a code from
    http://www.exampledepot.com/egs/java.security/GetKeyFromKs.html
    This example retrieves from a keystore, the private and public key associated with an alias.
    private and public key are having the same alias ?
    i know a alias for my key but i believe thats for private key not for public key ......is it true that both private and public key have the same alias ?
    and KeyPair is an interface and so its difficult to get a key out of it
    public KeyPair getPrivateKey(KeyStore keystore, String alias, char[] password) {
            try {
                // Get private key
                Key key = keystore.getKey(alias, password);
                if (key instanceof PrivateKey) {
                    // Get certificate of public key
                    java.security.cert.Certificate cert = keystore.getCertificate(alias);
                    // Get public key
                    PublicKey publicKey = cert.getPublicKey();
                    // Return a key pair
                    return new KeyPair(publicKey, (PrivateKey)key);
            } catch (UnrecoverableKeyException e) {
            } catch (NoSuchAlgorithmException e) {
            } catch (KeyStoreException e) {
            return null;
        }Message was edited by:
    Unknown_Citizen
    Message was edited by:
    Unknown_Citizen
    Message was edited by:
    Unknown_Citizen

  • Public Key Encryption

    Hi guys,
    I have to sign some data (a byte array) using a Public Key.
    How can I do that?
    (I know it's a bit strange..but I have to do this....)
    Thanks a lot...bye!!

    What you're really asking for is to do something with the data that only the owner of the Private Key can use. What you should be looking at is encryption with the Public Key and not Signing with the Public Key. You will find many examples on this forum, in the JCE web-pages at Sun and in David Hook's Book "Beginning Cryptography in Java".

  • Invalid Key Exception: Unsupported key type: Sun RSA public key, 1024 bits

    I am trying to retrieve certificates from Microsoft Keystore and extract its keys using SunMSCAPI in jdk 1.6. It gives me an invalid key exception, when I am trying to wrap the Symmetric key (which was previously used to perform AES encryption on data), using RSA algorithm.
    Code snippet:
               // RSA 1024 bits Asymmetric encryption of Symmetric AES key             
                // List the certificates from Microsoft KeyStore using SunMSCAPI.
                      System.out.println("List of certificates found in Microsoft Personal Keystore:");
                       KeyStore ks = KeyStore.getInstance("Windows-MY", "SunMSCAPI");
                       ks.load(null, null) ;
                       Enumeration en = ks.aliases() ;
                       PublicKey RSAPubKey = null;
                       Key RSAPrivKey = null;
                       int i = 0;
                       while (en.hasMoreElements()) {
                            String aliasKey = (String)en.nextElement() ;              
                            X509Certificate c = (X509Certificate) ks.getCertificate(aliasKey) ;     
                            String sss = ks.getCertificateAlias(c);
                            if(sss.equals("C5151997"))
                            System.out.println("---> alias : " + sss) ;
                            i= i + 1;
                            String str = c.toString();
                            System.out.println(" Certificate details : " + str ) ;
                          RSAPubKey = c.getPublicKey();
                            RSAPrivKey = ks.getKey(aliasKey, null);  //"mypassword".toCharArray()
                            Certificate[] chain = ks.getCertificateChain(aliasKey);     
                       System.out.println("No of certificates found from Personal MS Keystore: " + i);
                // Encrypt the generated Symmetric AES Key using RSA cipher      
                        Cipher rsaCipher = Cipher.getInstance("RSA/ECB/PKCS1Padding", ks.getProvider().getName());            
                       rsaCipher.init(Cipher.WRAP_MODE, RSAPubKey);
                       byte[] encryptedSymmKey = rsaCipher.wrap(aeskey);   
                       System.out.println("Encrypted Symmetric Key :" + new String(encryptedSymmKey));
                       System.out.println("Encrypted Symmetric Key Length in Bytes: " + encryptedSymmKey.length);
                       // RSA Decryption of Encrypted Symmetric AES key
                       rsaCipher.init(Cipher.UNWRAP_MODE, RSAPrivKey);
                       Key decryptedKey = rsaCipher.unwrap(encryptedSymmKey, "AES", Cipher.SECRET_KEY);Output:
    List of certificates found in Microsoft Personal Keystore:
    ---> alias : C5151997
    Certificate details : [
    Version: V3
    Subject: CN=C5151997, O=SAP-AG, C=DE
    Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
    Key: Sun RSA public key, 1024 bits
    modulus: 171871587533146191561538456391418351861663300588728159334223437391061141885590024223283480319626015611710315581642512941578588886825766256507714725820048129123720143461110410353346492039350478625370269565346566901446816729164309038944197418238814947654954590754593726047828813400082450341775203029183105860831
    public exponent: 65537
    Validity: [From: Mon Jan 24 18:17:49 IST 2011,
                   To: Wed Jan 23 18:17:49 IST 2013]
    Issuer: CN=SSO_CA, O=SAP-AG, C=DE
    SerialNumber: [    4d12c509 00000005 eb85]
    Certificate Extensions: 6
    [1]: ObjectId: 2.5.29.14 Criticality=false
    SubjectKeyIdentifier [
    KeyIdentifier [
    0000: 07 E5 83 A1 B2 B7 DF 6B 4B 67 9C 1D 42 C9 0D F4 .......kKg..B...
    0010: 35 76 D3 F7 5v..
    [2]: ObjectId: 2.5.29.35 Criticality=false
    AuthorityKeyIdentifier [
    KeyIdentifier [
    0000: E4 C4 2C 93 20 AF DA 4C F2 53 68 4A C0 E7 EC 30 ..,. ..L.ShJ...0
    0010: 8C 0C 3B 9A ..;.
    [3]: ObjectId: 1.3.6.1.4.1.311.21.7 Criticality=false
    Extension unknown: DER encoded OCTET string =
    0000: 04 30 30 2E 06 26 2B 06 01 04 01 82 37 15 08 82 .00..&+.....7...
    0010: D1 E1 73 84 E4 FE 0B 84 FD 8B 15 83 E5 90 1B 83 ..s.............
    0020: E6 A1 43 81 62 84 B1 DA 50 9E D3 14 02 01 64 02 ..C.b...P.....d.
    0030: 01 1B ..
    [4]: ObjectId: 2.5.29.17 Criticality=false
    SubjectAlternativeName [
    RFC822Name: [email protected]
    [5]: ObjectId: 2.5.29.15 Criticality=true
    KeyUsage [
    DigitalSignature
    Non_repudiation
    Key_Encipherment
    Data_Encipherment
    [6]: ObjectId: 2.5.29.19 Criticality=true
    BasicConstraints:[
    CA:false
    PathLen: undefined
    Algorithm: [SHA1withRSA]
    Signature:
    0000: B3 C5 92 66 8D D7 ED 6D 51 12 63 CC F4 52 18 B9 ...f...mQ.c..R..
    0010: B8 A6 78 F7 ED 7D 78 18 DA 71 09 C9 AE C8 49 23 ..x...x..q....I#
    0020: F5 32 2F 0F D1 C0 4C 08 2B 6D 3C 11 B9 5F 5B B5 .2/...L.+m<.._[.
    0030: 05 D9 CA E6 F9 0A 94 14 E7 C6 7A DB 63 FE E5 EC ..........z.c...
    0040: 48 94 8C 0D 77 92 59 DE 34 6E 77 1A 24 FE E3 C1 H...w.Y.4nw.$...
    0050: D8 0B 52 6A 7E 22 13 71 D7 F8 AF D1 17 C8 64 4F ..Rj.".q......dO
    0060: 83 EA 2D 6A CA 7F C3 84 37 15 FE 99 73 1D 7C D1 ..-j....7...s...
    0070: 6D B4 99 09 62 B9 0F 18 33 4C C6 66 7A 9F C0 DB m...b...3L.fz...
    No of certificates found from Personal MS Keystore: 1
    Exception in thread "main" java.security.InvalidKeyException: Unsupported key type: Sun RSA public key, 1024 bits
    modulus: 171871587533146191561538456391418351861663300588728159334223437391061141885590024223283480319626015611710315581642512941578588886825766256507714725820048129123720143461110410353346492039350478625370269565346566901446816729164309038944197418238814947654954590754593726047828813400082450341775203029183105860831
    public exponent: 65537
         at sun.security.mscapi.RSACipher.init(RSACipher.java:176)
         at sun.security.mscapi.RSACipher.engineInit(RSACipher.java:129)
         at javax.crypto.Cipher.init(DashoA13*..)
         at javax.crypto.Cipher.init(DashoA13*..)
         at com.sap.srm.crpto.client.applet.CryptoClass.main(CryptoClass.java:102)
    Edited by: sabre150 on 18-Jul-2011 03:47
    Added [ code] tags to make code readable.

    A bit of research indicates that the classes of the keys obtained by
                          RSAPubKey = c.getPublicKey();
                               RSAPrivKey = ks.getKey(aliasKey, null);  //"mypassword".toCharArray()are sun.security.rsa.RSAPublicKeyImpl and sun.security.*mscapi*.RSAPrivateKey . It seems that for Cipher objects from the SunMSCAPI provider cannot accept RSA public keys of class sun.security.rsa.RSAPublicKeyImpl and that the SunMSCAPI will only accept RSA private keys of class sun.security.mscapi.RSAPrivateKey.
    This came up under different guise a couple of years ago. It makes sense since encrypting/wrapping with a public key does not represent a security problem (there is nothing secret in any of the encryption operations) when done outside of MSCAPI so one can use any provider that has the capability BUT the decryption/unwrapping must be done with the SunMSCAPI provider which delegates it to the MSCAPI.
    My working test code based on your code implementing this approach is :
            // RSA 1024 bits Asymmetric encryption of Symmetric AES key             
            // List the certificates from Microsoft KeyStore using SunMSCAPI.
            System.out.println("List of certificates found in Microsoft Personal Keystore:");
            KeyStore ks = KeyStore.getInstance("Windows-MY", "SunMSCAPI");
            ks.load(null, null);
            Enumeration en = ks.aliases();
            PublicKey RSAPubKey = null;
            Key RSAPrivKey = null;
            int i = 0;
            while (en.hasMoreElements())
                String aliasKey = (String) en.nextElement();
                X509Certificate c = (X509Certificate) ks.getCertificate(aliasKey);
                String sss = ks.getCertificateAlias(c);
                if (sss.equals("rsa_key")) // The alias for my key - make sure you change it back to your alias
                    System.out.println("---> alias : " + sss);
                    i = i + 1;
                    String str = c.toString();
                    System.out.println(" Certificate details : " + str);
                    RSAPubKey = c.getPublicKey();
             System.out.println(RSAPubKey.getClass().getName());
                   RSAPrivKey = ks.getKey(aliasKey, null);  //"mypassword".toCharArray()
            System.out.println(RSAPrivKey.getClass().getName());
                    Certificate[] chain = ks.getCertificateChain(aliasKey);
            System.out.println(ks.getProvider().getName());
            System.out.println("No of certificates found from Personal MS Keystore: " + i);
            Cipher rsaCipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");//, ks.getProvider().getName());       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                rsaCipher.init(Cipher.WRAP_MODE, RSAPubKey);
            byte[] keyBytes =
                1, 2, 3, 4, 5, 6, 7, 8, 2, 3, 4, 5, 6, 7, 8, 9
            SecretKey aeskey = new SecretKeySpec(keyBytes, "AES");
            byte[] encryptedSymmKey = rsaCipher.wrap(aeskey);
            System.out.println("Encrypted Symmetric Key :" + Arrays.toString(encryptedSymmKey));
            System.out.println("Encrypted Symmetric Key Length in Bytes: " + encryptedSymmKey.length);
            // RSA Decryption of Encrypted Symmetric AES key
            Cipher unwrapRsaCipher = Cipher.getInstance("RSA/ECB/PKCS1Padding", ks.getProvider().getName());       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            unwrapRsaCipher.init(Cipher.UNWRAP_MODE, RSAPrivKey);
            Key decryptedKey = unwrapRsaCipher.unwrap(encryptedSymmKey, "AES", Cipher.SECRET_KEY);
            System.out.println("Decrypted Symmetric Key :" + Arrays.toString(decryptedKey.getEncoded())); // Matches the 'keyBytes' above

  • How to get Public Key Remainder?

    Hi Friends..
    Sorry, i have a little doubt regarding the Public Key Remainder..
    What is Public Key Remainder used for?.. is it a part of Public Key?.. How to get it from Public Key, especially in Java?
    As far as i know that the Public Key is constructed with Modulus and Exponent, and with this we can Encrypt and Verify data was signed by Private Key..
    In Java, we can expose Public Key's modulus and public exponent using RSAPublicKey, there's no method to expose Public Key's Remainder..
    Please help me regarding this..
    Thanks

    Leonardo Carreira wrote:
    Hi Shane,
    Thanks for your reply.. :)
    safarmer wrote:
    In that case the exponent and remainder are you public key (exponent and modulus) and the certificate is defined in the definitions section of Book 3. It is a secure way of verifying the public key and it's owner through a trusted certification authority.
    EMV Book 3 tends to use Remainder and Modulus interchangeably.You mean, the Issuer (in this case one of E,M, and V) should provide 2 certificates for 1 card?..
    This is implemented on SDA or DDA?..
    Sorry, i'm still have no idea..
    The Remainder and Modulus should be used interchangeably?..
    How the Host and Card can decides in each transaction whether it will use Remainder or Modulus?..I mean that the terminology is used interchangeably. They refer to the same thing as far as the actual key is concerned.
    Cheers,
    Shane

  • Cannot send a null Map key for type 'java.util.HashMap'

    Hi All,
      I am haing an issue with sending data from Server to the client using the AMF Channel.
      Most of the method invocations on the RemoteObject are throwing the following Exception.
    [CODE]
    (mx.rpc.events::FaultEvent)#0
      bubbles = false
      cancelable = true
      currentTarget = (null)
      eventPhase = 2
      fault = (mx.rpc::Fault)#1
        content = (null)
        errorID = 0
        faultCode = "Server.Processing"
        faultDetail = (null)
        faultString = "Cannot send a null Map key for type 'java.util.HashMap'."
        message = "faultCode:Server.Processing faultString:'Cannot send a null Map key for type 'java.util.HashMap'.' faultDetail:'null'"
        name = "Error"
        rootCause = (null)
      headers = (null)
      message = (mx.messaging.messages::ErrorMessage)#2
        body = (null)
        clientId = "22E55FB1-910E-312F-E37A-ED5167139CB0"
        correlationId = "4DB54224-662A-C596-D165-F7C3EBB64DB8"
        destination = "TimeMap"
        extendedData = (null)
        faultCode = "Server.Processing"
        faultDetail = (null)
        faultString = "Cannot send a null Map key for type 'java.util.HashMap'."
        headers = (Object)#3
        messageId = "22E56255-D62F-2ACF-4DA5-CF1E4D6353BB"
        rootCause = (null)
        timestamp = 1266877198902
        timeToLive = 0
      messageId = "22E56255-D62F-2ACF-4DA5-CF1E4D6353BB"
      statusCode = 0
      target = (null)
      token = (mx.rpc::AsyncToken)#4
        message = (mx.messaging.messages::RemotingMessage)#5
          body = (Array)#6
          clientId = (null)
          destination = "TimeMap"
          headers = (Object)#7
            DSEndpoint = "my-amf"
            DSId = "22E53936-7E0E-B21C-C936-EF1078000306"
          messageId = "4DB54224-662A-C596-D165-F7C3EBB64DB8"
          operation = "getMapKey"
          source = (null)
          timestamp = 0
          timeToLive = 0
        responders = (Array)#8
          [0] (com.universalmind.cairngorm.events::Callbacks)#9
            conflictHandler = (null)
            faultHandler = (function)
            priority = 0
            resultHandler = (function)
        result = (null)
      type = "fault"
    [CODE]
    The Spring bean which is exposed as a Remote Object has the following method signature..
    [CODE]
    public String getMapKey() {
            return mapKey;
    [/CODE]
    I am unable to understand why AMF Channel or Blaze DS is treating the String as HashMap !!!
    This was working pefectly fine till yesterday !!
    The version of the BlazeDS i am using is : blazeds_turnkey_3-0-0-544
    and the Flex SDK Version is : flex_sdk_3.5.0.12683
    We recently upgraded to Flex 3.5.0 version earlier we were using 3.3 version
    Thanks
    mars

    Hi All,
    I chcked my server side java beans ( which are managed by Spring) and they are all returning the data property and none of the Keys in the returned hashmaps are null.
    Not sure why this is happening.
    Thanks
    kumars

Maybe you are looking for

  • Customizing request & Workbench request

    Dear all,                 What is the differance between Customizing Request & workbench request?

  • CS3 won't print

    I've suddenly run into a situation where PS CS3 won't print. The Print dialog comes up as usual, but after making the selections and hitting Print, the print job never makes it to the printer(s).I'm using Epson printers and running Mac OSX Leopard. I

  • 10.9.2 Mail not working correctly

    I'm the only person in the office to upgrade to 10.9.2 (thankfully!). Since then, Mail has not worked correctly. It is an IMAP account. When I click on an existing message in my inbox, instead of displaying instantly it takes 3-4 seconds. The screen

  • Saving and then populating the vi when loading

    Hello, what i have is a vi that if i seclect a boolean control to be true then an array value will go into a string indicator.  the boolean controls that are selected are then put into a boolean array.  what i would like to do is save the the string

  • Displaying date as period in screen period

    Dear gurus , I have a field in a screen that i made that is date . Now i want to display it as period . For example if it is 10.12.2008 to be as 12.2008 . I use the FM 'PERIOD_AND_DATE_CONVERT_OUTPUT' but it doesn't work . It display the date like  '