Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.android.javacard.keymaster;

import com.android.javacard.keymaster.KMCipher;
import javacardx.crypto.Cipher;

public class KMCipherImpl extends KMCipher{
Cipher cipher;
short cipherAlg;
short paddingAlg;
KMCipherImpl(Cipher c){
cipher = c;
}

@Override
public short doFinal(byte[] buffer, short startOff, short length, byte[] scratchPad, short i) {
return cipher.doFinal(buffer, startOff, length, scratchPad, i);
}

@Override
public short getCipherAlgorithm() {
return cipherAlg;
}

@Override
public void setCipherAlgorithm(short alg) {
cipherAlg = alg;
}
@Override
public short update(byte[] buffer, short startOff, short length, byte[] scratchPad, short i) {
return cipher.update(buffer,startOff,length,scratchPad,i);
}

@Override
public short getPaddingAlgorithm() {
return paddingAlg;
}

@Override
public void setPaddingAlgorithm(short alg) {
paddingAlg = alg;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

package com.android.javacard.keymaster;

public class KMCryptoProviderImpl {
public static KMCryptoProvider instance(){
return new KMJcardSimulator();
}
}
Loading