How to know supported encryption/sign algorithms in a Javacard

Algorithm School

Moderator: UNKNwYSHSA

User avatar
NikerCR
Posts: 10
Joined: Fri Jun 19, 2015 6:49 am
Points :15
Contact:

How to know supported encryption/sign algorithms in a Javacard

Post by NikerCR » Fri Jun 19, 2015 7:05 am

As the subject mentioned, how can i know all the encryption algorithms the Javacard supports?
One way.

User avatar
horse dream
Posts: 76
Joined: Thu May 21, 2015 11:48 pm
Points :136
Contact:

Re: How to know supported encryption/sign algorithms in a Javacard

Post by horse dream » Thu Jul 02, 2015 4:39 am

The code below can check the specified algorithm your card supports or not. If the algorithm is supported, the instance creation will succeed. Otherwise,CryptoException.NO_SUCH_ALGORITHM is thrown. e.g. ALG_DES_CBC_NOPAD algorithm:

Code: Select all

try {
    m_cipher = Cipher.getInstance(ALG_DES_CBC_NOPAD, false);
    supported = true;
   }
catch (CryptoException e) {
    if (e.getReason() == CryptoException.NO_SUCH_ALGORITHM))
           {
             supported = false;
            }
   else {
             // other errors
         }
   }

User avatar
NikerCR
Posts: 10
Joined: Fri Jun 19, 2015 6:49 am
Points :15
Contact:

Re: How to know supported encryption/sign algorithms in a Javacard

Post by NikerCR » Thu Jul 02, 2015 5:04 am

That's so nice of you. But,it takes too long to test all the possible algorithms successively . Is there any method to know all the algorithms supported by the given card at a time ?
One way.

User avatar
horse dream
Posts: 76
Joined: Thu May 21, 2015 11:48 pm
Points :136
Contact:

Re: How to know supported encryption/sign algorithms in a Javacard

Post by horse dream » Thu Jul 02, 2015 5:32 am

Of course,you can see JavaCard Algorithms Support Test Tool, which can meet your need. Hope to help you.

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3037
Contact:

Re: How to know supported encryption/sign algorithms in a Javacard

Post by UNKNwYSHSA » Tue Aug 25, 2015 8:52 am

So simple, ask your card provider. If you did not know the card provider, you can only test yourself.
sense and simplicity

User avatar
NikerCR
Posts: 10
Joined: Fri Jun 19, 2015 6:49 am
Points :15
Contact:

Re: How to know supported encryption/sign algorithms in a Javacard

Post by NikerCR » Tue Aug 25, 2015 11:50 pm

UNKNwYSHSA wrote:So simple, ask your card provider. If you did not know the card provider, you can only test yourself.

Hi,UNKNwYSHSA
Thanks for your answer anyway.
One way.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 2 guests

JavaCard OS : Disclaimer