java.security.NoSuchAlgorithmException: no such algorithm: SHA1WITHRSA for provider BC - bouncycastle

I try verifying PKCS#7 Signature by this following code:
public static void verifypkcs7(String content, byte[] signedBytes) throws OperatorCreationException, CMSException, IOException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, CertStoreException, NoSuchStoreException
{
Security.addProvider(new BouncyCastleProvider());
CMSProcessableByteArray cmsByteArray = new CMSProcessableByteArray(content.getBytes("UTF-8"));
CMSSignedData sp = new CMSSignedData(cmsByteArray, signedBytes);
Store certStore = sp.getCertificates();
SignerInformationStore signers = sp.getSignerInfos();
Collection<?> c = signers.getSigners();
Iterator<?> it = c.iterator();
boolean verified = false;
while (it.hasNext())
{
SignerInformation signer = (SignerInformation)it.next();
Collection<?> certCollection = certStore.getMatches(signer.getSID());
Iterator<?> certIt = certCollection.iterator();
X509CertificateHolder cert = (X509CertificateHolder)certIt.next();
verified = signer.verify(new JcaSimpleSignerInfoVerifierBuilder().setProvider("BC").build(cert));
}
System.out.println(verified);
CMSProcessable signedContent = sp.getSignedContent() ;
byte[] originalContent = (byte[]) signedContent.getContent();
System.out.println(new String(originalContent));
}
and my problem is:
Exception in thread "main" org.bouncycastle.cms.CMSException: can't create digest calculator: exception on setup: java.security.NoSuchAlgorithmException: no such algorithm: SHA1WITHRSA for provider BC
at org.bouncycastle.cms.SignerInformation.doVerify(Unknown Source)
at org.bouncycastle.cms.SignerInformation.verify(Unknown Source)
at PKCS7Signer.verifypkcs7_4(PKCS7Signer.java:281)
at PKCS7Signer.main(PKCS7Signer.java:170)
Caused by: org.bouncycastle.operator.OperatorCreationException: exception on setup: java.security.NoSuchAlgorithmException: no such algorithm: SHA1WITHRSA for provider BC
at org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder$1.get(Unknown Source)
at org.bouncycastle.cms.SignerInformationVerifier.getDigestCalculator(Unknown Source)
... 4 more
Caused by: java.security.NoSuchAlgorithmException: no such algorithm: SHA1WITHRSA for provider BC
at sun.security.jca.GetInstance.getService(Unknown Source)
at sun.security.jca.GetInstance.getInstance(Unknown Source)
at java.security.Security.getImpl(Unknown Source)
at java.security.MessageDigest.getInstance(Unknown Source)
at org.bouncycastle.jcajce.NamedJcaJceHelper.createDigest(Unknown Source)
at org.bouncycastle.operator.jcajce.OperatorHelper.createDigest(Unknown Source)
... 6 more
The Exception caused at:
verified = signer.verify(new JcaSimpleSignerInfoVerifierBuilder().setProvider("BC").build(cert));
I have tried googling for solution but nothing helped. Can you help me, please?
Data I use for testing:
Signature: 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
Content: 5DDE879CDEB0623E018D0B67A227E67B
Unbase64 before use as the second parameter

Try this, but you should switch for older bouncy castle version. I used 1.45
byte[] signedData = ...;
byte[] originalData = ...;
CMSSignedDataParser parser = new CMSSignedDataParser(new CMSTypedStream(
new ByteArrayInputStream(originalData)), signedData);
parser.getSignedContent().drain();
CertStore certs = parser.getCertificatesAndCRLs("Collection", "BC");
SignerInformationStore signers = parser.getSignerInfos();
Collection<?> c = signers.getSigners();
Iterator<?> it = c.iterator();
while (it.hasNext()) {
SignerInformation signer = (SignerInformation) it.next();
Collection<?> certCollection = certs.getCertificates(signer.getSID());
Iterator<?> certIt = certCollection.iterator();
X509Certificate cert = (X509Certificate) certIt.next();
System.out.println("verify returns: " + signer.verify(cert, "BC"));
}

Related

Kafka Message Key - byte[] and String Simultaneously

I'm having a very confusing issue with Kafka - specifically trying to obtain the Key of a message.
The key seems to think it's both a String and a byte[]
The following code produces the exception below:
Map<String, Integer> topicCount = new HashMap<>();
topicCount.put(myConsumer.getTopic(), 1);
Map<String, List<KafkaStream<byte[], byte[]>>> consumerStreams = myConsumer.getConsumer().createMessageStreams(topicCount);
List<KafkaStream<byte[], byte[]>> streams = consumerStreams.get(myConsumer.getTopic());
System.out.println("Listening to topic " + myConsumer.getTopic());
for (final KafkaStream stream : streams) {
ConsumerIterator<String, byte[]> it = stream.iterator();
while (it.hasNext()) {
System.out.println("Message received from topic");
MessageAndMetadata<String, byte[]> o = it.next();
Object messageKey = o.key();
System.out.println("messageKey is type: " + messageKey.getClass().getName());
System.out.println("messageKey is type: " + messageKey.getClass().getCanonicalName());
System.out.println("o keyDecoder: " + o.keyDecoder());
System.out.println("Key from message: " + o.key()); //This throws exception - [B cannot be cast to java.lang.String
//System.out.println("Key as String: " + new String(o.key(), StandardCharsets.UTF_8)); //uncomment this compile Exception - no suitable constructor found for String(java.lang.String,java.nio.charset.Charset)
byte[] bytesIn = o.message(); //getting the bytes is fine
System.out.println("MessageAndMetadata: " + o);
///other code cut
}
}
Exception:
Listening to topic MyKafkaTopic
Message received from topic
messageKey is type: [B
messageKey is type: byte[]
o decoder: kafka.serializer.DefaultDecoder#2e0d0acd
[WARNING]
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: [B cannot be cast to java.lang.String
at com.foo.bar.KafkaCFS.process(KafkaCFS.java:153)
at com.foo.bar.KafkaCFS.run(KafkaCFS.java:63)
at com.foo.bar.App.main(App.java:90)
... 6 more
Maven:
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.10</artifactId>
<version>0.9.0.1</version>
</dependency>
If I uncomment the System.out line then I cannot even compile:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Dev/main/java/com/foo/bar/KafkaCFS.java:[152,56] no suitable constructor found for String(java.lang.String,java.nio.charset.Charset)
constructor java.lang.String.String(byte[],int) is not applicable
(argument mismatch; java.lang.String cannot be converted to byte[])
How is it that the compiler thinks the Key is a String (which is what I expected it to be) but that runtime it's a byte array?
What can I do to get the Key as a String?
Thanks,
KA.
This did not match! You are declare streams as KafkaStream<byte[], byte[]> and then you expect ConsumerIterator<String, byte[]> it = stream.iterator(); it should be ConsumerIterator<byte[], byte[]> it = stream.iterator(); to match generics. Then you can get o.key() and create a string from it via new String(o.key());
Better off setting KafkaStream generic parameter type is (byte[], byte[]). Try to change code like this:
ConsumerIterator<byte[], byte[]> it = stream.iterator();
while (it.hasNext()) {
String key = new String(it.next().key());
...
}

How do I get all the keys from a namespace?

How can I get all the keys from aerospike namespace like I can get keys from a map using map.keyset. I went through this link Aerospike: how do I get record key?. I did what was being told in the answers. I wrote the code with writePolicy.sendKey = true but i am still getting NULL when I display the key in scanCallback funtion.
Here is my code to write a record (any help would be appreciated)
def writeToAerospike(): Boolean = {
val host:Host = new Host("xx.xxx.xxx.xx", 3000)
val client = new AerospikeClient(new ClientPolicy,host)
val policy = new WritePolicy();
policy.sendKey = true;
policy.timeout = 50000;
if(client.isConnected()){
println("connection to aerospike client sucessful")
client.put(policy,new Key("test", "testSet", "1"),new Bin("name", "john"))
//verify if the record is entered correctly
println(client.get(policy,new Key("test", "testing", "1")).getValue("name"))
client.close()
return true
}
return false
}
I am using the code from this example to scan the records: http://www.aerospike.com/docs/client/java/usage/scan/scan.html
class ScanParallelTest extends ScanCallback {
private var recordCount: Int = _
def runTest() {
val client = new AerospikeClient("xxx.xx.xxx.xx", 3000)
try {
val policy = new ScanPolicy()
policy.concurrentNodes = true
policy.priority = Priority.LOW
policy.includeBinData = true
client.scanAll(policy, "test", "testSet", this)
println("Records " + recordCount)
} finally {
client.close()
}
}
def scanCallback(key: Key, record: Record) {
recordCount += 1
println("Records " + recordCount )
println ("key=" + " "+key.userKey.toString() +" and "+" record: "+" "+ record.bins)
}
}
Here is the error I am getting:
com.aerospike.client.AerospikeException: java.lang.NullPointerException
at com.aerospike.client.command.ScanExecutor.scanParallel(ScanExecutor.java:66)
at com.aerospike.client.AerospikeClient.scanAll(AerospikeClient.java:551)
at aerospike.asd.ScanParallelTest.runTest(ScanParallelTest.scala:23)
at aerospike.asd.test$.main(test.scala:10)
at aerospike.asd.test.main(test.scala)
Caused by: java.lang.NullPointerException
at aerospike.asd.ScanParallelTest.scanCallback(ScanParallelTest.scala:35)
at com.aerospike.client.command.ScanCommand.parseRecordResults(ScanCommand.java:122)
at com.aerospike.client.command.MultiCommand.parseResult(MultiCommand.java:58)
at com.aerospike.client.command.SyncCommand.execute(SyncCommand.java:56)
at com.aerospike.client.command.ScanExecutor$ScanThread.run(ScanExecutor.java:134)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I tried using client.readPolicyDefault.sendKey = true; and client.scanPolicyDefault.sendKey = true; with client.writePolicyDefault.sendKey = true; and the code started to return the original keys instead of NULL.
Here is a link to a working code by helipilot50: https://github.com/helipilot50/store-primary-key
It really helped in my case. Thank you!
Adding to Fahad's answer:
Keep in mind that storing the key (rather than just the Digest) takes up space. If you key is a 100 character string and your record is two 8 byte integers, the key storage will use more space than the the two values.
Use this knowledge for good and not for evil :)

Why I can not disable SSLv3?

I have disabled sslv3 in server side like this :
char certPass[] = "***";
char certAliaMainPass[] = "***";;
KeyStore keyStore = KeyStore.getInstance("JKS");
keyStore.load(new FileInputStream(certPath), certPass);
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509");
keyManagerFactory.init(keyStore, certAliaMainPass);
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(keyManagerFactory.getKeyManagers(), null, null);
SSLServerSocketFactory sslServerSocketFactory = sslContext.getServerSocketFactory();
sslServerSocket = (SSLServerSocket) sslServerSocketFactory.createServerSocket(iPort);
String[] protocols = sslServerSocket.getEnabledProtocols();
Set<String> set = new HashSet<String>();
for (String s : protocols) {
if (s.equals("SSLv3")) {
continue;
}
set.add(s);
}
sslServerSocket.setEnabledProtocols(set.toArray(new String[0]));
but client which used "SSLv3" still can connect to server, how can I do for this issue?
Go to Java installation folder.
Open {JRE_HOME}\lib\security\java.security -file in text editor.
Go to the last line.
Delete or comment out the following line jdk.tls.disabledAlgorithms=SSLv3

Cassandra Java Exception - NoHostAvailableException

I have setup single Cassandra node on VM. i have to create a table with 70000 columns. for this i have written java code that read json file and create table.
here is my java code snippet.
When i run my java code it throws exception after creation some columns.
Exception stack is
public void createTable(String keyspaceName, String tableName) throws FileNotFoundException{
JSONParser jsonParser = new JSONParser();
FileReader fileReader;
String filePath = "";
String columnHeader = "";
//String completeColumnHeader = "";
try{
System.out.println("Inside Create Table");
session.executeAsync("DROP TABLE IF EXISTS "+keyspaceName+"."+tableName+";");
String createQuery = "CREATE TABLE "+keyspaceName+"."+tableName +"(\"P:LanguageID\" text, "
+ "\"P:PdmarticleID\" text, PRIMARY KEY(\"P:PdmarticleID\",\"P:LanguageID\"));";
session.execute(createQuery);
System.out.println("Table created");
filePath = "CassandraTableColumnHeader/FixColumnHeader.json";
fileReader = new FileReader(filePath);
JSONObject jsonObject = (JSONObject) jsonParser.parse(fileReader);
JSONArray jsonArray = (JSONArray) jsonObject.get("columnHeaderName");
int columnHeaderSize = jsonArray.size();
int columnHeaderBatchSize = 1000;
int fromIndex = 0;
int toIndex = columnHeaderBatchSize;
while(columnHeaderSize > 0){
columnHeaderSize -=columnHeaderBatchSize;
for(int i = fromIndex; i < toIndex; i++) {
columnHeader = (String) jsonArray.get(i);
if(columnHeader.equals("P:PdmarticleID")||columnHeader.equals("P:LanguageID")){
continue;
}
session.execute("ALTER TABLE "+keyspaceName+"."+tableName +" ADD "+"\""+columnHeader+"\""+" text;");
}
fromIndex = toIndex;
if(columnHeaderSize < columnHeaderBatchSize){
toIndex += columnHeaderSize;
}else{
toIndex = toIndex + columnHeaderBatchSize;
}
}
}catch(FileNotFoundException fnfe){
throw fnfe;
}catch (ParseException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
Exception in thread "main" com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.exceptions.DriverException: Host replied with server error: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.io.FileNotFoundException: C:\apache-cassandra-new\data\data\system\schema_columnfamilies-45f5b36024bc3f83a3631034ea4fa697\system-schema_columnfamilies-tmplink-ka-4839-Data.db (The process cannot access the file because it is being used by another process)))
at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:84)
at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:265)
at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:179)
at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52)
at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:36)
at com.exportstagging.SparkTest.DataLoaderInCassandra.createTable(DataLoaderInCassandra.java:89)
at com.exportstagging.SparkTest.DataLoaderInCassandra.main(DataLoaderInCassandra.java:216)
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.exceptions.DriverException: Host replied with server error: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.io.FileNotFoundException: C:\apache-cassandra-new\data\data\system\schema_columnfamilies-45f5b36024bc3f83a3631034ea4fa697\system-schema_columnfamilies-tmplink-ka-4839-Data.db (The process cannot access the file because it is being used by another process)))
at com.datastax.driver.core.RequestHandler.reportNoMoreHosts(RequestHandler.java:216)
at com.datastax.driver.core.RequestHandler.access$900(RequestHandler.java:45)
at com.datastax.driver.core.RequestHandler$SpeculativeExecution.sendRequest(RequestHandler.java:276)
at com.datastax.driver.core.RequestHandler$SpeculativeExecution$1.run(RequestHandler.java:374)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I have stuck here. Please help me. Thanks in advance.
If I were you I might reevaluate creating a table with 70k column headers. Your partition key P:PdmarticleID and full primary key (P:PdmarticleID, P:LanguageID) are the only two pieces of information you will be able to use to get results anyway. So having these other pieces of information explicitly stored in columns is not buying you anything.
A collection (eg. map) can hold onto 64k items, with certain other limitations (see http://wiki.apache.org/cassandra/CassandraLimitations). Is there a way you can split the columns such that you can create multiple tables, with some pieces of information stored in one table and some in another?

Cant to remove a single row of excel using poi

I am trying to delete a single row from the excel file but the can't do that,
see the code here
try{
String val = request.getParameter("rdel");
int va = 5;
System.out.println("int val"+va);
FileInputStream file = new FileInputStream(new File(fileName));
HSSFWorkbook wb = new HSSFWorkbook(file); // here exception occurs
HSSFSheet sheet = wb.getSheetAt(0);
int lastRowNum=sheet.getLastRowNum();
if(va>=0&&va<lastRowNum){
sheet.shiftRows(va+1,lastRowNum, -1);
}
if(va==lastRowNum){
HSSFRow removingRow=sheet.getRow(va);
if(removingRow!=null){
sheet.removeRow(removingRow);
}
}
FileOutputStream out = new FileOutputStream ("D:/task.xls");
wb.write(out);
}catch(Exception e){
e.printStackTrace();
}
return SUCCESS;
}
see the exception
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance
at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:186)
at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:328)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:271)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:196)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:312)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:293)
at com.struts.curd.Delete.execute(Delete.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
This issue was removed after 3.2... Update POI version with recent one (right now it is 3.9) ... hope you will not face this issue again...
For Details plz check here

Resources