query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
optional uint32 payment_details_version = 1 [default = 1];
@java.lang.Override public boolean hasPaymentDetailsVersion() { return ((bitField0_ & 0x00000001) != 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getPaymentDetailsVersion();", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "boolean hasPaymentDetailsVersion();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "public Builder setPaymentDetailsVersion(int value) {\n copyOnWrite();\n instance.setPaymentDetailsVersion(value);\n return this;\n }", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "public CreditCard getDefaultPaymentInfo();", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "boolean hasSerializedPaymentDetails();", "String getPaymentInformation();", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public int getVersion() { return 1; }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "long getVersionNumber();", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\r\npublic int defaultPaymentInfo(int no) {\n\treturn session.insert(\"payments.defaultPayment\",no);\r\n}", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "public Builder clearPaymentDetailsVersion() {\n copyOnWrite();\n instance.clearPaymentDetailsVersion();\n return this;\n }", "void setPaymentInformation(String information);", "public String getMerchantNo();", "public long getVersion(){\n return localVersion;\n }", "public void setVersion(BigDecimal version) {\r\n this.version = version;\r\n }", "public int getPaymentNum() {\n \treturn this.paymentNum;\n }", "public int getC_Payment_ID();", "private void setPayment(com.dogecoin.protocols.payments.Protos.Payment value) {\n value.getClass();\n payment_ = value;\n bitField0_ |= 0x00000001;\n }", "public int updatePayment2(int requestId, int amount);", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "@Override\n\tpublic int updatePayment(RotatePayment record) {\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tif(null==detail.getId()||\"\".equals(detail.getId()))\n\t\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\t\n\t\t}\n\t\treturn paymentDao.updatePayment(record);\n\t}", "private void m50363B() {\n try {\n TokenPaymentParams tokenPaymentParams = new TokenPaymentParams(this.f30711G0, this.f30708D0, this.f30709E0.getBrand(), this.f30737h0.getText().toString());\n StringBuilder sb = new StringBuilder();\n sb.append(this.f30720S.getString(C10232R.string.checkout_ui_callback_scheme));\n sb.append(\"://callback\");\n tokenPaymentParams.mo40895e(sb.toString());\n this.f30754y0.mo41066a(new Transaction((PaymentParams) tokenPaymentParams));\n this.f30728a.mo23628i(C11645a.f33474f, \"credit_card\");\n } catch (PaymentException e) {\n e.printStackTrace();\n }\n }", "public long getPaymentType() {\n return paymentType;\n }", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@ApiModelProperty(value = \"Software Statement version as provided by the organisation's PTC\")\n\n @Valid\n\n public BigDecimal getVersion() {\n return version;\n }", "public static String aPaymentId() {\n return \"123456\";\n }", "public void setVersion(String version){\r\n this.version = version;\r\n }", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "long getVersion();", "long getVersion();", "long getVersion();", "long getVersion();", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_CODE_PAYMENT) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectUpdatePayment(paymentId, rideAccept.getTotalAmount());\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n }\n }\n\n if (requestCode == 3) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n String paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectWaitingCharge(paymentId);\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n showPayment();\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n showPayment();\n }\n }\n }", "public abstract double getVersionNumber();", "public byte[] Bldr_version() {return bldr_version;}", "public long getVersionNo() {\r\n return versionNo;\r\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "int getTcfPolicyVersion();", "public void setVersion(long version) {\n this.version = version;\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\n\tpublic String getVersion() {\n\t\treturn \"0\";\n\t}", "@Override\r\n\tpublic int getVersion() {\n\t\treturn 0;\r\n\t}", "Long getVersion();", "public String getVersionNumber ();", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "@SuppressWarnings(\"unused\")\n private Long getVersion() {\n return version;\n }", "@Override\n public int getVersion() {\n return 0;\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@Override\n public double getVersion() {\n return 0;\n }", "public String getVersion(){\r\n return version;\r\n }", "public BigDecimal getVersion() {\r\n return version;\r\n }", "int getNumberPaymentReceipt();", "public Object getPaymentMode() {\n\t\treturn null;\n\t}", "private void m9894b() {\n if (this.f9489a == null) {\n throw new IllegalStateException(\"PaymentMethod not set.\");\n }\n }", "PaymentHandler createPaymentHandler();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "@Test(priority = 4)\n\tpublic void testPayment() {\n\t\tlogger = extent.startTest(\"passed\");\n\t\tWebDriverWait wait = new WebDriverWait(driver, 100);\n\t\twait.until(ExpectedConditions.presenceOfElementLocated(By.className(\"payment-info\")));\n\n\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"swit\\\"]/div[1]\")).click();\n\t\tdriver.findElement(By.id(\"btn\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t// For netbanking login\n\t\tdriver.findElement(By.name(\"username\")).sendKeys(\"123456\");\n\t\tdriver.findElement(By.name(\"password\")).sendKeys(\"Pass@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='LOGIN']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t//\n\t\tdriver.findElement(By.name(\"transpwd\")).sendKeys(\"Trans@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='PayNow']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Order Details\");\n\t\tlogger.log(LogStatus.PASS, \"testPayment Testcase is passed\");\n\t}", "void setVersion(long version);", "void paymentOrder(long orderId);", "@Override\n\tpublic int savePayment(RotatePayment record) {\n\t\trecord.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\tDate date = Calendar.getInstance().getTime();\n\t\trecord.setReportDate(date);\n\t\tint i =(int)(Math.random()*1000);\n\t\tString serial = String.format(\"%s%s%03d\", PREFIX,date.getTime(),i);\n\t\trecord.setPaySerial(serial);\n//\t\trecord.setOperator(TokenManager.getNickname());\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\t\t\n\t\t}\n\t\treturn paymentDao.savePayment(record);\n\t}", "long version();", "public short getVersion() {\n return version;\n }", "public void setVersion(String version) {\n\t\t\r\n\t}", "public int getVersion()\n {\n return encryptionDictionary.getInt( \"V\", 0 );\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setC_Payment_ID (int C_Payment_ID);", "public void setVersion(String version)\n {\n this.ver = version;\n }", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "@Override\r\n\tpublic int updatePaymentInfo(Payment payment) {\n\t\treturn session.update(\"payments.updatePayment\", payment);\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version)\n {\n this.version = version;\n }", "public void makePayment(String amount, String paymentRef) {\n JudoSDKManager.setKeyAndSecret(getApplicationContext(), API_TOKEN, API_SECRET);\n\n// Set environment to Sandbox\n JudoSDKManager.setSandboxMode(getApplicationContext());\n\n String customerRef = Settings.Secure.getString(getApplicationContext().getContentResolver(),\n Settings.Secure.ANDROID_ID);\n\n Intent intent = JudoSDKManager.makeAPayment(getApplicationContext(), JUDO_ID, \"GBP\", amount, paymentRef, customerRef, null);\n startActivityForResult(intent, ACTION_CARD_PAYMENT);\n }", "public byte getVersion() {\n return version;\n }", "public String getLBR_PartialPayment();", "@Override\n public int getVersion() {\n return 4;\n }", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "public void setVersion(Integer version)\r\n {\r\n this.version = version;\r\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public String versionNumber (){\r\n\t\t\treturn _versionNumber;\r\n\t\t}", "PaymentMethod getPaymentMethod();", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public Version version()\n/* */ {\n/* 518 */ return PackageVersion.VERSION;\n/* */ }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }" ]
[ "0.8003874", "0.7615207", "0.74101", "0.7088673", "0.697602", "0.66937214", "0.6601176", "0.62929416", "0.61239535", "0.611659", "0.58286566", "0.5777521", "0.5769225", "0.56743276", "0.5670999", "0.56420475", "0.56047046", "0.5594619", "0.5589226", "0.55740225", "0.55720717", "0.55314547", "0.55163753", "0.55087274", "0.5499384", "0.54845893", "0.5481322", "0.54725695", "0.5446738", "0.5446641", "0.5427762", "0.5414947", "0.5413848", "0.5411432", "0.5409488", "0.5404151", "0.53936666", "0.5391206", "0.53840125", "0.5363505", "0.5358766", "0.5358766", "0.5358766", "0.5358766", "0.5358199", "0.53405505", "0.5328853", "0.5323514", "0.53233206", "0.5312478", "0.5311192", "0.5309387", "0.5308493", "0.5297332", "0.5288811", "0.5284828", "0.52731156", "0.52724797", "0.52721226", "0.52669126", "0.5252194", "0.5247288", "0.5241985", "0.52417135", "0.52342534", "0.52320915", "0.523048", "0.5227301", "0.5223976", "0.522189", "0.5197352", "0.51936233", "0.5192416", "0.5188104", "0.518117", "0.5180413", "0.5180156", "0.5179672", "0.51669365", "0.5164336", "0.5159831", "0.51593894", "0.51540077", "0.51540077", "0.51528555", "0.5149047", "0.51431334", "0.5138233", "0.5137014", "0.5132955", "0.51279193", "0.51142555", "0.51139617", "0.51139617", "0.5109055", "0.510852", "0.5107375", "0.5101227", "0.5100216", "0.5100216" ]
0.69522053
5
optional uint32 payment_details_version = 1 [default = 1];
@java.lang.Override public int getPaymentDetailsVersion() { return paymentDetailsVersion_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getPaymentDetailsVersion();", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "boolean hasPaymentDetailsVersion();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "public Builder setPaymentDetailsVersion(int value) {\n copyOnWrite();\n instance.setPaymentDetailsVersion(value);\n return this;\n }", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "public CreditCard getDefaultPaymentInfo();", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "boolean hasSerializedPaymentDetails();", "String getPaymentInformation();", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public int getVersion() { return 1; }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "long getVersionNumber();", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\r\npublic int defaultPaymentInfo(int no) {\n\treturn session.insert(\"payments.defaultPayment\",no);\r\n}", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "public Builder clearPaymentDetailsVersion() {\n copyOnWrite();\n instance.clearPaymentDetailsVersion();\n return this;\n }", "void setPaymentInformation(String information);", "public String getMerchantNo();", "public long getVersion(){\n return localVersion;\n }", "public void setVersion(BigDecimal version) {\r\n this.version = version;\r\n }", "public int getPaymentNum() {\n \treturn this.paymentNum;\n }", "private void setPayment(com.dogecoin.protocols.payments.Protos.Payment value) {\n value.getClass();\n payment_ = value;\n bitField0_ |= 0x00000001;\n }", "public int getC_Payment_ID();", "public int updatePayment2(int requestId, int amount);", "@Override\n\tpublic int updatePayment(RotatePayment record) {\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tif(null==detail.getId()||\"\".equals(detail.getId()))\n\t\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\t\n\t\t}\n\t\treturn paymentDao.updatePayment(record);\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "private void m50363B() {\n try {\n TokenPaymentParams tokenPaymentParams = new TokenPaymentParams(this.f30711G0, this.f30708D0, this.f30709E0.getBrand(), this.f30737h0.getText().toString());\n StringBuilder sb = new StringBuilder();\n sb.append(this.f30720S.getString(C10232R.string.checkout_ui_callback_scheme));\n sb.append(\"://callback\");\n tokenPaymentParams.mo40895e(sb.toString());\n this.f30754y0.mo41066a(new Transaction((PaymentParams) tokenPaymentParams));\n this.f30728a.mo23628i(C11645a.f33474f, \"credit_card\");\n } catch (PaymentException e) {\n e.printStackTrace();\n }\n }", "public long getPaymentType() {\n return paymentType;\n }", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@ApiModelProperty(value = \"Software Statement version as provided by the organisation's PTC\")\n\n @Valid\n\n public BigDecimal getVersion() {\n return version;\n }", "public static String aPaymentId() {\n return \"123456\";\n }", "public void setVersion(String version){\r\n this.version = version;\r\n }", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "long getVersion();", "long getVersion();", "long getVersion();", "long getVersion();", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_CODE_PAYMENT) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectUpdatePayment(paymentId, rideAccept.getTotalAmount());\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n }\n }\n\n if (requestCode == 3) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n String paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectWaitingCharge(paymentId);\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n showPayment();\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n showPayment();\n }\n }\n }", "public abstract double getVersionNumber();", "public byte[] Bldr_version() {return bldr_version;}", "public long getVersionNo() {\r\n return versionNo;\r\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "public void setVersion(long version) {\n this.version = version;\n }", "int getTcfPolicyVersion();", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\n\tpublic String getVersion() {\n\t\treturn \"0\";\n\t}", "@Override\r\n\tpublic int getVersion() {\n\t\treturn 0;\r\n\t}", "Long getVersion();", "public String getVersionNumber ();", "@SuppressWarnings(\"unused\")\n private Long getVersion() {\n return version;\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "@Override\n public int getVersion() {\n return 0;\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@Override\n public double getVersion() {\n return 0;\n }", "public String getVersion(){\r\n return version;\r\n }", "public BigDecimal getVersion() {\r\n return version;\r\n }", "int getNumberPaymentReceipt();", "private void m9894b() {\n if (this.f9489a == null) {\n throw new IllegalStateException(\"PaymentMethod not set.\");\n }\n }", "public Object getPaymentMode() {\n\t\treturn null;\n\t}", "PaymentHandler createPaymentHandler();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "@Test(priority = 4)\n\tpublic void testPayment() {\n\t\tlogger = extent.startTest(\"passed\");\n\t\tWebDriverWait wait = new WebDriverWait(driver, 100);\n\t\twait.until(ExpectedConditions.presenceOfElementLocated(By.className(\"payment-info\")));\n\n\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"swit\\\"]/div[1]\")).click();\n\t\tdriver.findElement(By.id(\"btn\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t// For netbanking login\n\t\tdriver.findElement(By.name(\"username\")).sendKeys(\"123456\");\n\t\tdriver.findElement(By.name(\"password\")).sendKeys(\"Pass@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='LOGIN']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t//\n\t\tdriver.findElement(By.name(\"transpwd\")).sendKeys(\"Trans@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='PayNow']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Order Details\");\n\t\tlogger.log(LogStatus.PASS, \"testPayment Testcase is passed\");\n\t}", "void setVersion(long version);", "void paymentOrder(long orderId);", "@Override\n\tpublic int savePayment(RotatePayment record) {\n\t\trecord.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\tDate date = Calendar.getInstance().getTime();\n\t\trecord.setReportDate(date);\n\t\tint i =(int)(Math.random()*1000);\n\t\tString serial = String.format(\"%s%s%03d\", PREFIX,date.getTime(),i);\n\t\trecord.setPaySerial(serial);\n//\t\trecord.setOperator(TokenManager.getNickname());\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\t\t\n\t\t}\n\t\treturn paymentDao.savePayment(record);\n\t}", "long version();", "public void setVersion(String version) {\n\t\t\r\n\t}", "public short getVersion() {\n return version;\n }", "public int getVersion()\n {\n return encryptionDictionary.getInt( \"V\", 0 );\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version)\n {\n this.ver = version;\n }", "public void setC_Payment_ID (int C_Payment_ID);", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "@Override\r\n\tpublic int updatePaymentInfo(Payment payment) {\n\t\treturn session.update(\"payments.updatePayment\", payment);\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version)\n {\n this.version = version;\n }", "public void makePayment(String amount, String paymentRef) {\n JudoSDKManager.setKeyAndSecret(getApplicationContext(), API_TOKEN, API_SECRET);\n\n// Set environment to Sandbox\n JudoSDKManager.setSandboxMode(getApplicationContext());\n\n String customerRef = Settings.Secure.getString(getApplicationContext().getContentResolver(),\n Settings.Secure.ANDROID_ID);\n\n Intent intent = JudoSDKManager.makeAPayment(getApplicationContext(), JUDO_ID, \"GBP\", amount, paymentRef, customerRef, null);\n startActivityForResult(intent, ACTION_CARD_PAYMENT);\n }", "public byte getVersion() {\n return version;\n }", "@Override\n public int getVersion() {\n return 4;\n }", "public String getLBR_PartialPayment();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "public void setVersion(Integer version)\r\n {\r\n this.version = version;\r\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public String versionNumber (){\r\n\t\t\treturn _versionNumber;\r\n\t\t}", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "PaymentMethod getPaymentMethod();", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }" ]
[ "0.80033404", "0.76153654", "0.7409321", "0.69754475", "0.6951989", "0.6692849", "0.6600417", "0.62931544", "0.61232376", "0.61151564", "0.58272123", "0.57759625", "0.5767995", "0.56724226", "0.5670457", "0.5641753", "0.56025696", "0.55940056", "0.55900306", "0.55752903", "0.5571828", "0.55296344", "0.55157065", "0.5507845", "0.549894", "0.5485007", "0.54830855", "0.54718226", "0.5445836", "0.5445685", "0.54282063", "0.5413922", "0.5413161", "0.5411478", "0.5408061", "0.54030067", "0.5394123", "0.5390393", "0.5385908", "0.536276", "0.5358878", "0.5358878", "0.5358878", "0.5358878", "0.53573567", "0.5341767", "0.5329126", "0.5324657", "0.5323544", "0.53126985", "0.531203", "0.5310835", "0.53096783", "0.5297628", "0.5289074", "0.52851415", "0.52738047", "0.52731353", "0.5272184", "0.52671415", "0.52521473", "0.52478826", "0.5242297", "0.52420473", "0.52349424", "0.52304155", "0.52302", "0.5226005", "0.52228004", "0.5220261", "0.519926", "0.5194534", "0.5192214", "0.51874834", "0.5182522", "0.51820135", "0.51817393", "0.51817316", "0.5166491", "0.5166081", "0.51606935", "0.515869", "0.5156166", "0.5156166", "0.5154974", "0.5147997", "0.5144217", "0.5137154", "0.5137063", "0.5131639", "0.5127382", "0.5116467", "0.5116454", "0.5116454", "0.51098603", "0.51080173", "0.5107231", "0.51024103", "0.51024103", "0.51024103" ]
0.7087752
3
optional uint32 payment_details_version = 1 [default = 1];
private void setPaymentDetailsVersion(int value) { bitField0_ |= 0x00000001; paymentDetailsVersion_ = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getPaymentDetailsVersion();", "boolean hasPaymentDetailsVersion();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "public Builder setPaymentDetailsVersion(int value) {\n copyOnWrite();\n instance.setPaymentDetailsVersion(value);\n return this;\n }", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "public CreditCard getDefaultPaymentInfo();", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "boolean hasSerializedPaymentDetails();", "String getPaymentInformation();", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public int getVersion() { return 1; }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "long getVersionNumber();", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\r\npublic int defaultPaymentInfo(int no) {\n\treturn session.insert(\"payments.defaultPayment\",no);\r\n}", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "public Builder clearPaymentDetailsVersion() {\n copyOnWrite();\n instance.clearPaymentDetailsVersion();\n return this;\n }", "void setPaymentInformation(String information);", "public String getMerchantNo();", "public long getVersion(){\n return localVersion;\n }", "public void setVersion(BigDecimal version) {\r\n this.version = version;\r\n }", "public int getPaymentNum() {\n \treturn this.paymentNum;\n }", "private void setPayment(com.dogecoin.protocols.payments.Protos.Payment value) {\n value.getClass();\n payment_ = value;\n bitField0_ |= 0x00000001;\n }", "public int getC_Payment_ID();", "public int updatePayment2(int requestId, int amount);", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "@Override\n\tpublic int updatePayment(RotatePayment record) {\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tif(null==detail.getId()||\"\".equals(detail.getId()))\n\t\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\t\n\t\t}\n\t\treturn paymentDao.updatePayment(record);\n\t}", "private void m50363B() {\n try {\n TokenPaymentParams tokenPaymentParams = new TokenPaymentParams(this.f30711G0, this.f30708D0, this.f30709E0.getBrand(), this.f30737h0.getText().toString());\n StringBuilder sb = new StringBuilder();\n sb.append(this.f30720S.getString(C10232R.string.checkout_ui_callback_scheme));\n sb.append(\"://callback\");\n tokenPaymentParams.mo40895e(sb.toString());\n this.f30754y0.mo41066a(new Transaction((PaymentParams) tokenPaymentParams));\n this.f30728a.mo23628i(C11645a.f33474f, \"credit_card\");\n } catch (PaymentException e) {\n e.printStackTrace();\n }\n }", "public long getPaymentType() {\n return paymentType;\n }", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@ApiModelProperty(value = \"Software Statement version as provided by the organisation's PTC\")\n\n @Valid\n\n public BigDecimal getVersion() {\n return version;\n }", "public static String aPaymentId() {\n return \"123456\";\n }", "public void setVersion(String version){\r\n this.version = version;\r\n }", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "long getVersion();", "long getVersion();", "long getVersion();", "long getVersion();", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_CODE_PAYMENT) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectUpdatePayment(paymentId, rideAccept.getTotalAmount());\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n }\n }\n\n if (requestCode == 3) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n String paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectWaitingCharge(paymentId);\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n showPayment();\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n showPayment();\n }\n }\n }", "public abstract double getVersionNumber();", "public byte[] Bldr_version() {return bldr_version;}", "public long getVersionNo() {\r\n return versionNo;\r\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "int getTcfPolicyVersion();", "public void setVersion(long version) {\n this.version = version;\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\n\tpublic String getVersion() {\n\t\treturn \"0\";\n\t}", "@Override\r\n\tpublic int getVersion() {\n\t\treturn 0;\r\n\t}", "Long getVersion();", "public String getVersionNumber ();", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "@SuppressWarnings(\"unused\")\n private Long getVersion() {\n return version;\n }", "@Override\n public int getVersion() {\n return 0;\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@Override\n public double getVersion() {\n return 0;\n }", "public BigDecimal getVersion() {\r\n return version;\r\n }", "public String getVersion(){\r\n return version;\r\n }", "int getNumberPaymentReceipt();", "public Object getPaymentMode() {\n\t\treturn null;\n\t}", "private void m9894b() {\n if (this.f9489a == null) {\n throw new IllegalStateException(\"PaymentMethod not set.\");\n }\n }", "PaymentHandler createPaymentHandler();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "@Test(priority = 4)\n\tpublic void testPayment() {\n\t\tlogger = extent.startTest(\"passed\");\n\t\tWebDriverWait wait = new WebDriverWait(driver, 100);\n\t\twait.until(ExpectedConditions.presenceOfElementLocated(By.className(\"payment-info\")));\n\n\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"swit\\\"]/div[1]\")).click();\n\t\tdriver.findElement(By.id(\"btn\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t// For netbanking login\n\t\tdriver.findElement(By.name(\"username\")).sendKeys(\"123456\");\n\t\tdriver.findElement(By.name(\"password\")).sendKeys(\"Pass@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='LOGIN']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t//\n\t\tdriver.findElement(By.name(\"transpwd\")).sendKeys(\"Trans@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='PayNow']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Order Details\");\n\t\tlogger.log(LogStatus.PASS, \"testPayment Testcase is passed\");\n\t}", "void setVersion(long version);", "void paymentOrder(long orderId);", "@Override\n\tpublic int savePayment(RotatePayment record) {\n\t\trecord.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\tDate date = Calendar.getInstance().getTime();\n\t\trecord.setReportDate(date);\n\t\tint i =(int)(Math.random()*1000);\n\t\tString serial = String.format(\"%s%s%03d\", PREFIX,date.getTime(),i);\n\t\trecord.setPaySerial(serial);\n//\t\trecord.setOperator(TokenManager.getNickname());\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\t\t\n\t\t}\n\t\treturn paymentDao.savePayment(record);\n\t}", "long version();", "public short getVersion() {\n return version;\n }", "public void setVersion(String version) {\n\t\t\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "public int getVersion()\n {\n return encryptionDictionary.getInt( \"V\", 0 );\n }", "public void setC_Payment_ID (int C_Payment_ID);", "public void setVersion(String version)\n {\n this.ver = version;\n }", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "@Override\r\n\tpublic int updatePaymentInfo(Payment payment) {\n\t\treturn session.update(\"payments.updatePayment\", payment);\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version)\n {\n this.version = version;\n }", "public void makePayment(String amount, String paymentRef) {\n JudoSDKManager.setKeyAndSecret(getApplicationContext(), API_TOKEN, API_SECRET);\n\n// Set environment to Sandbox\n JudoSDKManager.setSandboxMode(getApplicationContext());\n\n String customerRef = Settings.Secure.getString(getApplicationContext().getContentResolver(),\n Settings.Secure.ANDROID_ID);\n\n Intent intent = JudoSDKManager.makeAPayment(getApplicationContext(), JUDO_ID, \"GBP\", amount, paymentRef, customerRef, null);\n startActivityForResult(intent, ACTION_CARD_PAYMENT);\n }", "public byte getVersion() {\n return version;\n }", "public String getLBR_PartialPayment();", "@Override\n public int getVersion() {\n return 4;\n }", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "public void setVersion(Integer version)\r\n {\r\n this.version = version;\r\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public String versionNumber (){\r\n\t\t\treturn _versionNumber;\r\n\t\t}", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "PaymentMethod getPaymentMethod();", "public Version version()\n/* */ {\n/* 518 */ return PackageVersion.VERSION;\n/* */ }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }" ]
[ "0.80034465", "0.7410622", "0.7088494", "0.6975793", "0.6953307", "0.66936916", "0.6601788", "0.62917477", "0.6124444", "0.61168504", "0.582807", "0.5777196", "0.57698876", "0.5674107", "0.5671132", "0.5642232", "0.56046927", "0.5595802", "0.55893826", "0.55744565", "0.5571356", "0.55305934", "0.55155885", "0.55086255", "0.54994094", "0.548515", "0.54823804", "0.54722375", "0.5446413", "0.5446033", "0.5426635", "0.54149896", "0.54134554", "0.54114383", "0.5409497", "0.5403855", "0.5394232", "0.53908634", "0.5384754", "0.53627515", "0.5358914", "0.5358914", "0.5358914", "0.5358914", "0.53581226", "0.53411514", "0.5329674", "0.5324385", "0.5322615", "0.531181", "0.53107846", "0.5310316", "0.5308829", "0.5297846", "0.5289529", "0.5285155", "0.5273382", "0.52730614", "0.5272987", "0.52676976", "0.5253469", "0.52482396", "0.52424824", "0.5242384", "0.5233856", "0.5232086", "0.52307016", "0.5226022", "0.52247953", "0.52215016", "0.5198114", "0.51938814", "0.51917595", "0.51878035", "0.51814425", "0.51811916", "0.5180288", "0.518016", "0.5166862", "0.5165169", "0.5160813", "0.51585674", "0.51547694", "0.51547694", "0.51535845", "0.5148061", "0.51435596", "0.51385784", "0.5137289", "0.51326686", "0.51273745", "0.51149565", "0.51147026", "0.51147026", "0.5109668", "0.5108239", "0.5107287", "0.51018167", "0.51009524", "0.51009524" ]
0.7615326
1
optional uint32 payment_details_version = 1 [default = 1];
private void clearPaymentDetailsVersion() { bitField0_ = (bitField0_ & ~0x00000001); paymentDetailsVersion_ = 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getPaymentDetailsVersion();", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "boolean hasPaymentDetailsVersion();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "public Builder setPaymentDetailsVersion(int value) {\n copyOnWrite();\n instance.setPaymentDetailsVersion(value);\n return this;\n }", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "public CreditCard getDefaultPaymentInfo();", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "boolean hasSerializedPaymentDetails();", "String getPaymentInformation();", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public int getVersion() { return 1; }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "long getVersionNumber();", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\r\npublic int defaultPaymentInfo(int no) {\n\treturn session.insert(\"payments.defaultPayment\",no);\r\n}", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "public Builder clearPaymentDetailsVersion() {\n copyOnWrite();\n instance.clearPaymentDetailsVersion();\n return this;\n }", "void setPaymentInformation(String information);", "public String getMerchantNo();", "public long getVersion(){\n return localVersion;\n }", "public void setVersion(BigDecimal version) {\r\n this.version = version;\r\n }", "public int getPaymentNum() {\n \treturn this.paymentNum;\n }", "private void setPayment(com.dogecoin.protocols.payments.Protos.Payment value) {\n value.getClass();\n payment_ = value;\n bitField0_ |= 0x00000001;\n }", "public int getC_Payment_ID();", "public int updatePayment2(int requestId, int amount);", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "@Override\n\tpublic int updatePayment(RotatePayment record) {\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tif(null==detail.getId()||\"\".equals(detail.getId()))\n\t\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\t\n\t\t}\n\t\treturn paymentDao.updatePayment(record);\n\t}", "private void m50363B() {\n try {\n TokenPaymentParams tokenPaymentParams = new TokenPaymentParams(this.f30711G0, this.f30708D0, this.f30709E0.getBrand(), this.f30737h0.getText().toString());\n StringBuilder sb = new StringBuilder();\n sb.append(this.f30720S.getString(C10232R.string.checkout_ui_callback_scheme));\n sb.append(\"://callback\");\n tokenPaymentParams.mo40895e(sb.toString());\n this.f30754y0.mo41066a(new Transaction((PaymentParams) tokenPaymentParams));\n this.f30728a.mo23628i(C11645a.f33474f, \"credit_card\");\n } catch (PaymentException e) {\n e.printStackTrace();\n }\n }", "public long getPaymentType() {\n return paymentType;\n }", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@ApiModelProperty(value = \"Software Statement version as provided by the organisation's PTC\")\n\n @Valid\n\n public BigDecimal getVersion() {\n return version;\n }", "public static String aPaymentId() {\n return \"123456\";\n }", "public void setVersion(String version){\r\n this.version = version;\r\n }", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "long getVersion();", "long getVersion();", "long getVersion();", "long getVersion();", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_CODE_PAYMENT) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectUpdatePayment(paymentId, rideAccept.getTotalAmount());\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n }\n }\n\n if (requestCode == 3) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n String paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectWaitingCharge(paymentId);\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n showPayment();\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n showPayment();\n }\n }\n }", "public abstract double getVersionNumber();", "public byte[] Bldr_version() {return bldr_version;}", "public long getVersionNo() {\r\n return versionNo;\r\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "int getTcfPolicyVersion();", "public void setVersion(long version) {\n this.version = version;\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\n\tpublic String getVersion() {\n\t\treturn \"0\";\n\t}", "@Override\r\n\tpublic int getVersion() {\n\t\treturn 0;\r\n\t}", "Long getVersion();", "public String getVersionNumber ();", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "@SuppressWarnings(\"unused\")\n private Long getVersion() {\n return version;\n }", "@Override\n public int getVersion() {\n return 0;\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@Override\n public double getVersion() {\n return 0;\n }", "public BigDecimal getVersion() {\r\n return version;\r\n }", "public String getVersion(){\r\n return version;\r\n }", "int getNumberPaymentReceipt();", "public Object getPaymentMode() {\n\t\treturn null;\n\t}", "private void m9894b() {\n if (this.f9489a == null) {\n throw new IllegalStateException(\"PaymentMethod not set.\");\n }\n }", "PaymentHandler createPaymentHandler();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "@Test(priority = 4)\n\tpublic void testPayment() {\n\t\tlogger = extent.startTest(\"passed\");\n\t\tWebDriverWait wait = new WebDriverWait(driver, 100);\n\t\twait.until(ExpectedConditions.presenceOfElementLocated(By.className(\"payment-info\")));\n\n\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"swit\\\"]/div[1]\")).click();\n\t\tdriver.findElement(By.id(\"btn\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t// For netbanking login\n\t\tdriver.findElement(By.name(\"username\")).sendKeys(\"123456\");\n\t\tdriver.findElement(By.name(\"password\")).sendKeys(\"Pass@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='LOGIN']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t//\n\t\tdriver.findElement(By.name(\"transpwd\")).sendKeys(\"Trans@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='PayNow']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Order Details\");\n\t\tlogger.log(LogStatus.PASS, \"testPayment Testcase is passed\");\n\t}", "void setVersion(long version);", "void paymentOrder(long orderId);", "@Override\n\tpublic int savePayment(RotatePayment record) {\n\t\trecord.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\tDate date = Calendar.getInstance().getTime();\n\t\trecord.setReportDate(date);\n\t\tint i =(int)(Math.random()*1000);\n\t\tString serial = String.format(\"%s%s%03d\", PREFIX,date.getTime(),i);\n\t\trecord.setPaySerial(serial);\n//\t\trecord.setOperator(TokenManager.getNickname());\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\t\t\n\t\t}\n\t\treturn paymentDao.savePayment(record);\n\t}", "long version();", "public short getVersion() {\n return version;\n }", "public void setVersion(String version) {\n\t\t\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "public int getVersion()\n {\n return encryptionDictionary.getInt( \"V\", 0 );\n }", "public void setC_Payment_ID (int C_Payment_ID);", "public void setVersion(String version)\n {\n this.ver = version;\n }", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "@Override\r\n\tpublic int updatePaymentInfo(Payment payment) {\n\t\treturn session.update(\"payments.updatePayment\", payment);\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version)\n {\n this.version = version;\n }", "public void makePayment(String amount, String paymentRef) {\n JudoSDKManager.setKeyAndSecret(getApplicationContext(), API_TOKEN, API_SECRET);\n\n// Set environment to Sandbox\n JudoSDKManager.setSandboxMode(getApplicationContext());\n\n String customerRef = Settings.Secure.getString(getApplicationContext().getContentResolver(),\n Settings.Secure.ANDROID_ID);\n\n Intent intent = JudoSDKManager.makeAPayment(getApplicationContext(), JUDO_ID, \"GBP\", amount, paymentRef, customerRef, null);\n startActivityForResult(intent, ACTION_CARD_PAYMENT);\n }", "public byte getVersion() {\n return version;\n }", "public String getLBR_PartialPayment();", "@Override\n public int getVersion() {\n return 4;\n }", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "public void setVersion(Integer version)\r\n {\r\n this.version = version;\r\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public String versionNumber (){\r\n\t\t\treturn _versionNumber;\r\n\t\t}", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "PaymentMethod getPaymentMethod();", "public Version version()\n/* */ {\n/* 518 */ return PackageVersion.VERSION;\n/* */ }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }" ]
[ "0.80034465", "0.7615326", "0.7410622", "0.7088494", "0.6975793", "0.6953307", "0.6601788", "0.62917477", "0.6124444", "0.61168504", "0.582807", "0.5777196", "0.57698876", "0.5674107", "0.5671132", "0.5642232", "0.56046927", "0.5595802", "0.55893826", "0.55744565", "0.5571356", "0.55305934", "0.55155885", "0.55086255", "0.54994094", "0.548515", "0.54823804", "0.54722375", "0.5446413", "0.5446033", "0.5426635", "0.54149896", "0.54134554", "0.54114383", "0.5409497", "0.5403855", "0.5394232", "0.53908634", "0.5384754", "0.53627515", "0.5358914", "0.5358914", "0.5358914", "0.5358914", "0.53581226", "0.53411514", "0.5329674", "0.5324385", "0.5322615", "0.531181", "0.53107846", "0.5310316", "0.5308829", "0.5297846", "0.5289529", "0.5285155", "0.5273382", "0.52730614", "0.5272987", "0.52676976", "0.5253469", "0.52482396", "0.52424824", "0.5242384", "0.5233856", "0.5232086", "0.52307016", "0.5226022", "0.52247953", "0.52215016", "0.5198114", "0.51938814", "0.51917595", "0.51878035", "0.51814425", "0.51811916", "0.5180288", "0.518016", "0.5166862", "0.5165169", "0.5160813", "0.51585674", "0.51547694", "0.51547694", "0.51535845", "0.5148061", "0.51435596", "0.51385784", "0.5137289", "0.51326686", "0.51273745", "0.51149565", "0.51147026", "0.51147026", "0.5109668", "0.5108239", "0.5107287", "0.51018167", "0.51009524", "0.51009524" ]
0.66936916
6
none / x509+sha256 / x509+sha1 optional string pki_type = 2 [default = "none"];
@java.lang.Override public boolean hasPkiType() { return ((bitField0_ & 0x00000002) != 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPkiType();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "boolean hasPkiType();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "public static void main(String[] args) throws IcbcApiException {\n\t\tUiIcbcClient client = new UiIcbcClient(APP_ID,IcbcConstants.SIGN_TYPE_RSA,\n\t\t\t\t\"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJCoQe/O+uqpOtyE/2CUjD7wosZw8jI1AlLNJCllOmlX+obA6h97b0JsEL0SjMCAR3xJyw7MKLqkcy5qQ/bBgw2XSrodmjzOVqfT1OXRii0xw0HiVkHR4cEWnEAAdfo0lDc4iuzCIQrnT5gM0+U+qeSV6JFfwVRjgYzBdHQRPCf1AgMBAAECgYAdQUoEe7GXH5591o/nMmOinvvscg8pRDsyD7bOgGBtyZMrCXzP3SDFKCHCeyvoColqg2oDlhpulK+OpYMVNlGQcO4eubOJp9MUc3m4A9RxkVr3dsVrmygM5czPfWHAPVQ4dECDruBJn9zoo1ci0myRTh4KSCq6SxpCE0Pbf3j7iQJBAOdMPFRfOkSQ1hsN9Mg4jd9on8r7+mF8gFPhkNI6qvEKw/prmU3obUWvZL42vRlLOQyyB92mBF24PStR/B6CjR8CQQCgGz0VoqCplurSCapGdgX3D7bNSDtMUmaLJYJxih8v+zghP0YtVgDeV3NjogVjOlz8/9Rebo0PoFcqyJnNA1RrAkEAul3dBoasZm7ldWsrXuDiv66HgoDB4Cb3J59Kl3oaHpp0CqUEI5gx48JNRE7K00SfNTGF0Pxh7Dn1X6Bxqwu6NQJADrdyPfLc4bnFi9jnleJzWepP2z6wdKt+UXv5KYaQp1BoMGYohTJKkiVnrdjOtfg/Y+IAG03+GVmbqYsW2AleUQJBANYQklohKtsmq8ptX3as6hjcuXcTpc2DSpVeOnCueNv107+dDJ+K14tbiVYzF3tkHBNMRkGtr6EuGKJ+A63sJ00=\",\n\t\t\t\tIcbcConstants.CHARSET_UTF8,IcbcConstants.ENCRYPT_TYPE_AES, \"xMh0xFsG7G80ziePFdnT8g==\");\n\t\tEaccountManageRequestV1 request = new EaccountManageRequestV1();\t\t\n\t\trequest.setServiceUrl(\"http://122.64.61.111:8081/ui/eaccount/manage/V1\");///\n\t\tEaccountManageRequestBizV1 bizContent = new EaccountManageRequestBizV1();\n\t\tbizContent.setMobileNo(\"13703878410\");//选输,手机号\n\t\tbizContent.setIdcode(\"128440810108044\");//选输,身份证号\n\t\tbizContent.setName(URLEncoder.encode(\"芡悠\"));//选输,用户姓名\n\t\tbizContent.setUserId(\"128440810108044\");//必输,需控制不能为空,用户唯一标识,送身份证号\n\t\tbizContent.setBacAddr(URLEncoder.encode(\"http://www.test.com\"));//选输,回调地址\n\t\tbizContent.setEpayflag(\"0\");//选输,工银e支付标志,0-短信、1-静态密码,集成客户端SDK的方式能送0-短信或1-静态密码,非APP方式只能送0-短信,不送默认为0-短信\n\t\t\n\t\tbizContent.setCorpAppid(APP_ID);//外公司合作方送APP_ID的值,行内应用如e支付等送外公司合作方的APPID\n\t\tlong systime = System.currentTimeMillis(); // 现时间戳\t\t\n\t\tString orderTimeStamp=new Long(systime).toString();\n\t\t\n\t\tSystem.out.println(\"orderTimeStamp:\"+orderTimeStamp);\n\t\tbizContent.setOrderTimeStamp(orderTimeStamp);//生成请求的时间,必输\n\t\t\n\t\tbizContent.setZoneno(\"00200\");//地区号号,选输,5位数字,上送值联系对接分行提供\n\t\tbizContent.setBrno(\"00260\");//网点号,选输,5位数字,上送值联系对接分行提供\n\t\t\n\t\trequest.setBizContent(bizContent);\n\t\tSystem.out.println(client.buildPostForm(request));// 实际调用时的相关返回结果及异常处理,请自行添加\n\t}", "dkk mo4509g();", "private void generatePrivacyKeyPair(boolean clientMode) throws IOException, UnsupportedEncodingException, NoSuchAlgorithmException, SaslException {\n byte[] ccmagic = CLIENT_CONF_MAGIC.getBytes(encoding);\n byte[] scmagic = SVR_CONF_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n int n;\n if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_40])) {\n n = 5;\n } else if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_56])) {\n n = 7;\n } else {\n n = 16;\n }\n byte[] keyBuffer = new byte[n + ccmagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, n);\n System.arraycopy(ccmagic, 0, keyBuffer, n, ccmagic.length);\n md5.update(keyBuffer);\n byte[] Kcc = md5.digest();\n System.arraycopy(scmagic, 0, keyBuffer, n, scmagic.length);\n md5.update(keyBuffer);\n byte[] Kcs = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST24:Kcc: \", Kcc);\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST25:Kcs: \", Kcs);\n }\n byte[] myKc;\n byte[] peerKc;\n if (clientMode) {\n myKc = Kcc;\n peerKc = Kcs;\n } else {\n myKc = Kcs;\n peerKc = Kcc;\n }\n try {\n SecretKey encKey;\n SecretKey decKey;\n if (negotiatedCipher.indexOf(CIPHER_TOKENS[RC4]) > -1) {\n encCipher = Cipher.getInstance(\"RC4\");\n decCipher = Cipher.getInstance(\"RC4\");\n encKey = new SecretKeySpec(myKc, \"RC4\");\n decKey = new SecretKeySpec(peerKc, \"RC4\");\n encCipher.init(Cipher.ENCRYPT_MODE, encKey);\n decCipher.init(Cipher.DECRYPT_MODE, decKey);\n } else if ((negotiatedCipher.equals(CIPHER_TOKENS[DES])) || (negotiatedCipher.equals(CIPHER_TOKENS[DES3]))) {\n String cipherFullname, cipherShortname;\n if (negotiatedCipher.equals(CIPHER_TOKENS[DES])) {\n cipherFullname = \"DES/CBC/NoPadding\";\n cipherShortname = \"des\";\n } else {\n cipherFullname = \"DESede/CBC/NoPadding\";\n cipherShortname = \"desede\";\n }\n encCipher = Cipher.getInstance(cipherFullname);\n decCipher = Cipher.getInstance(cipherFullname);\n encKey = makeDesKeys(myKc, cipherShortname);\n decKey = makeDesKeys(peerKc, cipherShortname);\n IvParameterSpec encIv = new IvParameterSpec(myKc, 8, 8);\n IvParameterSpec decIv = new IvParameterSpec(peerKc, 8, 8);\n encCipher.init(Cipher.ENCRYPT_MODE, encKey, encIv);\n decCipher.init(Cipher.DECRYPT_MODE, decKey, decIv);\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST26:\" + negotiatedCipher + \" IVcc: \", encIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST27:\" + negotiatedCipher + \" IVcs: \", decIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST28:\" + negotiatedCipher + \" encryption key: \", encKey.getEncoded());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST29:\" + negotiatedCipher + \" decryption key: \", decKey.getEncoded());\n }\n }\n } catch (InvalidKeySpecException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported key \" + \"specification used.\", e);\n } catch (InvalidAlgorithmParameterException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid cipher \" + \"algorithem parameter used to create cipher instance\", e);\n } catch (NoSuchPaddingException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported \" + \"padding used for chosen cipher\", e);\n } catch (InvalidKeyException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid data \" + \"used to initialize keys\", e);\n }\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "java.lang.String getPublicEciesKey();", "OpenSSLKey mo134201a();", "public abstract String getSigAlgOID();", "private void generateIntegrityKeyPair(boolean clientMode) throws UnsupportedEncodingException, IOException, NoSuchAlgorithmException {\n byte[] cimagic = CLIENT_INT_MAGIC.getBytes(encoding);\n byte[] simagic = SVR_INT_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n byte[] keyBuffer = new byte[H_A1.length + cimagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, H_A1.length);\n System.arraycopy(cimagic, 0, keyBuffer, H_A1.length, cimagic.length);\n md5.update(keyBuffer);\n byte[] Kic = md5.digest();\n System.arraycopy(simagic, 0, keyBuffer, H_A1.length, simagic.length);\n md5.update(keyBuffer);\n byte[] Kis = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST12:Kic: \", Kic);\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST13:Kis: \", Kis);\n }\n if (clientMode) {\n myKi = Kic;\n peerKi = Kis;\n } else {\n myKi = Kis;\n peerKi = Kic;\n }\n }", "public final String mo1957a() {\n return \"type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey\";\n }", "private native String native_ks(long cookie, byte[] userKey);", "@Override\n public ConcurrentContentSigner newSigner(\n String type, SignerConf conf, X509Cert[] certificateChain)\n throws ObjectCreationException {\n type = type.toLowerCase(Locale.ROOT);\n if (!types.contains(type)) {\n throw new ObjectCreationException(\"unknown signer type \" + type);\n }\n\n String str = conf.getConfValue(\"parallelism\");\n int parallelism = 20;\n if (str != null) {\n try {\n parallelism = Integer.parseInt(str);\n } catch (NumberFormatException ex) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n\n if (parallelism < 1) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n }\n\n str = conf.getConfValue(\"alias\");\n if (str == null) {\n throw new ObjectCreationException(\"alias is not specified\");\n }\n int keyId = Integer.parseInt(str);\n\n String algoName = conf.getConfValue(\"algo\");\n if (algoName == null) {\n throw new ObjectCreationException(\"algo is not specified\");\n }\n\n try {\n InitStatus initStatus = init(type);\n if (initStatus.status.get() != 1) {\n throw new ObjectCreationException(initStatus.details);\n }\n\n SignAlgo algo = SignAlgo.getInstance(algoName);\n String keyAlgoName;\n String bcKeyAlgoName;\n if (algo.isSM2SigAlgo()) {\n keyAlgoName = \"SM2\";\n bcKeyAlgoName = \"EC\";\n } else if (algo.isRSAPkcs1SigAlgo() || algo.isRSAPSSSigAlgo()) {\n keyAlgoName = \"RSA\";\n bcKeyAlgoName = \"RSA\";\n } else if (algo.isECDSASigAlgo() || algo.isPlainECDSASigAlgo()) {\n keyAlgoName = \"EC\";\n bcKeyAlgoName = \"EC\";\n } else {\n throw new ObjectCreationException(\"unsupported algo \" + algoName);\n }\n\n Provider provider = providerMap.get(type);\n\n // Method to read create PrivateKey and PublicKey object.\n // SANSEC use KeyPairGenerator.generateKeyPair to read the keypair-\n // No new keypair will be generated here.\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(keyAlgoName, provider);\n kpGen.initialize(keyId << 16);\n KeyPair kp = kpGen.generateKeyPair();\n\n PublicKey publicKey = KeyFactory.getInstance(bcKeyAlgoName, \"BC\")\n .generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));\n\n return new JceSignerBuilder(kp.getPrivate(), publicKey, certificateChain, provider)\n .createSigner(algo, parallelism);\n } catch (GeneralSecurityException | XiSecurityException ex) {\n throw new ObjectCreationException(ex.getMessage(), ex);\n }\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv xgetCryptProviderType();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "boolean hasPkiData();", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "public String mo34971a() {\n return \"SHA-384\";\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "public interface JsonKey {\n\n String CLASS = \"class\";\n String DATA = \"data\";\n String EKS = \"eks\";\n String ID = \"id\";\n String LEVEL = \"level\";\n String MESSAGE = \"message\";\n String METHOD = \"method\";\n String REQUEST_MESSAGE_ID = \"msgId\";\n String STACKTRACE = \"stacktrace\";\n String VER = \"ver\";\n String OK = \"ok\";\n String LOG_LEVEL = \"logLevel\";\n String ERROR = \"error\";\n String EMPTY_STRING = \"\";\n String RESPONSE = \"response\";\n String ADDRESS = \"address\";\n String KEY = \"key\";\n String ERROR_MSG = \"error_msg\";\n String ATTRIBUTE = \"attribute\";\n String ERRORS = \"errors\";\n String SUCCESS = \"success\";\n\n String CERTIFICATE = \"certificate\";\n String RECIPIENT_NAME = \"recipientName\";\n String COURSE_NAME = \"courseName\";\n String NAME = \"name\";\n String HTML_TEMPLATE = \"htmlTemplate\";\n String TAG = \"tag\";\n String ISSUER = \"issuer\";\n String URL = \"url\";\n String SIGNATORY_LIST = \"signatoryList\";\n String DESIGNATION = \"designation\";\n String SIGNATORY_IMAGE = \"image\";\n\n String DOMAIN_URL = \"sunbird_cert_domain_url\";\n String ASSESSED_DOMAIN = \"ASSESSED_DOMAIN\";\n String BADGE_URL = \"BADGE_URL\";\n String ISSUER_URL = \"ISSUER_URL\";\n String TEMPLATE_URL = \"TEMPLATE_URL\";\n String CONTEXT = \"CONTEXT\";\n String VERIFICATION_TYPE = \"VERIFICATION_TYPE\";\n String SIGNATORY_EXTENSION = \"SIGNATORY_EXTENSION\";\n String RECIPIENT_EMAIl = \"recipientEmail\";\n String RECIPIENT_PHONE = \"recipientPhone\";\n String RECIPIENT_ID = \"recipientId\";\n String VALID_FROM = \"validFrom\";\n String EXPIRY = \"expiry\";\n String OLD_ID = \"oldId\";\n String PUBLIC_KEY = \"publicKey\";\n String DESCRIPTION = \"description\";\n String LOGO = \"logo\";\n String ISSUE_DATE = \"issueDate\";\n String USER = \"user\";\n String CERTIFICATE_NAME = \"name\";\n\n String CONTAINER_NAME = \"CONTAINER_NAME\";\n String CLOUD_STORAGE_TYPE = \"CLOUD_STORAGE_TYPE\";\n String CLOUD_UPLOAD_RETRY_COUNT = \"CLOUD_UPLOAD_RETRY_COUNT\";\n String AZURE_STORAGE_SECRET = \"AZURE_STORAGE_SECRET\";\n String AZURE_STORAGE_KEY = \"AZURE_STORAGE_KEY\";\n String ACCESS_CODE_LENGTH = \"ACCESS_CODE_LENGTH\";\n String ORG_ID = \"orgId\";\n String KEYS = \"keys\";\n String ENC_SERVICE_URL = \"sunbird_cert_enc_service_url\";\n String SIGN_HEALTH_CHECK_URL = \"SIGN_HEALTH_CHECK_URL\";\n String SIGN_URL = \"SIGN_URL\";\n String SIGN_VERIFY_URL = \"SIGN_VERIFY_URL\";\n String SIGN_CREATOR = \"SIGN_CREATOR\";\n String SIGN = \"sign\";\n String VERIFY = \"verify\";\n String KEY_ID = \"keyId\";\n String JSON_URL = \"jsonUrl\";\n String PDF_URL = \"pdfUrl\";\n String UNIQUE_ID = \"id\";\n String GENERATE_CERT = \"generateCert\";\n String PUBLIC_KEY_URL = \"PUBLIC_KEY_URL\";\n String GET_SIGN_URL = \"getSignUrl\";\n String SIGNED_URL = \"signedUrl\";\n\n String ACCESS_CODE = \"accessCode\";\n String JSON_DATA = \"jsonData\";\n String SLUG = \"sunbird_cert_slug\";\n}", "BigInteger getCEP();", "java.lang.String getPubkey();", "public void setCertiType(java.lang.String certiType) {\n this.certiType = certiType;\n }", "@Schema(required = true, description = \"Contract type (KIP-7, KIP-17, ERC-20, ERC-721)\")\n public String getType() {\n return type;\n }", "public abstract String getSigAlgName();", "public ProfileKey getProfileKey(String username, String type) throws ProfileKeyManagerPersistenceException {\n ParameterHelpers.checkParameter(username, \"username\");\n\n boolean registered = checkType(type);\n\n Connection connection = getConnection();\n\n try {\n return getProfileKey(connection, username, type, registered);\n } finally {\n closeConnection(connection);\n }\n }", "protected CryptoProvider() {\n\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "@ParameterizedTest\n @EnumSource(KeyType.class)\n void testMissingJWTPublicKey(KeyType keyType) throws NoSuchAlgorithmException {\n final Pair<String, PrivateKey> keyPair = generateKeypair(keyType);\n\n final String jwt = Jwts.builder()\n .setHeaderParam(\"kid\", UUID.randomUUID())\n .setAudience(String.format(\"%sToken/auth\", \"here\"))\n .setIssuer(\"macaroon\")\n .setSubject(\"macaroon\")\n .setId(UUID.randomUUID().toString())\n .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES)))\n .signWith(keyPair.getRight(), APIAuthHelpers.getSigningAlgorithm(keyType))\n .compact();\n\n // Submit the JWT\n Response response = RESOURCE.target(\"/v1/Token/auth\")\n .queryParam(\"scope\", \"system/*.*\")\n .queryParam(\"grant_type\", \"client_credentials\")\n .queryParam(\"client_assertion_type\", TokenResource.CLIENT_ASSERTION_TYPE)\n .queryParam(\"client_assertion\", jwt)\n .request()\n .post(Entity.entity(\"\", MediaType.APPLICATION_FORM_URLENCODED));\n\n assertEquals(401, response.getStatus(), \"Should be unauthorized\");\n assertTrue(response.readEntity(String.class).contains(\"Cannot find public key\"), \"Should have correct exception\");\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "public ECP getPublicKGCKey(){return pkS;}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "private TPM_DIGEST createEmptyPubKeyHash()\r\n {\r\n// if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_BROADCOM )\r\n// {\r\n// return null;\r\n// }\r\n// else\r\n// {\r\n// return new TPM_DIGEST();\r\n// }\r\n if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_INFINEON )\r\n {\r\n return new TPM_DIGEST();\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }", "public String getTlsKey();", "@Test\n\tpublic void testSecuirtyConfigsOperations() throws NoSuchAlgorithmException {\n\t\t// Generate and store keys for the first time\n\t\tServerKeyPairs serverKeyPairs1 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair1 = serverKeyPairs1.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair1 = serverKeyPairs1.getSignatureKeyPair();\n\n\t\t// Initialize a new serverKeyPairs to test that it will only read\n\t\t// previously generated keys\n\t\tServerKeyPairs serverKeyPairs2 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair2 = serverKeyPairs2.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair2 = serverKeyPairs2.getSignatureKeyPair();\n\n\t\tassertEquals(\"Wrong loaded encryption public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded encryption private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getPrivateExponent());\n\n\t\tassertEquals(\"Wrong loaded signature public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded signature private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getPrivateExponent());\n\t}", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType.Enum getCryptAlgorithmType();", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public MEKeyTool() {\n keystore = new PublicKeyStoreBuilderBase();\n }", "public PrivateKeyType getPivateKeyType() {\n return PrivateKeyType.SAPLING_EXTENED_SPEND_KEY;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType xgetCryptAlgorithmType();", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "public void setPrincipalType(String principalType){\n this.principalType = principalType;\n //Update hashMap value..\n hashMap.put(\"principalType\", principalType);\n }", "private static String generateServerKey(Poi poi) {\n LonLat viewPoint = poi.getViewPosition();\n int lon = viewPoint.getLonInt();\n int lat = viewPoint.getLatInt();\n int alt = viewPoint.getAltInt();\n return generateServerKey(poi.getName(), poi.getAddress(), lon, lat, alt);\n }", "public static void main(String[] args) {\n String keyFile = \"D:\\\\data\\\\kms\\\\liweigang.idc\";\n String message = \"dksf3r38324hrewjrh3r&^%djfdsjkek\";\n String pubmatrix = \"D:\\\\data\\\\kms\\\\sm2cpk.cn.pkm\";\n\n byte[] keycard = Tool.ReadFile(keyFile);\n System.out.println(\"keyCard:\" + Tool.Bytes2Hex(keycard));\n\n //得到私钥\n byte[] priKey = GMJni.GetPriKey(keycard);\n String priKeyHex = Tool.Bytes2Hex(priKey);\n System.out.println(\"private key:\" + priKeyHex);\n\n //得到密钥标识\n byte[] keyId = GMJni.GetKeyId(keycard);\n System.out.println(\"keyId:\" + Tool.Bytes2String(keyId));\n\n //得到公钥\n byte[] pubKey = GMJni.CalPubKey(Tool.String2Bytes(pubmatrix), keyId);\n System.out.println(\"public key:\" + Tool.Bytes2Hex(pubKey));\n\n //1000个不同message\n List<String> msgList = new ArrayList<>(12);\n for (int i = 0; i < 1000; i++) {\n //message基础上字符串长度+10\n msgList.add(message + RandomUtil.randomString(10));\n }\n long start = System.currentTimeMillis();\n //签名结果\n int rv = 0;\n //缓存\n MapCache cache = new MapCache();\n //命中缓存次数\n int count = 0;\n int count2 = 0;\n for (int i = 0; i < 100000; i++) {\n System.out.println(\"模拟请求第\" + i + \"次数\");\n\n //计算E值\n //30种不同的message,即仅30个不走缓存\n byte[] E = GMJni.SM2GetE(keyId, pubKey, Tool.String2Bytes(msgList.get(new Random().nextInt(30))));\n String hexE = Tool.Bytes2Hex(E);\n// System.out.println(\"E:\" + hexE);\n\n //SM2签名\n byte[] sig = GMJni.SM2Sign(priKey, E);\n// System.out.println(\"private key:\" + Tool.Bytes2Hex(priKey));\n// System.out.println(\"sign value:\" + Tool.Bytes2Hex(sig));\n\n // SM2签名验证\n // 引入Map缓存 E,sig的16进制的MD5值\n String hex = hexE + priKeyHex;\n// System.out.println(\"finalStr:\" + hex);\n String md5 = SecureUtil.md5(hex);\n if (null != cache.get(md5)) {\n count++;\n// System.out.println(\"命中缓存\" + (++count));\n } else {\n rv += GMJni.SM2Verify(pubKey, E, sig);\n count2++;\n cache.add(md5, (byte) 1, 50 * 1000);\n }\n }\n long end = System.currentTimeMillis();\n double v = (end - start) / 1000.0;\n System.out.println(\"time consuming:\" + v + \" sec\");\n System.out.println(Math.round(100000 / v) + \" times/sec\");\n System.out.println(\"命中缓存\" + (count));\n System.out.println(\"未命中\" + (count2));\n if (rv != 0) {\n System.out.println(\"Verify signature fail, error code is \" + String.valueOf(rv));\n } else {\n System.out.println(\"Verify signature success.\");\n }\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public java.lang.String getCertiType() {\n return certiType;\n }", "public static void registerDefaultAlgorithms() {\n/* 390 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#dsa-sha1\", SignatureDSA.class);\n/* */ \n/* */ \n/* 393 */ algorithmHash.put(\"http://www.w3.org/2009/xmldsig11#dsa-sha256\", SignatureDSA.SHA256.class);\n/* */ \n/* */ \n/* 396 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\", SignatureBaseRSA.SignatureRSASHA1.class);\n/* */ \n/* */ \n/* 399 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#hmac-sha1\", IntegrityHmac.IntegrityHmacSHA1.class);\n/* */ \n/* */ \n/* 402 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-md5\", SignatureBaseRSA.SignatureRSAMD5.class);\n/* */ \n/* */ \n/* */ \n/* 406 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160\", SignatureBaseRSA.SignatureRSARIPEMD160.class);\n/* */ \n/* */ \n/* */ \n/* 410 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\", SignatureBaseRSA.SignatureRSASHA256.class);\n/* */ \n/* */ \n/* 413 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384\", SignatureBaseRSA.SignatureRSASHA384.class);\n/* */ \n/* */ \n/* 416 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\", SignatureBaseRSA.SignatureRSASHA512.class);\n/* */ \n/* */ \n/* 419 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1\", SignatureECDSA.SignatureECDSASHA1.class);\n/* */ \n/* */ \n/* 422 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256\", SignatureECDSA.SignatureECDSASHA256.class);\n/* */ \n/* */ \n/* 425 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384\", SignatureECDSA.SignatureECDSASHA384.class);\n/* */ \n/* */ \n/* 428 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512\", SignatureECDSA.SignatureECDSASHA512.class);\n/* */ \n/* */ \n/* 431 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-md5\", IntegrityHmac.IntegrityHmacMD5.class);\n/* */ \n/* */ \n/* 434 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160\", IntegrityHmac.IntegrityHmacRIPEMD160.class);\n/* */ \n/* */ \n/* 437 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha256\", IntegrityHmac.IntegrityHmacSHA256.class);\n/* */ \n/* */ \n/* 440 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha384\", IntegrityHmac.IntegrityHmacSHA384.class);\n/* */ \n/* */ \n/* 443 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha512\", IntegrityHmac.IntegrityHmacSHA512.class);\n/* */ }", "java.lang.String getServerSecret();", "public static void main(String[] args) {\n\t\tString algorithm = SignatureAlgorithm.HS256.getJcaName();\r\n\t\tSystem.out.println(algorithm);\r\n\r\n\t\t// set secret key\r\n\t\tString secret = \"this+is+my+scret+key+AAAAAAAAAAAAAAAAAAAAAAAAA\";\r\n\r\n\t\t// background information\r\n\t\t// =============================================================\r\n\t\t/*\r\n\t\t * the bytes of the secret key will be used by the signature algorithm - must be\r\n\t\t * in base 64 format\r\n\t\t */\r\n//\t\tbyte[] scretKeyEncoded = secret.getBytes(); // java encoding\r\n//\t\tbyte[] scretKeyDecoded = Base64.getDecoder().decode(secret); // base64\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyEncoded));\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyDecoded));\r\n\t\t// =====================================================================================\r\n\r\n\t\t// create the key from the decoded secret\r\n\t\tKey key = new SecretKeySpec(Base64.getDecoder().decode(secret), algorithm);\r\n\r\n\t\tInstant now = Instant.now();\r\n\r\n\t\t// create a JWT instance\r\n\t\tString jwt = Jwts.builder()\r\n\r\n\t\t\t\t.signWith(key)\r\n\r\n\t\t\t\t.setIssuedAt(Date.from(now))\r\n\r\n\t\t\t\t// will be valid for 10 seconds\r\n\t\t\t\t.setExpiration(Date.from(now.plus(10, ChronoUnit.SECONDS)))\r\n\r\n\t\t\t\t.setSubject(\"aaa@mail\")\r\n\r\n\t\t\t\t.claim(\"First name\", \"Dan\")\r\n\r\n\t\t\t\t.claim(\"Last name\", \"Levi\")\r\n\r\n\t\t\t\t.compact();\r\n\r\n\t\tSystem.out.println(jwt);\r\n\r\n\t\t// ==================================================\r\n\t\t// parse the JWS to get the expanded JWT\r\n//\t\tJWS - JSON Web Signature [aaaa.bbbb.cccc]\r\n//\t\tJWT - JSON Web Token [aaaa.bbbb.cccc]\r\n\r\n\t\tSystem.out.println(\"====================\");\r\n\t\tSystem.out.println(\"parsing the JWS to get a JWT\");\r\n\t\tJwtParser jwtParser = Jwts.parserBuilder().setSigningKey(key).build();\r\n\t\t// to demonstrate expiration paste an old JWS\r\n\t\tjwt = \"eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjA2Mzk1MTEsImV4cCI6MTYyMDYzOTUyMSwic3ViIjoiYWFhQG1haWwiLCJGaXJzdCBuYW1lIjoiRGFuIiwiTGFzdCBuYW1lIjoiTGV2aSJ9.cefEbBejjebKVILgOzca0LJZfd0F3qjezegeCaxOrfE\";\r\n\t\tSystem.out.println(jwtParser.parse(jwt));\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getHeader());\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getBody());\r\n\r\n\t}", "private String getSignatureString(Type type)\r\n {\r\n if(type instanceof CompoundType)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n CompoundType cType = (CompoundType)type;\r\n //find key and value types\r\n String keyType = getSignatureString(cType.keyType);\r\n sb.append(\"Ljava/util/HashMap\");\r\n sb.append(\"<\");\r\n sb.append(keyType);\r\n sb.append(getSignatureString(cType.valType));\r\n sb.append(\">;\");\r\n return sb.toString();\r\n }\r\n else if(type instanceof SimpleType)\r\n {\r\n switch(((SimpleType)type).type)\r\n {\r\n case INT:\r\n return \"Ljava/lang/Integer;\";\r\n case BOOLEAN:\r\n return \"Ljava/lang/Boolean;\";\r\n case STRING:\r\n return \"Ljava/lang/String;\";\r\n }\r\n }\r\n return null;\r\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "public String getJCEProviderName() {\n/* 196 */ return this.signatureAlgorithm.engineGetJCEProviderName();\n/* */ }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public String getJCEAlgorithmString() {\n/* 187 */ return this.signatureAlgorithm.engineGetJCEAlgorithmString();\n/* */ }", "com.google.protobuf.ByteString getPublicEciesKeyBytes();", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "public static String getKeyTypeName(KeyType type)\n {\n // TODO: should be moved to DBProvider ...\n // MySQL : key identifier\n // SQLServer : key identifier\n // Derby : key identifier\n // PostgreSQL: key identifier\n switch (type) {\n // MySQL: key types ...\n case PRIMARY : return \"PRIMARY KEY\"; // table\n case UNIQUE : return \"UNIQUE\"; // table\n case INDEX : return \"INDEX\"; // table/index\n case UNIQUE_INDEX : return \"UNIQUE INDEX\"; // table/index\n default : return \"UNKNOWN\";\n }\n }", "long getCryptProviderTypeExt();", "@PostMapping(\"/createKeyPair\")\n public String createKeyPair() {\n \n AWSKMS kmsClient = AWSKMSClientBuilder.standard().build();\n \n return \"Private uid: \"+ priuid +\"\\nPublic uid: \" + pubuid +\"\\n\";\n }", "long getCryptAlgorithmSid();", "switch (buffer[ISO7816.OFFSET_CDATA + 4]) {\r\n\t\tcase BASIC:\r\n\t\t\tsetSignatureType(BASIC);\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tsetSignatureType(AUTHENTICATION);\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tsetSignatureType(NON_REPUDIATION);\r\n\t\t\tbreak;\r\n\t\tcase CA_ROLE:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\tdefault:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "private KeyStore askForPin() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {\n char newPin[] = PinDialog.getPIN(this.providerDesc);\n try {\n KeyStore ks = getKeyStore(newPin);\n pin = newPin;\n return ks;\n } catch (IOException e2) {\n e2.printStackTrace();\n if (e2.getCause() instanceof LoginException) {\n JOptionPane.showMessageDialog(null, \"Wrong PIN\", \"Cryptographic card\", JOptionPane.WARNING_MESSAGE);\n }\n throw e2;\n }\n }", "public String getTlsKeyPath();", "@Override\n public String getProviderName() {\n return \"SimpleEncryptionKeyStoreProvider\";\n }", "public byte[] getUserKey() throws IOException\n {\n byte[] u = null;\n COSString user = (COSString)encryptionDictionary.getDictionaryObject( COSName.getPDFName( \"U\" ) );\n if( user != null )\n {\n u = user.getBytes();\n }\n return u;\n }", "public interface SKey {\n\n String FAIL_STORE = \"job.fail.store\";\n\n String LOADBALANCE = \"loadbalance\";\n\n String EVENT_CENTER = \"event.center\";\n\n String REMOTING = \"lts.remoting\";\n\n String REMOTING_SERIALIZABLE_DFT = \"lts.remoting.serializable.default\";\n\n String ZK_CLIENT_KEY = \"zk.client\";\n\n String JOB_ID_GENERATOR = \"id.generator\";\n\n String JOB_LOGGER = \"job.logger\";\n\n String JOB_QUEUE = \"job.queue\";\n}", "private void getKeyType(final PdfObject pdfObject, final int i, final byte[] raw, final int length, final int keyLength, final int keyStart, final int type) {\n if(debugFastCode)//used in debug\n {\n PDFkey = PdfDictionary.getKey(keyStart, keyLength, raw);\n }\n \n PDFkeyInt=PdfDictionary.getIntKey(keyStart,keyLength,raw);\n \n //correct mapping\n if(PDFkeyInt==PdfDictionary.Indexed && (type==PdfDictionary.MK ||type==PdfDictionary.Form || type==PdfDictionary.Linearized || type==PdfDictionary.Group)) {\n PDFkeyInt = PdfDictionary.I;\n }\n \n if(isInlineImage) {\n PDFkeyInt = PdfObjectFactory.getInlineID(PDFkeyInt);\n }\n \n final int id=pdfObject.getID();\n \n if(type==PdfDictionary.Resources && (PDFkeyInt==PdfDictionary.ColorSpace\n || PDFkeyInt==PdfDictionary.ExtGState || PDFkeyInt==PdfDictionary.Shading\n || PDFkeyInt==PdfDictionary.XObject || PDFkeyInt==PdfDictionary.Font|| PDFkeyInt==PdfDictionary.Pattern)){\n pdfKeyType=PdfDictionary.VALUE_IS_DICTIONARY_PAIRS;\n //}else if (type==PdfDictionary.Form && id== PdfDictionary.AA && PDFkeyInt== PdfDictionary.K){\n // pdfKeyType= PdfDictionary.VALUE_IS_UNREAD_DICTIONARY;\n }else if (type==PdfDictionary.Outlines && PDFkeyInt== PdfDictionary.D){\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && PDFkeyInt== PdfDictionary.D){\n if(id==PdfDictionary.AP || id==PdfDictionary.AA){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if(id==PdfDictionary.Win){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else{\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && (id==PdfDictionary.AP || id==PdfDictionary.AA) && PDFkeyInt== PdfDictionary.A){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if (PDFkeyInt== PdfDictionary.Order && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary. VALUE_IS_OBJECT_ARRAY;\n }else if (PDFkeyInt== PdfDictionary.Name && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if ((type==PdfDictionary.ColorSpace || type==PdfDictionary.Function) && PDFkeyInt== PdfDictionary.N){\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(PDFkeyInt==PdfDictionary.Gamma && type==PdfDictionary.ColorSpace &&\n pdfObject.getParameterConstant(PdfDictionary.ColorSpace)== ColorSpaces.CalGray){ //its a number not an array\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(id==PdfDictionary.Win && pdfObject.getObjectType()==PdfDictionary.Form &&\n (PDFkeyInt==PdfDictionary.P || PDFkeyInt==PdfDictionary.O)){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if (isInlineImage && PDFkeyInt==PdfDictionary.ColorSpace){\n pdfKeyType= PdfDictionary.VALUE_IS_DICTIONARY;\n }else {\n pdfKeyType = PdfDictionary.getKeyType(PDFkeyInt, type);\n }\n \n \n //handle array of Function in Shading by using keyArray\n if(id==PdfDictionary.Shading && PDFkeyInt==PdfDictionary.Function){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n if(raw[ptr]=='['){\n pdfKeyType=PdfDictionary.VALUE_IS_KEY_ARRAY;\n }\n }\n \n //allow for other values in D,N,R definitions\n if(pdfKeyType==-1 && id== PdfDictionary.ClassMap){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n }else\n //allow for other values in D,N,R definitions as key pairs\n if(((((id==PdfDictionary.N || id==PdfDictionary.D || id==PdfDictionary.R))) &&\n pdfObject.getParentID()==PdfDictionary.AP &&\n pdfObject.getObjectType()==PdfDictionary.Form\n && raw[i]!='[' )){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n //decide if pair\n if(raw[keyStart]=='L' && raw[keyStart+1]=='e' && raw[keyStart+2]=='n' && raw[keyStart+3]=='g' && raw[keyStart+4]=='t' && raw[keyStart+5]=='h'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='n'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='f' && raw[keyStart+2]=='f'){\n }else\n if(raw[ptr]=='R'){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n \n if(debugFastCode) {\n System.out.println(\"new Returns \" + pdfKeyType + \" i=\" + i);\n }\n }\n }\n \n /**/\n \n //DecodeParms can be an array as well as a dictionary so check next char and alter if so\n if(PDFkeyInt==PdfDictionary.DecodeParms) {\n pdfKeyType = setTypeForDecodeParams(i, raw, length, pdfKeyType);\n }\n \n if(debugFastCode && pdfKeyType==-1 && pdfObject.getObjectType()!=PdfDictionary.Page){\n System.out.println(id+\" \"+type);\n System.out.println(padding +PDFkey+\" NO type setting for \"+PdfDictionary.getKey(keyStart,keyLength,raw)+\" id=\"+i);\n }\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "public PaymentRecordKey() {\n super();\n }", "private PasskeyContract() {}", "public RSAKeyPairGenerator() {\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum getCryptProviderType();", "java.lang.String getSignatureProviderId();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }" ]
[ "0.6726498", "0.6677302", "0.65103334", "0.6503502", "0.62628514", "0.6250372", "0.61004686", "0.5888439", "0.58146834", "0.5749554", "0.55435157", "0.5493693", "0.5474418", "0.52934134", "0.52665645", "0.5246521", "0.52349544", "0.5175871", "0.5017036", "0.5007778", "0.4962969", "0.4950082", "0.49420312", "0.49163356", "0.49024847", "0.48897386", "0.48511118", "0.48511118", "0.4844952", "0.48370767", "0.4831613", "0.4831613", "0.4831613", "0.48279023", "0.4821235", "0.48205858", "0.48205858", "0.48201925", "0.48012882", "0.4783611", "0.47606364", "0.47574088", "0.47566023", "0.47519523", "0.47286636", "0.47235122", "0.47220808", "0.47063407", "0.47040585", "0.47039852", "0.47009808", "0.4687133", "0.46720207", "0.4663095", "0.46227324", "0.46167073", "0.4614823", "0.46146208", "0.46117303", "0.4609115", "0.4605506", "0.45985833", "0.45930865", "0.45889315", "0.45830595", "0.45830226", "0.45740417", "0.45735276", "0.4572773", "0.4563699", "0.4561856", "0.45605567", "0.45527497", "0.45521763", "0.4549838", "0.4536104", "0.45360166", "0.4531036", "0.45309407", "0.45290637", "0.45238796", "0.4519284", "0.45178244", "0.4511146", "0.45110682", "0.4508972", "0.45000508", "0.44973904", "0.44938332", "0.44937173", "0.44929975", "0.44925633", "0.44923615", "0.44870168", "0.44844353", "0.44840944", "0.44768944", "0.44768745", "0.4473516", "0.4471568" ]
0.5741641
10
none / x509+sha256 / x509+sha1 optional string pki_type = 2 [default = "none"];
@java.lang.Override public java.lang.String getPkiType() { return pkiType_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPkiType();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "boolean hasPkiType();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "public static void main(String[] args) throws IcbcApiException {\n\t\tUiIcbcClient client = new UiIcbcClient(APP_ID,IcbcConstants.SIGN_TYPE_RSA,\n\t\t\t\t\"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJCoQe/O+uqpOtyE/2CUjD7wosZw8jI1AlLNJCllOmlX+obA6h97b0JsEL0SjMCAR3xJyw7MKLqkcy5qQ/bBgw2XSrodmjzOVqfT1OXRii0xw0HiVkHR4cEWnEAAdfo0lDc4iuzCIQrnT5gM0+U+qeSV6JFfwVRjgYzBdHQRPCf1AgMBAAECgYAdQUoEe7GXH5591o/nMmOinvvscg8pRDsyD7bOgGBtyZMrCXzP3SDFKCHCeyvoColqg2oDlhpulK+OpYMVNlGQcO4eubOJp9MUc3m4A9RxkVr3dsVrmygM5czPfWHAPVQ4dECDruBJn9zoo1ci0myRTh4KSCq6SxpCE0Pbf3j7iQJBAOdMPFRfOkSQ1hsN9Mg4jd9on8r7+mF8gFPhkNI6qvEKw/prmU3obUWvZL42vRlLOQyyB92mBF24PStR/B6CjR8CQQCgGz0VoqCplurSCapGdgX3D7bNSDtMUmaLJYJxih8v+zghP0YtVgDeV3NjogVjOlz8/9Rebo0PoFcqyJnNA1RrAkEAul3dBoasZm7ldWsrXuDiv66HgoDB4Cb3J59Kl3oaHpp0CqUEI5gx48JNRE7K00SfNTGF0Pxh7Dn1X6Bxqwu6NQJADrdyPfLc4bnFi9jnleJzWepP2z6wdKt+UXv5KYaQp1BoMGYohTJKkiVnrdjOtfg/Y+IAG03+GVmbqYsW2AleUQJBANYQklohKtsmq8ptX3as6hjcuXcTpc2DSpVeOnCueNv107+dDJ+K14tbiVYzF3tkHBNMRkGtr6EuGKJ+A63sJ00=\",\n\t\t\t\tIcbcConstants.CHARSET_UTF8,IcbcConstants.ENCRYPT_TYPE_AES, \"xMh0xFsG7G80ziePFdnT8g==\");\n\t\tEaccountManageRequestV1 request = new EaccountManageRequestV1();\t\t\n\t\trequest.setServiceUrl(\"http://122.64.61.111:8081/ui/eaccount/manage/V1\");///\n\t\tEaccountManageRequestBizV1 bizContent = new EaccountManageRequestBizV1();\n\t\tbizContent.setMobileNo(\"13703878410\");//选输,手机号\n\t\tbizContent.setIdcode(\"128440810108044\");//选输,身份证号\n\t\tbizContent.setName(URLEncoder.encode(\"芡悠\"));//选输,用户姓名\n\t\tbizContent.setUserId(\"128440810108044\");//必输,需控制不能为空,用户唯一标识,送身份证号\n\t\tbizContent.setBacAddr(URLEncoder.encode(\"http://www.test.com\"));//选输,回调地址\n\t\tbizContent.setEpayflag(\"0\");//选输,工银e支付标志,0-短信、1-静态密码,集成客户端SDK的方式能送0-短信或1-静态密码,非APP方式只能送0-短信,不送默认为0-短信\n\t\t\n\t\tbizContent.setCorpAppid(APP_ID);//外公司合作方送APP_ID的值,行内应用如e支付等送外公司合作方的APPID\n\t\tlong systime = System.currentTimeMillis(); // 现时间戳\t\t\n\t\tString orderTimeStamp=new Long(systime).toString();\n\t\t\n\t\tSystem.out.println(\"orderTimeStamp:\"+orderTimeStamp);\n\t\tbizContent.setOrderTimeStamp(orderTimeStamp);//生成请求的时间,必输\n\t\t\n\t\tbizContent.setZoneno(\"00200\");//地区号号,选输,5位数字,上送值联系对接分行提供\n\t\tbizContent.setBrno(\"00260\");//网点号,选输,5位数字,上送值联系对接分行提供\n\t\t\n\t\trequest.setBizContent(bizContent);\n\t\tSystem.out.println(client.buildPostForm(request));// 实际调用时的相关返回结果及异常处理,请自行添加\n\t}", "dkk mo4509g();", "private void generatePrivacyKeyPair(boolean clientMode) throws IOException, UnsupportedEncodingException, NoSuchAlgorithmException, SaslException {\n byte[] ccmagic = CLIENT_CONF_MAGIC.getBytes(encoding);\n byte[] scmagic = SVR_CONF_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n int n;\n if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_40])) {\n n = 5;\n } else if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_56])) {\n n = 7;\n } else {\n n = 16;\n }\n byte[] keyBuffer = new byte[n + ccmagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, n);\n System.arraycopy(ccmagic, 0, keyBuffer, n, ccmagic.length);\n md5.update(keyBuffer);\n byte[] Kcc = md5.digest();\n System.arraycopy(scmagic, 0, keyBuffer, n, scmagic.length);\n md5.update(keyBuffer);\n byte[] Kcs = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST24:Kcc: \", Kcc);\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST25:Kcs: \", Kcs);\n }\n byte[] myKc;\n byte[] peerKc;\n if (clientMode) {\n myKc = Kcc;\n peerKc = Kcs;\n } else {\n myKc = Kcs;\n peerKc = Kcc;\n }\n try {\n SecretKey encKey;\n SecretKey decKey;\n if (negotiatedCipher.indexOf(CIPHER_TOKENS[RC4]) > -1) {\n encCipher = Cipher.getInstance(\"RC4\");\n decCipher = Cipher.getInstance(\"RC4\");\n encKey = new SecretKeySpec(myKc, \"RC4\");\n decKey = new SecretKeySpec(peerKc, \"RC4\");\n encCipher.init(Cipher.ENCRYPT_MODE, encKey);\n decCipher.init(Cipher.DECRYPT_MODE, decKey);\n } else if ((negotiatedCipher.equals(CIPHER_TOKENS[DES])) || (negotiatedCipher.equals(CIPHER_TOKENS[DES3]))) {\n String cipherFullname, cipherShortname;\n if (negotiatedCipher.equals(CIPHER_TOKENS[DES])) {\n cipherFullname = \"DES/CBC/NoPadding\";\n cipherShortname = \"des\";\n } else {\n cipherFullname = \"DESede/CBC/NoPadding\";\n cipherShortname = \"desede\";\n }\n encCipher = Cipher.getInstance(cipherFullname);\n decCipher = Cipher.getInstance(cipherFullname);\n encKey = makeDesKeys(myKc, cipherShortname);\n decKey = makeDesKeys(peerKc, cipherShortname);\n IvParameterSpec encIv = new IvParameterSpec(myKc, 8, 8);\n IvParameterSpec decIv = new IvParameterSpec(peerKc, 8, 8);\n encCipher.init(Cipher.ENCRYPT_MODE, encKey, encIv);\n decCipher.init(Cipher.DECRYPT_MODE, decKey, decIv);\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST26:\" + negotiatedCipher + \" IVcc: \", encIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST27:\" + negotiatedCipher + \" IVcs: \", decIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST28:\" + negotiatedCipher + \" encryption key: \", encKey.getEncoded());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST29:\" + negotiatedCipher + \" decryption key: \", decKey.getEncoded());\n }\n }\n } catch (InvalidKeySpecException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported key \" + \"specification used.\", e);\n } catch (InvalidAlgorithmParameterException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid cipher \" + \"algorithem parameter used to create cipher instance\", e);\n } catch (NoSuchPaddingException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported \" + \"padding used for chosen cipher\", e);\n } catch (InvalidKeyException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid data \" + \"used to initialize keys\", e);\n }\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "java.lang.String getPublicEciesKey();", "OpenSSLKey mo134201a();", "public abstract String getSigAlgOID();", "private void generateIntegrityKeyPair(boolean clientMode) throws UnsupportedEncodingException, IOException, NoSuchAlgorithmException {\n byte[] cimagic = CLIENT_INT_MAGIC.getBytes(encoding);\n byte[] simagic = SVR_INT_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n byte[] keyBuffer = new byte[H_A1.length + cimagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, H_A1.length);\n System.arraycopy(cimagic, 0, keyBuffer, H_A1.length, cimagic.length);\n md5.update(keyBuffer);\n byte[] Kic = md5.digest();\n System.arraycopy(simagic, 0, keyBuffer, H_A1.length, simagic.length);\n md5.update(keyBuffer);\n byte[] Kis = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST12:Kic: \", Kic);\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST13:Kis: \", Kis);\n }\n if (clientMode) {\n myKi = Kic;\n peerKi = Kis;\n } else {\n myKi = Kis;\n peerKi = Kic;\n }\n }", "public final String mo1957a() {\n return \"type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey\";\n }", "private native String native_ks(long cookie, byte[] userKey);", "@Override\n public ConcurrentContentSigner newSigner(\n String type, SignerConf conf, X509Cert[] certificateChain)\n throws ObjectCreationException {\n type = type.toLowerCase(Locale.ROOT);\n if (!types.contains(type)) {\n throw new ObjectCreationException(\"unknown signer type \" + type);\n }\n\n String str = conf.getConfValue(\"parallelism\");\n int parallelism = 20;\n if (str != null) {\n try {\n parallelism = Integer.parseInt(str);\n } catch (NumberFormatException ex) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n\n if (parallelism < 1) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n }\n\n str = conf.getConfValue(\"alias\");\n if (str == null) {\n throw new ObjectCreationException(\"alias is not specified\");\n }\n int keyId = Integer.parseInt(str);\n\n String algoName = conf.getConfValue(\"algo\");\n if (algoName == null) {\n throw new ObjectCreationException(\"algo is not specified\");\n }\n\n try {\n InitStatus initStatus = init(type);\n if (initStatus.status.get() != 1) {\n throw new ObjectCreationException(initStatus.details);\n }\n\n SignAlgo algo = SignAlgo.getInstance(algoName);\n String keyAlgoName;\n String bcKeyAlgoName;\n if (algo.isSM2SigAlgo()) {\n keyAlgoName = \"SM2\";\n bcKeyAlgoName = \"EC\";\n } else if (algo.isRSAPkcs1SigAlgo() || algo.isRSAPSSSigAlgo()) {\n keyAlgoName = \"RSA\";\n bcKeyAlgoName = \"RSA\";\n } else if (algo.isECDSASigAlgo() || algo.isPlainECDSASigAlgo()) {\n keyAlgoName = \"EC\";\n bcKeyAlgoName = \"EC\";\n } else {\n throw new ObjectCreationException(\"unsupported algo \" + algoName);\n }\n\n Provider provider = providerMap.get(type);\n\n // Method to read create PrivateKey and PublicKey object.\n // SANSEC use KeyPairGenerator.generateKeyPair to read the keypair-\n // No new keypair will be generated here.\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(keyAlgoName, provider);\n kpGen.initialize(keyId << 16);\n KeyPair kp = kpGen.generateKeyPair();\n\n PublicKey publicKey = KeyFactory.getInstance(bcKeyAlgoName, \"BC\")\n .generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));\n\n return new JceSignerBuilder(kp.getPrivate(), publicKey, certificateChain, provider)\n .createSigner(algo, parallelism);\n } catch (GeneralSecurityException | XiSecurityException ex) {\n throw new ObjectCreationException(ex.getMessage(), ex);\n }\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv xgetCryptProviderType();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "boolean hasPkiData();", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "public String mo34971a() {\n return \"SHA-384\";\n }", "public interface JsonKey {\n\n String CLASS = \"class\";\n String DATA = \"data\";\n String EKS = \"eks\";\n String ID = \"id\";\n String LEVEL = \"level\";\n String MESSAGE = \"message\";\n String METHOD = \"method\";\n String REQUEST_MESSAGE_ID = \"msgId\";\n String STACKTRACE = \"stacktrace\";\n String VER = \"ver\";\n String OK = \"ok\";\n String LOG_LEVEL = \"logLevel\";\n String ERROR = \"error\";\n String EMPTY_STRING = \"\";\n String RESPONSE = \"response\";\n String ADDRESS = \"address\";\n String KEY = \"key\";\n String ERROR_MSG = \"error_msg\";\n String ATTRIBUTE = \"attribute\";\n String ERRORS = \"errors\";\n String SUCCESS = \"success\";\n\n String CERTIFICATE = \"certificate\";\n String RECIPIENT_NAME = \"recipientName\";\n String COURSE_NAME = \"courseName\";\n String NAME = \"name\";\n String HTML_TEMPLATE = \"htmlTemplate\";\n String TAG = \"tag\";\n String ISSUER = \"issuer\";\n String URL = \"url\";\n String SIGNATORY_LIST = \"signatoryList\";\n String DESIGNATION = \"designation\";\n String SIGNATORY_IMAGE = \"image\";\n\n String DOMAIN_URL = \"sunbird_cert_domain_url\";\n String ASSESSED_DOMAIN = \"ASSESSED_DOMAIN\";\n String BADGE_URL = \"BADGE_URL\";\n String ISSUER_URL = \"ISSUER_URL\";\n String TEMPLATE_URL = \"TEMPLATE_URL\";\n String CONTEXT = \"CONTEXT\";\n String VERIFICATION_TYPE = \"VERIFICATION_TYPE\";\n String SIGNATORY_EXTENSION = \"SIGNATORY_EXTENSION\";\n String RECIPIENT_EMAIl = \"recipientEmail\";\n String RECIPIENT_PHONE = \"recipientPhone\";\n String RECIPIENT_ID = \"recipientId\";\n String VALID_FROM = \"validFrom\";\n String EXPIRY = \"expiry\";\n String OLD_ID = \"oldId\";\n String PUBLIC_KEY = \"publicKey\";\n String DESCRIPTION = \"description\";\n String LOGO = \"logo\";\n String ISSUE_DATE = \"issueDate\";\n String USER = \"user\";\n String CERTIFICATE_NAME = \"name\";\n\n String CONTAINER_NAME = \"CONTAINER_NAME\";\n String CLOUD_STORAGE_TYPE = \"CLOUD_STORAGE_TYPE\";\n String CLOUD_UPLOAD_RETRY_COUNT = \"CLOUD_UPLOAD_RETRY_COUNT\";\n String AZURE_STORAGE_SECRET = \"AZURE_STORAGE_SECRET\";\n String AZURE_STORAGE_KEY = \"AZURE_STORAGE_KEY\";\n String ACCESS_CODE_LENGTH = \"ACCESS_CODE_LENGTH\";\n String ORG_ID = \"orgId\";\n String KEYS = \"keys\";\n String ENC_SERVICE_URL = \"sunbird_cert_enc_service_url\";\n String SIGN_HEALTH_CHECK_URL = \"SIGN_HEALTH_CHECK_URL\";\n String SIGN_URL = \"SIGN_URL\";\n String SIGN_VERIFY_URL = \"SIGN_VERIFY_URL\";\n String SIGN_CREATOR = \"SIGN_CREATOR\";\n String SIGN = \"sign\";\n String VERIFY = \"verify\";\n String KEY_ID = \"keyId\";\n String JSON_URL = \"jsonUrl\";\n String PDF_URL = \"pdfUrl\";\n String UNIQUE_ID = \"id\";\n String GENERATE_CERT = \"generateCert\";\n String PUBLIC_KEY_URL = \"PUBLIC_KEY_URL\";\n String GET_SIGN_URL = \"getSignUrl\";\n String SIGNED_URL = \"signedUrl\";\n\n String ACCESS_CODE = \"accessCode\";\n String JSON_DATA = \"jsonData\";\n String SLUG = \"sunbird_cert_slug\";\n}", "BigInteger getCEP();", "java.lang.String getPubkey();", "public void setCertiType(java.lang.String certiType) {\n this.certiType = certiType;\n }", "public abstract String getSigAlgName();", "@Schema(required = true, description = \"Contract type (KIP-7, KIP-17, ERC-20, ERC-721)\")\n public String getType() {\n return type;\n }", "public ProfileKey getProfileKey(String username, String type) throws ProfileKeyManagerPersistenceException {\n ParameterHelpers.checkParameter(username, \"username\");\n\n boolean registered = checkType(type);\n\n Connection connection = getConnection();\n\n try {\n return getProfileKey(connection, username, type, registered);\n } finally {\n closeConnection(connection);\n }\n }", "protected CryptoProvider() {\n\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "@ParameterizedTest\n @EnumSource(KeyType.class)\n void testMissingJWTPublicKey(KeyType keyType) throws NoSuchAlgorithmException {\n final Pair<String, PrivateKey> keyPair = generateKeypair(keyType);\n\n final String jwt = Jwts.builder()\n .setHeaderParam(\"kid\", UUID.randomUUID())\n .setAudience(String.format(\"%sToken/auth\", \"here\"))\n .setIssuer(\"macaroon\")\n .setSubject(\"macaroon\")\n .setId(UUID.randomUUID().toString())\n .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES)))\n .signWith(keyPair.getRight(), APIAuthHelpers.getSigningAlgorithm(keyType))\n .compact();\n\n // Submit the JWT\n Response response = RESOURCE.target(\"/v1/Token/auth\")\n .queryParam(\"scope\", \"system/*.*\")\n .queryParam(\"grant_type\", \"client_credentials\")\n .queryParam(\"client_assertion_type\", TokenResource.CLIENT_ASSERTION_TYPE)\n .queryParam(\"client_assertion\", jwt)\n .request()\n .post(Entity.entity(\"\", MediaType.APPLICATION_FORM_URLENCODED));\n\n assertEquals(401, response.getStatus(), \"Should be unauthorized\");\n assertTrue(response.readEntity(String.class).contains(\"Cannot find public key\"), \"Should have correct exception\");\n }", "public ECP getPublicKGCKey(){return pkS;}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "private TPM_DIGEST createEmptyPubKeyHash()\r\n {\r\n// if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_BROADCOM )\r\n// {\r\n// return null;\r\n// }\r\n// else\r\n// {\r\n// return new TPM_DIGEST();\r\n// }\r\n if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_INFINEON )\r\n {\r\n return new TPM_DIGEST();\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }", "public String getTlsKey();", "@Test\n\tpublic void testSecuirtyConfigsOperations() throws NoSuchAlgorithmException {\n\t\t// Generate and store keys for the first time\n\t\tServerKeyPairs serverKeyPairs1 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair1 = serverKeyPairs1.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair1 = serverKeyPairs1.getSignatureKeyPair();\n\n\t\t// Initialize a new serverKeyPairs to test that it will only read\n\t\t// previously generated keys\n\t\tServerKeyPairs serverKeyPairs2 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair2 = serverKeyPairs2.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair2 = serverKeyPairs2.getSignatureKeyPair();\n\n\t\tassertEquals(\"Wrong loaded encryption public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded encryption private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getPrivateExponent());\n\n\t\tassertEquals(\"Wrong loaded signature public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded signature private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getPrivateExponent());\n\t}", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType.Enum getCryptAlgorithmType();", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public MEKeyTool() {\n keystore = new PublicKeyStoreBuilderBase();\n }", "public PrivateKeyType getPivateKeyType() {\n return PrivateKeyType.SAPLING_EXTENED_SPEND_KEY;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType xgetCryptAlgorithmType();", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "public void setPrincipalType(String principalType){\n this.principalType = principalType;\n //Update hashMap value..\n hashMap.put(\"principalType\", principalType);\n }", "public static void main(String[] args) {\n String keyFile = \"D:\\\\data\\\\kms\\\\liweigang.idc\";\n String message = \"dksf3r38324hrewjrh3r&^%djfdsjkek\";\n String pubmatrix = \"D:\\\\data\\\\kms\\\\sm2cpk.cn.pkm\";\n\n byte[] keycard = Tool.ReadFile(keyFile);\n System.out.println(\"keyCard:\" + Tool.Bytes2Hex(keycard));\n\n //得到私钥\n byte[] priKey = GMJni.GetPriKey(keycard);\n String priKeyHex = Tool.Bytes2Hex(priKey);\n System.out.println(\"private key:\" + priKeyHex);\n\n //得到密钥标识\n byte[] keyId = GMJni.GetKeyId(keycard);\n System.out.println(\"keyId:\" + Tool.Bytes2String(keyId));\n\n //得到公钥\n byte[] pubKey = GMJni.CalPubKey(Tool.String2Bytes(pubmatrix), keyId);\n System.out.println(\"public key:\" + Tool.Bytes2Hex(pubKey));\n\n //1000个不同message\n List<String> msgList = new ArrayList<>(12);\n for (int i = 0; i < 1000; i++) {\n //message基础上字符串长度+10\n msgList.add(message + RandomUtil.randomString(10));\n }\n long start = System.currentTimeMillis();\n //签名结果\n int rv = 0;\n //缓存\n MapCache cache = new MapCache();\n //命中缓存次数\n int count = 0;\n int count2 = 0;\n for (int i = 0; i < 100000; i++) {\n System.out.println(\"模拟请求第\" + i + \"次数\");\n\n //计算E值\n //30种不同的message,即仅30个不走缓存\n byte[] E = GMJni.SM2GetE(keyId, pubKey, Tool.String2Bytes(msgList.get(new Random().nextInt(30))));\n String hexE = Tool.Bytes2Hex(E);\n// System.out.println(\"E:\" + hexE);\n\n //SM2签名\n byte[] sig = GMJni.SM2Sign(priKey, E);\n// System.out.println(\"private key:\" + Tool.Bytes2Hex(priKey));\n// System.out.println(\"sign value:\" + Tool.Bytes2Hex(sig));\n\n // SM2签名验证\n // 引入Map缓存 E,sig的16进制的MD5值\n String hex = hexE + priKeyHex;\n// System.out.println(\"finalStr:\" + hex);\n String md5 = SecureUtil.md5(hex);\n if (null != cache.get(md5)) {\n count++;\n// System.out.println(\"命中缓存\" + (++count));\n } else {\n rv += GMJni.SM2Verify(pubKey, E, sig);\n count2++;\n cache.add(md5, (byte) 1, 50 * 1000);\n }\n }\n long end = System.currentTimeMillis();\n double v = (end - start) / 1000.0;\n System.out.println(\"time consuming:\" + v + \" sec\");\n System.out.println(Math.round(100000 / v) + \" times/sec\");\n System.out.println(\"命中缓存\" + (count));\n System.out.println(\"未命中\" + (count2));\n if (rv != 0) {\n System.out.println(\"Verify signature fail, error code is \" + String.valueOf(rv));\n } else {\n System.out.println(\"Verify signature success.\");\n }\n }", "private static String generateServerKey(Poi poi) {\n LonLat viewPoint = poi.getViewPosition();\n int lon = viewPoint.getLonInt();\n int lat = viewPoint.getLatInt();\n int alt = viewPoint.getAltInt();\n return generateServerKey(poi.getName(), poi.getAddress(), lon, lat, alt);\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public java.lang.String getCertiType() {\n return certiType;\n }", "java.lang.String getServerSecret();", "public static void registerDefaultAlgorithms() {\n/* 390 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#dsa-sha1\", SignatureDSA.class);\n/* */ \n/* */ \n/* 393 */ algorithmHash.put(\"http://www.w3.org/2009/xmldsig11#dsa-sha256\", SignatureDSA.SHA256.class);\n/* */ \n/* */ \n/* 396 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\", SignatureBaseRSA.SignatureRSASHA1.class);\n/* */ \n/* */ \n/* 399 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#hmac-sha1\", IntegrityHmac.IntegrityHmacSHA1.class);\n/* */ \n/* */ \n/* 402 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-md5\", SignatureBaseRSA.SignatureRSAMD5.class);\n/* */ \n/* */ \n/* */ \n/* 406 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160\", SignatureBaseRSA.SignatureRSARIPEMD160.class);\n/* */ \n/* */ \n/* */ \n/* 410 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\", SignatureBaseRSA.SignatureRSASHA256.class);\n/* */ \n/* */ \n/* 413 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384\", SignatureBaseRSA.SignatureRSASHA384.class);\n/* */ \n/* */ \n/* 416 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\", SignatureBaseRSA.SignatureRSASHA512.class);\n/* */ \n/* */ \n/* 419 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1\", SignatureECDSA.SignatureECDSASHA1.class);\n/* */ \n/* */ \n/* 422 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256\", SignatureECDSA.SignatureECDSASHA256.class);\n/* */ \n/* */ \n/* 425 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384\", SignatureECDSA.SignatureECDSASHA384.class);\n/* */ \n/* */ \n/* 428 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512\", SignatureECDSA.SignatureECDSASHA512.class);\n/* */ \n/* */ \n/* 431 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-md5\", IntegrityHmac.IntegrityHmacMD5.class);\n/* */ \n/* */ \n/* 434 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160\", IntegrityHmac.IntegrityHmacRIPEMD160.class);\n/* */ \n/* */ \n/* 437 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha256\", IntegrityHmac.IntegrityHmacSHA256.class);\n/* */ \n/* */ \n/* 440 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha384\", IntegrityHmac.IntegrityHmacSHA384.class);\n/* */ \n/* */ \n/* 443 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha512\", IntegrityHmac.IntegrityHmacSHA512.class);\n/* */ }", "public static void main(String[] args) {\n\t\tString algorithm = SignatureAlgorithm.HS256.getJcaName();\r\n\t\tSystem.out.println(algorithm);\r\n\r\n\t\t// set secret key\r\n\t\tString secret = \"this+is+my+scret+key+AAAAAAAAAAAAAAAAAAAAAAAAA\";\r\n\r\n\t\t// background information\r\n\t\t// =============================================================\r\n\t\t/*\r\n\t\t * the bytes of the secret key will be used by the signature algorithm - must be\r\n\t\t * in base 64 format\r\n\t\t */\r\n//\t\tbyte[] scretKeyEncoded = secret.getBytes(); // java encoding\r\n//\t\tbyte[] scretKeyDecoded = Base64.getDecoder().decode(secret); // base64\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyEncoded));\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyDecoded));\r\n\t\t// =====================================================================================\r\n\r\n\t\t// create the key from the decoded secret\r\n\t\tKey key = new SecretKeySpec(Base64.getDecoder().decode(secret), algorithm);\r\n\r\n\t\tInstant now = Instant.now();\r\n\r\n\t\t// create a JWT instance\r\n\t\tString jwt = Jwts.builder()\r\n\r\n\t\t\t\t.signWith(key)\r\n\r\n\t\t\t\t.setIssuedAt(Date.from(now))\r\n\r\n\t\t\t\t// will be valid for 10 seconds\r\n\t\t\t\t.setExpiration(Date.from(now.plus(10, ChronoUnit.SECONDS)))\r\n\r\n\t\t\t\t.setSubject(\"aaa@mail\")\r\n\r\n\t\t\t\t.claim(\"First name\", \"Dan\")\r\n\r\n\t\t\t\t.claim(\"Last name\", \"Levi\")\r\n\r\n\t\t\t\t.compact();\r\n\r\n\t\tSystem.out.println(jwt);\r\n\r\n\t\t// ==================================================\r\n\t\t// parse the JWS to get the expanded JWT\r\n//\t\tJWS - JSON Web Signature [aaaa.bbbb.cccc]\r\n//\t\tJWT - JSON Web Token [aaaa.bbbb.cccc]\r\n\r\n\t\tSystem.out.println(\"====================\");\r\n\t\tSystem.out.println(\"parsing the JWS to get a JWT\");\r\n\t\tJwtParser jwtParser = Jwts.parserBuilder().setSigningKey(key).build();\r\n\t\t// to demonstrate expiration paste an old JWS\r\n\t\tjwt = \"eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjA2Mzk1MTEsImV4cCI6MTYyMDYzOTUyMSwic3ViIjoiYWFhQG1haWwiLCJGaXJzdCBuYW1lIjoiRGFuIiwiTGFzdCBuYW1lIjoiTGV2aSJ9.cefEbBejjebKVILgOzca0LJZfd0F3qjezegeCaxOrfE\";\r\n\t\tSystem.out.println(jwtParser.parse(jwt));\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getHeader());\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getBody());\r\n\r\n\t}", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "private String getSignatureString(Type type)\r\n {\r\n if(type instanceof CompoundType)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n CompoundType cType = (CompoundType)type;\r\n //find key and value types\r\n String keyType = getSignatureString(cType.keyType);\r\n sb.append(\"Ljava/util/HashMap\");\r\n sb.append(\"<\");\r\n sb.append(keyType);\r\n sb.append(getSignatureString(cType.valType));\r\n sb.append(\">;\");\r\n return sb.toString();\r\n }\r\n else if(type instanceof SimpleType)\r\n {\r\n switch(((SimpleType)type).type)\r\n {\r\n case INT:\r\n return \"Ljava/lang/Integer;\";\r\n case BOOLEAN:\r\n return \"Ljava/lang/Boolean;\";\r\n case STRING:\r\n return \"Ljava/lang/String;\";\r\n }\r\n }\r\n return null;\r\n }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public String getJCEProviderName() {\n/* 196 */ return this.signatureAlgorithm.engineGetJCEProviderName();\n/* */ }", "com.google.protobuf.ByteString getPublicEciesKeyBytes();", "public String getJCEAlgorithmString() {\n/* 187 */ return this.signatureAlgorithm.engineGetJCEAlgorithmString();\n/* */ }", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "long getCryptProviderTypeExt();", "public static String getKeyTypeName(KeyType type)\n {\n // TODO: should be moved to DBProvider ...\n // MySQL : key identifier\n // SQLServer : key identifier\n // Derby : key identifier\n // PostgreSQL: key identifier\n switch (type) {\n // MySQL: key types ...\n case PRIMARY : return \"PRIMARY KEY\"; // table\n case UNIQUE : return \"UNIQUE\"; // table\n case INDEX : return \"INDEX\"; // table/index\n case UNIQUE_INDEX : return \"UNIQUE INDEX\"; // table/index\n default : return \"UNKNOWN\";\n }\n }", "@PostMapping(\"/createKeyPair\")\n public String createKeyPair() {\n \n AWSKMS kmsClient = AWSKMSClientBuilder.standard().build();\n \n return \"Private uid: \"+ priuid +\"\\nPublic uid: \" + pubuid +\"\\n\";\n }", "long getCryptAlgorithmSid();", "switch (buffer[ISO7816.OFFSET_CDATA + 4]) {\r\n\t\tcase BASIC:\r\n\t\t\tsetSignatureType(BASIC);\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tsetSignatureType(AUTHENTICATION);\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tsetSignatureType(NON_REPUDIATION);\r\n\t\t\tbreak;\r\n\t\tcase CA_ROLE:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\tdefault:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "private KeyStore askForPin() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {\n char newPin[] = PinDialog.getPIN(this.providerDesc);\n try {\n KeyStore ks = getKeyStore(newPin);\n pin = newPin;\n return ks;\n } catch (IOException e2) {\n e2.printStackTrace();\n if (e2.getCause() instanceof LoginException) {\n JOptionPane.showMessageDialog(null, \"Wrong PIN\", \"Cryptographic card\", JOptionPane.WARNING_MESSAGE);\n }\n throw e2;\n }\n }", "public String getTlsKeyPath();", "public byte[] getUserKey() throws IOException\n {\n byte[] u = null;\n COSString user = (COSString)encryptionDictionary.getDictionaryObject( COSName.getPDFName( \"U\" ) );\n if( user != null )\n {\n u = user.getBytes();\n }\n return u;\n }", "@Override\n public String getProviderName() {\n return \"SimpleEncryptionKeyStoreProvider\";\n }", "public interface SKey {\n\n String FAIL_STORE = \"job.fail.store\";\n\n String LOADBALANCE = \"loadbalance\";\n\n String EVENT_CENTER = \"event.center\";\n\n String REMOTING = \"lts.remoting\";\n\n String REMOTING_SERIALIZABLE_DFT = \"lts.remoting.serializable.default\";\n\n String ZK_CLIENT_KEY = \"zk.client\";\n\n String JOB_ID_GENERATOR = \"id.generator\";\n\n String JOB_LOGGER = \"job.logger\";\n\n String JOB_QUEUE = \"job.queue\";\n}", "private void getKeyType(final PdfObject pdfObject, final int i, final byte[] raw, final int length, final int keyLength, final int keyStart, final int type) {\n if(debugFastCode)//used in debug\n {\n PDFkey = PdfDictionary.getKey(keyStart, keyLength, raw);\n }\n \n PDFkeyInt=PdfDictionary.getIntKey(keyStart,keyLength,raw);\n \n //correct mapping\n if(PDFkeyInt==PdfDictionary.Indexed && (type==PdfDictionary.MK ||type==PdfDictionary.Form || type==PdfDictionary.Linearized || type==PdfDictionary.Group)) {\n PDFkeyInt = PdfDictionary.I;\n }\n \n if(isInlineImage) {\n PDFkeyInt = PdfObjectFactory.getInlineID(PDFkeyInt);\n }\n \n final int id=pdfObject.getID();\n \n if(type==PdfDictionary.Resources && (PDFkeyInt==PdfDictionary.ColorSpace\n || PDFkeyInt==PdfDictionary.ExtGState || PDFkeyInt==PdfDictionary.Shading\n || PDFkeyInt==PdfDictionary.XObject || PDFkeyInt==PdfDictionary.Font|| PDFkeyInt==PdfDictionary.Pattern)){\n pdfKeyType=PdfDictionary.VALUE_IS_DICTIONARY_PAIRS;\n //}else if (type==PdfDictionary.Form && id== PdfDictionary.AA && PDFkeyInt== PdfDictionary.K){\n // pdfKeyType= PdfDictionary.VALUE_IS_UNREAD_DICTIONARY;\n }else if (type==PdfDictionary.Outlines && PDFkeyInt== PdfDictionary.D){\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && PDFkeyInt== PdfDictionary.D){\n if(id==PdfDictionary.AP || id==PdfDictionary.AA){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if(id==PdfDictionary.Win){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else{\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && (id==PdfDictionary.AP || id==PdfDictionary.AA) && PDFkeyInt== PdfDictionary.A){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if (PDFkeyInt== PdfDictionary.Order && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary. VALUE_IS_OBJECT_ARRAY;\n }else if (PDFkeyInt== PdfDictionary.Name && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if ((type==PdfDictionary.ColorSpace || type==PdfDictionary.Function) && PDFkeyInt== PdfDictionary.N){\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(PDFkeyInt==PdfDictionary.Gamma && type==PdfDictionary.ColorSpace &&\n pdfObject.getParameterConstant(PdfDictionary.ColorSpace)== ColorSpaces.CalGray){ //its a number not an array\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(id==PdfDictionary.Win && pdfObject.getObjectType()==PdfDictionary.Form &&\n (PDFkeyInt==PdfDictionary.P || PDFkeyInt==PdfDictionary.O)){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if (isInlineImage && PDFkeyInt==PdfDictionary.ColorSpace){\n pdfKeyType= PdfDictionary.VALUE_IS_DICTIONARY;\n }else {\n pdfKeyType = PdfDictionary.getKeyType(PDFkeyInt, type);\n }\n \n \n //handle array of Function in Shading by using keyArray\n if(id==PdfDictionary.Shading && PDFkeyInt==PdfDictionary.Function){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n if(raw[ptr]=='['){\n pdfKeyType=PdfDictionary.VALUE_IS_KEY_ARRAY;\n }\n }\n \n //allow for other values in D,N,R definitions\n if(pdfKeyType==-1 && id== PdfDictionary.ClassMap){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n }else\n //allow for other values in D,N,R definitions as key pairs\n if(((((id==PdfDictionary.N || id==PdfDictionary.D || id==PdfDictionary.R))) &&\n pdfObject.getParentID()==PdfDictionary.AP &&\n pdfObject.getObjectType()==PdfDictionary.Form\n && raw[i]!='[' )){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n //decide if pair\n if(raw[keyStart]=='L' && raw[keyStart+1]=='e' && raw[keyStart+2]=='n' && raw[keyStart+3]=='g' && raw[keyStart+4]=='t' && raw[keyStart+5]=='h'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='n'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='f' && raw[keyStart+2]=='f'){\n }else\n if(raw[ptr]=='R'){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n \n if(debugFastCode) {\n System.out.println(\"new Returns \" + pdfKeyType + \" i=\" + i);\n }\n }\n }\n \n /**/\n \n //DecodeParms can be an array as well as a dictionary so check next char and alter if so\n if(PDFkeyInt==PdfDictionary.DecodeParms) {\n pdfKeyType = setTypeForDecodeParams(i, raw, length, pdfKeyType);\n }\n \n if(debugFastCode && pdfKeyType==-1 && pdfObject.getObjectType()!=PdfDictionary.Page){\n System.out.println(id+\" \"+type);\n System.out.println(padding +PDFkey+\" NO type setting for \"+PdfDictionary.getKey(keyStart,keyLength,raw)+\" id=\"+i);\n }\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "public PaymentRecordKey() {\n super();\n }", "public RSAKeyPairGenerator() {\n }", "private PasskeyContract() {}", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum getCryptProviderType();", "java.lang.String getSignatureProviderId();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }" ]
[ "0.67265475", "0.66766536", "0.65028304", "0.6262208", "0.6249799", "0.610079", "0.5888525", "0.5814085", "0.57488453", "0.5741013", "0.55434763", "0.5495098", "0.547463", "0.5293663", "0.5267275", "0.52484345", "0.5236787", "0.51757306", "0.50184387", "0.5009232", "0.4963339", "0.49510905", "0.49432135", "0.49177194", "0.49026552", "0.48897362", "0.4852516", "0.4852516", "0.48464367", "0.4837918", "0.48329684", "0.48329684", "0.48329684", "0.4827723", "0.48225248", "0.48225248", "0.48222625", "0.48206112", "0.48032084", "0.47844216", "0.47589076", "0.47568366", "0.47562766", "0.475171", "0.47300357", "0.47230795", "0.4722094", "0.4707639", "0.47028682", "0.4702566", "0.47019628", "0.46886435", "0.46737474", "0.46649238", "0.46241516", "0.46185207", "0.46162042", "0.4614444", "0.46140233", "0.46073017", "0.46071345", "0.4599757", "0.45933524", "0.45887133", "0.45851716", "0.4582875", "0.45752436", "0.45748132", "0.45720893", "0.45628002", "0.4562682", "0.4560899", "0.45528138", "0.45517504", "0.45498374", "0.45371762", "0.45361403", "0.4531953", "0.453109", "0.45296288", "0.4523701", "0.45182464", "0.45178583", "0.45135707", "0.4513127", "0.4508099", "0.45017824", "0.44983628", "0.4494895", "0.44948786", "0.44942138", "0.4491818", "0.44907737", "0.4488338", "0.4486263", "0.4485628", "0.44769597", "0.44763568", "0.4473159", "0.44716462" ]
0.65099293
2
none / x509+sha256 / x509+sha1 optional string pki_type = 2 [default = "none"];
@java.lang.Override public com.google.protobuf.ByteString getPkiTypeBytes() { return com.google.protobuf.ByteString.copyFromUtf8(pkiType_); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPkiType();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "boolean hasPkiType();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "public static void main(String[] args) throws IcbcApiException {\n\t\tUiIcbcClient client = new UiIcbcClient(APP_ID,IcbcConstants.SIGN_TYPE_RSA,\n\t\t\t\t\"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJCoQe/O+uqpOtyE/2CUjD7wosZw8jI1AlLNJCllOmlX+obA6h97b0JsEL0SjMCAR3xJyw7MKLqkcy5qQ/bBgw2XSrodmjzOVqfT1OXRii0xw0HiVkHR4cEWnEAAdfo0lDc4iuzCIQrnT5gM0+U+qeSV6JFfwVRjgYzBdHQRPCf1AgMBAAECgYAdQUoEe7GXH5591o/nMmOinvvscg8pRDsyD7bOgGBtyZMrCXzP3SDFKCHCeyvoColqg2oDlhpulK+OpYMVNlGQcO4eubOJp9MUc3m4A9RxkVr3dsVrmygM5czPfWHAPVQ4dECDruBJn9zoo1ci0myRTh4KSCq6SxpCE0Pbf3j7iQJBAOdMPFRfOkSQ1hsN9Mg4jd9on8r7+mF8gFPhkNI6qvEKw/prmU3obUWvZL42vRlLOQyyB92mBF24PStR/B6CjR8CQQCgGz0VoqCplurSCapGdgX3D7bNSDtMUmaLJYJxih8v+zghP0YtVgDeV3NjogVjOlz8/9Rebo0PoFcqyJnNA1RrAkEAul3dBoasZm7ldWsrXuDiv66HgoDB4Cb3J59Kl3oaHpp0CqUEI5gx48JNRE7K00SfNTGF0Pxh7Dn1X6Bxqwu6NQJADrdyPfLc4bnFi9jnleJzWepP2z6wdKt+UXv5KYaQp1BoMGYohTJKkiVnrdjOtfg/Y+IAG03+GVmbqYsW2AleUQJBANYQklohKtsmq8ptX3as6hjcuXcTpc2DSpVeOnCueNv107+dDJ+K14tbiVYzF3tkHBNMRkGtr6EuGKJ+A63sJ00=\",\n\t\t\t\tIcbcConstants.CHARSET_UTF8,IcbcConstants.ENCRYPT_TYPE_AES, \"xMh0xFsG7G80ziePFdnT8g==\");\n\t\tEaccountManageRequestV1 request = new EaccountManageRequestV1();\t\t\n\t\trequest.setServiceUrl(\"http://122.64.61.111:8081/ui/eaccount/manage/V1\");///\n\t\tEaccountManageRequestBizV1 bizContent = new EaccountManageRequestBizV1();\n\t\tbizContent.setMobileNo(\"13703878410\");//选输,手机号\n\t\tbizContent.setIdcode(\"128440810108044\");//选输,身份证号\n\t\tbizContent.setName(URLEncoder.encode(\"芡悠\"));//选输,用户姓名\n\t\tbizContent.setUserId(\"128440810108044\");//必输,需控制不能为空,用户唯一标识,送身份证号\n\t\tbizContent.setBacAddr(URLEncoder.encode(\"http://www.test.com\"));//选输,回调地址\n\t\tbizContent.setEpayflag(\"0\");//选输,工银e支付标志,0-短信、1-静态密码,集成客户端SDK的方式能送0-短信或1-静态密码,非APP方式只能送0-短信,不送默认为0-短信\n\t\t\n\t\tbizContent.setCorpAppid(APP_ID);//外公司合作方送APP_ID的值,行内应用如e支付等送外公司合作方的APPID\n\t\tlong systime = System.currentTimeMillis(); // 现时间戳\t\t\n\t\tString orderTimeStamp=new Long(systime).toString();\n\t\t\n\t\tSystem.out.println(\"orderTimeStamp:\"+orderTimeStamp);\n\t\tbizContent.setOrderTimeStamp(orderTimeStamp);//生成请求的时间,必输\n\t\t\n\t\tbizContent.setZoneno(\"00200\");//地区号号,选输,5位数字,上送值联系对接分行提供\n\t\tbizContent.setBrno(\"00260\");//网点号,选输,5位数字,上送值联系对接分行提供\n\t\t\n\t\trequest.setBizContent(bizContent);\n\t\tSystem.out.println(client.buildPostForm(request));// 实际调用时的相关返回结果及异常处理,请自行添加\n\t}", "dkk mo4509g();", "private void generatePrivacyKeyPair(boolean clientMode) throws IOException, UnsupportedEncodingException, NoSuchAlgorithmException, SaslException {\n byte[] ccmagic = CLIENT_CONF_MAGIC.getBytes(encoding);\n byte[] scmagic = SVR_CONF_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n int n;\n if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_40])) {\n n = 5;\n } else if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_56])) {\n n = 7;\n } else {\n n = 16;\n }\n byte[] keyBuffer = new byte[n + ccmagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, n);\n System.arraycopy(ccmagic, 0, keyBuffer, n, ccmagic.length);\n md5.update(keyBuffer);\n byte[] Kcc = md5.digest();\n System.arraycopy(scmagic, 0, keyBuffer, n, scmagic.length);\n md5.update(keyBuffer);\n byte[] Kcs = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST24:Kcc: \", Kcc);\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST25:Kcs: \", Kcs);\n }\n byte[] myKc;\n byte[] peerKc;\n if (clientMode) {\n myKc = Kcc;\n peerKc = Kcs;\n } else {\n myKc = Kcs;\n peerKc = Kcc;\n }\n try {\n SecretKey encKey;\n SecretKey decKey;\n if (negotiatedCipher.indexOf(CIPHER_TOKENS[RC4]) > -1) {\n encCipher = Cipher.getInstance(\"RC4\");\n decCipher = Cipher.getInstance(\"RC4\");\n encKey = new SecretKeySpec(myKc, \"RC4\");\n decKey = new SecretKeySpec(peerKc, \"RC4\");\n encCipher.init(Cipher.ENCRYPT_MODE, encKey);\n decCipher.init(Cipher.DECRYPT_MODE, decKey);\n } else if ((negotiatedCipher.equals(CIPHER_TOKENS[DES])) || (negotiatedCipher.equals(CIPHER_TOKENS[DES3]))) {\n String cipherFullname, cipherShortname;\n if (negotiatedCipher.equals(CIPHER_TOKENS[DES])) {\n cipherFullname = \"DES/CBC/NoPadding\";\n cipherShortname = \"des\";\n } else {\n cipherFullname = \"DESede/CBC/NoPadding\";\n cipherShortname = \"desede\";\n }\n encCipher = Cipher.getInstance(cipherFullname);\n decCipher = Cipher.getInstance(cipherFullname);\n encKey = makeDesKeys(myKc, cipherShortname);\n decKey = makeDesKeys(peerKc, cipherShortname);\n IvParameterSpec encIv = new IvParameterSpec(myKc, 8, 8);\n IvParameterSpec decIv = new IvParameterSpec(peerKc, 8, 8);\n encCipher.init(Cipher.ENCRYPT_MODE, encKey, encIv);\n decCipher.init(Cipher.DECRYPT_MODE, decKey, decIv);\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST26:\" + negotiatedCipher + \" IVcc: \", encIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST27:\" + negotiatedCipher + \" IVcs: \", decIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST28:\" + negotiatedCipher + \" encryption key: \", encKey.getEncoded());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST29:\" + negotiatedCipher + \" decryption key: \", decKey.getEncoded());\n }\n }\n } catch (InvalidKeySpecException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported key \" + \"specification used.\", e);\n } catch (InvalidAlgorithmParameterException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid cipher \" + \"algorithem parameter used to create cipher instance\", e);\n } catch (NoSuchPaddingException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported \" + \"padding used for chosen cipher\", e);\n } catch (InvalidKeyException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid data \" + \"used to initialize keys\", e);\n }\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "java.lang.String getPublicEciesKey();", "OpenSSLKey mo134201a();", "public abstract String getSigAlgOID();", "private void generateIntegrityKeyPair(boolean clientMode) throws UnsupportedEncodingException, IOException, NoSuchAlgorithmException {\n byte[] cimagic = CLIENT_INT_MAGIC.getBytes(encoding);\n byte[] simagic = SVR_INT_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n byte[] keyBuffer = new byte[H_A1.length + cimagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, H_A1.length);\n System.arraycopy(cimagic, 0, keyBuffer, H_A1.length, cimagic.length);\n md5.update(keyBuffer);\n byte[] Kic = md5.digest();\n System.arraycopy(simagic, 0, keyBuffer, H_A1.length, simagic.length);\n md5.update(keyBuffer);\n byte[] Kis = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST12:Kic: \", Kic);\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST13:Kis: \", Kis);\n }\n if (clientMode) {\n myKi = Kic;\n peerKi = Kis;\n } else {\n myKi = Kis;\n peerKi = Kic;\n }\n }", "public final String mo1957a() {\n return \"type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey\";\n }", "private native String native_ks(long cookie, byte[] userKey);", "@Override\n public ConcurrentContentSigner newSigner(\n String type, SignerConf conf, X509Cert[] certificateChain)\n throws ObjectCreationException {\n type = type.toLowerCase(Locale.ROOT);\n if (!types.contains(type)) {\n throw new ObjectCreationException(\"unknown signer type \" + type);\n }\n\n String str = conf.getConfValue(\"parallelism\");\n int parallelism = 20;\n if (str != null) {\n try {\n parallelism = Integer.parseInt(str);\n } catch (NumberFormatException ex) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n\n if (parallelism < 1) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n }\n\n str = conf.getConfValue(\"alias\");\n if (str == null) {\n throw new ObjectCreationException(\"alias is not specified\");\n }\n int keyId = Integer.parseInt(str);\n\n String algoName = conf.getConfValue(\"algo\");\n if (algoName == null) {\n throw new ObjectCreationException(\"algo is not specified\");\n }\n\n try {\n InitStatus initStatus = init(type);\n if (initStatus.status.get() != 1) {\n throw new ObjectCreationException(initStatus.details);\n }\n\n SignAlgo algo = SignAlgo.getInstance(algoName);\n String keyAlgoName;\n String bcKeyAlgoName;\n if (algo.isSM2SigAlgo()) {\n keyAlgoName = \"SM2\";\n bcKeyAlgoName = \"EC\";\n } else if (algo.isRSAPkcs1SigAlgo() || algo.isRSAPSSSigAlgo()) {\n keyAlgoName = \"RSA\";\n bcKeyAlgoName = \"RSA\";\n } else if (algo.isECDSASigAlgo() || algo.isPlainECDSASigAlgo()) {\n keyAlgoName = \"EC\";\n bcKeyAlgoName = \"EC\";\n } else {\n throw new ObjectCreationException(\"unsupported algo \" + algoName);\n }\n\n Provider provider = providerMap.get(type);\n\n // Method to read create PrivateKey and PublicKey object.\n // SANSEC use KeyPairGenerator.generateKeyPair to read the keypair-\n // No new keypair will be generated here.\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(keyAlgoName, provider);\n kpGen.initialize(keyId << 16);\n KeyPair kp = kpGen.generateKeyPair();\n\n PublicKey publicKey = KeyFactory.getInstance(bcKeyAlgoName, \"BC\")\n .generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));\n\n return new JceSignerBuilder(kp.getPrivate(), publicKey, certificateChain, provider)\n .createSigner(algo, parallelism);\n } catch (GeneralSecurityException | XiSecurityException ex) {\n throw new ObjectCreationException(ex.getMessage(), ex);\n }\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv xgetCryptProviderType();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "boolean hasPkiData();", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "public String mo34971a() {\n return \"SHA-384\";\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "public interface JsonKey {\n\n String CLASS = \"class\";\n String DATA = \"data\";\n String EKS = \"eks\";\n String ID = \"id\";\n String LEVEL = \"level\";\n String MESSAGE = \"message\";\n String METHOD = \"method\";\n String REQUEST_MESSAGE_ID = \"msgId\";\n String STACKTRACE = \"stacktrace\";\n String VER = \"ver\";\n String OK = \"ok\";\n String LOG_LEVEL = \"logLevel\";\n String ERROR = \"error\";\n String EMPTY_STRING = \"\";\n String RESPONSE = \"response\";\n String ADDRESS = \"address\";\n String KEY = \"key\";\n String ERROR_MSG = \"error_msg\";\n String ATTRIBUTE = \"attribute\";\n String ERRORS = \"errors\";\n String SUCCESS = \"success\";\n\n String CERTIFICATE = \"certificate\";\n String RECIPIENT_NAME = \"recipientName\";\n String COURSE_NAME = \"courseName\";\n String NAME = \"name\";\n String HTML_TEMPLATE = \"htmlTemplate\";\n String TAG = \"tag\";\n String ISSUER = \"issuer\";\n String URL = \"url\";\n String SIGNATORY_LIST = \"signatoryList\";\n String DESIGNATION = \"designation\";\n String SIGNATORY_IMAGE = \"image\";\n\n String DOMAIN_URL = \"sunbird_cert_domain_url\";\n String ASSESSED_DOMAIN = \"ASSESSED_DOMAIN\";\n String BADGE_URL = \"BADGE_URL\";\n String ISSUER_URL = \"ISSUER_URL\";\n String TEMPLATE_URL = \"TEMPLATE_URL\";\n String CONTEXT = \"CONTEXT\";\n String VERIFICATION_TYPE = \"VERIFICATION_TYPE\";\n String SIGNATORY_EXTENSION = \"SIGNATORY_EXTENSION\";\n String RECIPIENT_EMAIl = \"recipientEmail\";\n String RECIPIENT_PHONE = \"recipientPhone\";\n String RECIPIENT_ID = \"recipientId\";\n String VALID_FROM = \"validFrom\";\n String EXPIRY = \"expiry\";\n String OLD_ID = \"oldId\";\n String PUBLIC_KEY = \"publicKey\";\n String DESCRIPTION = \"description\";\n String LOGO = \"logo\";\n String ISSUE_DATE = \"issueDate\";\n String USER = \"user\";\n String CERTIFICATE_NAME = \"name\";\n\n String CONTAINER_NAME = \"CONTAINER_NAME\";\n String CLOUD_STORAGE_TYPE = \"CLOUD_STORAGE_TYPE\";\n String CLOUD_UPLOAD_RETRY_COUNT = \"CLOUD_UPLOAD_RETRY_COUNT\";\n String AZURE_STORAGE_SECRET = \"AZURE_STORAGE_SECRET\";\n String AZURE_STORAGE_KEY = \"AZURE_STORAGE_KEY\";\n String ACCESS_CODE_LENGTH = \"ACCESS_CODE_LENGTH\";\n String ORG_ID = \"orgId\";\n String KEYS = \"keys\";\n String ENC_SERVICE_URL = \"sunbird_cert_enc_service_url\";\n String SIGN_HEALTH_CHECK_URL = \"SIGN_HEALTH_CHECK_URL\";\n String SIGN_URL = \"SIGN_URL\";\n String SIGN_VERIFY_URL = \"SIGN_VERIFY_URL\";\n String SIGN_CREATOR = \"SIGN_CREATOR\";\n String SIGN = \"sign\";\n String VERIFY = \"verify\";\n String KEY_ID = \"keyId\";\n String JSON_URL = \"jsonUrl\";\n String PDF_URL = \"pdfUrl\";\n String UNIQUE_ID = \"id\";\n String GENERATE_CERT = \"generateCert\";\n String PUBLIC_KEY_URL = \"PUBLIC_KEY_URL\";\n String GET_SIGN_URL = \"getSignUrl\";\n String SIGNED_URL = \"signedUrl\";\n\n String ACCESS_CODE = \"accessCode\";\n String JSON_DATA = \"jsonData\";\n String SLUG = \"sunbird_cert_slug\";\n}", "BigInteger getCEP();", "java.lang.String getPubkey();", "public void setCertiType(java.lang.String certiType) {\n this.certiType = certiType;\n }", "public abstract String getSigAlgName();", "@Schema(required = true, description = \"Contract type (KIP-7, KIP-17, ERC-20, ERC-721)\")\n public String getType() {\n return type;\n }", "public ProfileKey getProfileKey(String username, String type) throws ProfileKeyManagerPersistenceException {\n ParameterHelpers.checkParameter(username, \"username\");\n\n boolean registered = checkType(type);\n\n Connection connection = getConnection();\n\n try {\n return getProfileKey(connection, username, type, registered);\n } finally {\n closeConnection(connection);\n }\n }", "protected CryptoProvider() {\n\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "@ParameterizedTest\n @EnumSource(KeyType.class)\n void testMissingJWTPublicKey(KeyType keyType) throws NoSuchAlgorithmException {\n final Pair<String, PrivateKey> keyPair = generateKeypair(keyType);\n\n final String jwt = Jwts.builder()\n .setHeaderParam(\"kid\", UUID.randomUUID())\n .setAudience(String.format(\"%sToken/auth\", \"here\"))\n .setIssuer(\"macaroon\")\n .setSubject(\"macaroon\")\n .setId(UUID.randomUUID().toString())\n .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES)))\n .signWith(keyPair.getRight(), APIAuthHelpers.getSigningAlgorithm(keyType))\n .compact();\n\n // Submit the JWT\n Response response = RESOURCE.target(\"/v1/Token/auth\")\n .queryParam(\"scope\", \"system/*.*\")\n .queryParam(\"grant_type\", \"client_credentials\")\n .queryParam(\"client_assertion_type\", TokenResource.CLIENT_ASSERTION_TYPE)\n .queryParam(\"client_assertion\", jwt)\n .request()\n .post(Entity.entity(\"\", MediaType.APPLICATION_FORM_URLENCODED));\n\n assertEquals(401, response.getStatus(), \"Should be unauthorized\");\n assertTrue(response.readEntity(String.class).contains(\"Cannot find public key\"), \"Should have correct exception\");\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "public ECP getPublicKGCKey(){return pkS;}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "private TPM_DIGEST createEmptyPubKeyHash()\r\n {\r\n// if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_BROADCOM )\r\n// {\r\n// return null;\r\n// }\r\n// else\r\n// {\r\n// return new TPM_DIGEST();\r\n// }\r\n if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_INFINEON )\r\n {\r\n return new TPM_DIGEST();\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }", "public String getTlsKey();", "@Test\n\tpublic void testSecuirtyConfigsOperations() throws NoSuchAlgorithmException {\n\t\t// Generate and store keys for the first time\n\t\tServerKeyPairs serverKeyPairs1 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair1 = serverKeyPairs1.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair1 = serverKeyPairs1.getSignatureKeyPair();\n\n\t\t// Initialize a new serverKeyPairs to test that it will only read\n\t\t// previously generated keys\n\t\tServerKeyPairs serverKeyPairs2 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair2 = serverKeyPairs2.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair2 = serverKeyPairs2.getSignatureKeyPair();\n\n\t\tassertEquals(\"Wrong loaded encryption public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded encryption private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getPrivateExponent());\n\n\t\tassertEquals(\"Wrong loaded signature public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded signature private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getPrivateExponent());\n\t}", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType.Enum getCryptAlgorithmType();", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public MEKeyTool() {\n keystore = new PublicKeyStoreBuilderBase();\n }", "public PrivateKeyType getPivateKeyType() {\n return PrivateKeyType.SAPLING_EXTENED_SPEND_KEY;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType xgetCryptAlgorithmType();", "public void setPrincipalType(String principalType){\n this.principalType = principalType;\n //Update hashMap value..\n hashMap.put(\"principalType\", principalType);\n }", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "private static String generateServerKey(Poi poi) {\n LonLat viewPoint = poi.getViewPosition();\n int lon = viewPoint.getLonInt();\n int lat = viewPoint.getLatInt();\n int alt = viewPoint.getAltInt();\n return generateServerKey(poi.getName(), poi.getAddress(), lon, lat, alt);\n }", "public static void main(String[] args) {\n String keyFile = \"D:\\\\data\\\\kms\\\\liweigang.idc\";\n String message = \"dksf3r38324hrewjrh3r&^%djfdsjkek\";\n String pubmatrix = \"D:\\\\data\\\\kms\\\\sm2cpk.cn.pkm\";\n\n byte[] keycard = Tool.ReadFile(keyFile);\n System.out.println(\"keyCard:\" + Tool.Bytes2Hex(keycard));\n\n //得到私钥\n byte[] priKey = GMJni.GetPriKey(keycard);\n String priKeyHex = Tool.Bytes2Hex(priKey);\n System.out.println(\"private key:\" + priKeyHex);\n\n //得到密钥标识\n byte[] keyId = GMJni.GetKeyId(keycard);\n System.out.println(\"keyId:\" + Tool.Bytes2String(keyId));\n\n //得到公钥\n byte[] pubKey = GMJni.CalPubKey(Tool.String2Bytes(pubmatrix), keyId);\n System.out.println(\"public key:\" + Tool.Bytes2Hex(pubKey));\n\n //1000个不同message\n List<String> msgList = new ArrayList<>(12);\n for (int i = 0; i < 1000; i++) {\n //message基础上字符串长度+10\n msgList.add(message + RandomUtil.randomString(10));\n }\n long start = System.currentTimeMillis();\n //签名结果\n int rv = 0;\n //缓存\n MapCache cache = new MapCache();\n //命中缓存次数\n int count = 0;\n int count2 = 0;\n for (int i = 0; i < 100000; i++) {\n System.out.println(\"模拟请求第\" + i + \"次数\");\n\n //计算E值\n //30种不同的message,即仅30个不走缓存\n byte[] E = GMJni.SM2GetE(keyId, pubKey, Tool.String2Bytes(msgList.get(new Random().nextInt(30))));\n String hexE = Tool.Bytes2Hex(E);\n// System.out.println(\"E:\" + hexE);\n\n //SM2签名\n byte[] sig = GMJni.SM2Sign(priKey, E);\n// System.out.println(\"private key:\" + Tool.Bytes2Hex(priKey));\n// System.out.println(\"sign value:\" + Tool.Bytes2Hex(sig));\n\n // SM2签名验证\n // 引入Map缓存 E,sig的16进制的MD5值\n String hex = hexE + priKeyHex;\n// System.out.println(\"finalStr:\" + hex);\n String md5 = SecureUtil.md5(hex);\n if (null != cache.get(md5)) {\n count++;\n// System.out.println(\"命中缓存\" + (++count));\n } else {\n rv += GMJni.SM2Verify(pubKey, E, sig);\n count2++;\n cache.add(md5, (byte) 1, 50 * 1000);\n }\n }\n long end = System.currentTimeMillis();\n double v = (end - start) / 1000.0;\n System.out.println(\"time consuming:\" + v + \" sec\");\n System.out.println(Math.round(100000 / v) + \" times/sec\");\n System.out.println(\"命中缓存\" + (count));\n System.out.println(\"未命中\" + (count2));\n if (rv != 0) {\n System.out.println(\"Verify signature fail, error code is \" + String.valueOf(rv));\n } else {\n System.out.println(\"Verify signature success.\");\n }\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public java.lang.String getCertiType() {\n return certiType;\n }", "public static void registerDefaultAlgorithms() {\n/* 390 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#dsa-sha1\", SignatureDSA.class);\n/* */ \n/* */ \n/* 393 */ algorithmHash.put(\"http://www.w3.org/2009/xmldsig11#dsa-sha256\", SignatureDSA.SHA256.class);\n/* */ \n/* */ \n/* 396 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\", SignatureBaseRSA.SignatureRSASHA1.class);\n/* */ \n/* */ \n/* 399 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#hmac-sha1\", IntegrityHmac.IntegrityHmacSHA1.class);\n/* */ \n/* */ \n/* 402 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-md5\", SignatureBaseRSA.SignatureRSAMD5.class);\n/* */ \n/* */ \n/* */ \n/* 406 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160\", SignatureBaseRSA.SignatureRSARIPEMD160.class);\n/* */ \n/* */ \n/* */ \n/* 410 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\", SignatureBaseRSA.SignatureRSASHA256.class);\n/* */ \n/* */ \n/* 413 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384\", SignatureBaseRSA.SignatureRSASHA384.class);\n/* */ \n/* */ \n/* 416 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\", SignatureBaseRSA.SignatureRSASHA512.class);\n/* */ \n/* */ \n/* 419 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1\", SignatureECDSA.SignatureECDSASHA1.class);\n/* */ \n/* */ \n/* 422 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256\", SignatureECDSA.SignatureECDSASHA256.class);\n/* */ \n/* */ \n/* 425 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384\", SignatureECDSA.SignatureECDSASHA384.class);\n/* */ \n/* */ \n/* 428 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512\", SignatureECDSA.SignatureECDSASHA512.class);\n/* */ \n/* */ \n/* 431 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-md5\", IntegrityHmac.IntegrityHmacMD5.class);\n/* */ \n/* */ \n/* 434 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160\", IntegrityHmac.IntegrityHmacRIPEMD160.class);\n/* */ \n/* */ \n/* 437 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha256\", IntegrityHmac.IntegrityHmacSHA256.class);\n/* */ \n/* */ \n/* 440 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha384\", IntegrityHmac.IntegrityHmacSHA384.class);\n/* */ \n/* */ \n/* 443 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha512\", IntegrityHmac.IntegrityHmacSHA512.class);\n/* */ }", "java.lang.String getServerSecret();", "public static void main(String[] args) {\n\t\tString algorithm = SignatureAlgorithm.HS256.getJcaName();\r\n\t\tSystem.out.println(algorithm);\r\n\r\n\t\t// set secret key\r\n\t\tString secret = \"this+is+my+scret+key+AAAAAAAAAAAAAAAAAAAAAAAAA\";\r\n\r\n\t\t// background information\r\n\t\t// =============================================================\r\n\t\t/*\r\n\t\t * the bytes of the secret key will be used by the signature algorithm - must be\r\n\t\t * in base 64 format\r\n\t\t */\r\n//\t\tbyte[] scretKeyEncoded = secret.getBytes(); // java encoding\r\n//\t\tbyte[] scretKeyDecoded = Base64.getDecoder().decode(secret); // base64\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyEncoded));\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyDecoded));\r\n\t\t// =====================================================================================\r\n\r\n\t\t// create the key from the decoded secret\r\n\t\tKey key = new SecretKeySpec(Base64.getDecoder().decode(secret), algorithm);\r\n\r\n\t\tInstant now = Instant.now();\r\n\r\n\t\t// create a JWT instance\r\n\t\tString jwt = Jwts.builder()\r\n\r\n\t\t\t\t.signWith(key)\r\n\r\n\t\t\t\t.setIssuedAt(Date.from(now))\r\n\r\n\t\t\t\t// will be valid for 10 seconds\r\n\t\t\t\t.setExpiration(Date.from(now.plus(10, ChronoUnit.SECONDS)))\r\n\r\n\t\t\t\t.setSubject(\"aaa@mail\")\r\n\r\n\t\t\t\t.claim(\"First name\", \"Dan\")\r\n\r\n\t\t\t\t.claim(\"Last name\", \"Levi\")\r\n\r\n\t\t\t\t.compact();\r\n\r\n\t\tSystem.out.println(jwt);\r\n\r\n\t\t// ==================================================\r\n\t\t// parse the JWS to get the expanded JWT\r\n//\t\tJWS - JSON Web Signature [aaaa.bbbb.cccc]\r\n//\t\tJWT - JSON Web Token [aaaa.bbbb.cccc]\r\n\r\n\t\tSystem.out.println(\"====================\");\r\n\t\tSystem.out.println(\"parsing the JWS to get a JWT\");\r\n\t\tJwtParser jwtParser = Jwts.parserBuilder().setSigningKey(key).build();\r\n\t\t// to demonstrate expiration paste an old JWS\r\n\t\tjwt = \"eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjA2Mzk1MTEsImV4cCI6MTYyMDYzOTUyMSwic3ViIjoiYWFhQG1haWwiLCJGaXJzdCBuYW1lIjoiRGFuIiwiTGFzdCBuYW1lIjoiTGV2aSJ9.cefEbBejjebKVILgOzca0LJZfd0F3qjezegeCaxOrfE\";\r\n\t\tSystem.out.println(jwtParser.parse(jwt));\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getHeader());\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getBody());\r\n\r\n\t}", "private String getSignatureString(Type type)\r\n {\r\n if(type instanceof CompoundType)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n CompoundType cType = (CompoundType)type;\r\n //find key and value types\r\n String keyType = getSignatureString(cType.keyType);\r\n sb.append(\"Ljava/util/HashMap\");\r\n sb.append(\"<\");\r\n sb.append(keyType);\r\n sb.append(getSignatureString(cType.valType));\r\n sb.append(\">;\");\r\n return sb.toString();\r\n }\r\n else if(type instanceof SimpleType)\r\n {\r\n switch(((SimpleType)type).type)\r\n {\r\n case INT:\r\n return \"Ljava/lang/Integer;\";\r\n case BOOLEAN:\r\n return \"Ljava/lang/Boolean;\";\r\n case STRING:\r\n return \"Ljava/lang/String;\";\r\n }\r\n }\r\n return null;\r\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "public String getJCEProviderName() {\n/* 196 */ return this.signatureAlgorithm.engineGetJCEProviderName();\n/* */ }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public String getJCEAlgorithmString() {\n/* 187 */ return this.signatureAlgorithm.engineGetJCEAlgorithmString();\n/* */ }", "com.google.protobuf.ByteString getPublicEciesKeyBytes();", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "long getCryptProviderTypeExt();", "public static String getKeyTypeName(KeyType type)\n {\n // TODO: should be moved to DBProvider ...\n // MySQL : key identifier\n // SQLServer : key identifier\n // Derby : key identifier\n // PostgreSQL: key identifier\n switch (type) {\n // MySQL: key types ...\n case PRIMARY : return \"PRIMARY KEY\"; // table\n case UNIQUE : return \"UNIQUE\"; // table\n case INDEX : return \"INDEX\"; // table/index\n case UNIQUE_INDEX : return \"UNIQUE INDEX\"; // table/index\n default : return \"UNKNOWN\";\n }\n }", "long getCryptAlgorithmSid();", "@PostMapping(\"/createKeyPair\")\n public String createKeyPair() {\n \n AWSKMS kmsClient = AWSKMSClientBuilder.standard().build();\n \n return \"Private uid: \"+ priuid +\"\\nPublic uid: \" + pubuid +\"\\n\";\n }", "switch (buffer[ISO7816.OFFSET_CDATA + 4]) {\r\n\t\tcase BASIC:\r\n\t\t\tsetSignatureType(BASIC);\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tsetSignatureType(AUTHENTICATION);\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tsetSignatureType(NON_REPUDIATION);\r\n\t\t\tbreak;\r\n\t\tcase CA_ROLE:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\tdefault:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "private KeyStore askForPin() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {\n char newPin[] = PinDialog.getPIN(this.providerDesc);\n try {\n KeyStore ks = getKeyStore(newPin);\n pin = newPin;\n return ks;\n } catch (IOException e2) {\n e2.printStackTrace();\n if (e2.getCause() instanceof LoginException) {\n JOptionPane.showMessageDialog(null, \"Wrong PIN\", \"Cryptographic card\", JOptionPane.WARNING_MESSAGE);\n }\n throw e2;\n }\n }", "public String getTlsKeyPath();", "public byte[] getUserKey() throws IOException\n {\n byte[] u = null;\n COSString user = (COSString)encryptionDictionary.getDictionaryObject( COSName.getPDFName( \"U\" ) );\n if( user != null )\n {\n u = user.getBytes();\n }\n return u;\n }", "@Override\n public String getProviderName() {\n return \"SimpleEncryptionKeyStoreProvider\";\n }", "public interface SKey {\n\n String FAIL_STORE = \"job.fail.store\";\n\n String LOADBALANCE = \"loadbalance\";\n\n String EVENT_CENTER = \"event.center\";\n\n String REMOTING = \"lts.remoting\";\n\n String REMOTING_SERIALIZABLE_DFT = \"lts.remoting.serializable.default\";\n\n String ZK_CLIENT_KEY = \"zk.client\";\n\n String JOB_ID_GENERATOR = \"id.generator\";\n\n String JOB_LOGGER = \"job.logger\";\n\n String JOB_QUEUE = \"job.queue\";\n}", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "private void getKeyType(final PdfObject pdfObject, final int i, final byte[] raw, final int length, final int keyLength, final int keyStart, final int type) {\n if(debugFastCode)//used in debug\n {\n PDFkey = PdfDictionary.getKey(keyStart, keyLength, raw);\n }\n \n PDFkeyInt=PdfDictionary.getIntKey(keyStart,keyLength,raw);\n \n //correct mapping\n if(PDFkeyInt==PdfDictionary.Indexed && (type==PdfDictionary.MK ||type==PdfDictionary.Form || type==PdfDictionary.Linearized || type==PdfDictionary.Group)) {\n PDFkeyInt = PdfDictionary.I;\n }\n \n if(isInlineImage) {\n PDFkeyInt = PdfObjectFactory.getInlineID(PDFkeyInt);\n }\n \n final int id=pdfObject.getID();\n \n if(type==PdfDictionary.Resources && (PDFkeyInt==PdfDictionary.ColorSpace\n || PDFkeyInt==PdfDictionary.ExtGState || PDFkeyInt==PdfDictionary.Shading\n || PDFkeyInt==PdfDictionary.XObject || PDFkeyInt==PdfDictionary.Font|| PDFkeyInt==PdfDictionary.Pattern)){\n pdfKeyType=PdfDictionary.VALUE_IS_DICTIONARY_PAIRS;\n //}else if (type==PdfDictionary.Form && id== PdfDictionary.AA && PDFkeyInt== PdfDictionary.K){\n // pdfKeyType= PdfDictionary.VALUE_IS_UNREAD_DICTIONARY;\n }else if (type==PdfDictionary.Outlines && PDFkeyInt== PdfDictionary.D){\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && PDFkeyInt== PdfDictionary.D){\n if(id==PdfDictionary.AP || id==PdfDictionary.AA){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if(id==PdfDictionary.Win){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else{\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && (id==PdfDictionary.AP || id==PdfDictionary.AA) && PDFkeyInt== PdfDictionary.A){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if (PDFkeyInt== PdfDictionary.Order && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary. VALUE_IS_OBJECT_ARRAY;\n }else if (PDFkeyInt== PdfDictionary.Name && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if ((type==PdfDictionary.ColorSpace || type==PdfDictionary.Function) && PDFkeyInt== PdfDictionary.N){\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(PDFkeyInt==PdfDictionary.Gamma && type==PdfDictionary.ColorSpace &&\n pdfObject.getParameterConstant(PdfDictionary.ColorSpace)== ColorSpaces.CalGray){ //its a number not an array\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(id==PdfDictionary.Win && pdfObject.getObjectType()==PdfDictionary.Form &&\n (PDFkeyInt==PdfDictionary.P || PDFkeyInt==PdfDictionary.O)){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if (isInlineImage && PDFkeyInt==PdfDictionary.ColorSpace){\n pdfKeyType= PdfDictionary.VALUE_IS_DICTIONARY;\n }else {\n pdfKeyType = PdfDictionary.getKeyType(PDFkeyInt, type);\n }\n \n \n //handle array of Function in Shading by using keyArray\n if(id==PdfDictionary.Shading && PDFkeyInt==PdfDictionary.Function){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n if(raw[ptr]=='['){\n pdfKeyType=PdfDictionary.VALUE_IS_KEY_ARRAY;\n }\n }\n \n //allow for other values in D,N,R definitions\n if(pdfKeyType==-1 && id== PdfDictionary.ClassMap){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n }else\n //allow for other values in D,N,R definitions as key pairs\n if(((((id==PdfDictionary.N || id==PdfDictionary.D || id==PdfDictionary.R))) &&\n pdfObject.getParentID()==PdfDictionary.AP &&\n pdfObject.getObjectType()==PdfDictionary.Form\n && raw[i]!='[' )){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n //decide if pair\n if(raw[keyStart]=='L' && raw[keyStart+1]=='e' && raw[keyStart+2]=='n' && raw[keyStart+3]=='g' && raw[keyStart+4]=='t' && raw[keyStart+5]=='h'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='n'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='f' && raw[keyStart+2]=='f'){\n }else\n if(raw[ptr]=='R'){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n \n if(debugFastCode) {\n System.out.println(\"new Returns \" + pdfKeyType + \" i=\" + i);\n }\n }\n }\n \n /**/\n \n //DecodeParms can be an array as well as a dictionary so check next char and alter if so\n if(PDFkeyInt==PdfDictionary.DecodeParms) {\n pdfKeyType = setTypeForDecodeParams(i, raw, length, pdfKeyType);\n }\n \n if(debugFastCode && pdfKeyType==-1 && pdfObject.getObjectType()!=PdfDictionary.Page){\n System.out.println(id+\" \"+type);\n System.out.println(padding +PDFkey+\" NO type setting for \"+PdfDictionary.getKey(keyStart,keyLength,raw)+\" id=\"+i);\n }\n }", "public PaymentRecordKey() {\n super();\n }", "private PasskeyContract() {}", "public RSAKeyPairGenerator() {\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum getCryptProviderType();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "java.lang.String getSignatureProviderId();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }" ]
[ "0.6727748", "0.6678317", "0.65109533", "0.6505185", "0.62514466", "0.6101432", "0.58894575", "0.58158875", "0.5750823", "0.57424897", "0.5544559", "0.5495345", "0.5475865", "0.52942586", "0.5266195", "0.5246643", "0.5234547", "0.51766807", "0.5016653", "0.50066125", "0.49636778", "0.49505574", "0.49419945", "0.49173275", "0.4900499", "0.4890469", "0.4850671", "0.4850671", "0.4846046", "0.4838196", "0.4831908", "0.4831908", "0.4831908", "0.4825468", "0.48228103", "0.48206773", "0.48206773", "0.4819316", "0.4801538", "0.47818527", "0.47589698", "0.47572955", "0.47565547", "0.47491077", "0.4728713", "0.47247025", "0.4719931", "0.47070387", "0.47024977", "0.47009662", "0.47000995", "0.46869826", "0.4670702", "0.46633434", "0.46223763", "0.4615428", "0.4615166", "0.46142715", "0.4610485", "0.46074787", "0.46031564", "0.4598209", "0.45926628", "0.4589497", "0.45822904", "0.45822853", "0.45731214", "0.45729804", "0.45704383", "0.45628694", "0.45616642", "0.45607027", "0.4551816", "0.4550097", "0.4547954", "0.4536531", "0.45355284", "0.45310175", "0.45305023", "0.4530499", "0.45229068", "0.4518561", "0.45185053", "0.4512594", "0.451091", "0.45088643", "0.44993877", "0.44969955", "0.44939372", "0.4493796", "0.44936416", "0.44899356", "0.44895783", "0.44872308", "0.4484021", "0.44833055", "0.44777814", "0.44765133", "0.44732615", "0.4471168" ]
0.6263132
4
none / x509+sha256 / x509+sha1 optional string pki_type = 2 [default = "none"];
private void setPkiType( java.lang.String value) { java.lang.Class<?> valueClass = value.getClass(); bitField0_ |= 0x00000002; pkiType_ = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPkiType();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "boolean hasPkiType();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "public static void main(String[] args) throws IcbcApiException {\n\t\tUiIcbcClient client = new UiIcbcClient(APP_ID,IcbcConstants.SIGN_TYPE_RSA,\n\t\t\t\t\"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJCoQe/O+uqpOtyE/2CUjD7wosZw8jI1AlLNJCllOmlX+obA6h97b0JsEL0SjMCAR3xJyw7MKLqkcy5qQ/bBgw2XSrodmjzOVqfT1OXRii0xw0HiVkHR4cEWnEAAdfo0lDc4iuzCIQrnT5gM0+U+qeSV6JFfwVRjgYzBdHQRPCf1AgMBAAECgYAdQUoEe7GXH5591o/nMmOinvvscg8pRDsyD7bOgGBtyZMrCXzP3SDFKCHCeyvoColqg2oDlhpulK+OpYMVNlGQcO4eubOJp9MUc3m4A9RxkVr3dsVrmygM5czPfWHAPVQ4dECDruBJn9zoo1ci0myRTh4KSCq6SxpCE0Pbf3j7iQJBAOdMPFRfOkSQ1hsN9Mg4jd9on8r7+mF8gFPhkNI6qvEKw/prmU3obUWvZL42vRlLOQyyB92mBF24PStR/B6CjR8CQQCgGz0VoqCplurSCapGdgX3D7bNSDtMUmaLJYJxih8v+zghP0YtVgDeV3NjogVjOlz8/9Rebo0PoFcqyJnNA1RrAkEAul3dBoasZm7ldWsrXuDiv66HgoDB4Cb3J59Kl3oaHpp0CqUEI5gx48JNRE7K00SfNTGF0Pxh7Dn1X6Bxqwu6NQJADrdyPfLc4bnFi9jnleJzWepP2z6wdKt+UXv5KYaQp1BoMGYohTJKkiVnrdjOtfg/Y+IAG03+GVmbqYsW2AleUQJBANYQklohKtsmq8ptX3as6hjcuXcTpc2DSpVeOnCueNv107+dDJ+K14tbiVYzF3tkHBNMRkGtr6EuGKJ+A63sJ00=\",\n\t\t\t\tIcbcConstants.CHARSET_UTF8,IcbcConstants.ENCRYPT_TYPE_AES, \"xMh0xFsG7G80ziePFdnT8g==\");\n\t\tEaccountManageRequestV1 request = new EaccountManageRequestV1();\t\t\n\t\trequest.setServiceUrl(\"http://122.64.61.111:8081/ui/eaccount/manage/V1\");///\n\t\tEaccountManageRequestBizV1 bizContent = new EaccountManageRequestBizV1();\n\t\tbizContent.setMobileNo(\"13703878410\");//选输,手机号\n\t\tbizContent.setIdcode(\"128440810108044\");//选输,身份证号\n\t\tbizContent.setName(URLEncoder.encode(\"芡悠\"));//选输,用户姓名\n\t\tbizContent.setUserId(\"128440810108044\");//必输,需控制不能为空,用户唯一标识,送身份证号\n\t\tbizContent.setBacAddr(URLEncoder.encode(\"http://www.test.com\"));//选输,回调地址\n\t\tbizContent.setEpayflag(\"0\");//选输,工银e支付标志,0-短信、1-静态密码,集成客户端SDK的方式能送0-短信或1-静态密码,非APP方式只能送0-短信,不送默认为0-短信\n\t\t\n\t\tbizContent.setCorpAppid(APP_ID);//外公司合作方送APP_ID的值,行内应用如e支付等送外公司合作方的APPID\n\t\tlong systime = System.currentTimeMillis(); // 现时间戳\t\t\n\t\tString orderTimeStamp=new Long(systime).toString();\n\t\t\n\t\tSystem.out.println(\"orderTimeStamp:\"+orderTimeStamp);\n\t\tbizContent.setOrderTimeStamp(orderTimeStamp);//生成请求的时间,必输\n\t\t\n\t\tbizContent.setZoneno(\"00200\");//地区号号,选输,5位数字,上送值联系对接分行提供\n\t\tbizContent.setBrno(\"00260\");//网点号,选输,5位数字,上送值联系对接分行提供\n\t\t\n\t\trequest.setBizContent(bizContent);\n\t\tSystem.out.println(client.buildPostForm(request));// 实际调用时的相关返回结果及异常处理,请自行添加\n\t}", "dkk mo4509g();", "private void generatePrivacyKeyPair(boolean clientMode) throws IOException, UnsupportedEncodingException, NoSuchAlgorithmException, SaslException {\n byte[] ccmagic = CLIENT_CONF_MAGIC.getBytes(encoding);\n byte[] scmagic = SVR_CONF_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n int n;\n if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_40])) {\n n = 5;\n } else if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_56])) {\n n = 7;\n } else {\n n = 16;\n }\n byte[] keyBuffer = new byte[n + ccmagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, n);\n System.arraycopy(ccmagic, 0, keyBuffer, n, ccmagic.length);\n md5.update(keyBuffer);\n byte[] Kcc = md5.digest();\n System.arraycopy(scmagic, 0, keyBuffer, n, scmagic.length);\n md5.update(keyBuffer);\n byte[] Kcs = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST24:Kcc: \", Kcc);\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST25:Kcs: \", Kcs);\n }\n byte[] myKc;\n byte[] peerKc;\n if (clientMode) {\n myKc = Kcc;\n peerKc = Kcs;\n } else {\n myKc = Kcs;\n peerKc = Kcc;\n }\n try {\n SecretKey encKey;\n SecretKey decKey;\n if (negotiatedCipher.indexOf(CIPHER_TOKENS[RC4]) > -1) {\n encCipher = Cipher.getInstance(\"RC4\");\n decCipher = Cipher.getInstance(\"RC4\");\n encKey = new SecretKeySpec(myKc, \"RC4\");\n decKey = new SecretKeySpec(peerKc, \"RC4\");\n encCipher.init(Cipher.ENCRYPT_MODE, encKey);\n decCipher.init(Cipher.DECRYPT_MODE, decKey);\n } else if ((negotiatedCipher.equals(CIPHER_TOKENS[DES])) || (negotiatedCipher.equals(CIPHER_TOKENS[DES3]))) {\n String cipherFullname, cipherShortname;\n if (negotiatedCipher.equals(CIPHER_TOKENS[DES])) {\n cipherFullname = \"DES/CBC/NoPadding\";\n cipherShortname = \"des\";\n } else {\n cipherFullname = \"DESede/CBC/NoPadding\";\n cipherShortname = \"desede\";\n }\n encCipher = Cipher.getInstance(cipherFullname);\n decCipher = Cipher.getInstance(cipherFullname);\n encKey = makeDesKeys(myKc, cipherShortname);\n decKey = makeDesKeys(peerKc, cipherShortname);\n IvParameterSpec encIv = new IvParameterSpec(myKc, 8, 8);\n IvParameterSpec decIv = new IvParameterSpec(peerKc, 8, 8);\n encCipher.init(Cipher.ENCRYPT_MODE, encKey, encIv);\n decCipher.init(Cipher.DECRYPT_MODE, decKey, decIv);\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST26:\" + negotiatedCipher + \" IVcc: \", encIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST27:\" + negotiatedCipher + \" IVcs: \", decIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST28:\" + negotiatedCipher + \" encryption key: \", encKey.getEncoded());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST29:\" + negotiatedCipher + \" decryption key: \", decKey.getEncoded());\n }\n }\n } catch (InvalidKeySpecException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported key \" + \"specification used.\", e);\n } catch (InvalidAlgorithmParameterException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid cipher \" + \"algorithem parameter used to create cipher instance\", e);\n } catch (NoSuchPaddingException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported \" + \"padding used for chosen cipher\", e);\n } catch (InvalidKeyException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid data \" + \"used to initialize keys\", e);\n }\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "java.lang.String getPublicEciesKey();", "OpenSSLKey mo134201a();", "public abstract String getSigAlgOID();", "private void generateIntegrityKeyPair(boolean clientMode) throws UnsupportedEncodingException, IOException, NoSuchAlgorithmException {\n byte[] cimagic = CLIENT_INT_MAGIC.getBytes(encoding);\n byte[] simagic = SVR_INT_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n byte[] keyBuffer = new byte[H_A1.length + cimagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, H_A1.length);\n System.arraycopy(cimagic, 0, keyBuffer, H_A1.length, cimagic.length);\n md5.update(keyBuffer);\n byte[] Kic = md5.digest();\n System.arraycopy(simagic, 0, keyBuffer, H_A1.length, simagic.length);\n md5.update(keyBuffer);\n byte[] Kis = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST12:Kic: \", Kic);\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST13:Kis: \", Kis);\n }\n if (clientMode) {\n myKi = Kic;\n peerKi = Kis;\n } else {\n myKi = Kis;\n peerKi = Kic;\n }\n }", "public final String mo1957a() {\n return \"type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey\";\n }", "private native String native_ks(long cookie, byte[] userKey);", "@Override\n public ConcurrentContentSigner newSigner(\n String type, SignerConf conf, X509Cert[] certificateChain)\n throws ObjectCreationException {\n type = type.toLowerCase(Locale.ROOT);\n if (!types.contains(type)) {\n throw new ObjectCreationException(\"unknown signer type \" + type);\n }\n\n String str = conf.getConfValue(\"parallelism\");\n int parallelism = 20;\n if (str != null) {\n try {\n parallelism = Integer.parseInt(str);\n } catch (NumberFormatException ex) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n\n if (parallelism < 1) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n }\n\n str = conf.getConfValue(\"alias\");\n if (str == null) {\n throw new ObjectCreationException(\"alias is not specified\");\n }\n int keyId = Integer.parseInt(str);\n\n String algoName = conf.getConfValue(\"algo\");\n if (algoName == null) {\n throw new ObjectCreationException(\"algo is not specified\");\n }\n\n try {\n InitStatus initStatus = init(type);\n if (initStatus.status.get() != 1) {\n throw new ObjectCreationException(initStatus.details);\n }\n\n SignAlgo algo = SignAlgo.getInstance(algoName);\n String keyAlgoName;\n String bcKeyAlgoName;\n if (algo.isSM2SigAlgo()) {\n keyAlgoName = \"SM2\";\n bcKeyAlgoName = \"EC\";\n } else if (algo.isRSAPkcs1SigAlgo() || algo.isRSAPSSSigAlgo()) {\n keyAlgoName = \"RSA\";\n bcKeyAlgoName = \"RSA\";\n } else if (algo.isECDSASigAlgo() || algo.isPlainECDSASigAlgo()) {\n keyAlgoName = \"EC\";\n bcKeyAlgoName = \"EC\";\n } else {\n throw new ObjectCreationException(\"unsupported algo \" + algoName);\n }\n\n Provider provider = providerMap.get(type);\n\n // Method to read create PrivateKey and PublicKey object.\n // SANSEC use KeyPairGenerator.generateKeyPair to read the keypair-\n // No new keypair will be generated here.\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(keyAlgoName, provider);\n kpGen.initialize(keyId << 16);\n KeyPair kp = kpGen.generateKeyPair();\n\n PublicKey publicKey = KeyFactory.getInstance(bcKeyAlgoName, \"BC\")\n .generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));\n\n return new JceSignerBuilder(kp.getPrivate(), publicKey, certificateChain, provider)\n .createSigner(algo, parallelism);\n } catch (GeneralSecurityException | XiSecurityException ex) {\n throw new ObjectCreationException(ex.getMessage(), ex);\n }\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv xgetCryptProviderType();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "boolean hasPkiData();", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "public String mo34971a() {\n return \"SHA-384\";\n }", "public interface JsonKey {\n\n String CLASS = \"class\";\n String DATA = \"data\";\n String EKS = \"eks\";\n String ID = \"id\";\n String LEVEL = \"level\";\n String MESSAGE = \"message\";\n String METHOD = \"method\";\n String REQUEST_MESSAGE_ID = \"msgId\";\n String STACKTRACE = \"stacktrace\";\n String VER = \"ver\";\n String OK = \"ok\";\n String LOG_LEVEL = \"logLevel\";\n String ERROR = \"error\";\n String EMPTY_STRING = \"\";\n String RESPONSE = \"response\";\n String ADDRESS = \"address\";\n String KEY = \"key\";\n String ERROR_MSG = \"error_msg\";\n String ATTRIBUTE = \"attribute\";\n String ERRORS = \"errors\";\n String SUCCESS = \"success\";\n\n String CERTIFICATE = \"certificate\";\n String RECIPIENT_NAME = \"recipientName\";\n String COURSE_NAME = \"courseName\";\n String NAME = \"name\";\n String HTML_TEMPLATE = \"htmlTemplate\";\n String TAG = \"tag\";\n String ISSUER = \"issuer\";\n String URL = \"url\";\n String SIGNATORY_LIST = \"signatoryList\";\n String DESIGNATION = \"designation\";\n String SIGNATORY_IMAGE = \"image\";\n\n String DOMAIN_URL = \"sunbird_cert_domain_url\";\n String ASSESSED_DOMAIN = \"ASSESSED_DOMAIN\";\n String BADGE_URL = \"BADGE_URL\";\n String ISSUER_URL = \"ISSUER_URL\";\n String TEMPLATE_URL = \"TEMPLATE_URL\";\n String CONTEXT = \"CONTEXT\";\n String VERIFICATION_TYPE = \"VERIFICATION_TYPE\";\n String SIGNATORY_EXTENSION = \"SIGNATORY_EXTENSION\";\n String RECIPIENT_EMAIl = \"recipientEmail\";\n String RECIPIENT_PHONE = \"recipientPhone\";\n String RECIPIENT_ID = \"recipientId\";\n String VALID_FROM = \"validFrom\";\n String EXPIRY = \"expiry\";\n String OLD_ID = \"oldId\";\n String PUBLIC_KEY = \"publicKey\";\n String DESCRIPTION = \"description\";\n String LOGO = \"logo\";\n String ISSUE_DATE = \"issueDate\";\n String USER = \"user\";\n String CERTIFICATE_NAME = \"name\";\n\n String CONTAINER_NAME = \"CONTAINER_NAME\";\n String CLOUD_STORAGE_TYPE = \"CLOUD_STORAGE_TYPE\";\n String CLOUD_UPLOAD_RETRY_COUNT = \"CLOUD_UPLOAD_RETRY_COUNT\";\n String AZURE_STORAGE_SECRET = \"AZURE_STORAGE_SECRET\";\n String AZURE_STORAGE_KEY = \"AZURE_STORAGE_KEY\";\n String ACCESS_CODE_LENGTH = \"ACCESS_CODE_LENGTH\";\n String ORG_ID = \"orgId\";\n String KEYS = \"keys\";\n String ENC_SERVICE_URL = \"sunbird_cert_enc_service_url\";\n String SIGN_HEALTH_CHECK_URL = \"SIGN_HEALTH_CHECK_URL\";\n String SIGN_URL = \"SIGN_URL\";\n String SIGN_VERIFY_URL = \"SIGN_VERIFY_URL\";\n String SIGN_CREATOR = \"SIGN_CREATOR\";\n String SIGN = \"sign\";\n String VERIFY = \"verify\";\n String KEY_ID = \"keyId\";\n String JSON_URL = \"jsonUrl\";\n String PDF_URL = \"pdfUrl\";\n String UNIQUE_ID = \"id\";\n String GENERATE_CERT = \"generateCert\";\n String PUBLIC_KEY_URL = \"PUBLIC_KEY_URL\";\n String GET_SIGN_URL = \"getSignUrl\";\n String SIGNED_URL = \"signedUrl\";\n\n String ACCESS_CODE = \"accessCode\";\n String JSON_DATA = \"jsonData\";\n String SLUG = \"sunbird_cert_slug\";\n}", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "BigInteger getCEP();", "java.lang.String getPubkey();", "public void setCertiType(java.lang.String certiType) {\n this.certiType = certiType;\n }", "public abstract String getSigAlgName();", "@Schema(required = true, description = \"Contract type (KIP-7, KIP-17, ERC-20, ERC-721)\")\n public String getType() {\n return type;\n }", "public ProfileKey getProfileKey(String username, String type) throws ProfileKeyManagerPersistenceException {\n ParameterHelpers.checkParameter(username, \"username\");\n\n boolean registered = checkType(type);\n\n Connection connection = getConnection();\n\n try {\n return getProfileKey(connection, username, type, registered);\n } finally {\n closeConnection(connection);\n }\n }", "protected CryptoProvider() {\n\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "@ParameterizedTest\n @EnumSource(KeyType.class)\n void testMissingJWTPublicKey(KeyType keyType) throws NoSuchAlgorithmException {\n final Pair<String, PrivateKey> keyPair = generateKeypair(keyType);\n\n final String jwt = Jwts.builder()\n .setHeaderParam(\"kid\", UUID.randomUUID())\n .setAudience(String.format(\"%sToken/auth\", \"here\"))\n .setIssuer(\"macaroon\")\n .setSubject(\"macaroon\")\n .setId(UUID.randomUUID().toString())\n .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES)))\n .signWith(keyPair.getRight(), APIAuthHelpers.getSigningAlgorithm(keyType))\n .compact();\n\n // Submit the JWT\n Response response = RESOURCE.target(\"/v1/Token/auth\")\n .queryParam(\"scope\", \"system/*.*\")\n .queryParam(\"grant_type\", \"client_credentials\")\n .queryParam(\"client_assertion_type\", TokenResource.CLIENT_ASSERTION_TYPE)\n .queryParam(\"client_assertion\", jwt)\n .request()\n .post(Entity.entity(\"\", MediaType.APPLICATION_FORM_URLENCODED));\n\n assertEquals(401, response.getStatus(), \"Should be unauthorized\");\n assertTrue(response.readEntity(String.class).contains(\"Cannot find public key\"), \"Should have correct exception\");\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "public ECP getPublicKGCKey(){return pkS;}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "private TPM_DIGEST createEmptyPubKeyHash()\r\n {\r\n// if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_BROADCOM )\r\n// {\r\n// return null;\r\n// }\r\n// else\r\n// {\r\n// return new TPM_DIGEST();\r\n// }\r\n if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_INFINEON )\r\n {\r\n return new TPM_DIGEST();\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }", "public String getTlsKey();", "@Test\n\tpublic void testSecuirtyConfigsOperations() throws NoSuchAlgorithmException {\n\t\t// Generate and store keys for the first time\n\t\tServerKeyPairs serverKeyPairs1 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair1 = serverKeyPairs1.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair1 = serverKeyPairs1.getSignatureKeyPair();\n\n\t\t// Initialize a new serverKeyPairs to test that it will only read\n\t\t// previously generated keys\n\t\tServerKeyPairs serverKeyPairs2 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair2 = serverKeyPairs2.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair2 = serverKeyPairs2.getSignatureKeyPair();\n\n\t\tassertEquals(\"Wrong loaded encryption public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded encryption private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getPrivateExponent());\n\n\t\tassertEquals(\"Wrong loaded signature public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded signature private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getPrivateExponent());\n\t}", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType.Enum getCryptAlgorithmType();", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public MEKeyTool() {\n keystore = new PublicKeyStoreBuilderBase();\n }", "public PrivateKeyType getPivateKeyType() {\n return PrivateKeyType.SAPLING_EXTENED_SPEND_KEY;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType xgetCryptAlgorithmType();", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "public void setPrincipalType(String principalType){\n this.principalType = principalType;\n //Update hashMap value..\n hashMap.put(\"principalType\", principalType);\n }", "public static void main(String[] args) {\n String keyFile = \"D:\\\\data\\\\kms\\\\liweigang.idc\";\n String message = \"dksf3r38324hrewjrh3r&^%djfdsjkek\";\n String pubmatrix = \"D:\\\\data\\\\kms\\\\sm2cpk.cn.pkm\";\n\n byte[] keycard = Tool.ReadFile(keyFile);\n System.out.println(\"keyCard:\" + Tool.Bytes2Hex(keycard));\n\n //得到私钥\n byte[] priKey = GMJni.GetPriKey(keycard);\n String priKeyHex = Tool.Bytes2Hex(priKey);\n System.out.println(\"private key:\" + priKeyHex);\n\n //得到密钥标识\n byte[] keyId = GMJni.GetKeyId(keycard);\n System.out.println(\"keyId:\" + Tool.Bytes2String(keyId));\n\n //得到公钥\n byte[] pubKey = GMJni.CalPubKey(Tool.String2Bytes(pubmatrix), keyId);\n System.out.println(\"public key:\" + Tool.Bytes2Hex(pubKey));\n\n //1000个不同message\n List<String> msgList = new ArrayList<>(12);\n for (int i = 0; i < 1000; i++) {\n //message基础上字符串长度+10\n msgList.add(message + RandomUtil.randomString(10));\n }\n long start = System.currentTimeMillis();\n //签名结果\n int rv = 0;\n //缓存\n MapCache cache = new MapCache();\n //命中缓存次数\n int count = 0;\n int count2 = 0;\n for (int i = 0; i < 100000; i++) {\n System.out.println(\"模拟请求第\" + i + \"次数\");\n\n //计算E值\n //30种不同的message,即仅30个不走缓存\n byte[] E = GMJni.SM2GetE(keyId, pubKey, Tool.String2Bytes(msgList.get(new Random().nextInt(30))));\n String hexE = Tool.Bytes2Hex(E);\n// System.out.println(\"E:\" + hexE);\n\n //SM2签名\n byte[] sig = GMJni.SM2Sign(priKey, E);\n// System.out.println(\"private key:\" + Tool.Bytes2Hex(priKey));\n// System.out.println(\"sign value:\" + Tool.Bytes2Hex(sig));\n\n // SM2签名验证\n // 引入Map缓存 E,sig的16进制的MD5值\n String hex = hexE + priKeyHex;\n// System.out.println(\"finalStr:\" + hex);\n String md5 = SecureUtil.md5(hex);\n if (null != cache.get(md5)) {\n count++;\n// System.out.println(\"命中缓存\" + (++count));\n } else {\n rv += GMJni.SM2Verify(pubKey, E, sig);\n count2++;\n cache.add(md5, (byte) 1, 50 * 1000);\n }\n }\n long end = System.currentTimeMillis();\n double v = (end - start) / 1000.0;\n System.out.println(\"time consuming:\" + v + \" sec\");\n System.out.println(Math.round(100000 / v) + \" times/sec\");\n System.out.println(\"命中缓存\" + (count));\n System.out.println(\"未命中\" + (count2));\n if (rv != 0) {\n System.out.println(\"Verify signature fail, error code is \" + String.valueOf(rv));\n } else {\n System.out.println(\"Verify signature success.\");\n }\n }", "private static String generateServerKey(Poi poi) {\n LonLat viewPoint = poi.getViewPosition();\n int lon = viewPoint.getLonInt();\n int lat = viewPoint.getLatInt();\n int alt = viewPoint.getAltInt();\n return generateServerKey(poi.getName(), poi.getAddress(), lon, lat, alt);\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public static void registerDefaultAlgorithms() {\n/* 390 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#dsa-sha1\", SignatureDSA.class);\n/* */ \n/* */ \n/* 393 */ algorithmHash.put(\"http://www.w3.org/2009/xmldsig11#dsa-sha256\", SignatureDSA.SHA256.class);\n/* */ \n/* */ \n/* 396 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\", SignatureBaseRSA.SignatureRSASHA1.class);\n/* */ \n/* */ \n/* 399 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#hmac-sha1\", IntegrityHmac.IntegrityHmacSHA1.class);\n/* */ \n/* */ \n/* 402 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-md5\", SignatureBaseRSA.SignatureRSAMD5.class);\n/* */ \n/* */ \n/* */ \n/* 406 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160\", SignatureBaseRSA.SignatureRSARIPEMD160.class);\n/* */ \n/* */ \n/* */ \n/* 410 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\", SignatureBaseRSA.SignatureRSASHA256.class);\n/* */ \n/* */ \n/* 413 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384\", SignatureBaseRSA.SignatureRSASHA384.class);\n/* */ \n/* */ \n/* 416 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\", SignatureBaseRSA.SignatureRSASHA512.class);\n/* */ \n/* */ \n/* 419 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1\", SignatureECDSA.SignatureECDSASHA1.class);\n/* */ \n/* */ \n/* 422 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256\", SignatureECDSA.SignatureECDSASHA256.class);\n/* */ \n/* */ \n/* 425 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384\", SignatureECDSA.SignatureECDSASHA384.class);\n/* */ \n/* */ \n/* 428 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512\", SignatureECDSA.SignatureECDSASHA512.class);\n/* */ \n/* */ \n/* 431 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-md5\", IntegrityHmac.IntegrityHmacMD5.class);\n/* */ \n/* */ \n/* 434 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160\", IntegrityHmac.IntegrityHmacRIPEMD160.class);\n/* */ \n/* */ \n/* 437 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha256\", IntegrityHmac.IntegrityHmacSHA256.class);\n/* */ \n/* */ \n/* 440 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha384\", IntegrityHmac.IntegrityHmacSHA384.class);\n/* */ \n/* */ \n/* 443 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha512\", IntegrityHmac.IntegrityHmacSHA512.class);\n/* */ }", "public java.lang.String getCertiType() {\n return certiType;\n }", "java.lang.String getServerSecret();", "public static void main(String[] args) {\n\t\tString algorithm = SignatureAlgorithm.HS256.getJcaName();\r\n\t\tSystem.out.println(algorithm);\r\n\r\n\t\t// set secret key\r\n\t\tString secret = \"this+is+my+scret+key+AAAAAAAAAAAAAAAAAAAAAAAAA\";\r\n\r\n\t\t// background information\r\n\t\t// =============================================================\r\n\t\t/*\r\n\t\t * the bytes of the secret key will be used by the signature algorithm - must be\r\n\t\t * in base 64 format\r\n\t\t */\r\n//\t\tbyte[] scretKeyEncoded = secret.getBytes(); // java encoding\r\n//\t\tbyte[] scretKeyDecoded = Base64.getDecoder().decode(secret); // base64\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyEncoded));\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyDecoded));\r\n\t\t// =====================================================================================\r\n\r\n\t\t// create the key from the decoded secret\r\n\t\tKey key = new SecretKeySpec(Base64.getDecoder().decode(secret), algorithm);\r\n\r\n\t\tInstant now = Instant.now();\r\n\r\n\t\t// create a JWT instance\r\n\t\tString jwt = Jwts.builder()\r\n\r\n\t\t\t\t.signWith(key)\r\n\r\n\t\t\t\t.setIssuedAt(Date.from(now))\r\n\r\n\t\t\t\t// will be valid for 10 seconds\r\n\t\t\t\t.setExpiration(Date.from(now.plus(10, ChronoUnit.SECONDS)))\r\n\r\n\t\t\t\t.setSubject(\"aaa@mail\")\r\n\r\n\t\t\t\t.claim(\"First name\", \"Dan\")\r\n\r\n\t\t\t\t.claim(\"Last name\", \"Levi\")\r\n\r\n\t\t\t\t.compact();\r\n\r\n\t\tSystem.out.println(jwt);\r\n\r\n\t\t// ==================================================\r\n\t\t// parse the JWS to get the expanded JWT\r\n//\t\tJWS - JSON Web Signature [aaaa.bbbb.cccc]\r\n//\t\tJWT - JSON Web Token [aaaa.bbbb.cccc]\r\n\r\n\t\tSystem.out.println(\"====================\");\r\n\t\tSystem.out.println(\"parsing the JWS to get a JWT\");\r\n\t\tJwtParser jwtParser = Jwts.parserBuilder().setSigningKey(key).build();\r\n\t\t// to demonstrate expiration paste an old JWS\r\n\t\tjwt = \"eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjA2Mzk1MTEsImV4cCI6MTYyMDYzOTUyMSwic3ViIjoiYWFhQG1haWwiLCJGaXJzdCBuYW1lIjoiRGFuIiwiTGFzdCBuYW1lIjoiTGV2aSJ9.cefEbBejjebKVILgOzca0LJZfd0F3qjezegeCaxOrfE\";\r\n\t\tSystem.out.println(jwtParser.parse(jwt));\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getHeader());\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getBody());\r\n\r\n\t}", "private String getSignatureString(Type type)\r\n {\r\n if(type instanceof CompoundType)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n CompoundType cType = (CompoundType)type;\r\n //find key and value types\r\n String keyType = getSignatureString(cType.keyType);\r\n sb.append(\"Ljava/util/HashMap\");\r\n sb.append(\"<\");\r\n sb.append(keyType);\r\n sb.append(getSignatureString(cType.valType));\r\n sb.append(\">;\");\r\n return sb.toString();\r\n }\r\n else if(type instanceof SimpleType)\r\n {\r\n switch(((SimpleType)type).type)\r\n {\r\n case INT:\r\n return \"Ljava/lang/Integer;\";\r\n case BOOLEAN:\r\n return \"Ljava/lang/Boolean;\";\r\n case STRING:\r\n return \"Ljava/lang/String;\";\r\n }\r\n }\r\n return null;\r\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public String getJCEProviderName() {\n/* 196 */ return this.signatureAlgorithm.engineGetJCEProviderName();\n/* */ }", "public String getJCEAlgorithmString() {\n/* 187 */ return this.signatureAlgorithm.engineGetJCEAlgorithmString();\n/* */ }", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "com.google.protobuf.ByteString getPublicEciesKeyBytes();", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "public static String getKeyTypeName(KeyType type)\n {\n // TODO: should be moved to DBProvider ...\n // MySQL : key identifier\n // SQLServer : key identifier\n // Derby : key identifier\n // PostgreSQL: key identifier\n switch (type) {\n // MySQL: key types ...\n case PRIMARY : return \"PRIMARY KEY\"; // table\n case UNIQUE : return \"UNIQUE\"; // table\n case INDEX : return \"INDEX\"; // table/index\n case UNIQUE_INDEX : return \"UNIQUE INDEX\"; // table/index\n default : return \"UNKNOWN\";\n }\n }", "long getCryptProviderTypeExt();", "@PostMapping(\"/createKeyPair\")\n public String createKeyPair() {\n \n AWSKMS kmsClient = AWSKMSClientBuilder.standard().build();\n \n return \"Private uid: \"+ priuid +\"\\nPublic uid: \" + pubuid +\"\\n\";\n }", "long getCryptAlgorithmSid();", "switch (buffer[ISO7816.OFFSET_CDATA + 4]) {\r\n\t\tcase BASIC:\r\n\t\t\tsetSignatureType(BASIC);\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tsetSignatureType(AUTHENTICATION);\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tsetSignatureType(NON_REPUDIATION);\r\n\t\t\tbreak;\r\n\t\tcase CA_ROLE:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\tdefault:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "private KeyStore askForPin() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {\n char newPin[] = PinDialog.getPIN(this.providerDesc);\n try {\n KeyStore ks = getKeyStore(newPin);\n pin = newPin;\n return ks;\n } catch (IOException e2) {\n e2.printStackTrace();\n if (e2.getCause() instanceof LoginException) {\n JOptionPane.showMessageDialog(null, \"Wrong PIN\", \"Cryptographic card\", JOptionPane.WARNING_MESSAGE);\n }\n throw e2;\n }\n }", "public String getTlsKeyPath();", "public byte[] getUserKey() throws IOException\n {\n byte[] u = null;\n COSString user = (COSString)encryptionDictionary.getDictionaryObject( COSName.getPDFName( \"U\" ) );\n if( user != null )\n {\n u = user.getBytes();\n }\n return u;\n }", "@Override\n public String getProviderName() {\n return \"SimpleEncryptionKeyStoreProvider\";\n }", "public interface SKey {\n\n String FAIL_STORE = \"job.fail.store\";\n\n String LOADBALANCE = \"loadbalance\";\n\n String EVENT_CENTER = \"event.center\";\n\n String REMOTING = \"lts.remoting\";\n\n String REMOTING_SERIALIZABLE_DFT = \"lts.remoting.serializable.default\";\n\n String ZK_CLIENT_KEY = \"zk.client\";\n\n String JOB_ID_GENERATOR = \"id.generator\";\n\n String JOB_LOGGER = \"job.logger\";\n\n String JOB_QUEUE = \"job.queue\";\n}", "private void getKeyType(final PdfObject pdfObject, final int i, final byte[] raw, final int length, final int keyLength, final int keyStart, final int type) {\n if(debugFastCode)//used in debug\n {\n PDFkey = PdfDictionary.getKey(keyStart, keyLength, raw);\n }\n \n PDFkeyInt=PdfDictionary.getIntKey(keyStart,keyLength,raw);\n \n //correct mapping\n if(PDFkeyInt==PdfDictionary.Indexed && (type==PdfDictionary.MK ||type==PdfDictionary.Form || type==PdfDictionary.Linearized || type==PdfDictionary.Group)) {\n PDFkeyInt = PdfDictionary.I;\n }\n \n if(isInlineImage) {\n PDFkeyInt = PdfObjectFactory.getInlineID(PDFkeyInt);\n }\n \n final int id=pdfObject.getID();\n \n if(type==PdfDictionary.Resources && (PDFkeyInt==PdfDictionary.ColorSpace\n || PDFkeyInt==PdfDictionary.ExtGState || PDFkeyInt==PdfDictionary.Shading\n || PDFkeyInt==PdfDictionary.XObject || PDFkeyInt==PdfDictionary.Font|| PDFkeyInt==PdfDictionary.Pattern)){\n pdfKeyType=PdfDictionary.VALUE_IS_DICTIONARY_PAIRS;\n //}else if (type==PdfDictionary.Form && id== PdfDictionary.AA && PDFkeyInt== PdfDictionary.K){\n // pdfKeyType= PdfDictionary.VALUE_IS_UNREAD_DICTIONARY;\n }else if (type==PdfDictionary.Outlines && PDFkeyInt== PdfDictionary.D){\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && PDFkeyInt== PdfDictionary.D){\n if(id==PdfDictionary.AP || id==PdfDictionary.AA){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if(id==PdfDictionary.Win){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else{\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && (id==PdfDictionary.AP || id==PdfDictionary.AA) && PDFkeyInt== PdfDictionary.A){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if (PDFkeyInt== PdfDictionary.Order && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary. VALUE_IS_OBJECT_ARRAY;\n }else if (PDFkeyInt== PdfDictionary.Name && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if ((type==PdfDictionary.ColorSpace || type==PdfDictionary.Function) && PDFkeyInt== PdfDictionary.N){\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(PDFkeyInt==PdfDictionary.Gamma && type==PdfDictionary.ColorSpace &&\n pdfObject.getParameterConstant(PdfDictionary.ColorSpace)== ColorSpaces.CalGray){ //its a number not an array\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(id==PdfDictionary.Win && pdfObject.getObjectType()==PdfDictionary.Form &&\n (PDFkeyInt==PdfDictionary.P || PDFkeyInt==PdfDictionary.O)){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if (isInlineImage && PDFkeyInt==PdfDictionary.ColorSpace){\n pdfKeyType= PdfDictionary.VALUE_IS_DICTIONARY;\n }else {\n pdfKeyType = PdfDictionary.getKeyType(PDFkeyInt, type);\n }\n \n \n //handle array of Function in Shading by using keyArray\n if(id==PdfDictionary.Shading && PDFkeyInt==PdfDictionary.Function){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n if(raw[ptr]=='['){\n pdfKeyType=PdfDictionary.VALUE_IS_KEY_ARRAY;\n }\n }\n \n //allow for other values in D,N,R definitions\n if(pdfKeyType==-1 && id== PdfDictionary.ClassMap){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n }else\n //allow for other values in D,N,R definitions as key pairs\n if(((((id==PdfDictionary.N || id==PdfDictionary.D || id==PdfDictionary.R))) &&\n pdfObject.getParentID()==PdfDictionary.AP &&\n pdfObject.getObjectType()==PdfDictionary.Form\n && raw[i]!='[' )){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n //decide if pair\n if(raw[keyStart]=='L' && raw[keyStart+1]=='e' && raw[keyStart+2]=='n' && raw[keyStart+3]=='g' && raw[keyStart+4]=='t' && raw[keyStart+5]=='h'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='n'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='f' && raw[keyStart+2]=='f'){\n }else\n if(raw[ptr]=='R'){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n \n if(debugFastCode) {\n System.out.println(\"new Returns \" + pdfKeyType + \" i=\" + i);\n }\n }\n }\n \n /**/\n \n //DecodeParms can be an array as well as a dictionary so check next char and alter if so\n if(PDFkeyInt==PdfDictionary.DecodeParms) {\n pdfKeyType = setTypeForDecodeParams(i, raw, length, pdfKeyType);\n }\n \n if(debugFastCode && pdfKeyType==-1 && pdfObject.getObjectType()!=PdfDictionary.Page){\n System.out.println(id+\" \"+type);\n System.out.println(padding +PDFkey+\" NO type setting for \"+PdfDictionary.getKey(keyStart,keyLength,raw)+\" id=\"+i);\n }\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "public PaymentRecordKey() {\n super();\n }", "private PasskeyContract() {}", "public RSAKeyPairGenerator() {\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum getCryptProviderType();", "java.lang.String getSignatureProviderId();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }" ]
[ "0.6727689", "0.66767913", "0.6510369", "0.6262288", "0.6251234", "0.6101008", "0.58891505", "0.5814989", "0.5750624", "0.57413155", "0.5544094", "0.5496116", "0.547445", "0.52937627", "0.5266566", "0.524678", "0.52335155", "0.51767373", "0.50153226", "0.5006655", "0.4962356", "0.49499023", "0.49411032", "0.49168855", "0.49020067", "0.4888426", "0.48494777", "0.48494777", "0.48460793", "0.48377907", "0.4832051", "0.4832051", "0.4832051", "0.48257953", "0.4821702", "0.48194492", "0.4819314", "0.4819314", "0.47991663", "0.4781225", "0.47571105", "0.4756231", "0.47555733", "0.47499835", "0.47289437", "0.47254056", "0.47212568", "0.47066334", "0.47023937", "0.47019845", "0.46989855", "0.46851024", "0.46719837", "0.46639642", "0.46222693", "0.46156308", "0.46136636", "0.4612661", "0.46108755", "0.46063787", "0.46033537", "0.4599115", "0.45910728", "0.45881075", "0.45822087", "0.4581919", "0.45753542", "0.45734766", "0.45711392", "0.45614913", "0.45610267", "0.45608622", "0.45530447", "0.4550199", "0.4548751", "0.45359287", "0.45348635", "0.45301956", "0.45298547", "0.45289811", "0.45227852", "0.45182446", "0.45164904", "0.45110202", "0.45109597", "0.4506969", "0.44993004", "0.44970086", "0.4493643", "0.4493612", "0.44934398", "0.4490861", "0.44874617", "0.44862193", "0.44837305", "0.44832504", "0.44770813", "0.44753104", "0.44724855", "0.44717774" ]
0.65033424
3
none / x509+sha256 / x509+sha1 optional string pki_type = 2 [default = "none"];
private void clearPkiType() { bitField0_ = (bitField0_ & ~0x00000002); pkiType_ = getDefaultInstance().getPkiType(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPkiType();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "boolean hasPkiType();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "public static void main(String[] args) throws IcbcApiException {\n\t\tUiIcbcClient client = new UiIcbcClient(APP_ID,IcbcConstants.SIGN_TYPE_RSA,\n\t\t\t\t\"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJCoQe/O+uqpOtyE/2CUjD7wosZw8jI1AlLNJCllOmlX+obA6h97b0JsEL0SjMCAR3xJyw7MKLqkcy5qQ/bBgw2XSrodmjzOVqfT1OXRii0xw0HiVkHR4cEWnEAAdfo0lDc4iuzCIQrnT5gM0+U+qeSV6JFfwVRjgYzBdHQRPCf1AgMBAAECgYAdQUoEe7GXH5591o/nMmOinvvscg8pRDsyD7bOgGBtyZMrCXzP3SDFKCHCeyvoColqg2oDlhpulK+OpYMVNlGQcO4eubOJp9MUc3m4A9RxkVr3dsVrmygM5czPfWHAPVQ4dECDruBJn9zoo1ci0myRTh4KSCq6SxpCE0Pbf3j7iQJBAOdMPFRfOkSQ1hsN9Mg4jd9on8r7+mF8gFPhkNI6qvEKw/prmU3obUWvZL42vRlLOQyyB92mBF24PStR/B6CjR8CQQCgGz0VoqCplurSCapGdgX3D7bNSDtMUmaLJYJxih8v+zghP0YtVgDeV3NjogVjOlz8/9Rebo0PoFcqyJnNA1RrAkEAul3dBoasZm7ldWsrXuDiv66HgoDB4Cb3J59Kl3oaHpp0CqUEI5gx48JNRE7K00SfNTGF0Pxh7Dn1X6Bxqwu6NQJADrdyPfLc4bnFi9jnleJzWepP2z6wdKt+UXv5KYaQp1BoMGYohTJKkiVnrdjOtfg/Y+IAG03+GVmbqYsW2AleUQJBANYQklohKtsmq8ptX3as6hjcuXcTpc2DSpVeOnCueNv107+dDJ+K14tbiVYzF3tkHBNMRkGtr6EuGKJ+A63sJ00=\",\n\t\t\t\tIcbcConstants.CHARSET_UTF8,IcbcConstants.ENCRYPT_TYPE_AES, \"xMh0xFsG7G80ziePFdnT8g==\");\n\t\tEaccountManageRequestV1 request = new EaccountManageRequestV1();\t\t\n\t\trequest.setServiceUrl(\"http://122.64.61.111:8081/ui/eaccount/manage/V1\");///\n\t\tEaccountManageRequestBizV1 bizContent = new EaccountManageRequestBizV1();\n\t\tbizContent.setMobileNo(\"13703878410\");//选输,手机号\n\t\tbizContent.setIdcode(\"128440810108044\");//选输,身份证号\n\t\tbizContent.setName(URLEncoder.encode(\"芡悠\"));//选输,用户姓名\n\t\tbizContent.setUserId(\"128440810108044\");//必输,需控制不能为空,用户唯一标识,送身份证号\n\t\tbizContent.setBacAddr(URLEncoder.encode(\"http://www.test.com\"));//选输,回调地址\n\t\tbizContent.setEpayflag(\"0\");//选输,工银e支付标志,0-短信、1-静态密码,集成客户端SDK的方式能送0-短信或1-静态密码,非APP方式只能送0-短信,不送默认为0-短信\n\t\t\n\t\tbizContent.setCorpAppid(APP_ID);//外公司合作方送APP_ID的值,行内应用如e支付等送外公司合作方的APPID\n\t\tlong systime = System.currentTimeMillis(); // 现时间戳\t\t\n\t\tString orderTimeStamp=new Long(systime).toString();\n\t\t\n\t\tSystem.out.println(\"orderTimeStamp:\"+orderTimeStamp);\n\t\tbizContent.setOrderTimeStamp(orderTimeStamp);//生成请求的时间,必输\n\t\t\n\t\tbizContent.setZoneno(\"00200\");//地区号号,选输,5位数字,上送值联系对接分行提供\n\t\tbizContent.setBrno(\"00260\");//网点号,选输,5位数字,上送值联系对接分行提供\n\t\t\n\t\trequest.setBizContent(bizContent);\n\t\tSystem.out.println(client.buildPostForm(request));// 实际调用时的相关返回结果及异常处理,请自行添加\n\t}", "dkk mo4509g();", "private void generatePrivacyKeyPair(boolean clientMode) throws IOException, UnsupportedEncodingException, NoSuchAlgorithmException, SaslException {\n byte[] ccmagic = CLIENT_CONF_MAGIC.getBytes(encoding);\n byte[] scmagic = SVR_CONF_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n int n;\n if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_40])) {\n n = 5;\n } else if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_56])) {\n n = 7;\n } else {\n n = 16;\n }\n byte[] keyBuffer = new byte[n + ccmagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, n);\n System.arraycopy(ccmagic, 0, keyBuffer, n, ccmagic.length);\n md5.update(keyBuffer);\n byte[] Kcc = md5.digest();\n System.arraycopy(scmagic, 0, keyBuffer, n, scmagic.length);\n md5.update(keyBuffer);\n byte[] Kcs = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST24:Kcc: \", Kcc);\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST25:Kcs: \", Kcs);\n }\n byte[] myKc;\n byte[] peerKc;\n if (clientMode) {\n myKc = Kcc;\n peerKc = Kcs;\n } else {\n myKc = Kcs;\n peerKc = Kcc;\n }\n try {\n SecretKey encKey;\n SecretKey decKey;\n if (negotiatedCipher.indexOf(CIPHER_TOKENS[RC4]) > -1) {\n encCipher = Cipher.getInstance(\"RC4\");\n decCipher = Cipher.getInstance(\"RC4\");\n encKey = new SecretKeySpec(myKc, \"RC4\");\n decKey = new SecretKeySpec(peerKc, \"RC4\");\n encCipher.init(Cipher.ENCRYPT_MODE, encKey);\n decCipher.init(Cipher.DECRYPT_MODE, decKey);\n } else if ((negotiatedCipher.equals(CIPHER_TOKENS[DES])) || (negotiatedCipher.equals(CIPHER_TOKENS[DES3]))) {\n String cipherFullname, cipherShortname;\n if (negotiatedCipher.equals(CIPHER_TOKENS[DES])) {\n cipherFullname = \"DES/CBC/NoPadding\";\n cipherShortname = \"des\";\n } else {\n cipherFullname = \"DESede/CBC/NoPadding\";\n cipherShortname = \"desede\";\n }\n encCipher = Cipher.getInstance(cipherFullname);\n decCipher = Cipher.getInstance(cipherFullname);\n encKey = makeDesKeys(myKc, cipherShortname);\n decKey = makeDesKeys(peerKc, cipherShortname);\n IvParameterSpec encIv = new IvParameterSpec(myKc, 8, 8);\n IvParameterSpec decIv = new IvParameterSpec(peerKc, 8, 8);\n encCipher.init(Cipher.ENCRYPT_MODE, encKey, encIv);\n decCipher.init(Cipher.DECRYPT_MODE, decKey, decIv);\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST26:\" + negotiatedCipher + \" IVcc: \", encIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST27:\" + negotiatedCipher + \" IVcs: \", decIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST28:\" + negotiatedCipher + \" encryption key: \", encKey.getEncoded());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST29:\" + negotiatedCipher + \" decryption key: \", decKey.getEncoded());\n }\n }\n } catch (InvalidKeySpecException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported key \" + \"specification used.\", e);\n } catch (InvalidAlgorithmParameterException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid cipher \" + \"algorithem parameter used to create cipher instance\", e);\n } catch (NoSuchPaddingException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported \" + \"padding used for chosen cipher\", e);\n } catch (InvalidKeyException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid data \" + \"used to initialize keys\", e);\n }\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "java.lang.String getPublicEciesKey();", "OpenSSLKey mo134201a();", "public abstract String getSigAlgOID();", "private void generateIntegrityKeyPair(boolean clientMode) throws UnsupportedEncodingException, IOException, NoSuchAlgorithmException {\n byte[] cimagic = CLIENT_INT_MAGIC.getBytes(encoding);\n byte[] simagic = SVR_INT_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n byte[] keyBuffer = new byte[H_A1.length + cimagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, H_A1.length);\n System.arraycopy(cimagic, 0, keyBuffer, H_A1.length, cimagic.length);\n md5.update(keyBuffer);\n byte[] Kic = md5.digest();\n System.arraycopy(simagic, 0, keyBuffer, H_A1.length, simagic.length);\n md5.update(keyBuffer);\n byte[] Kis = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST12:Kic: \", Kic);\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST13:Kis: \", Kis);\n }\n if (clientMode) {\n myKi = Kic;\n peerKi = Kis;\n } else {\n myKi = Kis;\n peerKi = Kic;\n }\n }", "public final String mo1957a() {\n return \"type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey\";\n }", "private native String native_ks(long cookie, byte[] userKey);", "@Override\n public ConcurrentContentSigner newSigner(\n String type, SignerConf conf, X509Cert[] certificateChain)\n throws ObjectCreationException {\n type = type.toLowerCase(Locale.ROOT);\n if (!types.contains(type)) {\n throw new ObjectCreationException(\"unknown signer type \" + type);\n }\n\n String str = conf.getConfValue(\"parallelism\");\n int parallelism = 20;\n if (str != null) {\n try {\n parallelism = Integer.parseInt(str);\n } catch (NumberFormatException ex) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n\n if (parallelism < 1) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n }\n\n str = conf.getConfValue(\"alias\");\n if (str == null) {\n throw new ObjectCreationException(\"alias is not specified\");\n }\n int keyId = Integer.parseInt(str);\n\n String algoName = conf.getConfValue(\"algo\");\n if (algoName == null) {\n throw new ObjectCreationException(\"algo is not specified\");\n }\n\n try {\n InitStatus initStatus = init(type);\n if (initStatus.status.get() != 1) {\n throw new ObjectCreationException(initStatus.details);\n }\n\n SignAlgo algo = SignAlgo.getInstance(algoName);\n String keyAlgoName;\n String bcKeyAlgoName;\n if (algo.isSM2SigAlgo()) {\n keyAlgoName = \"SM2\";\n bcKeyAlgoName = \"EC\";\n } else if (algo.isRSAPkcs1SigAlgo() || algo.isRSAPSSSigAlgo()) {\n keyAlgoName = \"RSA\";\n bcKeyAlgoName = \"RSA\";\n } else if (algo.isECDSASigAlgo() || algo.isPlainECDSASigAlgo()) {\n keyAlgoName = \"EC\";\n bcKeyAlgoName = \"EC\";\n } else {\n throw new ObjectCreationException(\"unsupported algo \" + algoName);\n }\n\n Provider provider = providerMap.get(type);\n\n // Method to read create PrivateKey and PublicKey object.\n // SANSEC use KeyPairGenerator.generateKeyPair to read the keypair-\n // No new keypair will be generated here.\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(keyAlgoName, provider);\n kpGen.initialize(keyId << 16);\n KeyPair kp = kpGen.generateKeyPair();\n\n PublicKey publicKey = KeyFactory.getInstance(bcKeyAlgoName, \"BC\")\n .generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));\n\n return new JceSignerBuilder(kp.getPrivate(), publicKey, certificateChain, provider)\n .createSigner(algo, parallelism);\n } catch (GeneralSecurityException | XiSecurityException ex) {\n throw new ObjectCreationException(ex.getMessage(), ex);\n }\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv xgetCryptProviderType();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "boolean hasPkiData();", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "public String mo34971a() {\n return \"SHA-384\";\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "public interface JsonKey {\n\n String CLASS = \"class\";\n String DATA = \"data\";\n String EKS = \"eks\";\n String ID = \"id\";\n String LEVEL = \"level\";\n String MESSAGE = \"message\";\n String METHOD = \"method\";\n String REQUEST_MESSAGE_ID = \"msgId\";\n String STACKTRACE = \"stacktrace\";\n String VER = \"ver\";\n String OK = \"ok\";\n String LOG_LEVEL = \"logLevel\";\n String ERROR = \"error\";\n String EMPTY_STRING = \"\";\n String RESPONSE = \"response\";\n String ADDRESS = \"address\";\n String KEY = \"key\";\n String ERROR_MSG = \"error_msg\";\n String ATTRIBUTE = \"attribute\";\n String ERRORS = \"errors\";\n String SUCCESS = \"success\";\n\n String CERTIFICATE = \"certificate\";\n String RECIPIENT_NAME = \"recipientName\";\n String COURSE_NAME = \"courseName\";\n String NAME = \"name\";\n String HTML_TEMPLATE = \"htmlTemplate\";\n String TAG = \"tag\";\n String ISSUER = \"issuer\";\n String URL = \"url\";\n String SIGNATORY_LIST = \"signatoryList\";\n String DESIGNATION = \"designation\";\n String SIGNATORY_IMAGE = \"image\";\n\n String DOMAIN_URL = \"sunbird_cert_domain_url\";\n String ASSESSED_DOMAIN = \"ASSESSED_DOMAIN\";\n String BADGE_URL = \"BADGE_URL\";\n String ISSUER_URL = \"ISSUER_URL\";\n String TEMPLATE_URL = \"TEMPLATE_URL\";\n String CONTEXT = \"CONTEXT\";\n String VERIFICATION_TYPE = \"VERIFICATION_TYPE\";\n String SIGNATORY_EXTENSION = \"SIGNATORY_EXTENSION\";\n String RECIPIENT_EMAIl = \"recipientEmail\";\n String RECIPIENT_PHONE = \"recipientPhone\";\n String RECIPIENT_ID = \"recipientId\";\n String VALID_FROM = \"validFrom\";\n String EXPIRY = \"expiry\";\n String OLD_ID = \"oldId\";\n String PUBLIC_KEY = \"publicKey\";\n String DESCRIPTION = \"description\";\n String LOGO = \"logo\";\n String ISSUE_DATE = \"issueDate\";\n String USER = \"user\";\n String CERTIFICATE_NAME = \"name\";\n\n String CONTAINER_NAME = \"CONTAINER_NAME\";\n String CLOUD_STORAGE_TYPE = \"CLOUD_STORAGE_TYPE\";\n String CLOUD_UPLOAD_RETRY_COUNT = \"CLOUD_UPLOAD_RETRY_COUNT\";\n String AZURE_STORAGE_SECRET = \"AZURE_STORAGE_SECRET\";\n String AZURE_STORAGE_KEY = \"AZURE_STORAGE_KEY\";\n String ACCESS_CODE_LENGTH = \"ACCESS_CODE_LENGTH\";\n String ORG_ID = \"orgId\";\n String KEYS = \"keys\";\n String ENC_SERVICE_URL = \"sunbird_cert_enc_service_url\";\n String SIGN_HEALTH_CHECK_URL = \"SIGN_HEALTH_CHECK_URL\";\n String SIGN_URL = \"SIGN_URL\";\n String SIGN_VERIFY_URL = \"SIGN_VERIFY_URL\";\n String SIGN_CREATOR = \"SIGN_CREATOR\";\n String SIGN = \"sign\";\n String VERIFY = \"verify\";\n String KEY_ID = \"keyId\";\n String JSON_URL = \"jsonUrl\";\n String PDF_URL = \"pdfUrl\";\n String UNIQUE_ID = \"id\";\n String GENERATE_CERT = \"generateCert\";\n String PUBLIC_KEY_URL = \"PUBLIC_KEY_URL\";\n String GET_SIGN_URL = \"getSignUrl\";\n String SIGNED_URL = \"signedUrl\";\n\n String ACCESS_CODE = \"accessCode\";\n String JSON_DATA = \"jsonData\";\n String SLUG = \"sunbird_cert_slug\";\n}", "BigInteger getCEP();", "java.lang.String getPubkey();", "public void setCertiType(java.lang.String certiType) {\n this.certiType = certiType;\n }", "@Schema(required = true, description = \"Contract type (KIP-7, KIP-17, ERC-20, ERC-721)\")\n public String getType() {\n return type;\n }", "public abstract String getSigAlgName();", "public ProfileKey getProfileKey(String username, String type) throws ProfileKeyManagerPersistenceException {\n ParameterHelpers.checkParameter(username, \"username\");\n\n boolean registered = checkType(type);\n\n Connection connection = getConnection();\n\n try {\n return getProfileKey(connection, username, type, registered);\n } finally {\n closeConnection(connection);\n }\n }", "protected CryptoProvider() {\n\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "@ParameterizedTest\n @EnumSource(KeyType.class)\n void testMissingJWTPublicKey(KeyType keyType) throws NoSuchAlgorithmException {\n final Pair<String, PrivateKey> keyPair = generateKeypair(keyType);\n\n final String jwt = Jwts.builder()\n .setHeaderParam(\"kid\", UUID.randomUUID())\n .setAudience(String.format(\"%sToken/auth\", \"here\"))\n .setIssuer(\"macaroon\")\n .setSubject(\"macaroon\")\n .setId(UUID.randomUUID().toString())\n .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES)))\n .signWith(keyPair.getRight(), APIAuthHelpers.getSigningAlgorithm(keyType))\n .compact();\n\n // Submit the JWT\n Response response = RESOURCE.target(\"/v1/Token/auth\")\n .queryParam(\"scope\", \"system/*.*\")\n .queryParam(\"grant_type\", \"client_credentials\")\n .queryParam(\"client_assertion_type\", TokenResource.CLIENT_ASSERTION_TYPE)\n .queryParam(\"client_assertion\", jwt)\n .request()\n .post(Entity.entity(\"\", MediaType.APPLICATION_FORM_URLENCODED));\n\n assertEquals(401, response.getStatus(), \"Should be unauthorized\");\n assertTrue(response.readEntity(String.class).contains(\"Cannot find public key\"), \"Should have correct exception\");\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "public ECP getPublicKGCKey(){return pkS;}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "private TPM_DIGEST createEmptyPubKeyHash()\r\n {\r\n// if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_BROADCOM )\r\n// {\r\n// return null;\r\n// }\r\n// else\r\n// {\r\n// return new TPM_DIGEST();\r\n// }\r\n if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_INFINEON )\r\n {\r\n return new TPM_DIGEST();\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }", "public String getTlsKey();", "@Test\n\tpublic void testSecuirtyConfigsOperations() throws NoSuchAlgorithmException {\n\t\t// Generate and store keys for the first time\n\t\tServerKeyPairs serverKeyPairs1 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair1 = serverKeyPairs1.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair1 = serverKeyPairs1.getSignatureKeyPair();\n\n\t\t// Initialize a new serverKeyPairs to test that it will only read\n\t\t// previously generated keys\n\t\tServerKeyPairs serverKeyPairs2 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair2 = serverKeyPairs2.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair2 = serverKeyPairs2.getSignatureKeyPair();\n\n\t\tassertEquals(\"Wrong loaded encryption public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded encryption private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getPrivateExponent());\n\n\t\tassertEquals(\"Wrong loaded signature public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded signature private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getPrivateExponent());\n\t}", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType.Enum getCryptAlgorithmType();", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public MEKeyTool() {\n keystore = new PublicKeyStoreBuilderBase();\n }", "public PrivateKeyType getPivateKeyType() {\n return PrivateKeyType.SAPLING_EXTENED_SPEND_KEY;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType xgetCryptAlgorithmType();", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "public void setPrincipalType(String principalType){\n this.principalType = principalType;\n //Update hashMap value..\n hashMap.put(\"principalType\", principalType);\n }", "private static String generateServerKey(Poi poi) {\n LonLat viewPoint = poi.getViewPosition();\n int lon = viewPoint.getLonInt();\n int lat = viewPoint.getLatInt();\n int alt = viewPoint.getAltInt();\n return generateServerKey(poi.getName(), poi.getAddress(), lon, lat, alt);\n }", "public static void main(String[] args) {\n String keyFile = \"D:\\\\data\\\\kms\\\\liweigang.idc\";\n String message = \"dksf3r38324hrewjrh3r&^%djfdsjkek\";\n String pubmatrix = \"D:\\\\data\\\\kms\\\\sm2cpk.cn.pkm\";\n\n byte[] keycard = Tool.ReadFile(keyFile);\n System.out.println(\"keyCard:\" + Tool.Bytes2Hex(keycard));\n\n //得到私钥\n byte[] priKey = GMJni.GetPriKey(keycard);\n String priKeyHex = Tool.Bytes2Hex(priKey);\n System.out.println(\"private key:\" + priKeyHex);\n\n //得到密钥标识\n byte[] keyId = GMJni.GetKeyId(keycard);\n System.out.println(\"keyId:\" + Tool.Bytes2String(keyId));\n\n //得到公钥\n byte[] pubKey = GMJni.CalPubKey(Tool.String2Bytes(pubmatrix), keyId);\n System.out.println(\"public key:\" + Tool.Bytes2Hex(pubKey));\n\n //1000个不同message\n List<String> msgList = new ArrayList<>(12);\n for (int i = 0; i < 1000; i++) {\n //message基础上字符串长度+10\n msgList.add(message + RandomUtil.randomString(10));\n }\n long start = System.currentTimeMillis();\n //签名结果\n int rv = 0;\n //缓存\n MapCache cache = new MapCache();\n //命中缓存次数\n int count = 0;\n int count2 = 0;\n for (int i = 0; i < 100000; i++) {\n System.out.println(\"模拟请求第\" + i + \"次数\");\n\n //计算E值\n //30种不同的message,即仅30个不走缓存\n byte[] E = GMJni.SM2GetE(keyId, pubKey, Tool.String2Bytes(msgList.get(new Random().nextInt(30))));\n String hexE = Tool.Bytes2Hex(E);\n// System.out.println(\"E:\" + hexE);\n\n //SM2签名\n byte[] sig = GMJni.SM2Sign(priKey, E);\n// System.out.println(\"private key:\" + Tool.Bytes2Hex(priKey));\n// System.out.println(\"sign value:\" + Tool.Bytes2Hex(sig));\n\n // SM2签名验证\n // 引入Map缓存 E,sig的16进制的MD5值\n String hex = hexE + priKeyHex;\n// System.out.println(\"finalStr:\" + hex);\n String md5 = SecureUtil.md5(hex);\n if (null != cache.get(md5)) {\n count++;\n// System.out.println(\"命中缓存\" + (++count));\n } else {\n rv += GMJni.SM2Verify(pubKey, E, sig);\n count2++;\n cache.add(md5, (byte) 1, 50 * 1000);\n }\n }\n long end = System.currentTimeMillis();\n double v = (end - start) / 1000.0;\n System.out.println(\"time consuming:\" + v + \" sec\");\n System.out.println(Math.round(100000 / v) + \" times/sec\");\n System.out.println(\"命中缓存\" + (count));\n System.out.println(\"未命中\" + (count2));\n if (rv != 0) {\n System.out.println(\"Verify signature fail, error code is \" + String.valueOf(rv));\n } else {\n System.out.println(\"Verify signature success.\");\n }\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public java.lang.String getCertiType() {\n return certiType;\n }", "public static void registerDefaultAlgorithms() {\n/* 390 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#dsa-sha1\", SignatureDSA.class);\n/* */ \n/* */ \n/* 393 */ algorithmHash.put(\"http://www.w3.org/2009/xmldsig11#dsa-sha256\", SignatureDSA.SHA256.class);\n/* */ \n/* */ \n/* 396 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\", SignatureBaseRSA.SignatureRSASHA1.class);\n/* */ \n/* */ \n/* 399 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#hmac-sha1\", IntegrityHmac.IntegrityHmacSHA1.class);\n/* */ \n/* */ \n/* 402 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-md5\", SignatureBaseRSA.SignatureRSAMD5.class);\n/* */ \n/* */ \n/* */ \n/* 406 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160\", SignatureBaseRSA.SignatureRSARIPEMD160.class);\n/* */ \n/* */ \n/* */ \n/* 410 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\", SignatureBaseRSA.SignatureRSASHA256.class);\n/* */ \n/* */ \n/* 413 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384\", SignatureBaseRSA.SignatureRSASHA384.class);\n/* */ \n/* */ \n/* 416 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\", SignatureBaseRSA.SignatureRSASHA512.class);\n/* */ \n/* */ \n/* 419 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1\", SignatureECDSA.SignatureECDSASHA1.class);\n/* */ \n/* */ \n/* 422 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256\", SignatureECDSA.SignatureECDSASHA256.class);\n/* */ \n/* */ \n/* 425 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384\", SignatureECDSA.SignatureECDSASHA384.class);\n/* */ \n/* */ \n/* 428 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512\", SignatureECDSA.SignatureECDSASHA512.class);\n/* */ \n/* */ \n/* 431 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-md5\", IntegrityHmac.IntegrityHmacMD5.class);\n/* */ \n/* */ \n/* 434 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160\", IntegrityHmac.IntegrityHmacRIPEMD160.class);\n/* */ \n/* */ \n/* 437 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha256\", IntegrityHmac.IntegrityHmacSHA256.class);\n/* */ \n/* */ \n/* 440 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha384\", IntegrityHmac.IntegrityHmacSHA384.class);\n/* */ \n/* */ \n/* 443 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha512\", IntegrityHmac.IntegrityHmacSHA512.class);\n/* */ }", "java.lang.String getServerSecret();", "public static void main(String[] args) {\n\t\tString algorithm = SignatureAlgorithm.HS256.getJcaName();\r\n\t\tSystem.out.println(algorithm);\r\n\r\n\t\t// set secret key\r\n\t\tString secret = \"this+is+my+scret+key+AAAAAAAAAAAAAAAAAAAAAAAAA\";\r\n\r\n\t\t// background information\r\n\t\t// =============================================================\r\n\t\t/*\r\n\t\t * the bytes of the secret key will be used by the signature algorithm - must be\r\n\t\t * in base 64 format\r\n\t\t */\r\n//\t\tbyte[] scretKeyEncoded = secret.getBytes(); // java encoding\r\n//\t\tbyte[] scretKeyDecoded = Base64.getDecoder().decode(secret); // base64\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyEncoded));\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyDecoded));\r\n\t\t// =====================================================================================\r\n\r\n\t\t// create the key from the decoded secret\r\n\t\tKey key = new SecretKeySpec(Base64.getDecoder().decode(secret), algorithm);\r\n\r\n\t\tInstant now = Instant.now();\r\n\r\n\t\t// create a JWT instance\r\n\t\tString jwt = Jwts.builder()\r\n\r\n\t\t\t\t.signWith(key)\r\n\r\n\t\t\t\t.setIssuedAt(Date.from(now))\r\n\r\n\t\t\t\t// will be valid for 10 seconds\r\n\t\t\t\t.setExpiration(Date.from(now.plus(10, ChronoUnit.SECONDS)))\r\n\r\n\t\t\t\t.setSubject(\"aaa@mail\")\r\n\r\n\t\t\t\t.claim(\"First name\", \"Dan\")\r\n\r\n\t\t\t\t.claim(\"Last name\", \"Levi\")\r\n\r\n\t\t\t\t.compact();\r\n\r\n\t\tSystem.out.println(jwt);\r\n\r\n\t\t// ==================================================\r\n\t\t// parse the JWS to get the expanded JWT\r\n//\t\tJWS - JSON Web Signature [aaaa.bbbb.cccc]\r\n//\t\tJWT - JSON Web Token [aaaa.bbbb.cccc]\r\n\r\n\t\tSystem.out.println(\"====================\");\r\n\t\tSystem.out.println(\"parsing the JWS to get a JWT\");\r\n\t\tJwtParser jwtParser = Jwts.parserBuilder().setSigningKey(key).build();\r\n\t\t// to demonstrate expiration paste an old JWS\r\n\t\tjwt = \"eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjA2Mzk1MTEsImV4cCI6MTYyMDYzOTUyMSwic3ViIjoiYWFhQG1haWwiLCJGaXJzdCBuYW1lIjoiRGFuIiwiTGFzdCBuYW1lIjoiTGV2aSJ9.cefEbBejjebKVILgOzca0LJZfd0F3qjezegeCaxOrfE\";\r\n\t\tSystem.out.println(jwtParser.parse(jwt));\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getHeader());\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getBody());\r\n\r\n\t}", "private String getSignatureString(Type type)\r\n {\r\n if(type instanceof CompoundType)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n CompoundType cType = (CompoundType)type;\r\n //find key and value types\r\n String keyType = getSignatureString(cType.keyType);\r\n sb.append(\"Ljava/util/HashMap\");\r\n sb.append(\"<\");\r\n sb.append(keyType);\r\n sb.append(getSignatureString(cType.valType));\r\n sb.append(\">;\");\r\n return sb.toString();\r\n }\r\n else if(type instanceof SimpleType)\r\n {\r\n switch(((SimpleType)type).type)\r\n {\r\n case INT:\r\n return \"Ljava/lang/Integer;\";\r\n case BOOLEAN:\r\n return \"Ljava/lang/Boolean;\";\r\n case STRING:\r\n return \"Ljava/lang/String;\";\r\n }\r\n }\r\n return null;\r\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "public String getJCEProviderName() {\n/* 196 */ return this.signatureAlgorithm.engineGetJCEProviderName();\n/* */ }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public String getJCEAlgorithmString() {\n/* 187 */ return this.signatureAlgorithm.engineGetJCEAlgorithmString();\n/* */ }", "com.google.protobuf.ByteString getPublicEciesKeyBytes();", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "public static String getKeyTypeName(KeyType type)\n {\n // TODO: should be moved to DBProvider ...\n // MySQL : key identifier\n // SQLServer : key identifier\n // Derby : key identifier\n // PostgreSQL: key identifier\n switch (type) {\n // MySQL: key types ...\n case PRIMARY : return \"PRIMARY KEY\"; // table\n case UNIQUE : return \"UNIQUE\"; // table\n case INDEX : return \"INDEX\"; // table/index\n case UNIQUE_INDEX : return \"UNIQUE INDEX\"; // table/index\n default : return \"UNKNOWN\";\n }\n }", "long getCryptProviderTypeExt();", "@PostMapping(\"/createKeyPair\")\n public String createKeyPair() {\n \n AWSKMS kmsClient = AWSKMSClientBuilder.standard().build();\n \n return \"Private uid: \"+ priuid +\"\\nPublic uid: \" + pubuid +\"\\n\";\n }", "long getCryptAlgorithmSid();", "switch (buffer[ISO7816.OFFSET_CDATA + 4]) {\r\n\t\tcase BASIC:\r\n\t\t\tsetSignatureType(BASIC);\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tsetSignatureType(AUTHENTICATION);\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tsetSignatureType(NON_REPUDIATION);\r\n\t\t\tbreak;\r\n\t\tcase CA_ROLE:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\tdefault:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "private KeyStore askForPin() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {\n char newPin[] = PinDialog.getPIN(this.providerDesc);\n try {\n KeyStore ks = getKeyStore(newPin);\n pin = newPin;\n return ks;\n } catch (IOException e2) {\n e2.printStackTrace();\n if (e2.getCause() instanceof LoginException) {\n JOptionPane.showMessageDialog(null, \"Wrong PIN\", \"Cryptographic card\", JOptionPane.WARNING_MESSAGE);\n }\n throw e2;\n }\n }", "public String getTlsKeyPath();", "@Override\n public String getProviderName() {\n return \"SimpleEncryptionKeyStoreProvider\";\n }", "public byte[] getUserKey() throws IOException\n {\n byte[] u = null;\n COSString user = (COSString)encryptionDictionary.getDictionaryObject( COSName.getPDFName( \"U\" ) );\n if( user != null )\n {\n u = user.getBytes();\n }\n return u;\n }", "public interface SKey {\n\n String FAIL_STORE = \"job.fail.store\";\n\n String LOADBALANCE = \"loadbalance\";\n\n String EVENT_CENTER = \"event.center\";\n\n String REMOTING = \"lts.remoting\";\n\n String REMOTING_SERIALIZABLE_DFT = \"lts.remoting.serializable.default\";\n\n String ZK_CLIENT_KEY = \"zk.client\";\n\n String JOB_ID_GENERATOR = \"id.generator\";\n\n String JOB_LOGGER = \"job.logger\";\n\n String JOB_QUEUE = \"job.queue\";\n}", "private void getKeyType(final PdfObject pdfObject, final int i, final byte[] raw, final int length, final int keyLength, final int keyStart, final int type) {\n if(debugFastCode)//used in debug\n {\n PDFkey = PdfDictionary.getKey(keyStart, keyLength, raw);\n }\n \n PDFkeyInt=PdfDictionary.getIntKey(keyStart,keyLength,raw);\n \n //correct mapping\n if(PDFkeyInt==PdfDictionary.Indexed && (type==PdfDictionary.MK ||type==PdfDictionary.Form || type==PdfDictionary.Linearized || type==PdfDictionary.Group)) {\n PDFkeyInt = PdfDictionary.I;\n }\n \n if(isInlineImage) {\n PDFkeyInt = PdfObjectFactory.getInlineID(PDFkeyInt);\n }\n \n final int id=pdfObject.getID();\n \n if(type==PdfDictionary.Resources && (PDFkeyInt==PdfDictionary.ColorSpace\n || PDFkeyInt==PdfDictionary.ExtGState || PDFkeyInt==PdfDictionary.Shading\n || PDFkeyInt==PdfDictionary.XObject || PDFkeyInt==PdfDictionary.Font|| PDFkeyInt==PdfDictionary.Pattern)){\n pdfKeyType=PdfDictionary.VALUE_IS_DICTIONARY_PAIRS;\n //}else if (type==PdfDictionary.Form && id== PdfDictionary.AA && PDFkeyInt== PdfDictionary.K){\n // pdfKeyType= PdfDictionary.VALUE_IS_UNREAD_DICTIONARY;\n }else if (type==PdfDictionary.Outlines && PDFkeyInt== PdfDictionary.D){\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && PDFkeyInt== PdfDictionary.D){\n if(id==PdfDictionary.AP || id==PdfDictionary.AA){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if(id==PdfDictionary.Win){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else{\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && (id==PdfDictionary.AP || id==PdfDictionary.AA) && PDFkeyInt== PdfDictionary.A){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if (PDFkeyInt== PdfDictionary.Order && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary. VALUE_IS_OBJECT_ARRAY;\n }else if (PDFkeyInt== PdfDictionary.Name && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if ((type==PdfDictionary.ColorSpace || type==PdfDictionary.Function) && PDFkeyInt== PdfDictionary.N){\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(PDFkeyInt==PdfDictionary.Gamma && type==PdfDictionary.ColorSpace &&\n pdfObject.getParameterConstant(PdfDictionary.ColorSpace)== ColorSpaces.CalGray){ //its a number not an array\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(id==PdfDictionary.Win && pdfObject.getObjectType()==PdfDictionary.Form &&\n (PDFkeyInt==PdfDictionary.P || PDFkeyInt==PdfDictionary.O)){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if (isInlineImage && PDFkeyInt==PdfDictionary.ColorSpace){\n pdfKeyType= PdfDictionary.VALUE_IS_DICTIONARY;\n }else {\n pdfKeyType = PdfDictionary.getKeyType(PDFkeyInt, type);\n }\n \n \n //handle array of Function in Shading by using keyArray\n if(id==PdfDictionary.Shading && PDFkeyInt==PdfDictionary.Function){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n if(raw[ptr]=='['){\n pdfKeyType=PdfDictionary.VALUE_IS_KEY_ARRAY;\n }\n }\n \n //allow for other values in D,N,R definitions\n if(pdfKeyType==-1 && id== PdfDictionary.ClassMap){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n }else\n //allow for other values in D,N,R definitions as key pairs\n if(((((id==PdfDictionary.N || id==PdfDictionary.D || id==PdfDictionary.R))) &&\n pdfObject.getParentID()==PdfDictionary.AP &&\n pdfObject.getObjectType()==PdfDictionary.Form\n && raw[i]!='[' )){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n //decide if pair\n if(raw[keyStart]=='L' && raw[keyStart+1]=='e' && raw[keyStart+2]=='n' && raw[keyStart+3]=='g' && raw[keyStart+4]=='t' && raw[keyStart+5]=='h'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='n'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='f' && raw[keyStart+2]=='f'){\n }else\n if(raw[ptr]=='R'){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n \n if(debugFastCode) {\n System.out.println(\"new Returns \" + pdfKeyType + \" i=\" + i);\n }\n }\n }\n \n /**/\n \n //DecodeParms can be an array as well as a dictionary so check next char and alter if so\n if(PDFkeyInt==PdfDictionary.DecodeParms) {\n pdfKeyType = setTypeForDecodeParams(i, raw, length, pdfKeyType);\n }\n \n if(debugFastCode && pdfKeyType==-1 && pdfObject.getObjectType()!=PdfDictionary.Page){\n System.out.println(id+\" \"+type);\n System.out.println(padding +PDFkey+\" NO type setting for \"+PdfDictionary.getKey(keyStart,keyLength,raw)+\" id=\"+i);\n }\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "public PaymentRecordKey() {\n super();\n }", "private PasskeyContract() {}", "public RSAKeyPairGenerator() {\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum getCryptProviderType();", "java.lang.String getSignatureProviderId();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }" ]
[ "0.6726498", "0.6677302", "0.65103334", "0.6503502", "0.62628514", "0.6250372", "0.61004686", "0.5888439", "0.5749554", "0.5741641", "0.55435157", "0.5493693", "0.5474418", "0.52934134", "0.52665645", "0.5246521", "0.52349544", "0.5175871", "0.5017036", "0.5007778", "0.4962969", "0.4950082", "0.49420312", "0.49163356", "0.49024847", "0.48897386", "0.48511118", "0.48511118", "0.4844952", "0.48370767", "0.4831613", "0.4831613", "0.4831613", "0.48279023", "0.4821235", "0.48205858", "0.48205858", "0.48201925", "0.48012882", "0.4783611", "0.47606364", "0.47574088", "0.47566023", "0.47519523", "0.47286636", "0.47235122", "0.47220808", "0.47063407", "0.47040585", "0.47039852", "0.47009808", "0.4687133", "0.46720207", "0.4663095", "0.46227324", "0.46167073", "0.4614823", "0.46146208", "0.46117303", "0.4609115", "0.4605506", "0.45985833", "0.45930865", "0.45889315", "0.45830595", "0.45830226", "0.45740417", "0.45735276", "0.4572773", "0.4563699", "0.4561856", "0.45605567", "0.45527497", "0.45521763", "0.4549838", "0.4536104", "0.45360166", "0.4531036", "0.45309407", "0.45290637", "0.45238796", "0.4519284", "0.45178244", "0.4511146", "0.45110682", "0.4508972", "0.45000508", "0.44973904", "0.44938332", "0.44937173", "0.44929975", "0.44925633", "0.44923615", "0.44870168", "0.44844353", "0.44840944", "0.44768944", "0.44768745", "0.4473516", "0.4471568" ]
0.58146834
8
none / x509+sha256 / x509+sha1 optional string pki_type = 2 [default = "none"];
private void setPkiTypeBytes( com.google.protobuf.ByteString value) { pkiType_ = value.toStringUtf8(); bitField0_ |= 0x00000002; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPkiType();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "boolean hasPkiType();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "public static void main(String[] args) throws IcbcApiException {\n\t\tUiIcbcClient client = new UiIcbcClient(APP_ID,IcbcConstants.SIGN_TYPE_RSA,\n\t\t\t\t\"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJCoQe/O+uqpOtyE/2CUjD7wosZw8jI1AlLNJCllOmlX+obA6h97b0JsEL0SjMCAR3xJyw7MKLqkcy5qQ/bBgw2XSrodmjzOVqfT1OXRii0xw0HiVkHR4cEWnEAAdfo0lDc4iuzCIQrnT5gM0+U+qeSV6JFfwVRjgYzBdHQRPCf1AgMBAAECgYAdQUoEe7GXH5591o/nMmOinvvscg8pRDsyD7bOgGBtyZMrCXzP3SDFKCHCeyvoColqg2oDlhpulK+OpYMVNlGQcO4eubOJp9MUc3m4A9RxkVr3dsVrmygM5czPfWHAPVQ4dECDruBJn9zoo1ci0myRTh4KSCq6SxpCE0Pbf3j7iQJBAOdMPFRfOkSQ1hsN9Mg4jd9on8r7+mF8gFPhkNI6qvEKw/prmU3obUWvZL42vRlLOQyyB92mBF24PStR/B6CjR8CQQCgGz0VoqCplurSCapGdgX3D7bNSDtMUmaLJYJxih8v+zghP0YtVgDeV3NjogVjOlz8/9Rebo0PoFcqyJnNA1RrAkEAul3dBoasZm7ldWsrXuDiv66HgoDB4Cb3J59Kl3oaHpp0CqUEI5gx48JNRE7K00SfNTGF0Pxh7Dn1X6Bxqwu6NQJADrdyPfLc4bnFi9jnleJzWepP2z6wdKt+UXv5KYaQp1BoMGYohTJKkiVnrdjOtfg/Y+IAG03+GVmbqYsW2AleUQJBANYQklohKtsmq8ptX3as6hjcuXcTpc2DSpVeOnCueNv107+dDJ+K14tbiVYzF3tkHBNMRkGtr6EuGKJ+A63sJ00=\",\n\t\t\t\tIcbcConstants.CHARSET_UTF8,IcbcConstants.ENCRYPT_TYPE_AES, \"xMh0xFsG7G80ziePFdnT8g==\");\n\t\tEaccountManageRequestV1 request = new EaccountManageRequestV1();\t\t\n\t\trequest.setServiceUrl(\"http://122.64.61.111:8081/ui/eaccount/manage/V1\");///\n\t\tEaccountManageRequestBizV1 bizContent = new EaccountManageRequestBizV1();\n\t\tbizContent.setMobileNo(\"13703878410\");//选输,手机号\n\t\tbizContent.setIdcode(\"128440810108044\");//选输,身份证号\n\t\tbizContent.setName(URLEncoder.encode(\"芡悠\"));//选输,用户姓名\n\t\tbizContent.setUserId(\"128440810108044\");//必输,需控制不能为空,用户唯一标识,送身份证号\n\t\tbizContent.setBacAddr(URLEncoder.encode(\"http://www.test.com\"));//选输,回调地址\n\t\tbizContent.setEpayflag(\"0\");//选输,工银e支付标志,0-短信、1-静态密码,集成客户端SDK的方式能送0-短信或1-静态密码,非APP方式只能送0-短信,不送默认为0-短信\n\t\t\n\t\tbizContent.setCorpAppid(APP_ID);//外公司合作方送APP_ID的值,行内应用如e支付等送外公司合作方的APPID\n\t\tlong systime = System.currentTimeMillis(); // 现时间戳\t\t\n\t\tString orderTimeStamp=new Long(systime).toString();\n\t\t\n\t\tSystem.out.println(\"orderTimeStamp:\"+orderTimeStamp);\n\t\tbizContent.setOrderTimeStamp(orderTimeStamp);//生成请求的时间,必输\n\t\t\n\t\tbizContent.setZoneno(\"00200\");//地区号号,选输,5位数字,上送值联系对接分行提供\n\t\tbizContent.setBrno(\"00260\");//网点号,选输,5位数字,上送值联系对接分行提供\n\t\t\n\t\trequest.setBizContent(bizContent);\n\t\tSystem.out.println(client.buildPostForm(request));// 实际调用时的相关返回结果及异常处理,请自行添加\n\t}", "dkk mo4509g();", "private void generatePrivacyKeyPair(boolean clientMode) throws IOException, UnsupportedEncodingException, NoSuchAlgorithmException, SaslException {\n byte[] ccmagic = CLIENT_CONF_MAGIC.getBytes(encoding);\n byte[] scmagic = SVR_CONF_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n int n;\n if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_40])) {\n n = 5;\n } else if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_56])) {\n n = 7;\n } else {\n n = 16;\n }\n byte[] keyBuffer = new byte[n + ccmagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, n);\n System.arraycopy(ccmagic, 0, keyBuffer, n, ccmagic.length);\n md5.update(keyBuffer);\n byte[] Kcc = md5.digest();\n System.arraycopy(scmagic, 0, keyBuffer, n, scmagic.length);\n md5.update(keyBuffer);\n byte[] Kcs = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST24:Kcc: \", Kcc);\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST25:Kcs: \", Kcs);\n }\n byte[] myKc;\n byte[] peerKc;\n if (clientMode) {\n myKc = Kcc;\n peerKc = Kcs;\n } else {\n myKc = Kcs;\n peerKc = Kcc;\n }\n try {\n SecretKey encKey;\n SecretKey decKey;\n if (negotiatedCipher.indexOf(CIPHER_TOKENS[RC4]) > -1) {\n encCipher = Cipher.getInstance(\"RC4\");\n decCipher = Cipher.getInstance(\"RC4\");\n encKey = new SecretKeySpec(myKc, \"RC4\");\n decKey = new SecretKeySpec(peerKc, \"RC4\");\n encCipher.init(Cipher.ENCRYPT_MODE, encKey);\n decCipher.init(Cipher.DECRYPT_MODE, decKey);\n } else if ((negotiatedCipher.equals(CIPHER_TOKENS[DES])) || (negotiatedCipher.equals(CIPHER_TOKENS[DES3]))) {\n String cipherFullname, cipherShortname;\n if (negotiatedCipher.equals(CIPHER_TOKENS[DES])) {\n cipherFullname = \"DES/CBC/NoPadding\";\n cipherShortname = \"des\";\n } else {\n cipherFullname = \"DESede/CBC/NoPadding\";\n cipherShortname = \"desede\";\n }\n encCipher = Cipher.getInstance(cipherFullname);\n decCipher = Cipher.getInstance(cipherFullname);\n encKey = makeDesKeys(myKc, cipherShortname);\n decKey = makeDesKeys(peerKc, cipherShortname);\n IvParameterSpec encIv = new IvParameterSpec(myKc, 8, 8);\n IvParameterSpec decIv = new IvParameterSpec(peerKc, 8, 8);\n encCipher.init(Cipher.ENCRYPT_MODE, encKey, encIv);\n decCipher.init(Cipher.DECRYPT_MODE, decKey, decIv);\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST26:\" + negotiatedCipher + \" IVcc: \", encIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST27:\" + negotiatedCipher + \" IVcs: \", decIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST28:\" + negotiatedCipher + \" encryption key: \", encKey.getEncoded());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST29:\" + negotiatedCipher + \" decryption key: \", decKey.getEncoded());\n }\n }\n } catch (InvalidKeySpecException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported key \" + \"specification used.\", e);\n } catch (InvalidAlgorithmParameterException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid cipher \" + \"algorithem parameter used to create cipher instance\", e);\n } catch (NoSuchPaddingException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported \" + \"padding used for chosen cipher\", e);\n } catch (InvalidKeyException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid data \" + \"used to initialize keys\", e);\n }\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "java.lang.String getPublicEciesKey();", "OpenSSLKey mo134201a();", "public abstract String getSigAlgOID();", "private void generateIntegrityKeyPair(boolean clientMode) throws UnsupportedEncodingException, IOException, NoSuchAlgorithmException {\n byte[] cimagic = CLIENT_INT_MAGIC.getBytes(encoding);\n byte[] simagic = SVR_INT_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n byte[] keyBuffer = new byte[H_A1.length + cimagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, H_A1.length);\n System.arraycopy(cimagic, 0, keyBuffer, H_A1.length, cimagic.length);\n md5.update(keyBuffer);\n byte[] Kic = md5.digest();\n System.arraycopy(simagic, 0, keyBuffer, H_A1.length, simagic.length);\n md5.update(keyBuffer);\n byte[] Kis = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST12:Kic: \", Kic);\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST13:Kis: \", Kis);\n }\n if (clientMode) {\n myKi = Kic;\n peerKi = Kis;\n } else {\n myKi = Kis;\n peerKi = Kic;\n }\n }", "public final String mo1957a() {\n return \"type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey\";\n }", "private native String native_ks(long cookie, byte[] userKey);", "@Override\n public ConcurrentContentSigner newSigner(\n String type, SignerConf conf, X509Cert[] certificateChain)\n throws ObjectCreationException {\n type = type.toLowerCase(Locale.ROOT);\n if (!types.contains(type)) {\n throw new ObjectCreationException(\"unknown signer type \" + type);\n }\n\n String str = conf.getConfValue(\"parallelism\");\n int parallelism = 20;\n if (str != null) {\n try {\n parallelism = Integer.parseInt(str);\n } catch (NumberFormatException ex) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n\n if (parallelism < 1) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n }\n\n str = conf.getConfValue(\"alias\");\n if (str == null) {\n throw new ObjectCreationException(\"alias is not specified\");\n }\n int keyId = Integer.parseInt(str);\n\n String algoName = conf.getConfValue(\"algo\");\n if (algoName == null) {\n throw new ObjectCreationException(\"algo is not specified\");\n }\n\n try {\n InitStatus initStatus = init(type);\n if (initStatus.status.get() != 1) {\n throw new ObjectCreationException(initStatus.details);\n }\n\n SignAlgo algo = SignAlgo.getInstance(algoName);\n String keyAlgoName;\n String bcKeyAlgoName;\n if (algo.isSM2SigAlgo()) {\n keyAlgoName = \"SM2\";\n bcKeyAlgoName = \"EC\";\n } else if (algo.isRSAPkcs1SigAlgo() || algo.isRSAPSSSigAlgo()) {\n keyAlgoName = \"RSA\";\n bcKeyAlgoName = \"RSA\";\n } else if (algo.isECDSASigAlgo() || algo.isPlainECDSASigAlgo()) {\n keyAlgoName = \"EC\";\n bcKeyAlgoName = \"EC\";\n } else {\n throw new ObjectCreationException(\"unsupported algo \" + algoName);\n }\n\n Provider provider = providerMap.get(type);\n\n // Method to read create PrivateKey and PublicKey object.\n // SANSEC use KeyPairGenerator.generateKeyPair to read the keypair-\n // No new keypair will be generated here.\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(keyAlgoName, provider);\n kpGen.initialize(keyId << 16);\n KeyPair kp = kpGen.generateKeyPair();\n\n PublicKey publicKey = KeyFactory.getInstance(bcKeyAlgoName, \"BC\")\n .generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));\n\n return new JceSignerBuilder(kp.getPrivate(), publicKey, certificateChain, provider)\n .createSigner(algo, parallelism);\n } catch (GeneralSecurityException | XiSecurityException ex) {\n throw new ObjectCreationException(ex.getMessage(), ex);\n }\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv xgetCryptProviderType();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "boolean hasPkiData();", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "public String mo34971a() {\n return \"SHA-384\";\n }", "public interface JsonKey {\n\n String CLASS = \"class\";\n String DATA = \"data\";\n String EKS = \"eks\";\n String ID = \"id\";\n String LEVEL = \"level\";\n String MESSAGE = \"message\";\n String METHOD = \"method\";\n String REQUEST_MESSAGE_ID = \"msgId\";\n String STACKTRACE = \"stacktrace\";\n String VER = \"ver\";\n String OK = \"ok\";\n String LOG_LEVEL = \"logLevel\";\n String ERROR = \"error\";\n String EMPTY_STRING = \"\";\n String RESPONSE = \"response\";\n String ADDRESS = \"address\";\n String KEY = \"key\";\n String ERROR_MSG = \"error_msg\";\n String ATTRIBUTE = \"attribute\";\n String ERRORS = \"errors\";\n String SUCCESS = \"success\";\n\n String CERTIFICATE = \"certificate\";\n String RECIPIENT_NAME = \"recipientName\";\n String COURSE_NAME = \"courseName\";\n String NAME = \"name\";\n String HTML_TEMPLATE = \"htmlTemplate\";\n String TAG = \"tag\";\n String ISSUER = \"issuer\";\n String URL = \"url\";\n String SIGNATORY_LIST = \"signatoryList\";\n String DESIGNATION = \"designation\";\n String SIGNATORY_IMAGE = \"image\";\n\n String DOMAIN_URL = \"sunbird_cert_domain_url\";\n String ASSESSED_DOMAIN = \"ASSESSED_DOMAIN\";\n String BADGE_URL = \"BADGE_URL\";\n String ISSUER_URL = \"ISSUER_URL\";\n String TEMPLATE_URL = \"TEMPLATE_URL\";\n String CONTEXT = \"CONTEXT\";\n String VERIFICATION_TYPE = \"VERIFICATION_TYPE\";\n String SIGNATORY_EXTENSION = \"SIGNATORY_EXTENSION\";\n String RECIPIENT_EMAIl = \"recipientEmail\";\n String RECIPIENT_PHONE = \"recipientPhone\";\n String RECIPIENT_ID = \"recipientId\";\n String VALID_FROM = \"validFrom\";\n String EXPIRY = \"expiry\";\n String OLD_ID = \"oldId\";\n String PUBLIC_KEY = \"publicKey\";\n String DESCRIPTION = \"description\";\n String LOGO = \"logo\";\n String ISSUE_DATE = \"issueDate\";\n String USER = \"user\";\n String CERTIFICATE_NAME = \"name\";\n\n String CONTAINER_NAME = \"CONTAINER_NAME\";\n String CLOUD_STORAGE_TYPE = \"CLOUD_STORAGE_TYPE\";\n String CLOUD_UPLOAD_RETRY_COUNT = \"CLOUD_UPLOAD_RETRY_COUNT\";\n String AZURE_STORAGE_SECRET = \"AZURE_STORAGE_SECRET\";\n String AZURE_STORAGE_KEY = \"AZURE_STORAGE_KEY\";\n String ACCESS_CODE_LENGTH = \"ACCESS_CODE_LENGTH\";\n String ORG_ID = \"orgId\";\n String KEYS = \"keys\";\n String ENC_SERVICE_URL = \"sunbird_cert_enc_service_url\";\n String SIGN_HEALTH_CHECK_URL = \"SIGN_HEALTH_CHECK_URL\";\n String SIGN_URL = \"SIGN_URL\";\n String SIGN_VERIFY_URL = \"SIGN_VERIFY_URL\";\n String SIGN_CREATOR = \"SIGN_CREATOR\";\n String SIGN = \"sign\";\n String VERIFY = \"verify\";\n String KEY_ID = \"keyId\";\n String JSON_URL = \"jsonUrl\";\n String PDF_URL = \"pdfUrl\";\n String UNIQUE_ID = \"id\";\n String GENERATE_CERT = \"generateCert\";\n String PUBLIC_KEY_URL = \"PUBLIC_KEY_URL\";\n String GET_SIGN_URL = \"getSignUrl\";\n String SIGNED_URL = \"signedUrl\";\n\n String ACCESS_CODE = \"accessCode\";\n String JSON_DATA = \"jsonData\";\n String SLUG = \"sunbird_cert_slug\";\n}", "BigInteger getCEP();", "java.lang.String getPubkey();", "public void setCertiType(java.lang.String certiType) {\n this.certiType = certiType;\n }", "public abstract String getSigAlgName();", "@Schema(required = true, description = \"Contract type (KIP-7, KIP-17, ERC-20, ERC-721)\")\n public String getType() {\n return type;\n }", "public ProfileKey getProfileKey(String username, String type) throws ProfileKeyManagerPersistenceException {\n ParameterHelpers.checkParameter(username, \"username\");\n\n boolean registered = checkType(type);\n\n Connection connection = getConnection();\n\n try {\n return getProfileKey(connection, username, type, registered);\n } finally {\n closeConnection(connection);\n }\n }", "protected CryptoProvider() {\n\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "@ParameterizedTest\n @EnumSource(KeyType.class)\n void testMissingJWTPublicKey(KeyType keyType) throws NoSuchAlgorithmException {\n final Pair<String, PrivateKey> keyPair = generateKeypair(keyType);\n\n final String jwt = Jwts.builder()\n .setHeaderParam(\"kid\", UUID.randomUUID())\n .setAudience(String.format(\"%sToken/auth\", \"here\"))\n .setIssuer(\"macaroon\")\n .setSubject(\"macaroon\")\n .setId(UUID.randomUUID().toString())\n .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES)))\n .signWith(keyPair.getRight(), APIAuthHelpers.getSigningAlgorithm(keyType))\n .compact();\n\n // Submit the JWT\n Response response = RESOURCE.target(\"/v1/Token/auth\")\n .queryParam(\"scope\", \"system/*.*\")\n .queryParam(\"grant_type\", \"client_credentials\")\n .queryParam(\"client_assertion_type\", TokenResource.CLIENT_ASSERTION_TYPE)\n .queryParam(\"client_assertion\", jwt)\n .request()\n .post(Entity.entity(\"\", MediaType.APPLICATION_FORM_URLENCODED));\n\n assertEquals(401, response.getStatus(), \"Should be unauthorized\");\n assertTrue(response.readEntity(String.class).contains(\"Cannot find public key\"), \"Should have correct exception\");\n }", "public ECP getPublicKGCKey(){return pkS;}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "private TPM_DIGEST createEmptyPubKeyHash()\r\n {\r\n// if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_BROADCOM )\r\n// {\r\n// return null;\r\n// }\r\n// else\r\n// {\r\n// return new TPM_DIGEST();\r\n// }\r\n if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_INFINEON )\r\n {\r\n return new TPM_DIGEST();\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }", "public String getTlsKey();", "@Test\n\tpublic void testSecuirtyConfigsOperations() throws NoSuchAlgorithmException {\n\t\t// Generate and store keys for the first time\n\t\tServerKeyPairs serverKeyPairs1 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair1 = serverKeyPairs1.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair1 = serverKeyPairs1.getSignatureKeyPair();\n\n\t\t// Initialize a new serverKeyPairs to test that it will only read\n\t\t// previously generated keys\n\t\tServerKeyPairs serverKeyPairs2 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair2 = serverKeyPairs2.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair2 = serverKeyPairs2.getSignatureKeyPair();\n\n\t\tassertEquals(\"Wrong loaded encryption public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded encryption private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getPrivateExponent());\n\n\t\tassertEquals(\"Wrong loaded signature public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded signature private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getPrivateExponent());\n\t}", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType.Enum getCryptAlgorithmType();", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public MEKeyTool() {\n keystore = new PublicKeyStoreBuilderBase();\n }", "public PrivateKeyType getPivateKeyType() {\n return PrivateKeyType.SAPLING_EXTENED_SPEND_KEY;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType xgetCryptAlgorithmType();", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "public void setPrincipalType(String principalType){\n this.principalType = principalType;\n //Update hashMap value..\n hashMap.put(\"principalType\", principalType);\n }", "public static void main(String[] args) {\n String keyFile = \"D:\\\\data\\\\kms\\\\liweigang.idc\";\n String message = \"dksf3r38324hrewjrh3r&^%djfdsjkek\";\n String pubmatrix = \"D:\\\\data\\\\kms\\\\sm2cpk.cn.pkm\";\n\n byte[] keycard = Tool.ReadFile(keyFile);\n System.out.println(\"keyCard:\" + Tool.Bytes2Hex(keycard));\n\n //得到私钥\n byte[] priKey = GMJni.GetPriKey(keycard);\n String priKeyHex = Tool.Bytes2Hex(priKey);\n System.out.println(\"private key:\" + priKeyHex);\n\n //得到密钥标识\n byte[] keyId = GMJni.GetKeyId(keycard);\n System.out.println(\"keyId:\" + Tool.Bytes2String(keyId));\n\n //得到公钥\n byte[] pubKey = GMJni.CalPubKey(Tool.String2Bytes(pubmatrix), keyId);\n System.out.println(\"public key:\" + Tool.Bytes2Hex(pubKey));\n\n //1000个不同message\n List<String> msgList = new ArrayList<>(12);\n for (int i = 0; i < 1000; i++) {\n //message基础上字符串长度+10\n msgList.add(message + RandomUtil.randomString(10));\n }\n long start = System.currentTimeMillis();\n //签名结果\n int rv = 0;\n //缓存\n MapCache cache = new MapCache();\n //命中缓存次数\n int count = 0;\n int count2 = 0;\n for (int i = 0; i < 100000; i++) {\n System.out.println(\"模拟请求第\" + i + \"次数\");\n\n //计算E值\n //30种不同的message,即仅30个不走缓存\n byte[] E = GMJni.SM2GetE(keyId, pubKey, Tool.String2Bytes(msgList.get(new Random().nextInt(30))));\n String hexE = Tool.Bytes2Hex(E);\n// System.out.println(\"E:\" + hexE);\n\n //SM2签名\n byte[] sig = GMJni.SM2Sign(priKey, E);\n// System.out.println(\"private key:\" + Tool.Bytes2Hex(priKey));\n// System.out.println(\"sign value:\" + Tool.Bytes2Hex(sig));\n\n // SM2签名验证\n // 引入Map缓存 E,sig的16进制的MD5值\n String hex = hexE + priKeyHex;\n// System.out.println(\"finalStr:\" + hex);\n String md5 = SecureUtil.md5(hex);\n if (null != cache.get(md5)) {\n count++;\n// System.out.println(\"命中缓存\" + (++count));\n } else {\n rv += GMJni.SM2Verify(pubKey, E, sig);\n count2++;\n cache.add(md5, (byte) 1, 50 * 1000);\n }\n }\n long end = System.currentTimeMillis();\n double v = (end - start) / 1000.0;\n System.out.println(\"time consuming:\" + v + \" sec\");\n System.out.println(Math.round(100000 / v) + \" times/sec\");\n System.out.println(\"命中缓存\" + (count));\n System.out.println(\"未命中\" + (count2));\n if (rv != 0) {\n System.out.println(\"Verify signature fail, error code is \" + String.valueOf(rv));\n } else {\n System.out.println(\"Verify signature success.\");\n }\n }", "private static String generateServerKey(Poi poi) {\n LonLat viewPoint = poi.getViewPosition();\n int lon = viewPoint.getLonInt();\n int lat = viewPoint.getLatInt();\n int alt = viewPoint.getAltInt();\n return generateServerKey(poi.getName(), poi.getAddress(), lon, lat, alt);\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public java.lang.String getCertiType() {\n return certiType;\n }", "java.lang.String getServerSecret();", "public static void registerDefaultAlgorithms() {\n/* 390 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#dsa-sha1\", SignatureDSA.class);\n/* */ \n/* */ \n/* 393 */ algorithmHash.put(\"http://www.w3.org/2009/xmldsig11#dsa-sha256\", SignatureDSA.SHA256.class);\n/* */ \n/* */ \n/* 396 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\", SignatureBaseRSA.SignatureRSASHA1.class);\n/* */ \n/* */ \n/* 399 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#hmac-sha1\", IntegrityHmac.IntegrityHmacSHA1.class);\n/* */ \n/* */ \n/* 402 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-md5\", SignatureBaseRSA.SignatureRSAMD5.class);\n/* */ \n/* */ \n/* */ \n/* 406 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160\", SignatureBaseRSA.SignatureRSARIPEMD160.class);\n/* */ \n/* */ \n/* */ \n/* 410 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\", SignatureBaseRSA.SignatureRSASHA256.class);\n/* */ \n/* */ \n/* 413 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384\", SignatureBaseRSA.SignatureRSASHA384.class);\n/* */ \n/* */ \n/* 416 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\", SignatureBaseRSA.SignatureRSASHA512.class);\n/* */ \n/* */ \n/* 419 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1\", SignatureECDSA.SignatureECDSASHA1.class);\n/* */ \n/* */ \n/* 422 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256\", SignatureECDSA.SignatureECDSASHA256.class);\n/* */ \n/* */ \n/* 425 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384\", SignatureECDSA.SignatureECDSASHA384.class);\n/* */ \n/* */ \n/* 428 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512\", SignatureECDSA.SignatureECDSASHA512.class);\n/* */ \n/* */ \n/* 431 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-md5\", IntegrityHmac.IntegrityHmacMD5.class);\n/* */ \n/* */ \n/* 434 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160\", IntegrityHmac.IntegrityHmacRIPEMD160.class);\n/* */ \n/* */ \n/* 437 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha256\", IntegrityHmac.IntegrityHmacSHA256.class);\n/* */ \n/* */ \n/* 440 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha384\", IntegrityHmac.IntegrityHmacSHA384.class);\n/* */ \n/* */ \n/* 443 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha512\", IntegrityHmac.IntegrityHmacSHA512.class);\n/* */ }", "public static void main(String[] args) {\n\t\tString algorithm = SignatureAlgorithm.HS256.getJcaName();\r\n\t\tSystem.out.println(algorithm);\r\n\r\n\t\t// set secret key\r\n\t\tString secret = \"this+is+my+scret+key+AAAAAAAAAAAAAAAAAAAAAAAAA\";\r\n\r\n\t\t// background information\r\n\t\t// =============================================================\r\n\t\t/*\r\n\t\t * the bytes of the secret key will be used by the signature algorithm - must be\r\n\t\t * in base 64 format\r\n\t\t */\r\n//\t\tbyte[] scretKeyEncoded = secret.getBytes(); // java encoding\r\n//\t\tbyte[] scretKeyDecoded = Base64.getDecoder().decode(secret); // base64\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyEncoded));\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyDecoded));\r\n\t\t// =====================================================================================\r\n\r\n\t\t// create the key from the decoded secret\r\n\t\tKey key = new SecretKeySpec(Base64.getDecoder().decode(secret), algorithm);\r\n\r\n\t\tInstant now = Instant.now();\r\n\r\n\t\t// create a JWT instance\r\n\t\tString jwt = Jwts.builder()\r\n\r\n\t\t\t\t.signWith(key)\r\n\r\n\t\t\t\t.setIssuedAt(Date.from(now))\r\n\r\n\t\t\t\t// will be valid for 10 seconds\r\n\t\t\t\t.setExpiration(Date.from(now.plus(10, ChronoUnit.SECONDS)))\r\n\r\n\t\t\t\t.setSubject(\"aaa@mail\")\r\n\r\n\t\t\t\t.claim(\"First name\", \"Dan\")\r\n\r\n\t\t\t\t.claim(\"Last name\", \"Levi\")\r\n\r\n\t\t\t\t.compact();\r\n\r\n\t\tSystem.out.println(jwt);\r\n\r\n\t\t// ==================================================\r\n\t\t// parse the JWS to get the expanded JWT\r\n//\t\tJWS - JSON Web Signature [aaaa.bbbb.cccc]\r\n//\t\tJWT - JSON Web Token [aaaa.bbbb.cccc]\r\n\r\n\t\tSystem.out.println(\"====================\");\r\n\t\tSystem.out.println(\"parsing the JWS to get a JWT\");\r\n\t\tJwtParser jwtParser = Jwts.parserBuilder().setSigningKey(key).build();\r\n\t\t// to demonstrate expiration paste an old JWS\r\n\t\tjwt = \"eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjA2Mzk1MTEsImV4cCI6MTYyMDYzOTUyMSwic3ViIjoiYWFhQG1haWwiLCJGaXJzdCBuYW1lIjoiRGFuIiwiTGFzdCBuYW1lIjoiTGV2aSJ9.cefEbBejjebKVILgOzca0LJZfd0F3qjezegeCaxOrfE\";\r\n\t\tSystem.out.println(jwtParser.parse(jwt));\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getHeader());\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getBody());\r\n\r\n\t}", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "private String getSignatureString(Type type)\r\n {\r\n if(type instanceof CompoundType)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n CompoundType cType = (CompoundType)type;\r\n //find key and value types\r\n String keyType = getSignatureString(cType.keyType);\r\n sb.append(\"Ljava/util/HashMap\");\r\n sb.append(\"<\");\r\n sb.append(keyType);\r\n sb.append(getSignatureString(cType.valType));\r\n sb.append(\">;\");\r\n return sb.toString();\r\n }\r\n else if(type instanceof SimpleType)\r\n {\r\n switch(((SimpleType)type).type)\r\n {\r\n case INT:\r\n return \"Ljava/lang/Integer;\";\r\n case BOOLEAN:\r\n return \"Ljava/lang/Boolean;\";\r\n case STRING:\r\n return \"Ljava/lang/String;\";\r\n }\r\n }\r\n return null;\r\n }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public String getJCEProviderName() {\n/* 196 */ return this.signatureAlgorithm.engineGetJCEProviderName();\n/* */ }", "com.google.protobuf.ByteString getPublicEciesKeyBytes();", "public String getJCEAlgorithmString() {\n/* 187 */ return this.signatureAlgorithm.engineGetJCEAlgorithmString();\n/* */ }", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "long getCryptProviderTypeExt();", "public static String getKeyTypeName(KeyType type)\n {\n // TODO: should be moved to DBProvider ...\n // MySQL : key identifier\n // SQLServer : key identifier\n // Derby : key identifier\n // PostgreSQL: key identifier\n switch (type) {\n // MySQL: key types ...\n case PRIMARY : return \"PRIMARY KEY\"; // table\n case UNIQUE : return \"UNIQUE\"; // table\n case INDEX : return \"INDEX\"; // table/index\n case UNIQUE_INDEX : return \"UNIQUE INDEX\"; // table/index\n default : return \"UNKNOWN\";\n }\n }", "@PostMapping(\"/createKeyPair\")\n public String createKeyPair() {\n \n AWSKMS kmsClient = AWSKMSClientBuilder.standard().build();\n \n return \"Private uid: \"+ priuid +\"\\nPublic uid: \" + pubuid +\"\\n\";\n }", "long getCryptAlgorithmSid();", "switch (buffer[ISO7816.OFFSET_CDATA + 4]) {\r\n\t\tcase BASIC:\r\n\t\t\tsetSignatureType(BASIC);\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tsetSignatureType(AUTHENTICATION);\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tsetSignatureType(NON_REPUDIATION);\r\n\t\t\tbreak;\r\n\t\tcase CA_ROLE:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\tdefault:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "private KeyStore askForPin() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {\n char newPin[] = PinDialog.getPIN(this.providerDesc);\n try {\n KeyStore ks = getKeyStore(newPin);\n pin = newPin;\n return ks;\n } catch (IOException e2) {\n e2.printStackTrace();\n if (e2.getCause() instanceof LoginException) {\n JOptionPane.showMessageDialog(null, \"Wrong PIN\", \"Cryptographic card\", JOptionPane.WARNING_MESSAGE);\n }\n throw e2;\n }\n }", "public String getTlsKeyPath();", "public byte[] getUserKey() throws IOException\n {\n byte[] u = null;\n COSString user = (COSString)encryptionDictionary.getDictionaryObject( COSName.getPDFName( \"U\" ) );\n if( user != null )\n {\n u = user.getBytes();\n }\n return u;\n }", "@Override\n public String getProviderName() {\n return \"SimpleEncryptionKeyStoreProvider\";\n }", "public interface SKey {\n\n String FAIL_STORE = \"job.fail.store\";\n\n String LOADBALANCE = \"loadbalance\";\n\n String EVENT_CENTER = \"event.center\";\n\n String REMOTING = \"lts.remoting\";\n\n String REMOTING_SERIALIZABLE_DFT = \"lts.remoting.serializable.default\";\n\n String ZK_CLIENT_KEY = \"zk.client\";\n\n String JOB_ID_GENERATOR = \"id.generator\";\n\n String JOB_LOGGER = \"job.logger\";\n\n String JOB_QUEUE = \"job.queue\";\n}", "private void getKeyType(final PdfObject pdfObject, final int i, final byte[] raw, final int length, final int keyLength, final int keyStart, final int type) {\n if(debugFastCode)//used in debug\n {\n PDFkey = PdfDictionary.getKey(keyStart, keyLength, raw);\n }\n \n PDFkeyInt=PdfDictionary.getIntKey(keyStart,keyLength,raw);\n \n //correct mapping\n if(PDFkeyInt==PdfDictionary.Indexed && (type==PdfDictionary.MK ||type==PdfDictionary.Form || type==PdfDictionary.Linearized || type==PdfDictionary.Group)) {\n PDFkeyInt = PdfDictionary.I;\n }\n \n if(isInlineImage) {\n PDFkeyInt = PdfObjectFactory.getInlineID(PDFkeyInt);\n }\n \n final int id=pdfObject.getID();\n \n if(type==PdfDictionary.Resources && (PDFkeyInt==PdfDictionary.ColorSpace\n || PDFkeyInt==PdfDictionary.ExtGState || PDFkeyInt==PdfDictionary.Shading\n || PDFkeyInt==PdfDictionary.XObject || PDFkeyInt==PdfDictionary.Font|| PDFkeyInt==PdfDictionary.Pattern)){\n pdfKeyType=PdfDictionary.VALUE_IS_DICTIONARY_PAIRS;\n //}else if (type==PdfDictionary.Form && id== PdfDictionary.AA && PDFkeyInt== PdfDictionary.K){\n // pdfKeyType= PdfDictionary.VALUE_IS_UNREAD_DICTIONARY;\n }else if (type==PdfDictionary.Outlines && PDFkeyInt== PdfDictionary.D){\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && PDFkeyInt== PdfDictionary.D){\n if(id==PdfDictionary.AP || id==PdfDictionary.AA){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if(id==PdfDictionary.Win){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else{\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && (id==PdfDictionary.AP || id==PdfDictionary.AA) && PDFkeyInt== PdfDictionary.A){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if (PDFkeyInt== PdfDictionary.Order && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary. VALUE_IS_OBJECT_ARRAY;\n }else if (PDFkeyInt== PdfDictionary.Name && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if ((type==PdfDictionary.ColorSpace || type==PdfDictionary.Function) && PDFkeyInt== PdfDictionary.N){\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(PDFkeyInt==PdfDictionary.Gamma && type==PdfDictionary.ColorSpace &&\n pdfObject.getParameterConstant(PdfDictionary.ColorSpace)== ColorSpaces.CalGray){ //its a number not an array\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(id==PdfDictionary.Win && pdfObject.getObjectType()==PdfDictionary.Form &&\n (PDFkeyInt==PdfDictionary.P || PDFkeyInt==PdfDictionary.O)){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if (isInlineImage && PDFkeyInt==PdfDictionary.ColorSpace){\n pdfKeyType= PdfDictionary.VALUE_IS_DICTIONARY;\n }else {\n pdfKeyType = PdfDictionary.getKeyType(PDFkeyInt, type);\n }\n \n \n //handle array of Function in Shading by using keyArray\n if(id==PdfDictionary.Shading && PDFkeyInt==PdfDictionary.Function){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n if(raw[ptr]=='['){\n pdfKeyType=PdfDictionary.VALUE_IS_KEY_ARRAY;\n }\n }\n \n //allow for other values in D,N,R definitions\n if(pdfKeyType==-1 && id== PdfDictionary.ClassMap){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n }else\n //allow for other values in D,N,R definitions as key pairs\n if(((((id==PdfDictionary.N || id==PdfDictionary.D || id==PdfDictionary.R))) &&\n pdfObject.getParentID()==PdfDictionary.AP &&\n pdfObject.getObjectType()==PdfDictionary.Form\n && raw[i]!='[' )){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n //decide if pair\n if(raw[keyStart]=='L' && raw[keyStart+1]=='e' && raw[keyStart+2]=='n' && raw[keyStart+3]=='g' && raw[keyStart+4]=='t' && raw[keyStart+5]=='h'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='n'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='f' && raw[keyStart+2]=='f'){\n }else\n if(raw[ptr]=='R'){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n \n if(debugFastCode) {\n System.out.println(\"new Returns \" + pdfKeyType + \" i=\" + i);\n }\n }\n }\n \n /**/\n \n //DecodeParms can be an array as well as a dictionary so check next char and alter if so\n if(PDFkeyInt==PdfDictionary.DecodeParms) {\n pdfKeyType = setTypeForDecodeParams(i, raw, length, pdfKeyType);\n }\n \n if(debugFastCode && pdfKeyType==-1 && pdfObject.getObjectType()!=PdfDictionary.Page){\n System.out.println(id+\" \"+type);\n System.out.println(padding +PDFkey+\" NO type setting for \"+PdfDictionary.getKey(keyStart,keyLength,raw)+\" id=\"+i);\n }\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "public PaymentRecordKey() {\n super();\n }", "public RSAKeyPairGenerator() {\n }", "private PasskeyContract() {}", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum getCryptProviderType();", "java.lang.String getSignatureProviderId();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }" ]
[ "0.67265475", "0.65099293", "0.65028304", "0.6262208", "0.6249799", "0.610079", "0.5888525", "0.5814085", "0.57488453", "0.5741013", "0.55434763", "0.5495098", "0.547463", "0.5293663", "0.5267275", "0.52484345", "0.5236787", "0.51757306", "0.50184387", "0.5009232", "0.4963339", "0.49510905", "0.49432135", "0.49177194", "0.49026552", "0.48897362", "0.4852516", "0.4852516", "0.48464367", "0.4837918", "0.48329684", "0.48329684", "0.48329684", "0.4827723", "0.48225248", "0.48225248", "0.48222625", "0.48206112", "0.48032084", "0.47844216", "0.47589076", "0.47568366", "0.47562766", "0.475171", "0.47300357", "0.47230795", "0.4722094", "0.4707639", "0.47028682", "0.4702566", "0.47019628", "0.46886435", "0.46737474", "0.46649238", "0.46241516", "0.46185207", "0.46162042", "0.4614444", "0.46140233", "0.46073017", "0.46071345", "0.4599757", "0.45933524", "0.45887133", "0.45851716", "0.4582875", "0.45752436", "0.45748132", "0.45720893", "0.45628002", "0.4562682", "0.4560899", "0.45528138", "0.45517504", "0.45498374", "0.45371762", "0.45361403", "0.4531953", "0.453109", "0.45296288", "0.4523701", "0.45182464", "0.45178583", "0.45135707", "0.4513127", "0.4508099", "0.45017824", "0.44983628", "0.4494895", "0.44948786", "0.44942138", "0.4491818", "0.44907737", "0.4488338", "0.4486263", "0.4485628", "0.44769597", "0.44763568", "0.4473159", "0.44716462" ]
0.66766536
1
depends on pki_type optional bytes pki_data = 3;
@java.lang.Override public boolean hasPkiData() { return ((bitField0_ & 0x00000004) != 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "java.lang.String getPkiType();", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "boolean hasPkiType();", "boolean hasPkiData();", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "public Builder setPkiData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiData(value);\n return this;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return instance.getPkiData();\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "@java.lang.Override\n public boolean hasPkiData() {\n return instance.hasPkiData();\n }", "void setPQ( byte[] buffer, short offset, short length) throws CryptoException;", "public byte[] getPKP(final TrzbaDataType data) throws DataSigningException {\n return this.clientKey.sign(serializeData(data));\n }", "@Override\r\n protected String getPrymaryType(Integer key) {\r\n return NodeTypes.SECTOR.getId();\r\n }", "com.hps.july.persistence.WorkerKey getTechStuffKey() throws java.rmi.RemoteException;", "public String reqsetpkt(byte []p,byte[] id,byte[] T,byte[] ip,byte[] no)\r\n\t{\n\t\treturn \"hi\";\r\n\t}", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "void privateSetTechStuffKey(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException;", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "public Builder clearPkiData() {\n copyOnWrite();\n instance.clearPkiData();\n return this;\n }", "protected byte[] getBathWaterVolumeSetting3() {return null;}", "public interface ICloudRequest {\n \n public int getOp();\n public void incrementRetries();\n public void resetRetries();\n public int getRetries();\n \n /**\n * Retrieve the data unit associated with this request\n * @return {@link DepSkyDataUnit}\n */\n public DepSkyDataUnit getDataUnit();\n \n /**\n * Determine when this procedure started originally\n * @return long - start time of this procedure\n */\n public long getStartTime();\n \n /**\n * Determine the sequence of this request\n * @return long\n */\n public long getSequenceNumber();\n \n /**\n * Get the data resulting from this request\n * @return byte[] consisting of the data\n */\n public byte[] getData();\n \n \n}", "public static Object PQinit(Object... arg) {\nUNSUPPORTED(\"c01vxogao855zs8fe94tpim9g\"); // void\nUNSUPPORTED(\"3p0cdanvp4f13d8omi42lvjl1\"); // PQinit(void)\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\nUNSUPPORTED(\"akljrpu8bej9lq4rmsktz8u2e\"); // PQcnt = 0;\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\n\nthrow new UnsupportedOperationException();\n}", "com.zzsong.netty.protobuff.two.ProtoData.MyDataInfo.DataType getDataType();", "@Override\n\tpublic void put(String key, String cat, byte[] data) throws RemoteException {\n\t\t\n\t}", "public static void setKPIsInCache(Map<String,String> dataMap){ \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tmemcache.delete(ALL_KPI_KEY);\n \t}\n \tmemcache.put(ALL_KPI_KEY, dataMap);\n\t}", "@Override //Client\n public void prepareAMServiceData(ClusterDescription clusterSpec,\n Map<String, ByteBuffer> serviceData) {\n \n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "Key[] getPq();", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public byte getType() {\n return TYPE_DATA;\n }", "KijiDataRequest getClientRequest();", "public void setPartProducedKey(long value) {\n\t\tthis.partProducedKey = value;\n\t}", "public void setStorageType(short type) {\n\tstorageType = type;\n }", "public static Map<String,String> getKPIsFromCache(){\n\t\tMap<String,String> dataMap=null;\n \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tdataMap=(Map<String,String>) memcache.get(ALL_KPI_KEY);\n \t\tlog.info(\"Memcache getKPIsFromCache size = \"+dataMap.size());\n \t} \t\n \treturn dataMap;\n\t}", "public void setParentContainerType(IPartitionType type)\n\t{\n\t\tthis.parentContainerType = (PartitionType) type;\n\t}", "private IDataKey(Queue<Part> parts) {\n super(parts);\n }", "public static byte[] readFile(File file, int valueType) {\n if (!file.exists()) {\n Log.e(TAG, \"The file doesn't exist\");\n }\n try {\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n FileInputStream fileInputStream = new FileInputStream(file);\n BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);\n byte[] buf = new byte[4096];\n switch (valueType) {\n case 0:\n case 1:\n case 2:\n case 3:\n while (bufferedInputStream.read(buf) != -1) {\n byteArrayOutputStream.write(buf, 16 * valueType, 16);\n }\n break;\n case 4:\n if (!file.getName().equals(\"E_SK2\")) {\n if (!file.getName().equals(\"E_PIN2\")) {\n while (true) {\n int len = bufferedInputStream.read(buf);\n if (len == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, (len - 32) - (16 * 1));\n }\n }\n } else {\n while (true) {\n int len2 = bufferedInputStream.read(buf);\n if (len2 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, ((len2 - 32) - (16 * 1)) - PKLENGTH);\n }\n }\n }\n } else {\n while (true) {\n int len3 = bufferedInputStream.read(buf);\n if (len3 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 4, (len3 - 32) - (16 * 4));\n }\n }\n }\n case 5:\n while (true) {\n int len4 = bufferedInputStream.read(buf);\n if (len4 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, len4 - 32, 32);\n }\n }\n case PUBLICKEY /* 7 */:\n while (true) {\n int len5 = bufferedInputStream.read(buf);\n if (len5 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, (len5 - 32) - PKLENGTH, PKLENGTH);\n }\n }\n case 8:\n while (true) {\n int len6 = bufferedInputStream.read(buf);\n if (len6 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 0, len6 - 32);\n }\n }\n }\n byte[] buffer = byteArrayOutputStream.toByteArray();\n bufferedInputStream.close();\n fileInputStream.close();\n byteArrayOutputStream.close();\n return buffer;\n } catch (IOException e) {\n Log.e(TAG, \"read file exception!\" + e.getMessage());\n return new byte[0];\n }\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public byte [] getKos()\n {\n return kosBytes;\n }", "private <T> Pair<KademliaNode, Boolean> storeGRPC(KademliaNode node, byte[] key, T info) {\n\n StoreRequest.Builder request = StoreRequest.newBuilder()\n .setNode(KademliaUtils.KademliaNodeToKademliaNodeProto(bucketManager.getMyNode()))\n .setKey(ByteString.copyFrom(key));\n\n\n if(info.getClass() == Transaction.class) {\n request.setTransaction(KademliaUtils.TransactionToTransactionProto((Transaction) info));\n }\n else if(info.getClass() == Block.class) {\n request.setBlock(KademliaUtils.BlockToBlockProto((Block) info));\n }\n else if(info.getClass() == Auction.class) {\n request.setAuction(KademliaUtils.AuctionToAuctionProto((Auction) info));\n }\n else if(info.getClass() == Bid.class) {\n request.setBid(KademliaUtils.BidToBidProto((Bid) info));\n }\n else {\n logger.log(Level.SEVERE, \"Error: store value type not valid - \" + info.getClass());\n return new Pair(null, false);\n }\n\n ManagedChannel channel = ManagedChannelBuilder.forTarget(node.getIpAddress() + \":\" + node.getPort()).usePlaintext().build();\n AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel);\n// AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel).withDeadlineAfter(KademliaUtils.networkTimeoutMsecs, TimeUnit.MILLISECONDS);\n\n StoreResponse response;\n\n try {\n response = blockingStub.store(request .build());\n } catch (StatusRuntimeException e) {\n// logger.log(Level.WARNING, \"STORE RPC failed for \" + node.getIpAddress() + \":\" + node.getPort() + \" - \" + e.getStatus());\n logger.log(Level.WARNING, \"STORE RPC failed for \" + node);\n closeChannel(channel);\n return new Pair(null, false);\n }\n\n\n KademliaNode nodeInResponse = KademliaUtils.KademliaNodeProtoToKademliaNode(response.getNode());\n\n if (!Arrays.equals(node.getNodeID(), nodeInResponse.getNodeID())) {\n logger.log(Level.WARNING, \"Response returned with different nodeID\");\n closeChannel(channel);\n return new Pair(nodeInResponse, false);\n }\n\n closeChannel(channel);\n\n// logger.log(Level.INFO, \"Successfully sent STORE RPC to \" + node + \" for key \" + Utils.bytesToHexString(key));\n return new Pair(nodeInResponse, response.getSuccess());\n }", "public int send(Object key, Packet p) throws IOException {\n if (p instanceof NIOPacket) {\n NIOPacket n = (NIOPacket) p;\n return send(key, n.getBuffer());\n } else {\n if (T.t) {\n T.warn(\"This has not been tested\");\n }\n int len = p.getAvailable();\n p.readArray(byteArray, 0, len);\n return send(key, byteArray, 0, len);\n }\n }", "public interface PacketFormatKeyContext {\n\n}", "public abstract PartitionType getType();", "public String getBKP(final byte[] pkp) throws DataSigningException {\n final byte[] bytes = sha1(pkp);\n final String base16 = StringUtils.leftPad(toBase16(bytes), 40, '0');\n final String[] blocks = StringUtils.splitBlocks(base16, 8);\n final StringJoiner stringJoiner = new StringJoiner(\"-\");\n for(final String block : blocks) {\n stringJoiner.add(block);\n }\n return stringJoiner.toString().toUpperCase();\n }", "public void setPkCacheSize(int pkCacheSize) {\n }", "public ECP getPublicEphemeralKey(){return epk;}", "protected byte[] getBathWaterVolumeSetting2() {return null;}", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "byte[] get_node_secret();", "public static KubevirtNode buildKubevirtNode(Node node) {\n String hostname = node.getMetadata().getName();\n IpAddress managementIp = null;\n IpAddress dataIp = null;\n\n for (NodeAddress nodeAddress:node.getStatus().getAddresses()) {\n if (nodeAddress.getType().equals(INTERNAL_IP)) {\n managementIp = IpAddress.valueOf(nodeAddress.getAddress());\n dataIp = IpAddress.valueOf(nodeAddress.getAddress());\n }\n }\n\n Set<String> rolesFull = node.getMetadata().getLabels().keySet().stream()\n .filter(l -> l.contains(K8S_ROLE))\n .collect(Collectors.toSet());\n\n KubevirtNode.Type nodeType = WORKER;\n\n for (String roleStr : rolesFull) {\n String role = roleStr.split(\"/\")[1];\n if (MASTER.name().equalsIgnoreCase(role)) {\n nodeType = MASTER;\n break;\n }\n }\n\n // start to parse kubernetes annotation\n Map<String, String> annots = node.getMetadata().getAnnotations();\n String physnetConfig = annots.get(PHYSNET_CONFIG_KEY);\n String gatewayConfig = annots.get(GATEWAY_CONFIG_KEY);\n String dataIpStr = annots.get(DATA_IP_KEY);\n Set<KubevirtPhyInterface> phys = new HashSet<>();\n String gatewayBridgeName = null;\n try {\n if (physnetConfig != null) {\n JsonArray configJson = JsonArray.readFrom(physnetConfig);\n\n for (int i = 0; i < configJson.size(); i++) {\n JsonObject object = configJson.get(i).asObject();\n String network = object.get(NETWORK_KEY).asString();\n String intf = object.get(INTERFACE_KEY).asString();\n\n if (network != null && intf != null) {\n String physBridgeId;\n if (object.get(PHYS_BRIDGE_ID) != null) {\n physBridgeId = object.get(PHYS_BRIDGE_ID).asString();\n } else {\n physBridgeId = genDpidFromName(network + intf + hostname);\n log.trace(\"host {} physnet dpid for network {} intf {} is null so generate dpid {}\",\n hostname, network, intf, physBridgeId);\n }\n\n phys.add(DefaultKubevirtPhyInterface.builder()\n .network(network)\n .intf(intf)\n .physBridge(DeviceId.deviceId(physBridgeId))\n .build());\n }\n }\n }\n\n if (dataIpStr != null) {\n dataIp = IpAddress.valueOf(dataIpStr);\n }\n\n if (gatewayConfig != null) {\n JsonNode jsonNode = new ObjectMapper().readTree(gatewayConfig);\n\n nodeType = GATEWAY;\n gatewayBridgeName = jsonNode.get(GATEWAY_BRIDGE_NAME).asText();\n }\n } catch (JsonProcessingException e) {\n log.error(\"Failed to parse physnet config or gateway config object\", e);\n }\n\n // if the node is taint with kubevirt.io key configured,\n // we mark this node as OTHER type, and do not add it into the cluster\n NodeSpec spec = node.getSpec();\n if (spec.getTaints() != null) {\n for (Taint taint : spec.getTaints()) {\n String effect = taint.getEffect();\n String key = taint.getKey();\n String value = taint.getValue();\n\n if (StringUtils.equals(effect, NO_SCHEDULE_EFFECT) &&\n StringUtils.equals(key, KUBEVIRT_IO_KEY) &&\n StringUtils.equals(value, DRAINING_VALUE)) {\n nodeType = OTHER;\n }\n }\n }\n\n return DefaultKubevirtNode.builder()\n .hostname(hostname)\n .managementIp(managementIp)\n .dataIp(dataIp)\n .type(nodeType)\n .state(KubevirtNodeState.ON_BOARDED)\n .phyIntfs(phys)\n .gatewayBridgeName(gatewayBridgeName)\n .build();\n }", "public int getByteSizeBasedOnDataType(String dataType)\n\t{\n\t\tif (dataType.equals(\"String\"))\n\t\t\treturn charInBytes;\n\t\treturn intInBytes;\n\t}", "private DataKeys(String pKey) {\n key = pKey;\n }", "com.google.protobuf.ByteString\n getHowToUseBytes();", "com.google.protobuf.ByteString\n getHowToUseBytes();", "public static void main(String[] args) {\n Pair<String, Integer> pair = new Pair<String, Integer>(\"testeString\", 12);\n System.out.println(pair.getTipo1());\n System.out.println(pair.getTipo2());\n pair.setTipo1(\"TESTEAGAIN\");\n System.out.println(pair.getTipo1());\n\n }", "String getProcessingInstructionData(Object pi);", "public String getType() {\r\n return \"Block Data Long\";\r\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "private static String nodeKey(Player player, TYPE type) {\n return \"{playerId:\" + player.getId() + \", teamId:\" + player.getTeamId() + \", gameId:\" + player.getGameId() + \", type:\\\"\" + type.toString() + \"\\\"}\";\n }", "protected byte[] getBathWaterVolumeSetting1() {return null;}", "public PlugwiseMQTTDeviceInfo()\n\t{\n\t\t// initialize internal variables\n\t\tthis.macAddress = \"\";\n\t\tthis.type = \"circle\";\n\t}", "public interface KudoClient {\n MixedOperation<Operator, OperatorList, DoneableOperator, Resource<Operator, DoneableOperator>> operators();\n\n MixedOperation<Instance, InstanceList, DoneableInstance, Resource<Instance, DoneableInstance>> instances();\n\n MixedOperation<OperatorVersion, OperatorVersionList, DoneableOperatorVersion, Resource<OperatorVersion, DoneableOperatorVersion>> operatorVersion();\n\n void close();\n}", "ByteBuffer getApplicationData();", "public interface JobMemcachedKeys {\n String JOB_DETAIL = \"JOB_DETAIL_\";\n String JOB_STATUS = \"JOB_STATUS_\";\n}", "public interface C0003a {\n public static final String ah = \"image_manager_disk_cache\";\n public static final int hP = 262144000;\n\n @Nullable\n a bz();\n }", "short getPQ( byte[] buffer, short offset );", "public ClientPacket(PacketType type, byte[] data){\r\n\t\tthis.type = type;\r\n\t\tthis.dataSize = data.length;\r\n\t\tthis.data = data;\r\n\t}", "private void ipcSend(JSONObject data) {\n JSONObject json = data;\n try {\n json.put(IPC_MESSAGE_APPID, mAppId);\n\n if (mIpcChannel != null) {\n log.e(\"ipcSend:[\" + json.toString() + \"]\");\n\n mIpcChannel.send(json.toString());\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void setOpckeytype(java.lang.Long value) {\n\t\tsetValue(test.generated.pg_catalog.tables.PgOpclass.PG_OPCLASS.OPCKEYTYPE, value);\n\t}", "private String createKey(OwObject object_p, OwPluginEntry pluginEntry_p) throws Exception\r\n {\r\n String objectId = object_p.getDMSID();\r\n String key = objectId + \"_\" + pluginEntry_p.getIndex();\r\n return key;\r\n }", "public void setAvailableExtraData(List<String> extraDataKeys) {\n/* 502 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public int getCapacity( Resource.Type type );", "public TableValue(short type) {\n\tkey = null; // No name by default.\n\tstorageType = type; // Type of data. \n\tattrs = null; // No attributes yet.\n\tflags = -1; // No flags yet. \n\n\t// Create a generic, default vector clock. \n\tvclock = new VectorClock(\"s\".getBytes(), 0);\n }", "void setP( byte[] buffer, short offset, short length) throws CryptoException;", "private void uniPerfGetConfig(Parcel data, Parcel reply) {\n int tagsSize = data.readInt();\n if (tagsSize <= 0 || tagsSize >= 128) {\n AwareLog.e(TAG, \"uniPerfGetConfig tags size invalid.\");\n return;\n }\n int[] tags = new int[tagsSize];\n for (int i = 0; i < tagsSize; i++) {\n tags[i] = data.readInt();\n }\n int[] values = new int[tagsSize];\n reply.writeInt(UniPerf.getInstance().uniPerfGetConfig(tags, values));\n for (int value : values) {\n reply.writeInt(value);\n }\n }", "void setQ( byte[] buffer, short offset, short length) throws CryptoException;", "public MessageClackData(String userName, String message, String key, int type) {\n super(userName, type);\n this.message = encrypt(message, key);\n }", "public void setProcessType(String currentProcess) {\n this.currentProcess=currentProcess;\n if(currentProcess.startsWith(\"ENCRYPTION\")) {\n processCaption=\"Encrypting\";\n }\n else {\n processCaption=\"Decrypting\";\n } \n }", "PNMMetadata(ImageTypeSpecifier imageType, ImageWriteParam param) {\n/* 145 */ this();\n/* 146 */ initialize(imageType, param);\n/* */ }", "private void parseCommandPut(DataInputStream in) throws IOException {\n int ksize = in.readInt();\n int vsize = in.readInt();\n byte[] key = new byte[ksize];\n in.read(key);\n byte[] value = new byte[vsize];\n in.read(value);\n // int err = \n in.readUnsignedByte(); // unused\n elements = new LinkedHashMap<String, String>(1);\n elements.put(new String(key), new String(value));\n if (LOG.isDebugEnabled()) LOG.debug(\"parseCommandPut: elements -> \" + elements);\n }", "@Override\n\tpublic Map<String, String> modifyInstanceChargeType(\n\t\t\tMap<String, String> paramsMap, Map<String, String> defaultParamsMap,String requestId) throws Exception {\n\t\tMap<String, String> resultMap = new HashMap<String, String>();\n\t\tif(null==requestId || requestId.length()<1) {\n\t\t\tlogger.info(\"RequestId is null or is error!\");\n\t\t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"The request processing has failed due to some unknown error.\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_INTERNAL_SERVER_ERROR+\"\");\n\t\t\treturn resultMap;\n\t\t}\n\t\tString appKeyId = paramsMap.get(Constants.APPKEY_ID);\n\t\tVmUser vmuser = vmUserProxy.getByAppKeyId(appKeyId);\n\t\tString uuid = paramsMap.get(Constants.INSTANCE_ID);\n\t\tVmInstance instance = vmInstanceProxy.getByUuid(uuid, false, true, false, true, true, true, false, false);\n\t\tInteger userId = vmuser.getUserId();\n\t\tInteger clusterid = instance.getCluster().getId();\n\t\tInteger cpuNum = instance.getVmInstanceType().getVcpus();\n\t\tInteger memNum = instance.getVmInstanceType().getMemoryMb();\n\t\tInteger bandNum = -1;\n\t\tInteger hdNum = instance.getVmInstanceType().getLocalGb();\n\t\tList<VmInstanceMetadata> bandNumlist = instance.getVmInstanceMetadatas();\n\t\tfor(VmInstanceMetadata md : bandNumlist) {\n\t\t\tif(md.getKey().equals(Constants.PUBLIC_BANDWIDTH)) {\n\t\t\t\tbandNum = Integer.valueOf(md.getValue());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(-1 == bandNum)\n\t\t{\n\t\t\tlogger.info(\"带宽获取失败!\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"This instance do not have band\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n\t\t}\n\t\tString instanceChargeType;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_TYPE))\n\t\t\tinstanceChargeType = defaultParamsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\telse\n\t\t\tinstanceChargeType = paramsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\tString instanceChargeLength;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH))\n\t\t\tinstanceChargeLength = defaultParamsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\telse\n\t\t\tinstanceChargeLength = paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\tInteger paymentType = convertToPaymentType(instanceChargeType);\n\t\tDouble count = Double.valueOf(instanceChargeLength);\n\t\tint times = 0;\n\t\tString type = new VmHdEndtimeManager().getVmEndtimeByUuid(uuid).getType().toLowerCase();\n\t\tString PTYPE = Constants.INSTANCE_TYPE;\n\t\t\n\t\t\n logger.info(\"clusterid: \" + clusterid + \"cpu: \" + cpuNum + \" ,mem: \" + memNum + \" ,hd: \" + hdNum + \" ,band: \" + bandNum);\n \n //计算时间,算各种份数,然后扣费,设每个月份定为30天,每年定为360天\n //计算旧计费规则的份数\n VmHdEndtimeManager vmHdEndtimeManager = new VmHdEndtimeManager();\n VmHdEndtime vm = vmHdEndtimeManager.getVmEndtimeByUuid(uuid);\n\t\tTimestamp currentTime = new Timestamp(System.currentTimeMillis());\n\t\tSimpleDateFormat timeformat = new SimpleDateFormat(\"yyyy-MM-dd,HH:mm:ss\");\n\t long t1 = 0L;\n\t long t2 = 0L;\n \n Timestamp endTime = new Timestamp(vm.getEndTime().getTime());\n t1 = timeformat.parse(getTimeStampNumberFormat(endTime)).getTime();\n t2 = timeformat.parse(getTimeStampNumberFormat(currentTime)).getTime();\n //账号余额\n HashMap<String, String> params = new HashMap<String, String>();\n\t\tparams.put(\"uid\", String.valueOf(userId));\n\t\tparams.put(\"source\", com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n\t\tInteger balance = BillingAPI.balance(userId ,null, AccountUtil.getSignature(params, com.appcloud.vm.fe.common.Constants.CLIENT_SECRET_KEY),com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n //本次应付款金额\n Integer payamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, paymentType, count);\n if (t1 - t2 >= 0) {//不过期才对其退费\n \tInteger oldPaymentType = vmHdEndtimeManager.convertToPaymentType(vm.getPayType());\n \tdouble oldCount = 1.00000;\n \tif(oldPaymentType == 1){\n \t\toldCount = (t1 - t2) / (Constants.yearDays*24*3600*1000.0);\n \t}else if(oldPaymentType == 2){\n \t\toldCount = (t1 - t2) / (Constants.monthDays*24*3600*1000.0); \n \t}else if(oldPaymentType == 3){\n \t\toldCount = (t1 - t2) / (24*3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除3600000得出小时\n \t}else if(oldPaymentType == 4){\n \t\toldCount = (t1 - t2) / (3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除1000得出秒\n \t}\n \tlogger.info(\"oldCount:\"+oldCount);\n \t//计算手续费的份数\n \tdouble chargecount = 1.0;\n \t//先判断余额是否充足,再进行扣费等操作\n \tInteger reamount = 0;\n \tInteger chargeamount = 0;\n \treamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, oldPaymentType, oldCount);\n \tchargeamount = BillingAPI.getPrice(\"charge\", clusterid, -1, -1, -1, -1, userId, oldPaymentType, chargecount);\n \tlogger.info(balance);\n \tlogger.info(payamount);\n \tlogger.info(reamount);\n \tlogger.info(chargeamount);\n \tif(balance < (payamount - reamount + chargeamount)){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t\n \t//根据旧的计费规则退费\n \tString PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum +\"G硬盘和\" + bandNum + \n \t\t\t\"M带宽,未到期,退费\";\n \tlogger.debug(\"PID = \" + PID);\n \tString item = \"\";\n \tif(type.equalsIgnoreCase(\"vm\")){\n \t\titem = \"CPU/内存/硬盘/带宽\";\n \t}else if(type.equalsIgnoreCase(\"instancetype\")){\n \t\tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n \t\titem = rate.getName();\n \t}\n \tlogger.debug(\"item = \" + item);\n \tString message = \"\";\n \tString payment_type = new VmHdEndtimeManager().convertToType(oldPaymentType);\n \tmessage = BillingAPI.pay(RECID, userId, item, payment_type, times, oldCount, PTYPE, PID, reamount, null);\n \tif(!message.equalsIgnoreCase(\"success\")){\n \t\tlogger.info(\"payment fail\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap; //退费不成功\n \t} \n \t //收取手续费\n item = \"手续费\";\n PID=\"修改付费规则的手续费\";\n payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, chargecount, PTYPE, PID, chargeamount, null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n } else {\n \tif(balance < payamount){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t}\n \n //查询余额,扣费\n logger.info(\"start payment!\");\n String PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum + \"G硬盘和\" + bandNum + \"M带宽\";\n logger.debug(\"PID = \" + PID);\n String item = \"\";\n String message = \"\";\n logger.info(\"type = \" + type);\n if(type.equalsIgnoreCase(\"vm\")){\n \titem = \"CPU/内存/硬盘/带宽\";\n logger.debug(\"item = \" + item);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n \tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n\t\t\titem = rate.getName();\n }\n String payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, count, PTYPE, PID, payamount,null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n resultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n \n //修改虚拟机到期时间以及付费类型\n logger.info(\"start modify endtime!\");\n if(type.equalsIgnoreCase(\"vm\")){\n logger.info(\"vm\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \" tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_VM);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_VM, paymentType, count);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n logger.info(\"instancetype\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \"tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_INSTANCETYPE);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_INSTANCETYPE, paymentType, count);\n }\n resultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_OK);\n return resultMap;\n\t}" ]
[ "0.7461772", "0.7270173", "0.7188162", "0.6849862", "0.6622877", "0.6556345", "0.644622", "0.630002", "0.6299455", "0.62147033", "0.6163412", "0.6087984", "0.6002228", "0.5975709", "0.5907646", "0.57982445", "0.5726266", "0.5712276", "0.5684582", "0.5584436", "0.5559634", "0.5252141", "0.49216577", "0.47094396", "0.4694811", "0.46729812", "0.4656656", "0.46391153", "0.46205348", "0.46073896", "0.45961434", "0.45853224", "0.45853224", "0.4572385", "0.45663446", "0.45509598", "0.453728", "0.45189363", "0.45187464", "0.45142606", "0.45046827", "0.4490483", "0.44709814", "0.44686854", "0.44686854", "0.4463381", "0.44375443", "0.4430811", "0.44306394", "0.44279918", "0.4413793", "0.4411431", "0.44075605", "0.44003716", "0.43986735", "0.43878996", "0.43874544", "0.43870187", "0.4370455", "0.43632102", "0.43427208", "0.43381727", "0.43282798", "0.43189391", "0.43189391", "0.43189391", "0.43189391", "0.4315619", "0.4315214", "0.43085253", "0.43080577", "0.43076736", "0.43076736", "0.43066546", "0.43042377", "0.4295094", "0.4285528", "0.42770728", "0.42726806", "0.4271019", "0.4267067", "0.42609677", "0.4253753", "0.4252036", "0.42447025", "0.4242165", "0.42407113", "0.422909", "0.42224765", "0.4221811", "0.42164075", "0.42121062", "0.42113987", "0.42101535", "0.41872218", "0.4183457", "0.4183175", "0.4179106", "0.41723317", "0.41705495" ]
0.59395826
14
depends on pki_type optional bytes pki_data = 3;
@java.lang.Override public com.google.protobuf.ByteString getPkiData() { return pkiData_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "java.lang.String getPkiType();", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "boolean hasPkiType();", "boolean hasPkiData();", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "public Builder setPkiData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiData(value);\n return this;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "@java.lang.Override\n public boolean hasPkiData() {\n return ((bitField0_ & 0x00000004) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return instance.getPkiData();\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "@java.lang.Override\n public boolean hasPkiData() {\n return instance.hasPkiData();\n }", "void setPQ( byte[] buffer, short offset, short length) throws CryptoException;", "public byte[] getPKP(final TrzbaDataType data) throws DataSigningException {\n return this.clientKey.sign(serializeData(data));\n }", "@Override\r\n protected String getPrymaryType(Integer key) {\r\n return NodeTypes.SECTOR.getId();\r\n }", "com.hps.july.persistence.WorkerKey getTechStuffKey() throws java.rmi.RemoteException;", "public String reqsetpkt(byte []p,byte[] id,byte[] T,byte[] ip,byte[] no)\r\n\t{\n\t\treturn \"hi\";\r\n\t}", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "void privateSetTechStuffKey(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException;", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "public Builder clearPkiData() {\n copyOnWrite();\n instance.clearPkiData();\n return this;\n }", "protected byte[] getBathWaterVolumeSetting3() {return null;}", "public interface ICloudRequest {\n \n public int getOp();\n public void incrementRetries();\n public void resetRetries();\n public int getRetries();\n \n /**\n * Retrieve the data unit associated with this request\n * @return {@link DepSkyDataUnit}\n */\n public DepSkyDataUnit getDataUnit();\n \n /**\n * Determine when this procedure started originally\n * @return long - start time of this procedure\n */\n public long getStartTime();\n \n /**\n * Determine the sequence of this request\n * @return long\n */\n public long getSequenceNumber();\n \n /**\n * Get the data resulting from this request\n * @return byte[] consisting of the data\n */\n public byte[] getData();\n \n \n}", "public static Object PQinit(Object... arg) {\nUNSUPPORTED(\"c01vxogao855zs8fe94tpim9g\"); // void\nUNSUPPORTED(\"3p0cdanvp4f13d8omi42lvjl1\"); // PQinit(void)\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\nUNSUPPORTED(\"akljrpu8bej9lq4rmsktz8u2e\"); // PQcnt = 0;\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\n\nthrow new UnsupportedOperationException();\n}", "com.zzsong.netty.protobuff.two.ProtoData.MyDataInfo.DataType getDataType();", "@Override\n\tpublic void put(String key, String cat, byte[] data) throws RemoteException {\n\t\t\n\t}", "public static void setKPIsInCache(Map<String,String> dataMap){ \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tmemcache.delete(ALL_KPI_KEY);\n \t}\n \tmemcache.put(ALL_KPI_KEY, dataMap);\n\t}", "@Override //Client\n public void prepareAMServiceData(ClusterDescription clusterSpec,\n Map<String, ByteBuffer> serviceData) {\n \n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "Key[] getPq();", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public byte getType() {\n return TYPE_DATA;\n }", "KijiDataRequest getClientRequest();", "public void setPartProducedKey(long value) {\n\t\tthis.partProducedKey = value;\n\t}", "public void setStorageType(short type) {\n\tstorageType = type;\n }", "public static Map<String,String> getKPIsFromCache(){\n\t\tMap<String,String> dataMap=null;\n \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tdataMap=(Map<String,String>) memcache.get(ALL_KPI_KEY);\n \t\tlog.info(\"Memcache getKPIsFromCache size = \"+dataMap.size());\n \t} \t\n \treturn dataMap;\n\t}", "public void setParentContainerType(IPartitionType type)\n\t{\n\t\tthis.parentContainerType = (PartitionType) type;\n\t}", "private IDataKey(Queue<Part> parts) {\n super(parts);\n }", "public static byte[] readFile(File file, int valueType) {\n if (!file.exists()) {\n Log.e(TAG, \"The file doesn't exist\");\n }\n try {\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n FileInputStream fileInputStream = new FileInputStream(file);\n BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);\n byte[] buf = new byte[4096];\n switch (valueType) {\n case 0:\n case 1:\n case 2:\n case 3:\n while (bufferedInputStream.read(buf) != -1) {\n byteArrayOutputStream.write(buf, 16 * valueType, 16);\n }\n break;\n case 4:\n if (!file.getName().equals(\"E_SK2\")) {\n if (!file.getName().equals(\"E_PIN2\")) {\n while (true) {\n int len = bufferedInputStream.read(buf);\n if (len == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, (len - 32) - (16 * 1));\n }\n }\n } else {\n while (true) {\n int len2 = bufferedInputStream.read(buf);\n if (len2 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, ((len2 - 32) - (16 * 1)) - PKLENGTH);\n }\n }\n }\n } else {\n while (true) {\n int len3 = bufferedInputStream.read(buf);\n if (len3 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 4, (len3 - 32) - (16 * 4));\n }\n }\n }\n case 5:\n while (true) {\n int len4 = bufferedInputStream.read(buf);\n if (len4 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, len4 - 32, 32);\n }\n }\n case PUBLICKEY /* 7 */:\n while (true) {\n int len5 = bufferedInputStream.read(buf);\n if (len5 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, (len5 - 32) - PKLENGTH, PKLENGTH);\n }\n }\n case 8:\n while (true) {\n int len6 = bufferedInputStream.read(buf);\n if (len6 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 0, len6 - 32);\n }\n }\n }\n byte[] buffer = byteArrayOutputStream.toByteArray();\n bufferedInputStream.close();\n fileInputStream.close();\n byteArrayOutputStream.close();\n return buffer;\n } catch (IOException e) {\n Log.e(TAG, \"read file exception!\" + e.getMessage());\n return new byte[0];\n }\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public byte [] getKos()\n {\n return kosBytes;\n }", "private <T> Pair<KademliaNode, Boolean> storeGRPC(KademliaNode node, byte[] key, T info) {\n\n StoreRequest.Builder request = StoreRequest.newBuilder()\n .setNode(KademliaUtils.KademliaNodeToKademliaNodeProto(bucketManager.getMyNode()))\n .setKey(ByteString.copyFrom(key));\n\n\n if(info.getClass() == Transaction.class) {\n request.setTransaction(KademliaUtils.TransactionToTransactionProto((Transaction) info));\n }\n else if(info.getClass() == Block.class) {\n request.setBlock(KademliaUtils.BlockToBlockProto((Block) info));\n }\n else if(info.getClass() == Auction.class) {\n request.setAuction(KademliaUtils.AuctionToAuctionProto((Auction) info));\n }\n else if(info.getClass() == Bid.class) {\n request.setBid(KademliaUtils.BidToBidProto((Bid) info));\n }\n else {\n logger.log(Level.SEVERE, \"Error: store value type not valid - \" + info.getClass());\n return new Pair(null, false);\n }\n\n ManagedChannel channel = ManagedChannelBuilder.forTarget(node.getIpAddress() + \":\" + node.getPort()).usePlaintext().build();\n AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel);\n// AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel).withDeadlineAfter(KademliaUtils.networkTimeoutMsecs, TimeUnit.MILLISECONDS);\n\n StoreResponse response;\n\n try {\n response = blockingStub.store(request .build());\n } catch (StatusRuntimeException e) {\n// logger.log(Level.WARNING, \"STORE RPC failed for \" + node.getIpAddress() + \":\" + node.getPort() + \" - \" + e.getStatus());\n logger.log(Level.WARNING, \"STORE RPC failed for \" + node);\n closeChannel(channel);\n return new Pair(null, false);\n }\n\n\n KademliaNode nodeInResponse = KademliaUtils.KademliaNodeProtoToKademliaNode(response.getNode());\n\n if (!Arrays.equals(node.getNodeID(), nodeInResponse.getNodeID())) {\n logger.log(Level.WARNING, \"Response returned with different nodeID\");\n closeChannel(channel);\n return new Pair(nodeInResponse, false);\n }\n\n closeChannel(channel);\n\n// logger.log(Level.INFO, \"Successfully sent STORE RPC to \" + node + \" for key \" + Utils.bytesToHexString(key));\n return new Pair(nodeInResponse, response.getSuccess());\n }", "public int send(Object key, Packet p) throws IOException {\n if (p instanceof NIOPacket) {\n NIOPacket n = (NIOPacket) p;\n return send(key, n.getBuffer());\n } else {\n if (T.t) {\n T.warn(\"This has not been tested\");\n }\n int len = p.getAvailable();\n p.readArray(byteArray, 0, len);\n return send(key, byteArray, 0, len);\n }\n }", "public interface PacketFormatKeyContext {\n\n}", "public abstract PartitionType getType();", "public String getBKP(final byte[] pkp) throws DataSigningException {\n final byte[] bytes = sha1(pkp);\n final String base16 = StringUtils.leftPad(toBase16(bytes), 40, '0');\n final String[] blocks = StringUtils.splitBlocks(base16, 8);\n final StringJoiner stringJoiner = new StringJoiner(\"-\");\n for(final String block : blocks) {\n stringJoiner.add(block);\n }\n return stringJoiner.toString().toUpperCase();\n }", "public void setPkCacheSize(int pkCacheSize) {\n }", "public ECP getPublicEphemeralKey(){return epk;}", "protected byte[] getBathWaterVolumeSetting2() {return null;}", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "byte[] get_node_secret();", "public static KubevirtNode buildKubevirtNode(Node node) {\n String hostname = node.getMetadata().getName();\n IpAddress managementIp = null;\n IpAddress dataIp = null;\n\n for (NodeAddress nodeAddress:node.getStatus().getAddresses()) {\n if (nodeAddress.getType().equals(INTERNAL_IP)) {\n managementIp = IpAddress.valueOf(nodeAddress.getAddress());\n dataIp = IpAddress.valueOf(nodeAddress.getAddress());\n }\n }\n\n Set<String> rolesFull = node.getMetadata().getLabels().keySet().stream()\n .filter(l -> l.contains(K8S_ROLE))\n .collect(Collectors.toSet());\n\n KubevirtNode.Type nodeType = WORKER;\n\n for (String roleStr : rolesFull) {\n String role = roleStr.split(\"/\")[1];\n if (MASTER.name().equalsIgnoreCase(role)) {\n nodeType = MASTER;\n break;\n }\n }\n\n // start to parse kubernetes annotation\n Map<String, String> annots = node.getMetadata().getAnnotations();\n String physnetConfig = annots.get(PHYSNET_CONFIG_KEY);\n String gatewayConfig = annots.get(GATEWAY_CONFIG_KEY);\n String dataIpStr = annots.get(DATA_IP_KEY);\n Set<KubevirtPhyInterface> phys = new HashSet<>();\n String gatewayBridgeName = null;\n try {\n if (physnetConfig != null) {\n JsonArray configJson = JsonArray.readFrom(physnetConfig);\n\n for (int i = 0; i < configJson.size(); i++) {\n JsonObject object = configJson.get(i).asObject();\n String network = object.get(NETWORK_KEY).asString();\n String intf = object.get(INTERFACE_KEY).asString();\n\n if (network != null && intf != null) {\n String physBridgeId;\n if (object.get(PHYS_BRIDGE_ID) != null) {\n physBridgeId = object.get(PHYS_BRIDGE_ID).asString();\n } else {\n physBridgeId = genDpidFromName(network + intf + hostname);\n log.trace(\"host {} physnet dpid for network {} intf {} is null so generate dpid {}\",\n hostname, network, intf, physBridgeId);\n }\n\n phys.add(DefaultKubevirtPhyInterface.builder()\n .network(network)\n .intf(intf)\n .physBridge(DeviceId.deviceId(physBridgeId))\n .build());\n }\n }\n }\n\n if (dataIpStr != null) {\n dataIp = IpAddress.valueOf(dataIpStr);\n }\n\n if (gatewayConfig != null) {\n JsonNode jsonNode = new ObjectMapper().readTree(gatewayConfig);\n\n nodeType = GATEWAY;\n gatewayBridgeName = jsonNode.get(GATEWAY_BRIDGE_NAME).asText();\n }\n } catch (JsonProcessingException e) {\n log.error(\"Failed to parse physnet config or gateway config object\", e);\n }\n\n // if the node is taint with kubevirt.io key configured,\n // we mark this node as OTHER type, and do not add it into the cluster\n NodeSpec spec = node.getSpec();\n if (spec.getTaints() != null) {\n for (Taint taint : spec.getTaints()) {\n String effect = taint.getEffect();\n String key = taint.getKey();\n String value = taint.getValue();\n\n if (StringUtils.equals(effect, NO_SCHEDULE_EFFECT) &&\n StringUtils.equals(key, KUBEVIRT_IO_KEY) &&\n StringUtils.equals(value, DRAINING_VALUE)) {\n nodeType = OTHER;\n }\n }\n }\n\n return DefaultKubevirtNode.builder()\n .hostname(hostname)\n .managementIp(managementIp)\n .dataIp(dataIp)\n .type(nodeType)\n .state(KubevirtNodeState.ON_BOARDED)\n .phyIntfs(phys)\n .gatewayBridgeName(gatewayBridgeName)\n .build();\n }", "public int getByteSizeBasedOnDataType(String dataType)\n\t{\n\t\tif (dataType.equals(\"String\"))\n\t\t\treturn charInBytes;\n\t\treturn intInBytes;\n\t}", "private DataKeys(String pKey) {\n key = pKey;\n }", "com.google.protobuf.ByteString\n getHowToUseBytes();", "com.google.protobuf.ByteString\n getHowToUseBytes();", "public static void main(String[] args) {\n Pair<String, Integer> pair = new Pair<String, Integer>(\"testeString\", 12);\n System.out.println(pair.getTipo1());\n System.out.println(pair.getTipo2());\n pair.setTipo1(\"TESTEAGAIN\");\n System.out.println(pair.getTipo1());\n\n }", "String getProcessingInstructionData(Object pi);", "public String getType() {\r\n return \"Block Data Long\";\r\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "private static String nodeKey(Player player, TYPE type) {\n return \"{playerId:\" + player.getId() + \", teamId:\" + player.getTeamId() + \", gameId:\" + player.getGameId() + \", type:\\\"\" + type.toString() + \"\\\"}\";\n }", "protected byte[] getBathWaterVolumeSetting1() {return null;}", "public PlugwiseMQTTDeviceInfo()\n\t{\n\t\t// initialize internal variables\n\t\tthis.macAddress = \"\";\n\t\tthis.type = \"circle\";\n\t}", "public interface KudoClient {\n MixedOperation<Operator, OperatorList, DoneableOperator, Resource<Operator, DoneableOperator>> operators();\n\n MixedOperation<Instance, InstanceList, DoneableInstance, Resource<Instance, DoneableInstance>> instances();\n\n MixedOperation<OperatorVersion, OperatorVersionList, DoneableOperatorVersion, Resource<OperatorVersion, DoneableOperatorVersion>> operatorVersion();\n\n void close();\n}", "ByteBuffer getApplicationData();", "public interface JobMemcachedKeys {\n String JOB_DETAIL = \"JOB_DETAIL_\";\n String JOB_STATUS = \"JOB_STATUS_\";\n}", "public interface C0003a {\n public static final String ah = \"image_manager_disk_cache\";\n public static final int hP = 262144000;\n\n @Nullable\n a bz();\n }", "short getPQ( byte[] buffer, short offset );", "public ClientPacket(PacketType type, byte[] data){\r\n\t\tthis.type = type;\r\n\t\tthis.dataSize = data.length;\r\n\t\tthis.data = data;\r\n\t}", "private void ipcSend(JSONObject data) {\n JSONObject json = data;\n try {\n json.put(IPC_MESSAGE_APPID, mAppId);\n\n if (mIpcChannel != null) {\n log.e(\"ipcSend:[\" + json.toString() + \"]\");\n\n mIpcChannel.send(json.toString());\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void setOpckeytype(java.lang.Long value) {\n\t\tsetValue(test.generated.pg_catalog.tables.PgOpclass.PG_OPCLASS.OPCKEYTYPE, value);\n\t}", "private String createKey(OwObject object_p, OwPluginEntry pluginEntry_p) throws Exception\r\n {\r\n String objectId = object_p.getDMSID();\r\n String key = objectId + \"_\" + pluginEntry_p.getIndex();\r\n return key;\r\n }", "public void setAvailableExtraData(List<String> extraDataKeys) {\n/* 502 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public int getCapacity( Resource.Type type );", "public TableValue(short type) {\n\tkey = null; // No name by default.\n\tstorageType = type; // Type of data. \n\tattrs = null; // No attributes yet.\n\tflags = -1; // No flags yet. \n\n\t// Create a generic, default vector clock. \n\tvclock = new VectorClock(\"s\".getBytes(), 0);\n }", "void setP( byte[] buffer, short offset, short length) throws CryptoException;", "private void uniPerfGetConfig(Parcel data, Parcel reply) {\n int tagsSize = data.readInt();\n if (tagsSize <= 0 || tagsSize >= 128) {\n AwareLog.e(TAG, \"uniPerfGetConfig tags size invalid.\");\n return;\n }\n int[] tags = new int[tagsSize];\n for (int i = 0; i < tagsSize; i++) {\n tags[i] = data.readInt();\n }\n int[] values = new int[tagsSize];\n reply.writeInt(UniPerf.getInstance().uniPerfGetConfig(tags, values));\n for (int value : values) {\n reply.writeInt(value);\n }\n }", "void setQ( byte[] buffer, short offset, short length) throws CryptoException;", "public MessageClackData(String userName, String message, String key, int type) {\n super(userName, type);\n this.message = encrypt(message, key);\n }", "public void setProcessType(String currentProcess) {\n this.currentProcess=currentProcess;\n if(currentProcess.startsWith(\"ENCRYPTION\")) {\n processCaption=\"Encrypting\";\n }\n else {\n processCaption=\"Decrypting\";\n } \n }", "PNMMetadata(ImageTypeSpecifier imageType, ImageWriteParam param) {\n/* 145 */ this();\n/* 146 */ initialize(imageType, param);\n/* */ }", "private void parseCommandPut(DataInputStream in) throws IOException {\n int ksize = in.readInt();\n int vsize = in.readInt();\n byte[] key = new byte[ksize];\n in.read(key);\n byte[] value = new byte[vsize];\n in.read(value);\n // int err = \n in.readUnsignedByte(); // unused\n elements = new LinkedHashMap<String, String>(1);\n elements.put(new String(key), new String(value));\n if (LOG.isDebugEnabled()) LOG.debug(\"parseCommandPut: elements -> \" + elements);\n }", "@Override\n\tpublic Map<String, String> modifyInstanceChargeType(\n\t\t\tMap<String, String> paramsMap, Map<String, String> defaultParamsMap,String requestId) throws Exception {\n\t\tMap<String, String> resultMap = new HashMap<String, String>();\n\t\tif(null==requestId || requestId.length()<1) {\n\t\t\tlogger.info(\"RequestId is null or is error!\");\n\t\t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"The request processing has failed due to some unknown error.\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_INTERNAL_SERVER_ERROR+\"\");\n\t\t\treturn resultMap;\n\t\t}\n\t\tString appKeyId = paramsMap.get(Constants.APPKEY_ID);\n\t\tVmUser vmuser = vmUserProxy.getByAppKeyId(appKeyId);\n\t\tString uuid = paramsMap.get(Constants.INSTANCE_ID);\n\t\tVmInstance instance = vmInstanceProxy.getByUuid(uuid, false, true, false, true, true, true, false, false);\n\t\tInteger userId = vmuser.getUserId();\n\t\tInteger clusterid = instance.getCluster().getId();\n\t\tInteger cpuNum = instance.getVmInstanceType().getVcpus();\n\t\tInteger memNum = instance.getVmInstanceType().getMemoryMb();\n\t\tInteger bandNum = -1;\n\t\tInteger hdNum = instance.getVmInstanceType().getLocalGb();\n\t\tList<VmInstanceMetadata> bandNumlist = instance.getVmInstanceMetadatas();\n\t\tfor(VmInstanceMetadata md : bandNumlist) {\n\t\t\tif(md.getKey().equals(Constants.PUBLIC_BANDWIDTH)) {\n\t\t\t\tbandNum = Integer.valueOf(md.getValue());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(-1 == bandNum)\n\t\t{\n\t\t\tlogger.info(\"带宽获取失败!\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"This instance do not have band\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n\t\t}\n\t\tString instanceChargeType;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_TYPE))\n\t\t\tinstanceChargeType = defaultParamsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\telse\n\t\t\tinstanceChargeType = paramsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\tString instanceChargeLength;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH))\n\t\t\tinstanceChargeLength = defaultParamsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\telse\n\t\t\tinstanceChargeLength = paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\tInteger paymentType = convertToPaymentType(instanceChargeType);\n\t\tDouble count = Double.valueOf(instanceChargeLength);\n\t\tint times = 0;\n\t\tString type = new VmHdEndtimeManager().getVmEndtimeByUuid(uuid).getType().toLowerCase();\n\t\tString PTYPE = Constants.INSTANCE_TYPE;\n\t\t\n\t\t\n logger.info(\"clusterid: \" + clusterid + \"cpu: \" + cpuNum + \" ,mem: \" + memNum + \" ,hd: \" + hdNum + \" ,band: \" + bandNum);\n \n //计算时间,算各种份数,然后扣费,设每个月份定为30天,每年定为360天\n //计算旧计费规则的份数\n VmHdEndtimeManager vmHdEndtimeManager = new VmHdEndtimeManager();\n VmHdEndtime vm = vmHdEndtimeManager.getVmEndtimeByUuid(uuid);\n\t\tTimestamp currentTime = new Timestamp(System.currentTimeMillis());\n\t\tSimpleDateFormat timeformat = new SimpleDateFormat(\"yyyy-MM-dd,HH:mm:ss\");\n\t long t1 = 0L;\n\t long t2 = 0L;\n \n Timestamp endTime = new Timestamp(vm.getEndTime().getTime());\n t1 = timeformat.parse(getTimeStampNumberFormat(endTime)).getTime();\n t2 = timeformat.parse(getTimeStampNumberFormat(currentTime)).getTime();\n //账号余额\n HashMap<String, String> params = new HashMap<String, String>();\n\t\tparams.put(\"uid\", String.valueOf(userId));\n\t\tparams.put(\"source\", com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n\t\tInteger balance = BillingAPI.balance(userId ,null, AccountUtil.getSignature(params, com.appcloud.vm.fe.common.Constants.CLIENT_SECRET_KEY),com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n //本次应付款金额\n Integer payamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, paymentType, count);\n if (t1 - t2 >= 0) {//不过期才对其退费\n \tInteger oldPaymentType = vmHdEndtimeManager.convertToPaymentType(vm.getPayType());\n \tdouble oldCount = 1.00000;\n \tif(oldPaymentType == 1){\n \t\toldCount = (t1 - t2) / (Constants.yearDays*24*3600*1000.0);\n \t}else if(oldPaymentType == 2){\n \t\toldCount = (t1 - t2) / (Constants.monthDays*24*3600*1000.0); \n \t}else if(oldPaymentType == 3){\n \t\toldCount = (t1 - t2) / (24*3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除3600000得出小时\n \t}else if(oldPaymentType == 4){\n \t\toldCount = (t1 - t2) / (3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除1000得出秒\n \t}\n \tlogger.info(\"oldCount:\"+oldCount);\n \t//计算手续费的份数\n \tdouble chargecount = 1.0;\n \t//先判断余额是否充足,再进行扣费等操作\n \tInteger reamount = 0;\n \tInteger chargeamount = 0;\n \treamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, oldPaymentType, oldCount);\n \tchargeamount = BillingAPI.getPrice(\"charge\", clusterid, -1, -1, -1, -1, userId, oldPaymentType, chargecount);\n \tlogger.info(balance);\n \tlogger.info(payamount);\n \tlogger.info(reamount);\n \tlogger.info(chargeamount);\n \tif(balance < (payamount - reamount + chargeamount)){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t\n \t//根据旧的计费规则退费\n \tString PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum +\"G硬盘和\" + bandNum + \n \t\t\t\"M带宽,未到期,退费\";\n \tlogger.debug(\"PID = \" + PID);\n \tString item = \"\";\n \tif(type.equalsIgnoreCase(\"vm\")){\n \t\titem = \"CPU/内存/硬盘/带宽\";\n \t}else if(type.equalsIgnoreCase(\"instancetype\")){\n \t\tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n \t\titem = rate.getName();\n \t}\n \tlogger.debug(\"item = \" + item);\n \tString message = \"\";\n \tString payment_type = new VmHdEndtimeManager().convertToType(oldPaymentType);\n \tmessage = BillingAPI.pay(RECID, userId, item, payment_type, times, oldCount, PTYPE, PID, reamount, null);\n \tif(!message.equalsIgnoreCase(\"success\")){\n \t\tlogger.info(\"payment fail\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap; //退费不成功\n \t} \n \t //收取手续费\n item = \"手续费\";\n PID=\"修改付费规则的手续费\";\n payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, chargecount, PTYPE, PID, chargeamount, null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n } else {\n \tif(balance < payamount){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t}\n \n //查询余额,扣费\n logger.info(\"start payment!\");\n String PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum + \"G硬盘和\" + bandNum + \"M带宽\";\n logger.debug(\"PID = \" + PID);\n String item = \"\";\n String message = \"\";\n logger.info(\"type = \" + type);\n if(type.equalsIgnoreCase(\"vm\")){\n \titem = \"CPU/内存/硬盘/带宽\";\n logger.debug(\"item = \" + item);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n \tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n\t\t\titem = rate.getName();\n }\n String payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, count, PTYPE, PID, payamount,null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n resultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n \n //修改虚拟机到期时间以及付费类型\n logger.info(\"start modify endtime!\");\n if(type.equalsIgnoreCase(\"vm\")){\n logger.info(\"vm\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \" tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_VM);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_VM, paymentType, count);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n logger.info(\"instancetype\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \"tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_INSTANCETYPE);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_INSTANCETYPE, paymentType, count);\n }\n resultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_OK);\n return resultMap;\n\t}" ]
[ "0.7461772", "0.7270173", "0.7188162", "0.6849862", "0.6622877", "0.6556345", "0.644622", "0.6299455", "0.62147033", "0.6163412", "0.6087984", "0.6002228", "0.5975709", "0.59395826", "0.5907646", "0.57982445", "0.5726266", "0.5712276", "0.5684582", "0.5584436", "0.5559634", "0.5252141", "0.49216577", "0.47094396", "0.4694811", "0.46729812", "0.4656656", "0.46391153", "0.46205348", "0.46073896", "0.45961434", "0.45853224", "0.45853224", "0.4572385", "0.45663446", "0.45509598", "0.453728", "0.45189363", "0.45187464", "0.45142606", "0.45046827", "0.4490483", "0.44709814", "0.44686854", "0.44686854", "0.4463381", "0.44375443", "0.4430811", "0.44306394", "0.44279918", "0.4413793", "0.4411431", "0.44075605", "0.44003716", "0.43986735", "0.43878996", "0.43874544", "0.43870187", "0.4370455", "0.43632102", "0.43427208", "0.43381727", "0.43282798", "0.43189391", "0.43189391", "0.43189391", "0.43189391", "0.4315619", "0.4315214", "0.43085253", "0.43080577", "0.43076736", "0.43076736", "0.43066546", "0.43042377", "0.4295094", "0.4285528", "0.42770728", "0.42726806", "0.4271019", "0.4267067", "0.42609677", "0.4253753", "0.4252036", "0.42447025", "0.4242165", "0.42407113", "0.422909", "0.42224765", "0.4221811", "0.42164075", "0.42121062", "0.42113987", "0.42101535", "0.41872218", "0.4183457", "0.4183175", "0.4179106", "0.41723317", "0.41705495" ]
0.630002
7
depends on pki_type optional bytes pki_data = 3;
private void setPkiData(com.google.protobuf.ByteString value) { java.lang.Class<?> valueClass = value.getClass(); bitField0_ |= 0x00000004; pkiData_ = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.google.protobuf.ByteString getPkiData();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "java.lang.String getPkiType();", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "boolean hasPkiType();", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "boolean hasPkiData();", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "public Builder setPkiData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiData(value);\n return this;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "@java.lang.Override\n public boolean hasPkiData() {\n return ((bitField0_ & 0x00000004) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return instance.getPkiData();\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "@java.lang.Override\n public boolean hasPkiData() {\n return instance.hasPkiData();\n }", "void setPQ( byte[] buffer, short offset, short length) throws CryptoException;", "public byte[] getPKP(final TrzbaDataType data) throws DataSigningException {\n return this.clientKey.sign(serializeData(data));\n }", "@Override\r\n protected String getPrymaryType(Integer key) {\r\n return NodeTypes.SECTOR.getId();\r\n }", "com.hps.july.persistence.WorkerKey getTechStuffKey() throws java.rmi.RemoteException;", "public String reqsetpkt(byte []p,byte[] id,byte[] T,byte[] ip,byte[] no)\r\n\t{\n\t\treturn \"hi\";\r\n\t}", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "void privateSetTechStuffKey(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException;", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "public Builder clearPkiData() {\n copyOnWrite();\n instance.clearPkiData();\n return this;\n }", "protected byte[] getBathWaterVolumeSetting3() {return null;}", "public interface ICloudRequest {\n \n public int getOp();\n public void incrementRetries();\n public void resetRetries();\n public int getRetries();\n \n /**\n * Retrieve the data unit associated with this request\n * @return {@link DepSkyDataUnit}\n */\n public DepSkyDataUnit getDataUnit();\n \n /**\n * Determine when this procedure started originally\n * @return long - start time of this procedure\n */\n public long getStartTime();\n \n /**\n * Determine the sequence of this request\n * @return long\n */\n public long getSequenceNumber();\n \n /**\n * Get the data resulting from this request\n * @return byte[] consisting of the data\n */\n public byte[] getData();\n \n \n}", "public static Object PQinit(Object... arg) {\nUNSUPPORTED(\"c01vxogao855zs8fe94tpim9g\"); // void\nUNSUPPORTED(\"3p0cdanvp4f13d8omi42lvjl1\"); // PQinit(void)\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\nUNSUPPORTED(\"akljrpu8bej9lq4rmsktz8u2e\"); // PQcnt = 0;\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\n\nthrow new UnsupportedOperationException();\n}", "com.zzsong.netty.protobuff.two.ProtoData.MyDataInfo.DataType getDataType();", "@Override\n\tpublic void put(String key, String cat, byte[] data) throws RemoteException {\n\t\t\n\t}", "public static void setKPIsInCache(Map<String,String> dataMap){ \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tmemcache.delete(ALL_KPI_KEY);\n \t}\n \tmemcache.put(ALL_KPI_KEY, dataMap);\n\t}", "@Override //Client\n public void prepareAMServiceData(ClusterDescription clusterSpec,\n Map<String, ByteBuffer> serviceData) {\n \n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "Key[] getPq();", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public byte getType() {\n return TYPE_DATA;\n }", "KijiDataRequest getClientRequest();", "public void setStorageType(short type) {\n\tstorageType = type;\n }", "public void setPartProducedKey(long value) {\n\t\tthis.partProducedKey = value;\n\t}", "public static Map<String,String> getKPIsFromCache(){\n\t\tMap<String,String> dataMap=null;\n \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tdataMap=(Map<String,String>) memcache.get(ALL_KPI_KEY);\n \t\tlog.info(\"Memcache getKPIsFromCache size = \"+dataMap.size());\n \t} \t\n \treturn dataMap;\n\t}", "public void setParentContainerType(IPartitionType type)\n\t{\n\t\tthis.parentContainerType = (PartitionType) type;\n\t}", "private IDataKey(Queue<Part> parts) {\n super(parts);\n }", "public static byte[] readFile(File file, int valueType) {\n if (!file.exists()) {\n Log.e(TAG, \"The file doesn't exist\");\n }\n try {\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n FileInputStream fileInputStream = new FileInputStream(file);\n BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);\n byte[] buf = new byte[4096];\n switch (valueType) {\n case 0:\n case 1:\n case 2:\n case 3:\n while (bufferedInputStream.read(buf) != -1) {\n byteArrayOutputStream.write(buf, 16 * valueType, 16);\n }\n break;\n case 4:\n if (!file.getName().equals(\"E_SK2\")) {\n if (!file.getName().equals(\"E_PIN2\")) {\n while (true) {\n int len = bufferedInputStream.read(buf);\n if (len == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, (len - 32) - (16 * 1));\n }\n }\n } else {\n while (true) {\n int len2 = bufferedInputStream.read(buf);\n if (len2 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, ((len2 - 32) - (16 * 1)) - PKLENGTH);\n }\n }\n }\n } else {\n while (true) {\n int len3 = bufferedInputStream.read(buf);\n if (len3 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 4, (len3 - 32) - (16 * 4));\n }\n }\n }\n case 5:\n while (true) {\n int len4 = bufferedInputStream.read(buf);\n if (len4 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, len4 - 32, 32);\n }\n }\n case PUBLICKEY /* 7 */:\n while (true) {\n int len5 = bufferedInputStream.read(buf);\n if (len5 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, (len5 - 32) - PKLENGTH, PKLENGTH);\n }\n }\n case 8:\n while (true) {\n int len6 = bufferedInputStream.read(buf);\n if (len6 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 0, len6 - 32);\n }\n }\n }\n byte[] buffer = byteArrayOutputStream.toByteArray();\n bufferedInputStream.close();\n fileInputStream.close();\n byteArrayOutputStream.close();\n return buffer;\n } catch (IOException e) {\n Log.e(TAG, \"read file exception!\" + e.getMessage());\n return new byte[0];\n }\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public byte [] getKos()\n {\n return kosBytes;\n }", "private <T> Pair<KademliaNode, Boolean> storeGRPC(KademliaNode node, byte[] key, T info) {\n\n StoreRequest.Builder request = StoreRequest.newBuilder()\n .setNode(KademliaUtils.KademliaNodeToKademliaNodeProto(bucketManager.getMyNode()))\n .setKey(ByteString.copyFrom(key));\n\n\n if(info.getClass() == Transaction.class) {\n request.setTransaction(KademliaUtils.TransactionToTransactionProto((Transaction) info));\n }\n else if(info.getClass() == Block.class) {\n request.setBlock(KademliaUtils.BlockToBlockProto((Block) info));\n }\n else if(info.getClass() == Auction.class) {\n request.setAuction(KademliaUtils.AuctionToAuctionProto((Auction) info));\n }\n else if(info.getClass() == Bid.class) {\n request.setBid(KademliaUtils.BidToBidProto((Bid) info));\n }\n else {\n logger.log(Level.SEVERE, \"Error: store value type not valid - \" + info.getClass());\n return new Pair(null, false);\n }\n\n ManagedChannel channel = ManagedChannelBuilder.forTarget(node.getIpAddress() + \":\" + node.getPort()).usePlaintext().build();\n AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel);\n// AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel).withDeadlineAfter(KademliaUtils.networkTimeoutMsecs, TimeUnit.MILLISECONDS);\n\n StoreResponse response;\n\n try {\n response = blockingStub.store(request .build());\n } catch (StatusRuntimeException e) {\n// logger.log(Level.WARNING, \"STORE RPC failed for \" + node.getIpAddress() + \":\" + node.getPort() + \" - \" + e.getStatus());\n logger.log(Level.WARNING, \"STORE RPC failed for \" + node);\n closeChannel(channel);\n return new Pair(null, false);\n }\n\n\n KademliaNode nodeInResponse = KademliaUtils.KademliaNodeProtoToKademliaNode(response.getNode());\n\n if (!Arrays.equals(node.getNodeID(), nodeInResponse.getNodeID())) {\n logger.log(Level.WARNING, \"Response returned with different nodeID\");\n closeChannel(channel);\n return new Pair(nodeInResponse, false);\n }\n\n closeChannel(channel);\n\n// logger.log(Level.INFO, \"Successfully sent STORE RPC to \" + node + \" for key \" + Utils.bytesToHexString(key));\n return new Pair(nodeInResponse, response.getSuccess());\n }", "public interface PacketFormatKeyContext {\n\n}", "public int send(Object key, Packet p) throws IOException {\n if (p instanceof NIOPacket) {\n NIOPacket n = (NIOPacket) p;\n return send(key, n.getBuffer());\n } else {\n if (T.t) {\n T.warn(\"This has not been tested\");\n }\n int len = p.getAvailable();\n p.readArray(byteArray, 0, len);\n return send(key, byteArray, 0, len);\n }\n }", "public abstract PartitionType getType();", "public String getBKP(final byte[] pkp) throws DataSigningException {\n final byte[] bytes = sha1(pkp);\n final String base16 = StringUtils.leftPad(toBase16(bytes), 40, '0');\n final String[] blocks = StringUtils.splitBlocks(base16, 8);\n final StringJoiner stringJoiner = new StringJoiner(\"-\");\n for(final String block : blocks) {\n stringJoiner.add(block);\n }\n return stringJoiner.toString().toUpperCase();\n }", "public void setPkCacheSize(int pkCacheSize) {\n }", "public ECP getPublicEphemeralKey(){return epk;}", "protected byte[] getBathWaterVolumeSetting2() {return null;}", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "byte[] get_node_secret();", "public static KubevirtNode buildKubevirtNode(Node node) {\n String hostname = node.getMetadata().getName();\n IpAddress managementIp = null;\n IpAddress dataIp = null;\n\n for (NodeAddress nodeAddress:node.getStatus().getAddresses()) {\n if (nodeAddress.getType().equals(INTERNAL_IP)) {\n managementIp = IpAddress.valueOf(nodeAddress.getAddress());\n dataIp = IpAddress.valueOf(nodeAddress.getAddress());\n }\n }\n\n Set<String> rolesFull = node.getMetadata().getLabels().keySet().stream()\n .filter(l -> l.contains(K8S_ROLE))\n .collect(Collectors.toSet());\n\n KubevirtNode.Type nodeType = WORKER;\n\n for (String roleStr : rolesFull) {\n String role = roleStr.split(\"/\")[1];\n if (MASTER.name().equalsIgnoreCase(role)) {\n nodeType = MASTER;\n break;\n }\n }\n\n // start to parse kubernetes annotation\n Map<String, String> annots = node.getMetadata().getAnnotations();\n String physnetConfig = annots.get(PHYSNET_CONFIG_KEY);\n String gatewayConfig = annots.get(GATEWAY_CONFIG_KEY);\n String dataIpStr = annots.get(DATA_IP_KEY);\n Set<KubevirtPhyInterface> phys = new HashSet<>();\n String gatewayBridgeName = null;\n try {\n if (physnetConfig != null) {\n JsonArray configJson = JsonArray.readFrom(physnetConfig);\n\n for (int i = 0; i < configJson.size(); i++) {\n JsonObject object = configJson.get(i).asObject();\n String network = object.get(NETWORK_KEY).asString();\n String intf = object.get(INTERFACE_KEY).asString();\n\n if (network != null && intf != null) {\n String physBridgeId;\n if (object.get(PHYS_BRIDGE_ID) != null) {\n physBridgeId = object.get(PHYS_BRIDGE_ID).asString();\n } else {\n physBridgeId = genDpidFromName(network + intf + hostname);\n log.trace(\"host {} physnet dpid for network {} intf {} is null so generate dpid {}\",\n hostname, network, intf, physBridgeId);\n }\n\n phys.add(DefaultKubevirtPhyInterface.builder()\n .network(network)\n .intf(intf)\n .physBridge(DeviceId.deviceId(physBridgeId))\n .build());\n }\n }\n }\n\n if (dataIpStr != null) {\n dataIp = IpAddress.valueOf(dataIpStr);\n }\n\n if (gatewayConfig != null) {\n JsonNode jsonNode = new ObjectMapper().readTree(gatewayConfig);\n\n nodeType = GATEWAY;\n gatewayBridgeName = jsonNode.get(GATEWAY_BRIDGE_NAME).asText();\n }\n } catch (JsonProcessingException e) {\n log.error(\"Failed to parse physnet config or gateway config object\", e);\n }\n\n // if the node is taint with kubevirt.io key configured,\n // we mark this node as OTHER type, and do not add it into the cluster\n NodeSpec spec = node.getSpec();\n if (spec.getTaints() != null) {\n for (Taint taint : spec.getTaints()) {\n String effect = taint.getEffect();\n String key = taint.getKey();\n String value = taint.getValue();\n\n if (StringUtils.equals(effect, NO_SCHEDULE_EFFECT) &&\n StringUtils.equals(key, KUBEVIRT_IO_KEY) &&\n StringUtils.equals(value, DRAINING_VALUE)) {\n nodeType = OTHER;\n }\n }\n }\n\n return DefaultKubevirtNode.builder()\n .hostname(hostname)\n .managementIp(managementIp)\n .dataIp(dataIp)\n .type(nodeType)\n .state(KubevirtNodeState.ON_BOARDED)\n .phyIntfs(phys)\n .gatewayBridgeName(gatewayBridgeName)\n .build();\n }", "public int getByteSizeBasedOnDataType(String dataType)\n\t{\n\t\tif (dataType.equals(\"String\"))\n\t\t\treturn charInBytes;\n\t\treturn intInBytes;\n\t}", "private DataKeys(String pKey) {\n key = pKey;\n }", "com.google.protobuf.ByteString\n getHowToUseBytes();", "com.google.protobuf.ByteString\n getHowToUseBytes();", "public static void main(String[] args) {\n Pair<String, Integer> pair = new Pair<String, Integer>(\"testeString\", 12);\n System.out.println(pair.getTipo1());\n System.out.println(pair.getTipo2());\n pair.setTipo1(\"TESTEAGAIN\");\n System.out.println(pair.getTipo1());\n\n }", "String getProcessingInstructionData(Object pi);", "public String getType() {\r\n return \"Block Data Long\";\r\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "private static String nodeKey(Player player, TYPE type) {\n return \"{playerId:\" + player.getId() + \", teamId:\" + player.getTeamId() + \", gameId:\" + player.getGameId() + \", type:\\\"\" + type.toString() + \"\\\"}\";\n }", "protected byte[] getBathWaterVolumeSetting1() {return null;}", "public PlugwiseMQTTDeviceInfo()\n\t{\n\t\t// initialize internal variables\n\t\tthis.macAddress = \"\";\n\t\tthis.type = \"circle\";\n\t}", "public interface KudoClient {\n MixedOperation<Operator, OperatorList, DoneableOperator, Resource<Operator, DoneableOperator>> operators();\n\n MixedOperation<Instance, InstanceList, DoneableInstance, Resource<Instance, DoneableInstance>> instances();\n\n MixedOperation<OperatorVersion, OperatorVersionList, DoneableOperatorVersion, Resource<OperatorVersion, DoneableOperatorVersion>> operatorVersion();\n\n void close();\n}", "ByteBuffer getApplicationData();", "public interface JobMemcachedKeys {\n String JOB_DETAIL = \"JOB_DETAIL_\";\n String JOB_STATUS = \"JOB_STATUS_\";\n}", "public interface C0003a {\n public static final String ah = \"image_manager_disk_cache\";\n public static final int hP = 262144000;\n\n @Nullable\n a bz();\n }", "short getPQ( byte[] buffer, short offset );", "public ClientPacket(PacketType type, byte[] data){\r\n\t\tthis.type = type;\r\n\t\tthis.dataSize = data.length;\r\n\t\tthis.data = data;\r\n\t}", "private void ipcSend(JSONObject data) {\n JSONObject json = data;\n try {\n json.put(IPC_MESSAGE_APPID, mAppId);\n\n if (mIpcChannel != null) {\n log.e(\"ipcSend:[\" + json.toString() + \"]\");\n\n mIpcChannel.send(json.toString());\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void setOpckeytype(java.lang.Long value) {\n\t\tsetValue(test.generated.pg_catalog.tables.PgOpclass.PG_OPCLASS.OPCKEYTYPE, value);\n\t}", "private String createKey(OwObject object_p, OwPluginEntry pluginEntry_p) throws Exception\r\n {\r\n String objectId = object_p.getDMSID();\r\n String key = objectId + \"_\" + pluginEntry_p.getIndex();\r\n return key;\r\n }", "public void setAvailableExtraData(List<String> extraDataKeys) {\n/* 502 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public int getCapacity( Resource.Type type );", "public TableValue(short type) {\n\tkey = null; // No name by default.\n\tstorageType = type; // Type of data. \n\tattrs = null; // No attributes yet.\n\tflags = -1; // No flags yet. \n\n\t// Create a generic, default vector clock. \n\tvclock = new VectorClock(\"s\".getBytes(), 0);\n }", "void setP( byte[] buffer, short offset, short length) throws CryptoException;", "private void uniPerfGetConfig(Parcel data, Parcel reply) {\n int tagsSize = data.readInt();\n if (tagsSize <= 0 || tagsSize >= 128) {\n AwareLog.e(TAG, \"uniPerfGetConfig tags size invalid.\");\n return;\n }\n int[] tags = new int[tagsSize];\n for (int i = 0; i < tagsSize; i++) {\n tags[i] = data.readInt();\n }\n int[] values = new int[tagsSize];\n reply.writeInt(UniPerf.getInstance().uniPerfGetConfig(tags, values));\n for (int value : values) {\n reply.writeInt(value);\n }\n }", "void setQ( byte[] buffer, short offset, short length) throws CryptoException;", "public void setProcessType(String currentProcess) {\n this.currentProcess=currentProcess;\n if(currentProcess.startsWith(\"ENCRYPTION\")) {\n processCaption=\"Encrypting\";\n }\n else {\n processCaption=\"Decrypting\";\n } \n }", "public MessageClackData(String userName, String message, String key, int type) {\n super(userName, type);\n this.message = encrypt(message, key);\n }", "PNMMetadata(ImageTypeSpecifier imageType, ImageWriteParam param) {\n/* 145 */ this();\n/* 146 */ initialize(imageType, param);\n/* */ }", "@Override\n\tpublic Map<String, String> modifyInstanceChargeType(\n\t\t\tMap<String, String> paramsMap, Map<String, String> defaultParamsMap,String requestId) throws Exception {\n\t\tMap<String, String> resultMap = new HashMap<String, String>();\n\t\tif(null==requestId || requestId.length()<1) {\n\t\t\tlogger.info(\"RequestId is null or is error!\");\n\t\t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"The request processing has failed due to some unknown error.\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_INTERNAL_SERVER_ERROR+\"\");\n\t\t\treturn resultMap;\n\t\t}\n\t\tString appKeyId = paramsMap.get(Constants.APPKEY_ID);\n\t\tVmUser vmuser = vmUserProxy.getByAppKeyId(appKeyId);\n\t\tString uuid = paramsMap.get(Constants.INSTANCE_ID);\n\t\tVmInstance instance = vmInstanceProxy.getByUuid(uuid, false, true, false, true, true, true, false, false);\n\t\tInteger userId = vmuser.getUserId();\n\t\tInteger clusterid = instance.getCluster().getId();\n\t\tInteger cpuNum = instance.getVmInstanceType().getVcpus();\n\t\tInteger memNum = instance.getVmInstanceType().getMemoryMb();\n\t\tInteger bandNum = -1;\n\t\tInteger hdNum = instance.getVmInstanceType().getLocalGb();\n\t\tList<VmInstanceMetadata> bandNumlist = instance.getVmInstanceMetadatas();\n\t\tfor(VmInstanceMetadata md : bandNumlist) {\n\t\t\tif(md.getKey().equals(Constants.PUBLIC_BANDWIDTH)) {\n\t\t\t\tbandNum = Integer.valueOf(md.getValue());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(-1 == bandNum)\n\t\t{\n\t\t\tlogger.info(\"带宽获取失败!\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"This instance do not have band\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n\t\t}\n\t\tString instanceChargeType;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_TYPE))\n\t\t\tinstanceChargeType = defaultParamsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\telse\n\t\t\tinstanceChargeType = paramsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\tString instanceChargeLength;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH))\n\t\t\tinstanceChargeLength = defaultParamsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\telse\n\t\t\tinstanceChargeLength = paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\tInteger paymentType = convertToPaymentType(instanceChargeType);\n\t\tDouble count = Double.valueOf(instanceChargeLength);\n\t\tint times = 0;\n\t\tString type = new VmHdEndtimeManager().getVmEndtimeByUuid(uuid).getType().toLowerCase();\n\t\tString PTYPE = Constants.INSTANCE_TYPE;\n\t\t\n\t\t\n logger.info(\"clusterid: \" + clusterid + \"cpu: \" + cpuNum + \" ,mem: \" + memNum + \" ,hd: \" + hdNum + \" ,band: \" + bandNum);\n \n //计算时间,算各种份数,然后扣费,设每个月份定为30天,每年定为360天\n //计算旧计费规则的份数\n VmHdEndtimeManager vmHdEndtimeManager = new VmHdEndtimeManager();\n VmHdEndtime vm = vmHdEndtimeManager.getVmEndtimeByUuid(uuid);\n\t\tTimestamp currentTime = new Timestamp(System.currentTimeMillis());\n\t\tSimpleDateFormat timeformat = new SimpleDateFormat(\"yyyy-MM-dd,HH:mm:ss\");\n\t long t1 = 0L;\n\t long t2 = 0L;\n \n Timestamp endTime = new Timestamp(vm.getEndTime().getTime());\n t1 = timeformat.parse(getTimeStampNumberFormat(endTime)).getTime();\n t2 = timeformat.parse(getTimeStampNumberFormat(currentTime)).getTime();\n //账号余额\n HashMap<String, String> params = new HashMap<String, String>();\n\t\tparams.put(\"uid\", String.valueOf(userId));\n\t\tparams.put(\"source\", com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n\t\tInteger balance = BillingAPI.balance(userId ,null, AccountUtil.getSignature(params, com.appcloud.vm.fe.common.Constants.CLIENT_SECRET_KEY),com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n //本次应付款金额\n Integer payamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, paymentType, count);\n if (t1 - t2 >= 0) {//不过期才对其退费\n \tInteger oldPaymentType = vmHdEndtimeManager.convertToPaymentType(vm.getPayType());\n \tdouble oldCount = 1.00000;\n \tif(oldPaymentType == 1){\n \t\toldCount = (t1 - t2) / (Constants.yearDays*24*3600*1000.0);\n \t}else if(oldPaymentType == 2){\n \t\toldCount = (t1 - t2) / (Constants.monthDays*24*3600*1000.0); \n \t}else if(oldPaymentType == 3){\n \t\toldCount = (t1 - t2) / (24*3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除3600000得出小时\n \t}else if(oldPaymentType == 4){\n \t\toldCount = (t1 - t2) / (3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除1000得出秒\n \t}\n \tlogger.info(\"oldCount:\"+oldCount);\n \t//计算手续费的份数\n \tdouble chargecount = 1.0;\n \t//先判断余额是否充足,再进行扣费等操作\n \tInteger reamount = 0;\n \tInteger chargeamount = 0;\n \treamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, oldPaymentType, oldCount);\n \tchargeamount = BillingAPI.getPrice(\"charge\", clusterid, -1, -1, -1, -1, userId, oldPaymentType, chargecount);\n \tlogger.info(balance);\n \tlogger.info(payamount);\n \tlogger.info(reamount);\n \tlogger.info(chargeamount);\n \tif(balance < (payamount - reamount + chargeamount)){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t\n \t//根据旧的计费规则退费\n \tString PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum +\"G硬盘和\" + bandNum + \n \t\t\t\"M带宽,未到期,退费\";\n \tlogger.debug(\"PID = \" + PID);\n \tString item = \"\";\n \tif(type.equalsIgnoreCase(\"vm\")){\n \t\titem = \"CPU/内存/硬盘/带宽\";\n \t}else if(type.equalsIgnoreCase(\"instancetype\")){\n \t\tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n \t\titem = rate.getName();\n \t}\n \tlogger.debug(\"item = \" + item);\n \tString message = \"\";\n \tString payment_type = new VmHdEndtimeManager().convertToType(oldPaymentType);\n \tmessage = BillingAPI.pay(RECID, userId, item, payment_type, times, oldCount, PTYPE, PID, reamount, null);\n \tif(!message.equalsIgnoreCase(\"success\")){\n \t\tlogger.info(\"payment fail\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap; //退费不成功\n \t} \n \t //收取手续费\n item = \"手续费\";\n PID=\"修改付费规则的手续费\";\n payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, chargecount, PTYPE, PID, chargeamount, null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n } else {\n \tif(balance < payamount){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t}\n \n //查询余额,扣费\n logger.info(\"start payment!\");\n String PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum + \"G硬盘和\" + bandNum + \"M带宽\";\n logger.debug(\"PID = \" + PID);\n String item = \"\";\n String message = \"\";\n logger.info(\"type = \" + type);\n if(type.equalsIgnoreCase(\"vm\")){\n \titem = \"CPU/内存/硬盘/带宽\";\n logger.debug(\"item = \" + item);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n \tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n\t\t\titem = rate.getName();\n }\n String payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, count, PTYPE, PID, payamount,null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n resultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n \n //修改虚拟机到期时间以及付费类型\n logger.info(\"start modify endtime!\");\n if(type.equalsIgnoreCase(\"vm\")){\n logger.info(\"vm\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \" tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_VM);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_VM, paymentType, count);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n logger.info(\"instancetype\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \"tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_INSTANCETYPE);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_INSTANCETYPE, paymentType, count);\n }\n resultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_OK);\n return resultMap;\n\t}", "private void parseCommandPut(DataInputStream in) throws IOException {\n int ksize = in.readInt();\n int vsize = in.readInt();\n byte[] key = new byte[ksize];\n in.read(key);\n byte[] value = new byte[vsize];\n in.read(value);\n // int err = \n in.readUnsignedByte(); // unused\n elements = new LinkedHashMap<String, String>(1);\n elements.put(new String(key), new String(value));\n if (LOG.isDebugEnabled()) LOG.debug(\"parseCommandPut: elements -> \" + elements);\n }" ]
[ "0.72702616", "0.7188906", "0.68515867", "0.6624186", "0.65576494", "0.6447282", "0.6300339", "0.62993044", "0.6214387", "0.6163452", "0.60877526", "0.6003346", "0.5976778", "0.5938548", "0.59072435", "0.57994956", "0.5727161", "0.57116103", "0.5686058", "0.5584766", "0.55599767", "0.52510893", "0.49216807", "0.47093555", "0.46954027", "0.46736592", "0.46566015", "0.46395743", "0.4619744", "0.46090588", "0.45961025", "0.45867506", "0.45867506", "0.4572135", "0.45664158", "0.4551403", "0.4537767", "0.45178577", "0.4517383", "0.4514775", "0.45038578", "0.44908682", "0.4472411", "0.44683048", "0.44683048", "0.44617105", "0.44367328", "0.44311747", "0.4430882", "0.44296244", "0.44141042", "0.4411593", "0.4408321", "0.44020844", "0.43990982", "0.43889695", "0.43869603", "0.43864048", "0.43717378", "0.4364568", "0.43434846", "0.43381876", "0.4328569", "0.431848", "0.431848", "0.431848", "0.431848", "0.43157503", "0.43153298", "0.43080008", "0.43079925", "0.4307515", "0.4307515", "0.43064898", "0.43032137", "0.42942187", "0.42856467", "0.42779836", "0.42730728", "0.42689502", "0.42660895", "0.42593196", "0.4255383", "0.4253359", "0.42450884", "0.42404717", "0.42379627", "0.42292163", "0.42238173", "0.42210498", "0.42171282", "0.421253", "0.42108163", "0.42089555", "0.41871208", "0.41820946", "0.4181567", "0.41791067", "0.41725397", "0.417151" ]
0.74609065
0
depends on pki_type optional bytes pki_data = 3;
private void clearPkiData() { bitField0_ = (bitField0_ & ~0x00000004); pkiData_ = getDefaultInstance().getPkiData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "java.lang.String getPkiType();", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "boolean hasPkiType();", "boolean hasPkiData();", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "public Builder setPkiData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiData(value);\n return this;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "@java.lang.Override\n public boolean hasPkiData() {\n return ((bitField0_ & 0x00000004) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return instance.getPkiData();\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "@java.lang.Override\n public boolean hasPkiData() {\n return instance.hasPkiData();\n }", "void setPQ( byte[] buffer, short offset, short length) throws CryptoException;", "public byte[] getPKP(final TrzbaDataType data) throws DataSigningException {\n return this.clientKey.sign(serializeData(data));\n }", "@Override\r\n protected String getPrymaryType(Integer key) {\r\n return NodeTypes.SECTOR.getId();\r\n }", "com.hps.july.persistence.WorkerKey getTechStuffKey() throws java.rmi.RemoteException;", "public String reqsetpkt(byte []p,byte[] id,byte[] T,byte[] ip,byte[] no)\r\n\t{\n\t\treturn \"hi\";\r\n\t}", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "void privateSetTechStuffKey(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException;", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "public Builder clearPkiData() {\n copyOnWrite();\n instance.clearPkiData();\n return this;\n }", "protected byte[] getBathWaterVolumeSetting3() {return null;}", "public interface ICloudRequest {\n \n public int getOp();\n public void incrementRetries();\n public void resetRetries();\n public int getRetries();\n \n /**\n * Retrieve the data unit associated with this request\n * @return {@link DepSkyDataUnit}\n */\n public DepSkyDataUnit getDataUnit();\n \n /**\n * Determine when this procedure started originally\n * @return long - start time of this procedure\n */\n public long getStartTime();\n \n /**\n * Determine the sequence of this request\n * @return long\n */\n public long getSequenceNumber();\n \n /**\n * Get the data resulting from this request\n * @return byte[] consisting of the data\n */\n public byte[] getData();\n \n \n}", "public static Object PQinit(Object... arg) {\nUNSUPPORTED(\"c01vxogao855zs8fe94tpim9g\"); // void\nUNSUPPORTED(\"3p0cdanvp4f13d8omi42lvjl1\"); // PQinit(void)\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\nUNSUPPORTED(\"akljrpu8bej9lq4rmsktz8u2e\"); // PQcnt = 0;\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\n\nthrow new UnsupportedOperationException();\n}", "@Override\n\tpublic void put(String key, String cat, byte[] data) throws RemoteException {\n\t\t\n\t}", "com.zzsong.netty.protobuff.two.ProtoData.MyDataInfo.DataType getDataType();", "public static void setKPIsInCache(Map<String,String> dataMap){ \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tmemcache.delete(ALL_KPI_KEY);\n \t}\n \tmemcache.put(ALL_KPI_KEY, dataMap);\n\t}", "@Override //Client\n public void prepareAMServiceData(ClusterDescription clusterSpec,\n Map<String, ByteBuffer> serviceData) {\n \n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "Key[] getPq();", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public byte getType() {\n return TYPE_DATA;\n }", "KijiDataRequest getClientRequest();", "public static Map<String,String> getKPIsFromCache(){\n\t\tMap<String,String> dataMap=null;\n \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tdataMap=(Map<String,String>) memcache.get(ALL_KPI_KEY);\n \t\tlog.info(\"Memcache getKPIsFromCache size = \"+dataMap.size());\n \t} \t\n \treturn dataMap;\n\t}", "public void setPartProducedKey(long value) {\n\t\tthis.partProducedKey = value;\n\t}", "public void setStorageType(short type) {\n\tstorageType = type;\n }", "public void setParentContainerType(IPartitionType type)\n\t{\n\t\tthis.parentContainerType = (PartitionType) type;\n\t}", "private IDataKey(Queue<Part> parts) {\n super(parts);\n }", "public static byte[] readFile(File file, int valueType) {\n if (!file.exists()) {\n Log.e(TAG, \"The file doesn't exist\");\n }\n try {\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n FileInputStream fileInputStream = new FileInputStream(file);\n BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);\n byte[] buf = new byte[4096];\n switch (valueType) {\n case 0:\n case 1:\n case 2:\n case 3:\n while (bufferedInputStream.read(buf) != -1) {\n byteArrayOutputStream.write(buf, 16 * valueType, 16);\n }\n break;\n case 4:\n if (!file.getName().equals(\"E_SK2\")) {\n if (!file.getName().equals(\"E_PIN2\")) {\n while (true) {\n int len = bufferedInputStream.read(buf);\n if (len == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, (len - 32) - (16 * 1));\n }\n }\n } else {\n while (true) {\n int len2 = bufferedInputStream.read(buf);\n if (len2 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, ((len2 - 32) - (16 * 1)) - PKLENGTH);\n }\n }\n }\n } else {\n while (true) {\n int len3 = bufferedInputStream.read(buf);\n if (len3 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 4, (len3 - 32) - (16 * 4));\n }\n }\n }\n case 5:\n while (true) {\n int len4 = bufferedInputStream.read(buf);\n if (len4 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, len4 - 32, 32);\n }\n }\n case PUBLICKEY /* 7 */:\n while (true) {\n int len5 = bufferedInputStream.read(buf);\n if (len5 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, (len5 - 32) - PKLENGTH, PKLENGTH);\n }\n }\n case 8:\n while (true) {\n int len6 = bufferedInputStream.read(buf);\n if (len6 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 0, len6 - 32);\n }\n }\n }\n byte[] buffer = byteArrayOutputStream.toByteArray();\n bufferedInputStream.close();\n fileInputStream.close();\n byteArrayOutputStream.close();\n return buffer;\n } catch (IOException e) {\n Log.e(TAG, \"read file exception!\" + e.getMessage());\n return new byte[0];\n }\n }", "public byte [] getKos()\n {\n return kosBytes;\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "private <T> Pair<KademliaNode, Boolean> storeGRPC(KademliaNode node, byte[] key, T info) {\n\n StoreRequest.Builder request = StoreRequest.newBuilder()\n .setNode(KademliaUtils.KademliaNodeToKademliaNodeProto(bucketManager.getMyNode()))\n .setKey(ByteString.copyFrom(key));\n\n\n if(info.getClass() == Transaction.class) {\n request.setTransaction(KademliaUtils.TransactionToTransactionProto((Transaction) info));\n }\n else if(info.getClass() == Block.class) {\n request.setBlock(KademliaUtils.BlockToBlockProto((Block) info));\n }\n else if(info.getClass() == Auction.class) {\n request.setAuction(KademliaUtils.AuctionToAuctionProto((Auction) info));\n }\n else if(info.getClass() == Bid.class) {\n request.setBid(KademliaUtils.BidToBidProto((Bid) info));\n }\n else {\n logger.log(Level.SEVERE, \"Error: store value type not valid - \" + info.getClass());\n return new Pair(null, false);\n }\n\n ManagedChannel channel = ManagedChannelBuilder.forTarget(node.getIpAddress() + \":\" + node.getPort()).usePlaintext().build();\n AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel);\n// AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel).withDeadlineAfter(KademliaUtils.networkTimeoutMsecs, TimeUnit.MILLISECONDS);\n\n StoreResponse response;\n\n try {\n response = blockingStub.store(request .build());\n } catch (StatusRuntimeException e) {\n// logger.log(Level.WARNING, \"STORE RPC failed for \" + node.getIpAddress() + \":\" + node.getPort() + \" - \" + e.getStatus());\n logger.log(Level.WARNING, \"STORE RPC failed for \" + node);\n closeChannel(channel);\n return new Pair(null, false);\n }\n\n\n KademliaNode nodeInResponse = KademliaUtils.KademliaNodeProtoToKademliaNode(response.getNode());\n\n if (!Arrays.equals(node.getNodeID(), nodeInResponse.getNodeID())) {\n logger.log(Level.WARNING, \"Response returned with different nodeID\");\n closeChannel(channel);\n return new Pair(nodeInResponse, false);\n }\n\n closeChannel(channel);\n\n// logger.log(Level.INFO, \"Successfully sent STORE RPC to \" + node + \" for key \" + Utils.bytesToHexString(key));\n return new Pair(nodeInResponse, response.getSuccess());\n }", "public interface PacketFormatKeyContext {\n\n}", "public int send(Object key, Packet p) throws IOException {\n if (p instanceof NIOPacket) {\n NIOPacket n = (NIOPacket) p;\n return send(key, n.getBuffer());\n } else {\n if (T.t) {\n T.warn(\"This has not been tested\");\n }\n int len = p.getAvailable();\n p.readArray(byteArray, 0, len);\n return send(key, byteArray, 0, len);\n }\n }", "public abstract PartitionType getType();", "public String getBKP(final byte[] pkp) throws DataSigningException {\n final byte[] bytes = sha1(pkp);\n final String base16 = StringUtils.leftPad(toBase16(bytes), 40, '0');\n final String[] blocks = StringUtils.splitBlocks(base16, 8);\n final StringJoiner stringJoiner = new StringJoiner(\"-\");\n for(final String block : blocks) {\n stringJoiner.add(block);\n }\n return stringJoiner.toString().toUpperCase();\n }", "public void setPkCacheSize(int pkCacheSize) {\n }", "public ECP getPublicEphemeralKey(){return epk;}", "protected byte[] getBathWaterVolumeSetting2() {return null;}", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "public static KubevirtNode buildKubevirtNode(Node node) {\n String hostname = node.getMetadata().getName();\n IpAddress managementIp = null;\n IpAddress dataIp = null;\n\n for (NodeAddress nodeAddress:node.getStatus().getAddresses()) {\n if (nodeAddress.getType().equals(INTERNAL_IP)) {\n managementIp = IpAddress.valueOf(nodeAddress.getAddress());\n dataIp = IpAddress.valueOf(nodeAddress.getAddress());\n }\n }\n\n Set<String> rolesFull = node.getMetadata().getLabels().keySet().stream()\n .filter(l -> l.contains(K8S_ROLE))\n .collect(Collectors.toSet());\n\n KubevirtNode.Type nodeType = WORKER;\n\n for (String roleStr : rolesFull) {\n String role = roleStr.split(\"/\")[1];\n if (MASTER.name().equalsIgnoreCase(role)) {\n nodeType = MASTER;\n break;\n }\n }\n\n // start to parse kubernetes annotation\n Map<String, String> annots = node.getMetadata().getAnnotations();\n String physnetConfig = annots.get(PHYSNET_CONFIG_KEY);\n String gatewayConfig = annots.get(GATEWAY_CONFIG_KEY);\n String dataIpStr = annots.get(DATA_IP_KEY);\n Set<KubevirtPhyInterface> phys = new HashSet<>();\n String gatewayBridgeName = null;\n try {\n if (physnetConfig != null) {\n JsonArray configJson = JsonArray.readFrom(physnetConfig);\n\n for (int i = 0; i < configJson.size(); i++) {\n JsonObject object = configJson.get(i).asObject();\n String network = object.get(NETWORK_KEY).asString();\n String intf = object.get(INTERFACE_KEY).asString();\n\n if (network != null && intf != null) {\n String physBridgeId;\n if (object.get(PHYS_BRIDGE_ID) != null) {\n physBridgeId = object.get(PHYS_BRIDGE_ID).asString();\n } else {\n physBridgeId = genDpidFromName(network + intf + hostname);\n log.trace(\"host {} physnet dpid for network {} intf {} is null so generate dpid {}\",\n hostname, network, intf, physBridgeId);\n }\n\n phys.add(DefaultKubevirtPhyInterface.builder()\n .network(network)\n .intf(intf)\n .physBridge(DeviceId.deviceId(physBridgeId))\n .build());\n }\n }\n }\n\n if (dataIpStr != null) {\n dataIp = IpAddress.valueOf(dataIpStr);\n }\n\n if (gatewayConfig != null) {\n JsonNode jsonNode = new ObjectMapper().readTree(gatewayConfig);\n\n nodeType = GATEWAY;\n gatewayBridgeName = jsonNode.get(GATEWAY_BRIDGE_NAME).asText();\n }\n } catch (JsonProcessingException e) {\n log.error(\"Failed to parse physnet config or gateway config object\", e);\n }\n\n // if the node is taint with kubevirt.io key configured,\n // we mark this node as OTHER type, and do not add it into the cluster\n NodeSpec spec = node.getSpec();\n if (spec.getTaints() != null) {\n for (Taint taint : spec.getTaints()) {\n String effect = taint.getEffect();\n String key = taint.getKey();\n String value = taint.getValue();\n\n if (StringUtils.equals(effect, NO_SCHEDULE_EFFECT) &&\n StringUtils.equals(key, KUBEVIRT_IO_KEY) &&\n StringUtils.equals(value, DRAINING_VALUE)) {\n nodeType = OTHER;\n }\n }\n }\n\n return DefaultKubevirtNode.builder()\n .hostname(hostname)\n .managementIp(managementIp)\n .dataIp(dataIp)\n .type(nodeType)\n .state(KubevirtNodeState.ON_BOARDED)\n .phyIntfs(phys)\n .gatewayBridgeName(gatewayBridgeName)\n .build();\n }", "byte[] get_node_secret();", "public int getByteSizeBasedOnDataType(String dataType)\n\t{\n\t\tif (dataType.equals(\"String\"))\n\t\t\treturn charInBytes;\n\t\treturn intInBytes;\n\t}", "private DataKeys(String pKey) {\n key = pKey;\n }", "com.google.protobuf.ByteString\n getHowToUseBytes();", "com.google.protobuf.ByteString\n getHowToUseBytes();", "public static void main(String[] args) {\n Pair<String, Integer> pair = new Pair<String, Integer>(\"testeString\", 12);\n System.out.println(pair.getTipo1());\n System.out.println(pair.getTipo2());\n pair.setTipo1(\"TESTEAGAIN\");\n System.out.println(pair.getTipo1());\n\n }", "String getProcessingInstructionData(Object pi);", "public String getType() {\r\n return \"Block Data Long\";\r\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "private static String nodeKey(Player player, TYPE type) {\n return \"{playerId:\" + player.getId() + \", teamId:\" + player.getTeamId() + \", gameId:\" + player.getGameId() + \", type:\\\"\" + type.toString() + \"\\\"}\";\n }", "protected byte[] getBathWaterVolumeSetting1() {return null;}", "public PlugwiseMQTTDeviceInfo()\n\t{\n\t\t// initialize internal variables\n\t\tthis.macAddress = \"\";\n\t\tthis.type = \"circle\";\n\t}", "public interface KudoClient {\n MixedOperation<Operator, OperatorList, DoneableOperator, Resource<Operator, DoneableOperator>> operators();\n\n MixedOperation<Instance, InstanceList, DoneableInstance, Resource<Instance, DoneableInstance>> instances();\n\n MixedOperation<OperatorVersion, OperatorVersionList, DoneableOperatorVersion, Resource<OperatorVersion, DoneableOperatorVersion>> operatorVersion();\n\n void close();\n}", "ByteBuffer getApplicationData();", "public interface JobMemcachedKeys {\n String JOB_DETAIL = \"JOB_DETAIL_\";\n String JOB_STATUS = \"JOB_STATUS_\";\n}", "public interface C0003a {\n public static final String ah = \"image_manager_disk_cache\";\n public static final int hP = 262144000;\n\n @Nullable\n a bz();\n }", "short getPQ( byte[] buffer, short offset );", "public ClientPacket(PacketType type, byte[] data){\r\n\t\tthis.type = type;\r\n\t\tthis.dataSize = data.length;\r\n\t\tthis.data = data;\r\n\t}", "private void ipcSend(JSONObject data) {\n JSONObject json = data;\n try {\n json.put(IPC_MESSAGE_APPID, mAppId);\n\n if (mIpcChannel != null) {\n log.e(\"ipcSend:[\" + json.toString() + \"]\");\n\n mIpcChannel.send(json.toString());\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void setOpckeytype(java.lang.Long value) {\n\t\tsetValue(test.generated.pg_catalog.tables.PgOpclass.PG_OPCLASS.OPCKEYTYPE, value);\n\t}", "private String createKey(OwObject object_p, OwPluginEntry pluginEntry_p) throws Exception\r\n {\r\n String objectId = object_p.getDMSID();\r\n String key = objectId + \"_\" + pluginEntry_p.getIndex();\r\n return key;\r\n }", "public void setAvailableExtraData(List<String> extraDataKeys) {\n/* 502 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public int getCapacity( Resource.Type type );", "public TableValue(short type) {\n\tkey = null; // No name by default.\n\tstorageType = type; // Type of data. \n\tattrs = null; // No attributes yet.\n\tflags = -1; // No flags yet. \n\n\t// Create a generic, default vector clock. \n\tvclock = new VectorClock(\"s\".getBytes(), 0);\n }", "private void uniPerfGetConfig(Parcel data, Parcel reply) {\n int tagsSize = data.readInt();\n if (tagsSize <= 0 || tagsSize >= 128) {\n AwareLog.e(TAG, \"uniPerfGetConfig tags size invalid.\");\n return;\n }\n int[] tags = new int[tagsSize];\n for (int i = 0; i < tagsSize; i++) {\n tags[i] = data.readInt();\n }\n int[] values = new int[tagsSize];\n reply.writeInt(UniPerf.getInstance().uniPerfGetConfig(tags, values));\n for (int value : values) {\n reply.writeInt(value);\n }\n }", "void setP( byte[] buffer, short offset, short length) throws CryptoException;", "void setQ( byte[] buffer, short offset, short length) throws CryptoException;", "public void setProcessType(String currentProcess) {\n this.currentProcess=currentProcess;\n if(currentProcess.startsWith(\"ENCRYPTION\")) {\n processCaption=\"Encrypting\";\n }\n else {\n processCaption=\"Decrypting\";\n } \n }", "public MessageClackData(String userName, String message, String key, int type) {\n super(userName, type);\n this.message = encrypt(message, key);\n }", "PNMMetadata(ImageTypeSpecifier imageType, ImageWriteParam param) {\n/* 145 */ this();\n/* 146 */ initialize(imageType, param);\n/* */ }", "private void parseCommandPut(DataInputStream in) throws IOException {\n int ksize = in.readInt();\n int vsize = in.readInt();\n byte[] key = new byte[ksize];\n in.read(key);\n byte[] value = new byte[vsize];\n in.read(value);\n // int err = \n in.readUnsignedByte(); // unused\n elements = new LinkedHashMap<String, String>(1);\n elements.put(new String(key), new String(value));\n if (LOG.isDebugEnabled()) LOG.debug(\"parseCommandPut: elements -> \" + elements);\n }", "@Override\n\tpublic Map<String, String> modifyInstanceChargeType(\n\t\t\tMap<String, String> paramsMap, Map<String, String> defaultParamsMap,String requestId) throws Exception {\n\t\tMap<String, String> resultMap = new HashMap<String, String>();\n\t\tif(null==requestId || requestId.length()<1) {\n\t\t\tlogger.info(\"RequestId is null or is error!\");\n\t\t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"The request processing has failed due to some unknown error.\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_INTERNAL_SERVER_ERROR+\"\");\n\t\t\treturn resultMap;\n\t\t}\n\t\tString appKeyId = paramsMap.get(Constants.APPKEY_ID);\n\t\tVmUser vmuser = vmUserProxy.getByAppKeyId(appKeyId);\n\t\tString uuid = paramsMap.get(Constants.INSTANCE_ID);\n\t\tVmInstance instance = vmInstanceProxy.getByUuid(uuid, false, true, false, true, true, true, false, false);\n\t\tInteger userId = vmuser.getUserId();\n\t\tInteger clusterid = instance.getCluster().getId();\n\t\tInteger cpuNum = instance.getVmInstanceType().getVcpus();\n\t\tInteger memNum = instance.getVmInstanceType().getMemoryMb();\n\t\tInteger bandNum = -1;\n\t\tInteger hdNum = instance.getVmInstanceType().getLocalGb();\n\t\tList<VmInstanceMetadata> bandNumlist = instance.getVmInstanceMetadatas();\n\t\tfor(VmInstanceMetadata md : bandNumlist) {\n\t\t\tif(md.getKey().equals(Constants.PUBLIC_BANDWIDTH)) {\n\t\t\t\tbandNum = Integer.valueOf(md.getValue());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(-1 == bandNum)\n\t\t{\n\t\t\tlogger.info(\"带宽获取失败!\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"This instance do not have band\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n\t\t}\n\t\tString instanceChargeType;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_TYPE))\n\t\t\tinstanceChargeType = defaultParamsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\telse\n\t\t\tinstanceChargeType = paramsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\tString instanceChargeLength;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH))\n\t\t\tinstanceChargeLength = defaultParamsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\telse\n\t\t\tinstanceChargeLength = paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\tInteger paymentType = convertToPaymentType(instanceChargeType);\n\t\tDouble count = Double.valueOf(instanceChargeLength);\n\t\tint times = 0;\n\t\tString type = new VmHdEndtimeManager().getVmEndtimeByUuid(uuid).getType().toLowerCase();\n\t\tString PTYPE = Constants.INSTANCE_TYPE;\n\t\t\n\t\t\n logger.info(\"clusterid: \" + clusterid + \"cpu: \" + cpuNum + \" ,mem: \" + memNum + \" ,hd: \" + hdNum + \" ,band: \" + bandNum);\n \n //计算时间,算各种份数,然后扣费,设每个月份定为30天,每年定为360天\n //计算旧计费规则的份数\n VmHdEndtimeManager vmHdEndtimeManager = new VmHdEndtimeManager();\n VmHdEndtime vm = vmHdEndtimeManager.getVmEndtimeByUuid(uuid);\n\t\tTimestamp currentTime = new Timestamp(System.currentTimeMillis());\n\t\tSimpleDateFormat timeformat = new SimpleDateFormat(\"yyyy-MM-dd,HH:mm:ss\");\n\t long t1 = 0L;\n\t long t2 = 0L;\n \n Timestamp endTime = new Timestamp(vm.getEndTime().getTime());\n t1 = timeformat.parse(getTimeStampNumberFormat(endTime)).getTime();\n t2 = timeformat.parse(getTimeStampNumberFormat(currentTime)).getTime();\n //账号余额\n HashMap<String, String> params = new HashMap<String, String>();\n\t\tparams.put(\"uid\", String.valueOf(userId));\n\t\tparams.put(\"source\", com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n\t\tInteger balance = BillingAPI.balance(userId ,null, AccountUtil.getSignature(params, com.appcloud.vm.fe.common.Constants.CLIENT_SECRET_KEY),com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n //本次应付款金额\n Integer payamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, paymentType, count);\n if (t1 - t2 >= 0) {//不过期才对其退费\n \tInteger oldPaymentType = vmHdEndtimeManager.convertToPaymentType(vm.getPayType());\n \tdouble oldCount = 1.00000;\n \tif(oldPaymentType == 1){\n \t\toldCount = (t1 - t2) / (Constants.yearDays*24*3600*1000.0);\n \t}else if(oldPaymentType == 2){\n \t\toldCount = (t1 - t2) / (Constants.monthDays*24*3600*1000.0); \n \t}else if(oldPaymentType == 3){\n \t\toldCount = (t1 - t2) / (24*3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除3600000得出小时\n \t}else if(oldPaymentType == 4){\n \t\toldCount = (t1 - t2) / (3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除1000得出秒\n \t}\n \tlogger.info(\"oldCount:\"+oldCount);\n \t//计算手续费的份数\n \tdouble chargecount = 1.0;\n \t//先判断余额是否充足,再进行扣费等操作\n \tInteger reamount = 0;\n \tInteger chargeamount = 0;\n \treamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, oldPaymentType, oldCount);\n \tchargeamount = BillingAPI.getPrice(\"charge\", clusterid, -1, -1, -1, -1, userId, oldPaymentType, chargecount);\n \tlogger.info(balance);\n \tlogger.info(payamount);\n \tlogger.info(reamount);\n \tlogger.info(chargeamount);\n \tif(balance < (payamount - reamount + chargeamount)){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t\n \t//根据旧的计费规则退费\n \tString PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum +\"G硬盘和\" + bandNum + \n \t\t\t\"M带宽,未到期,退费\";\n \tlogger.debug(\"PID = \" + PID);\n \tString item = \"\";\n \tif(type.equalsIgnoreCase(\"vm\")){\n \t\titem = \"CPU/内存/硬盘/带宽\";\n \t}else if(type.equalsIgnoreCase(\"instancetype\")){\n \t\tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n \t\titem = rate.getName();\n \t}\n \tlogger.debug(\"item = \" + item);\n \tString message = \"\";\n \tString payment_type = new VmHdEndtimeManager().convertToType(oldPaymentType);\n \tmessage = BillingAPI.pay(RECID, userId, item, payment_type, times, oldCount, PTYPE, PID, reamount, null);\n \tif(!message.equalsIgnoreCase(\"success\")){\n \t\tlogger.info(\"payment fail\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap; //退费不成功\n \t} \n \t //收取手续费\n item = \"手续费\";\n PID=\"修改付费规则的手续费\";\n payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, chargecount, PTYPE, PID, chargeamount, null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n } else {\n \tif(balance < payamount){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t}\n \n //查询余额,扣费\n logger.info(\"start payment!\");\n String PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum + \"G硬盘和\" + bandNum + \"M带宽\";\n logger.debug(\"PID = \" + PID);\n String item = \"\";\n String message = \"\";\n logger.info(\"type = \" + type);\n if(type.equalsIgnoreCase(\"vm\")){\n \titem = \"CPU/内存/硬盘/带宽\";\n logger.debug(\"item = \" + item);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n \tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n\t\t\titem = rate.getName();\n }\n String payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, count, PTYPE, PID, payamount,null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n resultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n \n //修改虚拟机到期时间以及付费类型\n logger.info(\"start modify endtime!\");\n if(type.equalsIgnoreCase(\"vm\")){\n logger.info(\"vm\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \" tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_VM);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_VM, paymentType, count);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n logger.info(\"instancetype\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \"tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_INSTANCETYPE);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_INSTANCETYPE, paymentType, count);\n }\n resultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_OK);\n return resultMap;\n\t}" ]
[ "0.74614704", "0.7271446", "0.7187013", "0.6850256", "0.6621789", "0.6556366", "0.64460635", "0.63007164", "0.6299884", "0.62162364", "0.61634666", "0.608813", "0.600272", "0.5976003", "0.59405404", "0.5908821", "0.57980275", "0.5725797", "0.5683758", "0.5583458", "0.5559882", "0.52533853", "0.49202198", "0.4709511", "0.46935123", "0.46732992", "0.46562645", "0.46382543", "0.46172744", "0.4606832", "0.45954546", "0.45859295", "0.45859295", "0.45725587", "0.45670766", "0.45511073", "0.45372626", "0.45191044", "0.45187593", "0.4516374", "0.45052835", "0.44903407", "0.44712907", "0.44699317", "0.44699317", "0.4463045", "0.44374177", "0.44312462", "0.44295922", "0.44291282", "0.44117898", "0.44114977", "0.44080195", "0.43996993", "0.439895", "0.43890876", "0.43872997", "0.43863404", "0.43695232", "0.43634602", "0.43436053", "0.43374926", "0.43290338", "0.4320167", "0.4320167", "0.4320167", "0.4320167", "0.43163896", "0.43162048", "0.43084076", "0.4307591", "0.4307521", "0.4307521", "0.43048373", "0.43043423", "0.4293991", "0.4283441", "0.42764074", "0.42732084", "0.4269577", "0.42665264", "0.4261938", "0.42549407", "0.4253268", "0.4244664", "0.42402878", "0.42402416", "0.42274034", "0.4222254", "0.42221525", "0.42159265", "0.42110968", "0.42107412", "0.42092377", "0.41862085", "0.41819403", "0.418059", "0.41781998", "0.41728628", "0.41716337" ]
0.57124394
18
PaymentDetails required bytes serialized_payment_details = 4;
@java.lang.Override public boolean hasSerializedPaymentDetails() { return ((bitField0_ & 0x00000008) != 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.google.protobuf.ByteString getSerializedPaymentDetails();", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "boolean hasSerializedPaymentDetails();", "private void clearSerializedPaymentDetails() {\n bitField0_ = (bitField0_ & ~0x00000008);\n serializedPaymentDetails_ = getDefaultInstance().getSerializedPaymentDetails();\n }", "public Builder setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setSerializedPaymentDetails(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "public String getPaymentData() {\n return paymentData;\n }", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "String getPaymentInformation();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "com.google.protobuf.ByteString getDetailsBytes();", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "void setPaymentInformation(String information);", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "boolean hasPaymentDetailsVersion();", "int getPaymentDetailsVersion();", "public Builder clearSerializedPaymentDetails() {\n copyOnWrite();\n instance.clearSerializedPaymentDetails();\n return this;\n }", "public java.lang.String getPaymentinformation () {\r\n\t\treturn paymentinformation;\r\n\t}", "public static PaymentManifestParserParsePaymentMethodManifestParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "public static PaymentManifestParserParsePaymentMethodManifestResponseParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public PaymentDetails () {\n\t}", "public Payment[] getPaymentInfo(){\n \t\n \treturn paymentArr;\n }", "com.google.protobuf.ByteString\n getField1504Bytes();", "com.google.protobuf.ByteString\n getField1704Bytes();", "public PolicyDetailsRecord() {\n\t\tsuper(PolicyDetails.POLICY_DETAILS);\n\t}", "@Override\r\n\tpublic byte[] getBytes() throws UnsupportedEncodingException {\r\n\t\tbyte[] bytes = new byte[RECORD_SIZE];\r\n\t\tbytes = Utilities.completeBytes(bytes, this.bidInfo.getBytes(), 0);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(biddingName, 30)), 32);\r\n\t\tbytes = Utilities.completeBytes(bytes, Utilities.intToBytes(typeProduct.ordinal()), 62);\r\n\t\tbytes = Utilities.completeBytes(bytes, product.getBytes(), 66);\r\n\t\tbytes = Utilities.completeBytes(bytes, publicationTime.getBytes(), 157);\r\n\t\tbytes = Utilities.completeBytes(bytes, initTime.getBytes(), 171);\r\n\t\tbytes = Utilities.completeBytes(bytes, finishTime.getBytes(), 185);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isAutomaticIncremet)?0:1), 199);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isPublic)?0:1), 200);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(owner, 20)), 201);\r\n\t\treturn bytes;\r\n\t}", "public PaymentmethodRecord() {\n super(Paymentmethod.PAYMENTMETHOD);\n }", "com.google.protobuf.ByteString\n getField1544Bytes();", "com.google.protobuf.ByteString\n getField1404Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "com.google.protobuf.ByteString\n getField1204Bytes();", "com.google.protobuf.ByteString\n getField1711Bytes();", "com.google.protobuf.ByteString\n getField1512Bytes();", "com.google.protobuf.ByteString\n getField1304Bytes();", "com.google.protobuf.ByteString\n getField1517Bytes();", "com.google.protobuf.ByteString\n getField1117Bytes();", "com.google.protobuf.ByteString\n getField1804Bytes();", "com.google.protobuf.ByteString\n getField1217Bytes();", "com.google.protobuf.ByteString\n getField1545Bytes();", "com.google.protobuf.ByteString\n getField1756Bytes();", "com.google.protobuf.ByteString\n getField1744Bytes();", "com.google.protobuf.ByteString\n getField1556Bytes();", "com.google.protobuf.ByteString\n getField1557Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@Override\n public byte getSubtype() {\n return SUBTYPE_PAYMENT_ORDINARY_PAYMENT;\n }", "com.google.protobuf.ByteString\n getField1757Bytes();", "com.google.protobuf.ByteString\n getField1748Bytes();", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "com.google.protobuf.ByteString\n getField1257Bytes();", "com.google.protobuf.ByteString\n getField1549Bytes();", "com.google.protobuf.ByteString\n getField1543Bytes();", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPayment getPayment();", "com.google.protobuf.ByteString\n getField1745Bytes();", "com.google.protobuf.ByteString\n getField1714Bytes();", "com.google.protobuf.ByteString\n getField1445Bytes();", "com.google.protobuf.ByteString\n getField1417Bytes();", "public CreditCard getDefaultPaymentInfo();", "com.google.protobuf.ByteString\n getField1511Bytes();", "com.google.protobuf.ByteString\n getField1215Bytes();", "com.google.protobuf.ByteString\n getField1244Bytes();", "com.google.protobuf.ByteString\n getField1715Bytes();", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPaymentUrlBytes() {\n return instance.getPaymentUrlBytes();\n }", "com.google.protobuf.ByteString\n getField1548Bytes();", "com.google.protobuf.ByteString\n getField1812Bytes();", "public void setDetail(byte[] detail) {\r\n this.detail = detail;\r\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString\n getField1412Bytes();", "com.google.protobuf.ByteString\n getField1558Bytes();", "com.google.protobuf.ByteString\n getField1214Bytes();", "com.google.protobuf.ByteString\n getField1604Bytes();", "com.google.protobuf.ByteString\n getField1144Bytes();", "com.google.protobuf.ByteString\n getField1218Bytes();", "com.google.protobuf.ByteString\n getField1212Bytes();", "com.google.protobuf.ByteString\n getField1114Bytes();", "public byte[] getDetail() {\r\n return detail;\r\n }", "public boolean isPartialPaymentSupported();", "com.google.protobuf.ByteString\n getField1856Bytes();", "com.google.protobuf.ByteString\n getField1115Bytes();", "com.google.protobuf.ByteString\n getField1857Bytes();", "com.google.protobuf.ByteString\n getField1248Bytes();", "com.google.protobuf.ByteString\n getField1518Bytes();", "com.google.protobuf.ByteString\n getField1578Bytes();", "com.google.protobuf.ByteString\n getField1456Bytes();", "com.google.protobuf.ByteString\n getField1345Bytes();", "public void setPaymentinformation (java.lang.String paymentinformation) {\r\n\t\tthis.paymentinformation = paymentinformation;\r\n\t}", "com.google.protobuf.ByteString\n getField1755Bytes();" ]
[ "0.82038945", "0.78406984", "0.7672053", "0.7183968", "0.6965263", "0.67179716", "0.66342545", "0.65559834", "0.6480167", "0.64448136", "0.6223145", "0.5956644", "0.5953231", "0.5951428", "0.59144926", "0.5891327", "0.57743084", "0.5749999", "0.5703974", "0.570069", "0.56634367", "0.5659935", "0.5657271", "0.5648342", "0.56400573", "0.56288546", "0.56113607", "0.5547695", "0.5542958", "0.55104643", "0.54973465", "0.5447462", "0.5435767", "0.5381711", "0.53777254", "0.5341594", "0.53340733", "0.5317032", "0.5309946", "0.53096765", "0.5283365", "0.5280656", "0.52784044", "0.5277518", "0.52692145", "0.5264747", "0.5263717", "0.5254973", "0.5252406", "0.5240902", "0.5240224", "0.5238198", "0.52337265", "0.52285266", "0.5227106", "0.52270997", "0.52267087", "0.5224098", "0.5217402", "0.5214952", "0.5214295", "0.52085435", "0.52082986", "0.52054614", "0.5203705", "0.5200687", "0.52006096", "0.51887554", "0.5186415", "0.5186199", "0.5185867", "0.5184772", "0.51840425", "0.5181835", "0.51812506", "0.51810455", "0.51807725", "0.517789", "0.5177483", "0.5177483", "0.5177114", "0.51766247", "0.5175826", "0.5174838", "0.5168", "0.51665026", "0.51644826", "0.5163361", "0.5163318", "0.5161598", "0.51615274", "0.5155481", "0.5154738", "0.5153608", "0.5149883", "0.5148344", "0.51455677", "0.51438934", "0.51423377", "0.51416725" ]
0.695285
5
PaymentDetails required bytes serialized_payment_details = 4;
@java.lang.Override public com.google.protobuf.ByteString getSerializedPaymentDetails() { return serializedPaymentDetails_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.google.protobuf.ByteString getSerializedPaymentDetails();", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "boolean hasSerializedPaymentDetails();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "private void clearSerializedPaymentDetails() {\n bitField0_ = (bitField0_ & ~0x00000008);\n serializedPaymentDetails_ = getDefaultInstance().getSerializedPaymentDetails();\n }", "public Builder setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setSerializedPaymentDetails(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "public String getPaymentData() {\n return paymentData;\n }", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "String getPaymentInformation();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "com.google.protobuf.ByteString getDetailsBytes();", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "void setPaymentInformation(String information);", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "boolean hasPaymentDetailsVersion();", "int getPaymentDetailsVersion();", "public Builder clearSerializedPaymentDetails() {\n copyOnWrite();\n instance.clearSerializedPaymentDetails();\n return this;\n }", "public java.lang.String getPaymentinformation () {\r\n\t\treturn paymentinformation;\r\n\t}", "public static PaymentManifestParserParsePaymentMethodManifestParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "public static PaymentManifestParserParsePaymentMethodManifestResponseParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public PaymentDetails () {\n\t}", "public Payment[] getPaymentInfo(){\n \t\n \treturn paymentArr;\n }", "com.google.protobuf.ByteString\n getField1504Bytes();", "com.google.protobuf.ByteString\n getField1704Bytes();", "public PolicyDetailsRecord() {\n\t\tsuper(PolicyDetails.POLICY_DETAILS);\n\t}", "@Override\r\n\tpublic byte[] getBytes() throws UnsupportedEncodingException {\r\n\t\tbyte[] bytes = new byte[RECORD_SIZE];\r\n\t\tbytes = Utilities.completeBytes(bytes, this.bidInfo.getBytes(), 0);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(biddingName, 30)), 32);\r\n\t\tbytes = Utilities.completeBytes(bytes, Utilities.intToBytes(typeProduct.ordinal()), 62);\r\n\t\tbytes = Utilities.completeBytes(bytes, product.getBytes(), 66);\r\n\t\tbytes = Utilities.completeBytes(bytes, publicationTime.getBytes(), 157);\r\n\t\tbytes = Utilities.completeBytes(bytes, initTime.getBytes(), 171);\r\n\t\tbytes = Utilities.completeBytes(bytes, finishTime.getBytes(), 185);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isAutomaticIncremet)?0:1), 199);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isPublic)?0:1), 200);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(owner, 20)), 201);\r\n\t\treturn bytes;\r\n\t}", "public PaymentmethodRecord() {\n super(Paymentmethod.PAYMENTMETHOD);\n }", "com.google.protobuf.ByteString\n getField1544Bytes();", "com.google.protobuf.ByteString\n getField1404Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "com.google.protobuf.ByteString\n getField1204Bytes();", "com.google.protobuf.ByteString\n getField1711Bytes();", "com.google.protobuf.ByteString\n getField1512Bytes();", "com.google.protobuf.ByteString\n getField1304Bytes();", "com.google.protobuf.ByteString\n getField1517Bytes();", "com.google.protobuf.ByteString\n getField1117Bytes();", "com.google.protobuf.ByteString\n getField1804Bytes();", "com.google.protobuf.ByteString\n getField1217Bytes();", "com.google.protobuf.ByteString\n getField1545Bytes();", "com.google.protobuf.ByteString\n getField1756Bytes();", "com.google.protobuf.ByteString\n getField1744Bytes();", "com.google.protobuf.ByteString\n getField1556Bytes();", "com.google.protobuf.ByteString\n getField1557Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@Override\n public byte getSubtype() {\n return SUBTYPE_PAYMENT_ORDINARY_PAYMENT;\n }", "com.google.protobuf.ByteString\n getField1757Bytes();", "com.google.protobuf.ByteString\n getField1748Bytes();", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "com.google.protobuf.ByteString\n getField1257Bytes();", "com.google.protobuf.ByteString\n getField1549Bytes();", "com.google.protobuf.ByteString\n getField1543Bytes();", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPayment getPayment();", "com.google.protobuf.ByteString\n getField1745Bytes();", "com.google.protobuf.ByteString\n getField1714Bytes();", "com.google.protobuf.ByteString\n getField1445Bytes();", "com.google.protobuf.ByteString\n getField1417Bytes();", "public CreditCard getDefaultPaymentInfo();", "com.google.protobuf.ByteString\n getField1511Bytes();", "com.google.protobuf.ByteString\n getField1215Bytes();", "com.google.protobuf.ByteString\n getField1244Bytes();", "com.google.protobuf.ByteString\n getField1715Bytes();", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPaymentUrlBytes() {\n return instance.getPaymentUrlBytes();\n }", "com.google.protobuf.ByteString\n getField1548Bytes();", "com.google.protobuf.ByteString\n getField1812Bytes();", "public void setDetail(byte[] detail) {\r\n this.detail = detail;\r\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString\n getField1412Bytes();", "com.google.protobuf.ByteString\n getField1558Bytes();", "com.google.protobuf.ByteString\n getField1214Bytes();", "com.google.protobuf.ByteString\n getField1604Bytes();", "com.google.protobuf.ByteString\n getField1144Bytes();", "com.google.protobuf.ByteString\n getField1218Bytes();", "com.google.protobuf.ByteString\n getField1212Bytes();", "com.google.protobuf.ByteString\n getField1114Bytes();", "public byte[] getDetail() {\r\n return detail;\r\n }", "public boolean isPartialPaymentSupported();", "com.google.protobuf.ByteString\n getField1856Bytes();", "com.google.protobuf.ByteString\n getField1115Bytes();", "com.google.protobuf.ByteString\n getField1857Bytes();", "com.google.protobuf.ByteString\n getField1248Bytes();", "com.google.protobuf.ByteString\n getField1518Bytes();", "com.google.protobuf.ByteString\n getField1578Bytes();", "com.google.protobuf.ByteString\n getField1456Bytes();", "com.google.protobuf.ByteString\n getField1345Bytes();", "public void setPaymentinformation (java.lang.String paymentinformation) {\r\n\t\tthis.paymentinformation = paymentinformation;\r\n\t}", "com.google.protobuf.ByteString\n getField1755Bytes();" ]
[ "0.82038945", "0.78406984", "0.7183968", "0.6965263", "0.695285", "0.67179716", "0.66342545", "0.65559834", "0.6480167", "0.64448136", "0.6223145", "0.5956644", "0.5953231", "0.5951428", "0.59144926", "0.5891327", "0.57743084", "0.5749999", "0.5703974", "0.570069", "0.56634367", "0.5659935", "0.5657271", "0.5648342", "0.56400573", "0.56288546", "0.56113607", "0.5547695", "0.5542958", "0.55104643", "0.54973465", "0.5447462", "0.5435767", "0.5381711", "0.53777254", "0.5341594", "0.53340733", "0.5317032", "0.5309946", "0.53096765", "0.5283365", "0.5280656", "0.52784044", "0.5277518", "0.52692145", "0.5264747", "0.5263717", "0.5254973", "0.5252406", "0.5240902", "0.5240224", "0.5238198", "0.52337265", "0.52285266", "0.5227106", "0.52270997", "0.52267087", "0.5224098", "0.5217402", "0.5214952", "0.5214295", "0.52085435", "0.52082986", "0.52054614", "0.5203705", "0.5200687", "0.52006096", "0.51887554", "0.5186415", "0.5186199", "0.5185867", "0.5184772", "0.51840425", "0.5181835", "0.51812506", "0.51810455", "0.51807725", "0.517789", "0.5177483", "0.5177483", "0.5177114", "0.51766247", "0.5175826", "0.5174838", "0.5168", "0.51665026", "0.51644826", "0.5163361", "0.5163318", "0.5161598", "0.51615274", "0.5155481", "0.5154738", "0.5153608", "0.5149883", "0.5148344", "0.51455677", "0.51438934", "0.51423377", "0.51416725" ]
0.7672053
2
PaymentDetails required bytes serialized_payment_details = 4;
private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) { java.lang.Class<?> valueClass = value.getClass(); bitField0_ |= 0x00000008; serializedPaymentDetails_ = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.google.protobuf.ByteString getSerializedPaymentDetails();", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "boolean hasSerializedPaymentDetails();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "private void clearSerializedPaymentDetails() {\n bitField0_ = (bitField0_ & ~0x00000008);\n serializedPaymentDetails_ = getDefaultInstance().getSerializedPaymentDetails();\n }", "public Builder setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setSerializedPaymentDetails(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "public String getPaymentData() {\n return paymentData;\n }", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "String getPaymentInformation();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "com.google.protobuf.ByteString getDetailsBytes();", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "void setPaymentInformation(String information);", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "boolean hasPaymentDetailsVersion();", "int getPaymentDetailsVersion();", "public Builder clearSerializedPaymentDetails() {\n copyOnWrite();\n instance.clearSerializedPaymentDetails();\n return this;\n }", "public java.lang.String getPaymentinformation () {\r\n\t\treturn paymentinformation;\r\n\t}", "public static PaymentManifestParserParsePaymentMethodManifestParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "public static PaymentManifestParserParsePaymentMethodManifestResponseParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public PaymentDetails () {\n\t}", "public Payment[] getPaymentInfo(){\n \t\n \treturn paymentArr;\n }", "com.google.protobuf.ByteString\n getField1504Bytes();", "com.google.protobuf.ByteString\n getField1704Bytes();", "public PolicyDetailsRecord() {\n\t\tsuper(PolicyDetails.POLICY_DETAILS);\n\t}", "@Override\r\n\tpublic byte[] getBytes() throws UnsupportedEncodingException {\r\n\t\tbyte[] bytes = new byte[RECORD_SIZE];\r\n\t\tbytes = Utilities.completeBytes(bytes, this.bidInfo.getBytes(), 0);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(biddingName, 30)), 32);\r\n\t\tbytes = Utilities.completeBytes(bytes, Utilities.intToBytes(typeProduct.ordinal()), 62);\r\n\t\tbytes = Utilities.completeBytes(bytes, product.getBytes(), 66);\r\n\t\tbytes = Utilities.completeBytes(bytes, publicationTime.getBytes(), 157);\r\n\t\tbytes = Utilities.completeBytes(bytes, initTime.getBytes(), 171);\r\n\t\tbytes = Utilities.completeBytes(bytes, finishTime.getBytes(), 185);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isAutomaticIncremet)?0:1), 199);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isPublic)?0:1), 200);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(owner, 20)), 201);\r\n\t\treturn bytes;\r\n\t}", "public PaymentmethodRecord() {\n super(Paymentmethod.PAYMENTMETHOD);\n }", "com.google.protobuf.ByteString\n getField1544Bytes();", "com.google.protobuf.ByteString\n getField1404Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "com.google.protobuf.ByteString\n getField1204Bytes();", "com.google.protobuf.ByteString\n getField1711Bytes();", "com.google.protobuf.ByteString\n getField1512Bytes();", "com.google.protobuf.ByteString\n getField1304Bytes();", "com.google.protobuf.ByteString\n getField1517Bytes();", "com.google.protobuf.ByteString\n getField1117Bytes();", "com.google.protobuf.ByteString\n getField1804Bytes();", "com.google.protobuf.ByteString\n getField1217Bytes();", "com.google.protobuf.ByteString\n getField1545Bytes();", "com.google.protobuf.ByteString\n getField1756Bytes();", "com.google.protobuf.ByteString\n getField1744Bytes();", "com.google.protobuf.ByteString\n getField1556Bytes();", "com.google.protobuf.ByteString\n getField1557Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@Override\n public byte getSubtype() {\n return SUBTYPE_PAYMENT_ORDINARY_PAYMENT;\n }", "com.google.protobuf.ByteString\n getField1757Bytes();", "com.google.protobuf.ByteString\n getField1748Bytes();", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "com.google.protobuf.ByteString\n getField1257Bytes();", "com.google.protobuf.ByteString\n getField1549Bytes();", "com.google.protobuf.ByteString\n getField1543Bytes();", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPayment getPayment();", "com.google.protobuf.ByteString\n getField1745Bytes();", "com.google.protobuf.ByteString\n getField1714Bytes();", "com.google.protobuf.ByteString\n getField1445Bytes();", "com.google.protobuf.ByteString\n getField1417Bytes();", "public CreditCard getDefaultPaymentInfo();", "com.google.protobuf.ByteString\n getField1511Bytes();", "com.google.protobuf.ByteString\n getField1215Bytes();", "com.google.protobuf.ByteString\n getField1244Bytes();", "com.google.protobuf.ByteString\n getField1715Bytes();", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPaymentUrlBytes() {\n return instance.getPaymentUrlBytes();\n }", "com.google.protobuf.ByteString\n getField1548Bytes();", "com.google.protobuf.ByteString\n getField1812Bytes();", "public void setDetail(byte[] detail) {\r\n this.detail = detail;\r\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString\n getField1412Bytes();", "com.google.protobuf.ByteString\n getField1558Bytes();", "com.google.protobuf.ByteString\n getField1214Bytes();", "com.google.protobuf.ByteString\n getField1604Bytes();", "com.google.protobuf.ByteString\n getField1144Bytes();", "com.google.protobuf.ByteString\n getField1218Bytes();", "com.google.protobuf.ByteString\n getField1212Bytes();", "com.google.protobuf.ByteString\n getField1114Bytes();", "public byte[] getDetail() {\r\n return detail;\r\n }", "public boolean isPartialPaymentSupported();", "com.google.protobuf.ByteString\n getField1856Bytes();", "com.google.protobuf.ByteString\n getField1115Bytes();", "com.google.protobuf.ByteString\n getField1857Bytes();", "com.google.protobuf.ByteString\n getField1248Bytes();", "com.google.protobuf.ByteString\n getField1518Bytes();", "com.google.protobuf.ByteString\n getField1578Bytes();", "com.google.protobuf.ByteString\n getField1456Bytes();", "com.google.protobuf.ByteString\n getField1345Bytes();", "public void setPaymentinformation (java.lang.String paymentinformation) {\r\n\t\tthis.paymentinformation = paymentinformation;\r\n\t}", "com.google.protobuf.ByteString\n getField1755Bytes();" ]
[ "0.82038945", "0.7672053", "0.7183968", "0.6965263", "0.695285", "0.67179716", "0.66342545", "0.65559834", "0.6480167", "0.64448136", "0.6223145", "0.5956644", "0.5953231", "0.5951428", "0.59144926", "0.5891327", "0.57743084", "0.5749999", "0.5703974", "0.570069", "0.56634367", "0.5659935", "0.5657271", "0.5648342", "0.56400573", "0.56288546", "0.56113607", "0.5547695", "0.5542958", "0.55104643", "0.54973465", "0.5447462", "0.5435767", "0.5381711", "0.53777254", "0.5341594", "0.53340733", "0.5317032", "0.5309946", "0.53096765", "0.5283365", "0.5280656", "0.52784044", "0.5277518", "0.52692145", "0.5264747", "0.5263717", "0.5254973", "0.5252406", "0.5240902", "0.5240224", "0.5238198", "0.52337265", "0.52285266", "0.5227106", "0.52270997", "0.52267087", "0.5224098", "0.5217402", "0.5214952", "0.5214295", "0.52085435", "0.52082986", "0.52054614", "0.5203705", "0.5200687", "0.52006096", "0.51887554", "0.5186415", "0.5186199", "0.5185867", "0.5184772", "0.51840425", "0.5181835", "0.51812506", "0.51810455", "0.51807725", "0.517789", "0.5177483", "0.5177483", "0.5177114", "0.51766247", "0.5175826", "0.5174838", "0.5168", "0.51665026", "0.51644826", "0.5163361", "0.5163318", "0.5161598", "0.51615274", "0.5155481", "0.5154738", "0.5153608", "0.5149883", "0.5148344", "0.51455677", "0.51438934", "0.51423377", "0.51416725" ]
0.78406984
1
PaymentDetails required bytes serialized_payment_details = 4;
private void clearSerializedPaymentDetails() { bitField0_ = (bitField0_ & ~0x00000008); serializedPaymentDetails_ = getDefaultInstance().getSerializedPaymentDetails(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.google.protobuf.ByteString getSerializedPaymentDetails();", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "boolean hasSerializedPaymentDetails();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "public Builder setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setSerializedPaymentDetails(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "public String getPaymentData() {\n return paymentData;\n }", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "String getPaymentInformation();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "com.google.protobuf.ByteString getDetailsBytes();", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "void setPaymentInformation(String information);", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "boolean hasPaymentDetailsVersion();", "int getPaymentDetailsVersion();", "public Builder clearSerializedPaymentDetails() {\n copyOnWrite();\n instance.clearSerializedPaymentDetails();\n return this;\n }", "public java.lang.String getPaymentinformation () {\r\n\t\treturn paymentinformation;\r\n\t}", "public static PaymentManifestParserParsePaymentMethodManifestParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "public static PaymentManifestParserParsePaymentMethodManifestResponseParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public PaymentDetails () {\n\t}", "public Payment[] getPaymentInfo(){\n \t\n \treturn paymentArr;\n }", "com.google.protobuf.ByteString\n getField1504Bytes();", "com.google.protobuf.ByteString\n getField1704Bytes();", "public PolicyDetailsRecord() {\n\t\tsuper(PolicyDetails.POLICY_DETAILS);\n\t}", "@Override\r\n\tpublic byte[] getBytes() throws UnsupportedEncodingException {\r\n\t\tbyte[] bytes = new byte[RECORD_SIZE];\r\n\t\tbytes = Utilities.completeBytes(bytes, this.bidInfo.getBytes(), 0);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(biddingName, 30)), 32);\r\n\t\tbytes = Utilities.completeBytes(bytes, Utilities.intToBytes(typeProduct.ordinal()), 62);\r\n\t\tbytes = Utilities.completeBytes(bytes, product.getBytes(), 66);\r\n\t\tbytes = Utilities.completeBytes(bytes, publicationTime.getBytes(), 157);\r\n\t\tbytes = Utilities.completeBytes(bytes, initTime.getBytes(), 171);\r\n\t\tbytes = Utilities.completeBytes(bytes, finishTime.getBytes(), 185);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isAutomaticIncremet)?0:1), 199);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isPublic)?0:1), 200);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(owner, 20)), 201);\r\n\t\treturn bytes;\r\n\t}", "public PaymentmethodRecord() {\n super(Paymentmethod.PAYMENTMETHOD);\n }", "com.google.protobuf.ByteString\n getField1544Bytes();", "com.google.protobuf.ByteString\n getField1404Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "com.google.protobuf.ByteString\n getField1204Bytes();", "com.google.protobuf.ByteString\n getField1711Bytes();", "com.google.protobuf.ByteString\n getField1512Bytes();", "com.google.protobuf.ByteString\n getField1304Bytes();", "com.google.protobuf.ByteString\n getField1517Bytes();", "com.google.protobuf.ByteString\n getField1117Bytes();", "com.google.protobuf.ByteString\n getField1804Bytes();", "com.google.protobuf.ByteString\n getField1217Bytes();", "com.google.protobuf.ByteString\n getField1545Bytes();", "com.google.protobuf.ByteString\n getField1756Bytes();", "com.google.protobuf.ByteString\n getField1744Bytes();", "com.google.protobuf.ByteString\n getField1556Bytes();", "com.google.protobuf.ByteString\n getField1557Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "com.google.protobuf.ByteString\n getField1757Bytes();", "com.google.protobuf.ByteString\n getField1748Bytes();", "@Override\n public byte getSubtype() {\n return SUBTYPE_PAYMENT_ORDINARY_PAYMENT;\n }", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "com.google.protobuf.ByteString\n getField1257Bytes();", "com.google.protobuf.ByteString\n getField1549Bytes();", "com.google.protobuf.ByteString\n getField1543Bytes();", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPayment getPayment();", "com.google.protobuf.ByteString\n getField1714Bytes();", "com.google.protobuf.ByteString\n getField1745Bytes();", "com.google.protobuf.ByteString\n getField1445Bytes();", "com.google.protobuf.ByteString\n getField1417Bytes();", "public CreditCard getDefaultPaymentInfo();", "com.google.protobuf.ByteString\n getField1511Bytes();", "com.google.protobuf.ByteString\n getField1215Bytes();", "com.google.protobuf.ByteString\n getField1244Bytes();", "com.google.protobuf.ByteString\n getField1715Bytes();", "com.google.protobuf.ByteString\n getField1548Bytes();", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPaymentUrlBytes() {\n return instance.getPaymentUrlBytes();\n }", "com.google.protobuf.ByteString\n getField1812Bytes();", "public void setDetail(byte[] detail) {\r\n this.detail = detail;\r\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString\n getField1412Bytes();", "com.google.protobuf.ByteString\n getField1558Bytes();", "com.google.protobuf.ByteString\n getField1214Bytes();", "com.google.protobuf.ByteString\n getField1604Bytes();", "com.google.protobuf.ByteString\n getField1144Bytes();", "com.google.protobuf.ByteString\n getField1218Bytes();", "com.google.protobuf.ByteString\n getField1212Bytes();", "com.google.protobuf.ByteString\n getField1114Bytes();", "public byte[] getDetail() {\r\n return detail;\r\n }", "com.google.protobuf.ByteString\n getField1856Bytes();", "public boolean isPartialPaymentSupported();", "com.google.protobuf.ByteString\n getField1115Bytes();", "com.google.protobuf.ByteString\n getField1857Bytes();", "com.google.protobuf.ByteString\n getField1248Bytes();", "com.google.protobuf.ByteString\n getField1518Bytes();", "com.google.protobuf.ByteString\n getField1578Bytes();", "com.google.protobuf.ByteString\n getField1456Bytes();", "com.google.protobuf.ByteString\n getField1345Bytes();", "public void setPaymentinformation (java.lang.String paymentinformation) {\r\n\t\tthis.paymentinformation = paymentinformation;\r\n\t}", "com.google.protobuf.ByteString\n getField1755Bytes();" ]
[ "0.82038236", "0.7840572", "0.7671914", "0.7183848", "0.6965419", "0.6952939", "0.663439", "0.6556068", "0.64802945", "0.64450496", "0.62232286", "0.5956749", "0.5953476", "0.59514207", "0.59146225", "0.5891537", "0.5773729", "0.5749882", "0.5703619", "0.5700829", "0.5663459", "0.5660361", "0.56575745", "0.5648787", "0.5640096", "0.5628598", "0.5611652", "0.55473053", "0.5543063", "0.55112493", "0.54972523", "0.54473674", "0.5435961", "0.53820443", "0.53773415", "0.53416026", "0.53340745", "0.53170466", "0.53097826", "0.5309769", "0.528339", "0.52810353", "0.5278492", "0.5277579", "0.52695304", "0.526513", "0.52637506", "0.52553463", "0.525242", "0.52412224", "0.5240505", "0.5238267", "0.52338886", "0.5228416", "0.52275294", "0.52271813", "0.52265006", "0.5223971", "0.5217591", "0.5215202", "0.52144265", "0.5208838", "0.5208109", "0.52052635", "0.52039796", "0.52010757", "0.5201014", "0.5188866", "0.5186855", "0.5186324", "0.5185992", "0.5184915", "0.5184059", "0.51822084", "0.518124", "0.5181134", "0.5180921", "0.517788", "0.5177446", "0.5177446", "0.51772887", "0.5176707", "0.51760477", "0.5174731", "0.5168059", "0.5166679", "0.5164655", "0.51636064", "0.5163509", "0.5161658", "0.5161565", "0.51556575", "0.51549417", "0.51538014", "0.5150051", "0.5148467", "0.5145721", "0.51440066", "0.51422024", "0.51419675" ]
0.6718031
6
pkidependent signature optional bytes signature = 5;
@java.lang.Override public boolean hasSignature() { return ((bitField0_ & 0x00000010) != 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract byte[] getSignature();", "com.google.protobuf.ByteString getSignature();", "int getSignature ();", "String getSignature();", "String getSignature();", "String getSignature();", "BigInteger getDigitalSignature();", "public abstract String getSignature();", "SignatureIdentification createSignatureIdentification();", "org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder();", "com.google.protobuf.ByteString\n getSignatureBytes();", "com.google.protobuf.ByteString\n getSignatureBytes();", "Signature getSignature();", "org.apache.calcite.avatica.proto.Common.Signature getSignature();", "byte[] getSignatureImage();", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }", "public GpgSignature(@NonNull byte[] signature) {\n\t\tthis.signature = signature;\n\t}", "byte[] generateSignature(byte[] message, PrivateKey privateKey, SecureRandom secureRandom) throws IOException;", "boolean hasSignature();", "boolean hasSignature();", "public byte[] getSigAlgParams() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[]\");\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "native String nativeGetSignature(long nativeHandler) throws RuntimeException;", "com.google.protobuf.ByteString getSig();", "SignatureSpi(com.android.org.bouncycastle.crypto.Digest r1, com.android.org.bouncycastle.crypto.DSA r2, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void\");\n }", "private void setSignature(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000010;\n signature_ = value;\n }", "String getUniqueSignature();", "public void setSignature( String pSignature )\r\n {\r\n this.signature = pSignature;\r\n }", "public byte []\ngetSignature() {\n\treturn signature;\n}", "int getSignatureType();", "@Override\n public String buildSignature(RequestDataToSign requestDataToSign, String appKey) {\n // find private key for this app\n final String secretKey = keyStore.getPrivateKey(appKey);\n if (secretKey == null) {\n LOG.error(\"Unknown application key: {}\", appKey);\n throw new PrivateKeyNotFoundException();\n }\n\n // sign\n return super.buildSignature(requestDataToSign, secretKey);\n }", "java.lang.String getSignatureText();", "public boolean verifySignature() {\r\n\t\t\r\n\t\tString data;\r\n\t\t\r\n\t\tif(isTypeCreation){\r\n\t\t\t\r\n\t\t\tdata = StringUtil.getStringFromKey(creator) + name +\r\n\t\t\t\t\tdescription + begin + end+end_subscription+\r\n\t\t\t\t\tlocation+min_capacity+max_capacity;\r\n\t\t\treturn StringUtil.verifyECDSASig(creator, data, signature);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata = StringUtil.getStringFromKey(subscriber)+id_event;\r\n\t\t\treturn StringUtil.verifyECDSASig(subscriber, data, signature);\r\n\t\t}\r\n//\t\tSystem.out.println(\"signature \"+signature);\r\n\t\t\r\n\t}", "public static native String getSignature(long[] msgArgs);", "@Override\n public boolean verifySignature(byte[] signature) {\n try {\n Element[] sig = derDecode(signature);\n CL04SignPublicPairingKeySerParameter pk = (CL04SignPublicPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(pairingKeySerParameter.getParameters());\n Element a = sig[0];\n Element b = sig[1];\n Element c = sig[2];\n List<Element> A = IntStream.range(3, 3 + messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n List<Element> B = IntStream.range(3 + messages.size(), 3 + 2 * messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n return aFormedCorrectly(pairing, a, A, pk) && bFormedCorrectly(pairing, a, b, A, B, pk) && cFormedCorrectly(pairing, a, b, c, B, pk);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return false;\n\n }", "public String getSignature()\r\n {\r\n return signature;\r\n }", "public boolean isSignatureRequired() {\n\t\treturn false;\n\t}", "boolean verifySignature(byte[] message, byte[] signature, PublicKey publicKey) throws IOException;", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public interface SignatureObject {\n}", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "com.google.protobuf.ByteString getArtifactSignature();", "public Signer getPDFSigner();", "public abstract String getSigAlgOID();", "public static void main(String[] args) {\n\n\t\tif (args.length != 5) {\n\t\t System.out.println(\"Usage: GenSig nameOfFileToSign keystore password sign publicKey\");\n\n\t\t }\n\t\telse try{\n\n\t\t KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t ks.load(new FileInputStream(args[1]), args[2].toCharArray());\n\t\t \n\t\t String alias = (String)ks.aliases().nextElement();\n\t\t PrivateKey privateKey = (PrivateKey) ks.getKey(alias, args[2].toCharArray());\n\n\t\t Certificate cert = ks.getCertificate(alias);\n\n\t\t // Get public key\t\n\t\t PublicKey publicKey = cert.getPublicKey();\n\n\t\t /* Create a Signature object and initialize it with the private key */\n\n\t\t Signature rsa = Signature.getInstance(\"SHA256withRSA\");\t\n\t\n\n\t\t rsa.initSign(privateKey);\n\n\t\t /* Update and sign the data */\n\n \t String hexString = readFile(args[0]).trim();\n\t\t byte[] decodedBytes = DatatypeConverter.parseHexBinary(hexString);\t\n\t\t InputStream bufin = new ByteArrayInputStream(decodedBytes);\n\n\n\t\t byte[] buffer = new byte[1024];\n\t\t int len;\n\t\t while (bufin.available() != 0) {\n\t\t\tlen = bufin.read(buffer);\n\t\t\trsa.update(buffer, 0, len);\n\t\t };\n\n\t\t bufin.close();\n\n\t\t /* Now that all the data to be signed has been read in, \n\t\t\t generate a signature for it */\n\n\t\t byte[] realSig = rsa.sign();\n\n\t\t \n\t\t /* Save the signature in a file */\n\n\t\t File file = new File(args[3]);\n\t\t PrintWriter out = new PrintWriter(file);\n\n\t\t\t// if file doesn't exists, then create it\n\t\t\tif (!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\n\t\t out.println(DatatypeConverter.printBase64Binary(realSig));\n\t\t out.close();\n\n\n\t\t /* Save the public key in a file */\n\t\t byte[] key = publicKey.getEncoded();\n\t\t FileOutputStream keyfos = new FileOutputStream(args[4]);\n\t\t keyfos.write(key);\n\n\t\t keyfos.close();\n\n\t\t} catch (Exception e) {\n\t\t System.err.println(\"Caught exception \" + e.toString());\n\t\t}\n\n\t}", "com.microsoft.schemas.office.x2006.digsig.STSignatureType xgetSignatureType();", "int getSignatureProviderDetails();", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "SignatureSource createSignatureSource();", "public byte[] getSignature()\n {\n return Arrays.clone(signature);\n }", "public Signator.Signers getUsedPDFSignerLibrary();", "String componentSignature();", "void setSignature(String signature) {\n this.signature = signature;\n }", "org.apache.xmlbeans.XmlBase64Binary xgetSignatureImage();", "public io.lightcone.data.types.EdDSASignatureOrBuilder getSigOrBuilder() {\n return getSig();\n }", "BlsPoint sign(BigInteger privateKey, byte[] data);", "public interface SignatureFactory \n{\n /** \n * initializes the implementation class \n */\n public void init()\n throws SignedDocException;\n \n /**\n * Method returns an array of strings representing the \n * list of available token names.\n * @return an array of available token names.\n * @throws SignedDocException if reading the token information fails.\n */\n public String[] getAvailableTokenNames()\n throws SignedDocException;\n \n /**\n * Method returns a digital signature. It finds the RSA private \n * key object from the active token and\n * then signs the given data with this key and RSA mechanism.\n * @param digest digest of the data to be signed.\n * @param token token index\n * @param pin users pin code\n * @return an array of bytes containing digital signature.\n * @throws SignedDocException if signing the data fails.\n */\n public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;\n \n /**\n * Method returns a X.509 certificate object readed \n * from the active token and representing an\n * user public key certificate value.\n * @return X.509 certificate object.\n * @throws SignedDocException if getting X.509 public key certificate \n * fails or the requested certificate type X.509 is not available in \n * the default provider package\n */\n public X509Certificate getCertificate(int token, String pin)\n throws SignedDocException;\n \n /**\n * Resets the previous session\n * and other selected values\n */\n public void reset() \n throws SignedDocException;\n \n\t/**\n\t * Method decrypts the data with the RSA private key\n\t * corresponding to this certificate (which was used\n\t * to encrypt it). Decryption will be done on the card.\n\t * This operation closes the possibly opened previous\n\t * session with signature token and opens a new one with\n\t * authentication token if necessary\n\t * @param data data to be decrypted.\n\t * @param token index of authentication token\n\t * @param pin PIN code\n\t * @return decrypted data.\n\t * @throws SignedDocException for all decryption errors\n\t */\n\tpublic byte[] decrypt(byte[] data, int token, String pin) \n\t\tthrows SignedDocException;\n\t\t\t\t\n}", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public byte[] signData(String fitxer, PrivateKey priv) {\n byte[] signature = null;\n FileInputStream datafis;\n BufferedInputStream bufin = null;\n byte[] buffer = new byte[1024];\n int len;\n \n try {\n Signature signer = Signature.getInstance(\"SHA256withRSA\");\n signer.initSign(priv); //Inicialitzem la firma digital a partirde l’algorisme utilitzat\n \n datafis = new FileInputStream(fitxer);\n bufin = new BufferedInputStream(datafis);\n \n while (bufin.available() != 0) {\n len = bufin.read(buffer);\n signer.update(buffer, 0, len);//Li assignem a l’objecte firma les dades afirmar digitalment\n } \n\n bufin.close();\n signature = signer.sign();//Finalment generem la firma\n } catch (Exception ex) {\n System.err.println(\"Error signant les dades: \" + ex);\n }\n return signature;\n }", "private byte getSignatureType() \r\n \t //@ requires [?f]signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures [f]signatureType |-> theSignatureType &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\treturn signatureType[0];\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public\nSIGRecord(Name name, int dclass, long ttl, int covered, int alg, int origttl,\n\t Date expire, Date timeSigned, int footprint, Name signer,\n\t byte [] signature)\n{\n\tthis(name, dclass, ttl);\n\tType.check(covered);\n\tcheckU8(\"alg\", alg);\n\tcheckU8(\"labels\", labels);\n\tTTL.check(origttl);\n\tcheckU16(\"footprint\", footprint);\n\tthis.covered = covered;\n\tthis.alg = alg;\n\tthis.labels = name.labels();\n\tthis.origttl = origttl;\n\tthis.expire = expire;\n\tthis.timeSigned = timeSigned;\n\tthis.footprint = footprint;\n\tif (!signer.isAbsolute())\n\t\tthrow new RelativeNameException(signer);\n\tthis.signer = signer;\n\tthis.signature = signature;\n}", "ReleaseFile parseWithSignature( InputStream is, InputStream signStream, InputStream keyStream ) throws IOException;", "public void setSignature(String signature) {\n\t\tthis.signature = signature;\n\t}", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "ISModifySignature createISModifySignature();", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;", "boolean readSignature(Integer[] sig) {\n Scales.sendByte((byte) 's');\n\t /* Get actual signature */\n sig[2] = Scales.getByte();\n sig[1] = Scales.getByte();\n sig[0] = Scales.getByte();\n return true;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n if (signatureBuilder_ != null) {\n return signatureBuilder_.getMessageOrBuilder();\n } else {\n return signature_ == null ?\n org.apache.calcite.avatica.proto.Common.Signature.getDefaultInstance() : signature_;\n }\n }", "private void validateFermatPacketSignature(FermatPacket fermatPacketReceive){\n\n System.out.println(\" WsCommunicationVPNClient - validateFermatPacketSignature\");\n\n /*\n * Validate the signature\n */\n boolean isValid = AsymmectricCryptography.verifyMessageSignature(fermatPacketReceive.getSignature(), fermatPacketReceive.getMessageContent(), vpnServerIdentity);\n\n System.out.println(\" WsCommunicationVPNClient - isValid = \" + isValid);\n\n /*\n * if not valid signature\n */\n if (!isValid){\n throw new RuntimeException(\"Fermat Packet received has not a valid signature, go to close this connection maybe is compromise\");\n }\n\n }", "public String getSignature() {\n\t\treturn signature;\n\t}", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "public static byte[] SignWithPrivateKey(byte[] buf,PrivateKey pkey) throws Exception{\r\n\t\tSecureRandom secureRandom = new SecureRandom();\r\n\t\tSignature signature = Signature.getInstance(\"SHA1WithECDSA\");\r\n\t\tsignature.initSign(pkey,secureRandom);\r\n\t\tsignature.update(buf);\r\n\t\tbyte[] digitalSignature = signature.sign();\r\n\t\treturn digitalSignature;\r\n\t\t\r\n\t}", "public void setSignature(String Signature) {\n this.Signature = Signature;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n return getSignature();\n }", "public ISignature getSignature() {\n return _signature;\n }", "public String getSignature() {\n return this.Signature;\n }", "@SuppressWarnings(\"all\")\n public static void main(String...args) throws Exception {\n FileInputStream pubKFile = new FileInputStream(\"C:\\\\Demo\\\\publicKey\");\n byte[] encKey = new byte[pubKFile.available()];\n pubKFile.read(encKey);\n pubKFile.close();\n\n // 2. decode the public key\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encKey);\n PublicKey publicKey = KeyFactory.getInstance(\"DSA\").generatePublic(spec);\n\n // 3. read the signature\n FileInputStream signatureFile = new FileInputStream(\"C:\\\\Demo\\\\signature\");\n byte[] sigByte = new byte[signatureFile.available()];\n signatureFile.read(sigByte);\n signatureFile.close();\n\n // 4. generate the signature\n Signature signature = Signature.getInstance(\"SHA1withDSA\");\n signature.initVerify(publicKey);\n\n // 5. supply the data\n FileInputStream dataFile = new FileInputStream(\"C:\\\\Demo\\\\code\");\n BufferedInputStream dataStream = new BufferedInputStream(dataFile);\n byte[] tmpBuf = new byte[dataStream.available()];\n int len;\n while ((len = dataStream.read(tmpBuf)) >= 0) {\n signature.update(tmpBuf, 0, len);\n }\n dataStream.close();\n\n // 6. verify\n boolean result = signature.verify(sigByte);\n System.out.println(\"Result:\" + result);\n }", "public static void main(String[] args) {\n\n String pfx = \"E:\\\\PDFFileTest\\\\1.pfx\";\n String tmpPath = \"E:\\\\PDFFileTest\\\\1562570792439.pdf\";\n String expPath = \"E:\\\\PDFFileTest\\\\11.11\\\\h83.pdf\";\n String gif = \"E:\\\\PDFFileTest\\\\1.gif\";\n String password = \"111111\";\n try {\n sign(pfx, tmpPath, expPath, gif, password);\n System.out.println(\"success\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "private void generatePkcs1Md5Signature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 16) || (byteRead != 16))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// use the correct key\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t\r\n\t\tif (getSignatureType() == NON_REPUDIATION) {\t\t\r\n\t\t\tcipher.init((RSAPrivateCrtKey)nonRepKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\tif (getSignatureType() == AUTHENTICATION) {\r\n\t\t\tcipher.init((RSAPrivateCrtKey)authKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t\t\r\n\t\t////@ open valid(); // todo\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\t\t\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\t////@ open [1/2]valid();\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_MD5_PKCS1, lc);\r\n\t\t// copy the MD5 hash from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA), messageBuffer, (short) (128 - lc), lc);\r\n\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// generate signature\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as1);\r\n\t\t//@ foreachp_remove(messageBuffer, as1);\r\n\t\t//@ open transient_byte_array(messageBuffer);\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as1);\r\n\r\n\t\t////@ close [1/2]valid(); // auto\r\n\r\n\r\n\t}", "boolean hasSig();", "boolean checkSignature(long sig0, long sig1, long sig2) throws Exception {\n Integer[] sig = new Integer[3];\n\t /* Get signature */\n readSignature(sig);\n\t /* Compare signature */\n if (sig[0] != sig0 || sig[1] != sig1 || sig[2] != sig2) {\n throw new Exception(\"Signature does not match selected device! \");\n }\n return true; // Indicate supported command.\n }", "void setSignatureImage(byte[] signatureImage);", "public boolean signRequired() {\n\t\treturn false;\n\t}", "protected byte[] getSignature() {\n return signatureImpl.calculate(content, null);\n }", "dkk mo4509g();", "SignatureSink createSignatureSink();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public void testDoubleX509SignatureThumb() throws Exception {\n WSSecSignature builder = new WSSecSignature();\n builder.setUserInfo(\"16c73ab6-b892-458f-abf5-2f875f74882e\", \"security\");\n // builder.setUserInfo(\"john\", \"keypass\");\n builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER); \n Document doc = unsignedEnvelope.getAsDocument();\n \n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc);\n\n Document signedDoc = builder.build(doc, crypto, secHeader);\n Document signedDoc1 = builder.build(signedDoc, crypto, secHeader);\n verify(signedDoc1);\n }", "public static byte[] sign(String stringPrivateKey,String plaintext){\r\n\t\ttry {\r\n\t\t\tPKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(stringPrivateKey));\r\n\t\t\tKeyFactory kf = KeyFactory.getInstance(\"EC\");\r\n\t\t\tPrivateKey privateKey= kf.generatePrivate(privateKeySpec);\r\n\t\t\tSignature sig = Signature.getInstance(\"SHA256withECDSA\");\r\n\t\t\tsig.initSign(privateKey);\r\n\t\t\tsig.update(plaintext.getBytes(\"UTF-8\"));\r\n\t\t\tbyte[] signature = sig.sign();\r\n\t\t\tSystem.out.println(\"Bytes:\"+signature.length);\r\n\t\t\treturn signature;\r\n\t\t} catch (InvalidKeyException | SignatureException | UnsupportedEncodingException | NoSuchAlgorithmException | InvalidKeySpecException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static void main(String[] args)\n throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, UnsupportedEncodingException {\n final String text = \"We would like to provide data integrity.\";\n\n /**\n * STEP 1.\n * We create a public-private key pair.\n * Standard Algorithm Names\n * http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html\n */\n final KeyPair key = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n /**\n * Alice creates Signature object defining Signature algorithm.\n */\n final Signature signatureAlg = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We initialize the signature object with\n * - Operation modes (SIGN) and\n * - provides appropriate ***Private*** Key\n */\n signatureAlg.initSign(key.getPrivate());\n\n // Finally, we load the message into the signature object and sign it\n signatureAlg.update(text.getBytes(\"UTF-8\"));\n final byte[] signedText = signatureAlg.sign();\n System.out.println(\"Signature: \" + DatatypeConverter.printHexBinary(signedText));\n\n /**\n * To verify the signature, we create another signature object\n * and specify its algorithm\n */\n final Signature signatureAlg2 = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We have to initialize it with the mode. But to verify the algorithm,\n * we only need the public key of the original signee\n */\n signatureAlg2.initVerify(key.getPublic());\n\n //Finally, we can check whether the signature is valid\n signatureAlg2.update(text.getBytes(\"UTF-8\"));\n\n if (signatureAlg2.verify(signedText))\n System.out.println(\"Valid signature.\");\n else\n System.err.println(\"Invalid signature.\");\n }", "public void affiche3(BigInteger signe){\n System.out.println(\"La signature est :\"+signe);\n }", "com.microsoft.schemas.office.x2006.digsig.STSignatureText xgetSignatureText();" ]
[ "0.73976135", "0.704309", "0.70210266", "0.6921052", "0.6921052", "0.6921052", "0.6833218", "0.68208843", "0.66571474", "0.65837884", "0.6580073", "0.6580073", "0.6549985", "0.65176594", "0.6499652", "0.6490479", "0.64046055", "0.63172966", "0.6307634", "0.6307634", "0.62898576", "0.6273093", "0.6249798", "0.62436706", "0.62151176", "0.6214869", "0.6214243", "0.6184172", "0.6180248", "0.61655164", "0.6113408", "0.61041343", "0.6092459", "0.6082781", "0.6056683", "0.60500777", "0.5998656", "0.59978396", "0.5959772", "0.593669", "0.59344125", "0.5918469", "0.5916969", "0.5910817", "0.58813316", "0.5864352", "0.58635926", "0.58560973", "0.58560973", "0.58557546", "0.5852426", "0.58436865", "0.5841626", "0.58226836", "0.5803321", "0.5799519", "0.5798923", "0.57931036", "0.57903373", "0.57903373", "0.57903373", "0.5785939", "0.57843107", "0.5747793", "0.5738761", "0.57264227", "0.5724643", "0.5718272", "0.5717422", "0.57154185", "0.57154185", "0.5714451", "0.5714451", "0.5710953", "0.5694987", "0.56920105", "0.5681027", "0.56799185", "0.56781644", "0.5672383", "0.56646734", "0.56491727", "0.5647587", "0.5643544", "0.5643239", "0.5640683", "0.56399196", "0.5639839", "0.5630529", "0.5627866", "0.561977", "0.56098723", "0.56039405", "0.5592808", "0.5580254", "0.55797774", "0.5576713", "0.5566575", "0.5559037", "0.5537511", "0.55128556" ]
0.0
-1
pkidependent signature optional bytes signature = 5;
@java.lang.Override public com.google.protobuf.ByteString getSignature() { return signature_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract byte[] getSignature();", "com.google.protobuf.ByteString getSignature();", "int getSignature ();", "String getSignature();", "String getSignature();", "String getSignature();", "BigInteger getDigitalSignature();", "public abstract String getSignature();", "SignatureIdentification createSignatureIdentification();", "org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder();", "com.google.protobuf.ByteString\n getSignatureBytes();", "com.google.protobuf.ByteString\n getSignatureBytes();", "Signature getSignature();", "org.apache.calcite.avatica.proto.Common.Signature getSignature();", "byte[] getSignatureImage();", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }", "public GpgSignature(@NonNull byte[] signature) {\n\t\tthis.signature = signature;\n\t}", "byte[] generateSignature(byte[] message, PrivateKey privateKey, SecureRandom secureRandom) throws IOException;", "boolean hasSignature();", "boolean hasSignature();", "public byte[] getSigAlgParams() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[]\");\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "native String nativeGetSignature(long nativeHandler) throws RuntimeException;", "com.google.protobuf.ByteString getSig();", "SignatureSpi(com.android.org.bouncycastle.crypto.Digest r1, com.android.org.bouncycastle.crypto.DSA r2, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void\");\n }", "private void setSignature(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000010;\n signature_ = value;\n }", "String getUniqueSignature();", "public void setSignature( String pSignature )\r\n {\r\n this.signature = pSignature;\r\n }", "public byte []\ngetSignature() {\n\treturn signature;\n}", "int getSignatureType();", "@Override\n public String buildSignature(RequestDataToSign requestDataToSign, String appKey) {\n // find private key for this app\n final String secretKey = keyStore.getPrivateKey(appKey);\n if (secretKey == null) {\n LOG.error(\"Unknown application key: {}\", appKey);\n throw new PrivateKeyNotFoundException();\n }\n\n // sign\n return super.buildSignature(requestDataToSign, secretKey);\n }", "java.lang.String getSignatureText();", "public boolean verifySignature() {\r\n\t\t\r\n\t\tString data;\r\n\t\t\r\n\t\tif(isTypeCreation){\r\n\t\t\t\r\n\t\t\tdata = StringUtil.getStringFromKey(creator) + name +\r\n\t\t\t\t\tdescription + begin + end+end_subscription+\r\n\t\t\t\t\tlocation+min_capacity+max_capacity;\r\n\t\t\treturn StringUtil.verifyECDSASig(creator, data, signature);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata = StringUtil.getStringFromKey(subscriber)+id_event;\r\n\t\t\treturn StringUtil.verifyECDSASig(subscriber, data, signature);\r\n\t\t}\r\n//\t\tSystem.out.println(\"signature \"+signature);\r\n\t\t\r\n\t}", "public static native String getSignature(long[] msgArgs);", "@Override\n public boolean verifySignature(byte[] signature) {\n try {\n Element[] sig = derDecode(signature);\n CL04SignPublicPairingKeySerParameter pk = (CL04SignPublicPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(pairingKeySerParameter.getParameters());\n Element a = sig[0];\n Element b = sig[1];\n Element c = sig[2];\n List<Element> A = IntStream.range(3, 3 + messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n List<Element> B = IntStream.range(3 + messages.size(), 3 + 2 * messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n return aFormedCorrectly(pairing, a, A, pk) && bFormedCorrectly(pairing, a, b, A, B, pk) && cFormedCorrectly(pairing, a, b, c, B, pk);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return false;\n\n }", "public String getSignature()\r\n {\r\n return signature;\r\n }", "public boolean isSignatureRequired() {\n\t\treturn false;\n\t}", "boolean verifySignature(byte[] message, byte[] signature, PublicKey publicKey) throws IOException;", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public interface SignatureObject {\n}", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "com.google.protobuf.ByteString getArtifactSignature();", "public Signer getPDFSigner();", "public abstract String getSigAlgOID();", "public static void main(String[] args) {\n\n\t\tif (args.length != 5) {\n\t\t System.out.println(\"Usage: GenSig nameOfFileToSign keystore password sign publicKey\");\n\n\t\t }\n\t\telse try{\n\n\t\t KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t ks.load(new FileInputStream(args[1]), args[2].toCharArray());\n\t\t \n\t\t String alias = (String)ks.aliases().nextElement();\n\t\t PrivateKey privateKey = (PrivateKey) ks.getKey(alias, args[2].toCharArray());\n\n\t\t Certificate cert = ks.getCertificate(alias);\n\n\t\t // Get public key\t\n\t\t PublicKey publicKey = cert.getPublicKey();\n\n\t\t /* Create a Signature object and initialize it with the private key */\n\n\t\t Signature rsa = Signature.getInstance(\"SHA256withRSA\");\t\n\t\n\n\t\t rsa.initSign(privateKey);\n\n\t\t /* Update and sign the data */\n\n \t String hexString = readFile(args[0]).trim();\n\t\t byte[] decodedBytes = DatatypeConverter.parseHexBinary(hexString);\t\n\t\t InputStream bufin = new ByteArrayInputStream(decodedBytes);\n\n\n\t\t byte[] buffer = new byte[1024];\n\t\t int len;\n\t\t while (bufin.available() != 0) {\n\t\t\tlen = bufin.read(buffer);\n\t\t\trsa.update(buffer, 0, len);\n\t\t };\n\n\t\t bufin.close();\n\n\t\t /* Now that all the data to be signed has been read in, \n\t\t\t generate a signature for it */\n\n\t\t byte[] realSig = rsa.sign();\n\n\t\t \n\t\t /* Save the signature in a file */\n\n\t\t File file = new File(args[3]);\n\t\t PrintWriter out = new PrintWriter(file);\n\n\t\t\t// if file doesn't exists, then create it\n\t\t\tif (!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\n\t\t out.println(DatatypeConverter.printBase64Binary(realSig));\n\t\t out.close();\n\n\n\t\t /* Save the public key in a file */\n\t\t byte[] key = publicKey.getEncoded();\n\t\t FileOutputStream keyfos = new FileOutputStream(args[4]);\n\t\t keyfos.write(key);\n\n\t\t keyfos.close();\n\n\t\t} catch (Exception e) {\n\t\t System.err.println(\"Caught exception \" + e.toString());\n\t\t}\n\n\t}", "com.microsoft.schemas.office.x2006.digsig.STSignatureType xgetSignatureType();", "int getSignatureProviderDetails();", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "SignatureSource createSignatureSource();", "public byte[] getSignature()\n {\n return Arrays.clone(signature);\n }", "public Signator.Signers getUsedPDFSignerLibrary();", "String componentSignature();", "void setSignature(String signature) {\n this.signature = signature;\n }", "org.apache.xmlbeans.XmlBase64Binary xgetSignatureImage();", "public io.lightcone.data.types.EdDSASignatureOrBuilder getSigOrBuilder() {\n return getSig();\n }", "BlsPoint sign(BigInteger privateKey, byte[] data);", "public interface SignatureFactory \n{\n /** \n * initializes the implementation class \n */\n public void init()\n throws SignedDocException;\n \n /**\n * Method returns an array of strings representing the \n * list of available token names.\n * @return an array of available token names.\n * @throws SignedDocException if reading the token information fails.\n */\n public String[] getAvailableTokenNames()\n throws SignedDocException;\n \n /**\n * Method returns a digital signature. It finds the RSA private \n * key object from the active token and\n * then signs the given data with this key and RSA mechanism.\n * @param digest digest of the data to be signed.\n * @param token token index\n * @param pin users pin code\n * @return an array of bytes containing digital signature.\n * @throws SignedDocException if signing the data fails.\n */\n public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;\n \n /**\n * Method returns a X.509 certificate object readed \n * from the active token and representing an\n * user public key certificate value.\n * @return X.509 certificate object.\n * @throws SignedDocException if getting X.509 public key certificate \n * fails or the requested certificate type X.509 is not available in \n * the default provider package\n */\n public X509Certificate getCertificate(int token, String pin)\n throws SignedDocException;\n \n /**\n * Resets the previous session\n * and other selected values\n */\n public void reset() \n throws SignedDocException;\n \n\t/**\n\t * Method decrypts the data with the RSA private key\n\t * corresponding to this certificate (which was used\n\t * to encrypt it). Decryption will be done on the card.\n\t * This operation closes the possibly opened previous\n\t * session with signature token and opens a new one with\n\t * authentication token if necessary\n\t * @param data data to be decrypted.\n\t * @param token index of authentication token\n\t * @param pin PIN code\n\t * @return decrypted data.\n\t * @throws SignedDocException for all decryption errors\n\t */\n\tpublic byte[] decrypt(byte[] data, int token, String pin) \n\t\tthrows SignedDocException;\n\t\t\t\t\n}", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public byte[] signData(String fitxer, PrivateKey priv) {\n byte[] signature = null;\n FileInputStream datafis;\n BufferedInputStream bufin = null;\n byte[] buffer = new byte[1024];\n int len;\n \n try {\n Signature signer = Signature.getInstance(\"SHA256withRSA\");\n signer.initSign(priv); //Inicialitzem la firma digital a partirde l’algorisme utilitzat\n \n datafis = new FileInputStream(fitxer);\n bufin = new BufferedInputStream(datafis);\n \n while (bufin.available() != 0) {\n len = bufin.read(buffer);\n signer.update(buffer, 0, len);//Li assignem a l’objecte firma les dades afirmar digitalment\n } \n\n bufin.close();\n signature = signer.sign();//Finalment generem la firma\n } catch (Exception ex) {\n System.err.println(\"Error signant les dades: \" + ex);\n }\n return signature;\n }", "private byte getSignatureType() \r\n \t //@ requires [?f]signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures [f]signatureType |-> theSignatureType &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\treturn signatureType[0];\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public\nSIGRecord(Name name, int dclass, long ttl, int covered, int alg, int origttl,\n\t Date expire, Date timeSigned, int footprint, Name signer,\n\t byte [] signature)\n{\n\tthis(name, dclass, ttl);\n\tType.check(covered);\n\tcheckU8(\"alg\", alg);\n\tcheckU8(\"labels\", labels);\n\tTTL.check(origttl);\n\tcheckU16(\"footprint\", footprint);\n\tthis.covered = covered;\n\tthis.alg = alg;\n\tthis.labels = name.labels();\n\tthis.origttl = origttl;\n\tthis.expire = expire;\n\tthis.timeSigned = timeSigned;\n\tthis.footprint = footprint;\n\tif (!signer.isAbsolute())\n\t\tthrow new RelativeNameException(signer);\n\tthis.signer = signer;\n\tthis.signature = signature;\n}", "ReleaseFile parseWithSignature( InputStream is, InputStream signStream, InputStream keyStream ) throws IOException;", "public void setSignature(String signature) {\n\t\tthis.signature = signature;\n\t}", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "ISModifySignature createISModifySignature();", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;", "boolean readSignature(Integer[] sig) {\n Scales.sendByte((byte) 's');\n\t /* Get actual signature */\n sig[2] = Scales.getByte();\n sig[1] = Scales.getByte();\n sig[0] = Scales.getByte();\n return true;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n if (signatureBuilder_ != null) {\n return signatureBuilder_.getMessageOrBuilder();\n } else {\n return signature_ == null ?\n org.apache.calcite.avatica.proto.Common.Signature.getDefaultInstance() : signature_;\n }\n }", "private void validateFermatPacketSignature(FermatPacket fermatPacketReceive){\n\n System.out.println(\" WsCommunicationVPNClient - validateFermatPacketSignature\");\n\n /*\n * Validate the signature\n */\n boolean isValid = AsymmectricCryptography.verifyMessageSignature(fermatPacketReceive.getSignature(), fermatPacketReceive.getMessageContent(), vpnServerIdentity);\n\n System.out.println(\" WsCommunicationVPNClient - isValid = \" + isValid);\n\n /*\n * if not valid signature\n */\n if (!isValid){\n throw new RuntimeException(\"Fermat Packet received has not a valid signature, go to close this connection maybe is compromise\");\n }\n\n }", "public String getSignature() {\n\t\treturn signature;\n\t}", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "public static byte[] SignWithPrivateKey(byte[] buf,PrivateKey pkey) throws Exception{\r\n\t\tSecureRandom secureRandom = new SecureRandom();\r\n\t\tSignature signature = Signature.getInstance(\"SHA1WithECDSA\");\r\n\t\tsignature.initSign(pkey,secureRandom);\r\n\t\tsignature.update(buf);\r\n\t\tbyte[] digitalSignature = signature.sign();\r\n\t\treturn digitalSignature;\r\n\t\t\r\n\t}", "public void setSignature(String Signature) {\n this.Signature = Signature;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n return getSignature();\n }", "public ISignature getSignature() {\n return _signature;\n }", "public String getSignature() {\n return this.Signature;\n }", "@SuppressWarnings(\"all\")\n public static void main(String...args) throws Exception {\n FileInputStream pubKFile = new FileInputStream(\"C:\\\\Demo\\\\publicKey\");\n byte[] encKey = new byte[pubKFile.available()];\n pubKFile.read(encKey);\n pubKFile.close();\n\n // 2. decode the public key\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encKey);\n PublicKey publicKey = KeyFactory.getInstance(\"DSA\").generatePublic(spec);\n\n // 3. read the signature\n FileInputStream signatureFile = new FileInputStream(\"C:\\\\Demo\\\\signature\");\n byte[] sigByte = new byte[signatureFile.available()];\n signatureFile.read(sigByte);\n signatureFile.close();\n\n // 4. generate the signature\n Signature signature = Signature.getInstance(\"SHA1withDSA\");\n signature.initVerify(publicKey);\n\n // 5. supply the data\n FileInputStream dataFile = new FileInputStream(\"C:\\\\Demo\\\\code\");\n BufferedInputStream dataStream = new BufferedInputStream(dataFile);\n byte[] tmpBuf = new byte[dataStream.available()];\n int len;\n while ((len = dataStream.read(tmpBuf)) >= 0) {\n signature.update(tmpBuf, 0, len);\n }\n dataStream.close();\n\n // 6. verify\n boolean result = signature.verify(sigByte);\n System.out.println(\"Result:\" + result);\n }", "public static void main(String[] args) {\n\n String pfx = \"E:\\\\PDFFileTest\\\\1.pfx\";\n String tmpPath = \"E:\\\\PDFFileTest\\\\1562570792439.pdf\";\n String expPath = \"E:\\\\PDFFileTest\\\\11.11\\\\h83.pdf\";\n String gif = \"E:\\\\PDFFileTest\\\\1.gif\";\n String password = \"111111\";\n try {\n sign(pfx, tmpPath, expPath, gif, password);\n System.out.println(\"success\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "private void generatePkcs1Md5Signature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 16) || (byteRead != 16))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// use the correct key\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t\r\n\t\tif (getSignatureType() == NON_REPUDIATION) {\t\t\r\n\t\t\tcipher.init((RSAPrivateCrtKey)nonRepKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\tif (getSignatureType() == AUTHENTICATION) {\r\n\t\t\tcipher.init((RSAPrivateCrtKey)authKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t\t\r\n\t\t////@ open valid(); // todo\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\t\t\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\t////@ open [1/2]valid();\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_MD5_PKCS1, lc);\r\n\t\t// copy the MD5 hash from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA), messageBuffer, (short) (128 - lc), lc);\r\n\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// generate signature\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as1);\r\n\t\t//@ foreachp_remove(messageBuffer, as1);\r\n\t\t//@ open transient_byte_array(messageBuffer);\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as1);\r\n\r\n\t\t////@ close [1/2]valid(); // auto\r\n\r\n\r\n\t}", "boolean hasSig();", "boolean checkSignature(long sig0, long sig1, long sig2) throws Exception {\n Integer[] sig = new Integer[3];\n\t /* Get signature */\n readSignature(sig);\n\t /* Compare signature */\n if (sig[0] != sig0 || sig[1] != sig1 || sig[2] != sig2) {\n throw new Exception(\"Signature does not match selected device! \");\n }\n return true; // Indicate supported command.\n }", "void setSignatureImage(byte[] signatureImage);", "public boolean signRequired() {\n\t\treturn false;\n\t}", "protected byte[] getSignature() {\n return signatureImpl.calculate(content, null);\n }", "dkk mo4509g();", "SignatureSink createSignatureSink();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public void testDoubleX509SignatureThumb() throws Exception {\n WSSecSignature builder = new WSSecSignature();\n builder.setUserInfo(\"16c73ab6-b892-458f-abf5-2f875f74882e\", \"security\");\n // builder.setUserInfo(\"john\", \"keypass\");\n builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER); \n Document doc = unsignedEnvelope.getAsDocument();\n \n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc);\n\n Document signedDoc = builder.build(doc, crypto, secHeader);\n Document signedDoc1 = builder.build(signedDoc, crypto, secHeader);\n verify(signedDoc1);\n }", "public static byte[] sign(String stringPrivateKey,String plaintext){\r\n\t\ttry {\r\n\t\t\tPKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(stringPrivateKey));\r\n\t\t\tKeyFactory kf = KeyFactory.getInstance(\"EC\");\r\n\t\t\tPrivateKey privateKey= kf.generatePrivate(privateKeySpec);\r\n\t\t\tSignature sig = Signature.getInstance(\"SHA256withECDSA\");\r\n\t\t\tsig.initSign(privateKey);\r\n\t\t\tsig.update(plaintext.getBytes(\"UTF-8\"));\r\n\t\t\tbyte[] signature = sig.sign();\r\n\t\t\tSystem.out.println(\"Bytes:\"+signature.length);\r\n\t\t\treturn signature;\r\n\t\t} catch (InvalidKeyException | SignatureException | UnsupportedEncodingException | NoSuchAlgorithmException | InvalidKeySpecException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static void main(String[] args)\n throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, UnsupportedEncodingException {\n final String text = \"We would like to provide data integrity.\";\n\n /**\n * STEP 1.\n * We create a public-private key pair.\n * Standard Algorithm Names\n * http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html\n */\n final KeyPair key = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n /**\n * Alice creates Signature object defining Signature algorithm.\n */\n final Signature signatureAlg = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We initialize the signature object with\n * - Operation modes (SIGN) and\n * - provides appropriate ***Private*** Key\n */\n signatureAlg.initSign(key.getPrivate());\n\n // Finally, we load the message into the signature object and sign it\n signatureAlg.update(text.getBytes(\"UTF-8\"));\n final byte[] signedText = signatureAlg.sign();\n System.out.println(\"Signature: \" + DatatypeConverter.printHexBinary(signedText));\n\n /**\n * To verify the signature, we create another signature object\n * and specify its algorithm\n */\n final Signature signatureAlg2 = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We have to initialize it with the mode. But to verify the algorithm,\n * we only need the public key of the original signee\n */\n signatureAlg2.initVerify(key.getPublic());\n\n //Finally, we can check whether the signature is valid\n signatureAlg2.update(text.getBytes(\"UTF-8\"));\n\n if (signatureAlg2.verify(signedText))\n System.out.println(\"Valid signature.\");\n else\n System.err.println(\"Invalid signature.\");\n }", "public void affiche3(BigInteger signe){\n System.out.println(\"La signature est :\"+signe);\n }", "com.microsoft.schemas.office.x2006.digsig.STSignatureText xgetSignatureText();" ]
[ "0.73976135", "0.704309", "0.70210266", "0.6921052", "0.6921052", "0.6921052", "0.6833218", "0.68208843", "0.66571474", "0.65837884", "0.6580073", "0.6580073", "0.6549985", "0.65176594", "0.6499652", "0.6490479", "0.64046055", "0.63172966", "0.6307634", "0.6307634", "0.62898576", "0.6273093", "0.6249798", "0.62436706", "0.62151176", "0.6214869", "0.6214243", "0.6184172", "0.6180248", "0.61655164", "0.6113408", "0.61041343", "0.6092459", "0.6082781", "0.6056683", "0.60500777", "0.5998656", "0.59978396", "0.5959772", "0.593669", "0.59344125", "0.5918469", "0.5916969", "0.5910817", "0.58813316", "0.5864352", "0.58635926", "0.58560973", "0.58560973", "0.58557546", "0.5852426", "0.58436865", "0.5841626", "0.58226836", "0.5803321", "0.5799519", "0.5798923", "0.57931036", "0.57903373", "0.57903373", "0.57903373", "0.5785939", "0.57843107", "0.5747793", "0.5738761", "0.57264227", "0.5724643", "0.5718272", "0.5717422", "0.57154185", "0.57154185", "0.5714451", "0.5714451", "0.5710953", "0.5694987", "0.56920105", "0.5681027", "0.56799185", "0.56781644", "0.5672383", "0.56646734", "0.56491727", "0.5647587", "0.5643544", "0.5643239", "0.5640683", "0.56399196", "0.5639839", "0.5630529", "0.5627866", "0.561977", "0.56098723", "0.56039405", "0.5592808", "0.5580254", "0.55797774", "0.5576713", "0.5566575", "0.5559037", "0.5537511", "0.55128556" ]
0.0
-1
pkidependent signature optional bytes signature = 5;
private void setSignature(com.google.protobuf.ByteString value) { java.lang.Class<?> valueClass = value.getClass(); bitField0_ |= 0x00000010; signature_ = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract byte[] getSignature();", "com.google.protobuf.ByteString getSignature();", "int getSignature ();", "String getSignature();", "String getSignature();", "String getSignature();", "BigInteger getDigitalSignature();", "public abstract String getSignature();", "SignatureIdentification createSignatureIdentification();", "org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder();", "com.google.protobuf.ByteString\n getSignatureBytes();", "com.google.protobuf.ByteString\n getSignatureBytes();", "Signature getSignature();", "org.apache.calcite.avatica.proto.Common.Signature getSignature();", "byte[] getSignatureImage();", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }", "public GpgSignature(@NonNull byte[] signature) {\n\t\tthis.signature = signature;\n\t}", "byte[] generateSignature(byte[] message, PrivateKey privateKey, SecureRandom secureRandom) throws IOException;", "boolean hasSignature();", "boolean hasSignature();", "public byte[] getSigAlgParams() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[]\");\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "native String nativeGetSignature(long nativeHandler) throws RuntimeException;", "com.google.protobuf.ByteString getSig();", "SignatureSpi(com.android.org.bouncycastle.crypto.Digest r1, com.android.org.bouncycastle.crypto.DSA r2, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void\");\n }", "String getUniqueSignature();", "public void setSignature( String pSignature )\r\n {\r\n this.signature = pSignature;\r\n }", "public byte []\ngetSignature() {\n\treturn signature;\n}", "int getSignatureType();", "@Override\n public String buildSignature(RequestDataToSign requestDataToSign, String appKey) {\n // find private key for this app\n final String secretKey = keyStore.getPrivateKey(appKey);\n if (secretKey == null) {\n LOG.error(\"Unknown application key: {}\", appKey);\n throw new PrivateKeyNotFoundException();\n }\n\n // sign\n return super.buildSignature(requestDataToSign, secretKey);\n }", "java.lang.String getSignatureText();", "public boolean verifySignature() {\r\n\t\t\r\n\t\tString data;\r\n\t\t\r\n\t\tif(isTypeCreation){\r\n\t\t\t\r\n\t\t\tdata = StringUtil.getStringFromKey(creator) + name +\r\n\t\t\t\t\tdescription + begin + end+end_subscription+\r\n\t\t\t\t\tlocation+min_capacity+max_capacity;\r\n\t\t\treturn StringUtil.verifyECDSASig(creator, data, signature);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata = StringUtil.getStringFromKey(subscriber)+id_event;\r\n\t\t\treturn StringUtil.verifyECDSASig(subscriber, data, signature);\r\n\t\t}\r\n//\t\tSystem.out.println(\"signature \"+signature);\r\n\t\t\r\n\t}", "public static native String getSignature(long[] msgArgs);", "@Override\n public boolean verifySignature(byte[] signature) {\n try {\n Element[] sig = derDecode(signature);\n CL04SignPublicPairingKeySerParameter pk = (CL04SignPublicPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(pairingKeySerParameter.getParameters());\n Element a = sig[0];\n Element b = sig[1];\n Element c = sig[2];\n List<Element> A = IntStream.range(3, 3 + messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n List<Element> B = IntStream.range(3 + messages.size(), 3 + 2 * messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n return aFormedCorrectly(pairing, a, A, pk) && bFormedCorrectly(pairing, a, b, A, B, pk) && cFormedCorrectly(pairing, a, b, c, B, pk);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return false;\n\n }", "public String getSignature()\r\n {\r\n return signature;\r\n }", "public boolean isSignatureRequired() {\n\t\treturn false;\n\t}", "boolean verifySignature(byte[] message, byte[] signature, PublicKey publicKey) throws IOException;", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public interface SignatureObject {\n}", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "com.google.protobuf.ByteString getArtifactSignature();", "public Signer getPDFSigner();", "public abstract String getSigAlgOID();", "public static void main(String[] args) {\n\n\t\tif (args.length != 5) {\n\t\t System.out.println(\"Usage: GenSig nameOfFileToSign keystore password sign publicKey\");\n\n\t\t }\n\t\telse try{\n\n\t\t KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t ks.load(new FileInputStream(args[1]), args[2].toCharArray());\n\t\t \n\t\t String alias = (String)ks.aliases().nextElement();\n\t\t PrivateKey privateKey = (PrivateKey) ks.getKey(alias, args[2].toCharArray());\n\n\t\t Certificate cert = ks.getCertificate(alias);\n\n\t\t // Get public key\t\n\t\t PublicKey publicKey = cert.getPublicKey();\n\n\t\t /* Create a Signature object and initialize it with the private key */\n\n\t\t Signature rsa = Signature.getInstance(\"SHA256withRSA\");\t\n\t\n\n\t\t rsa.initSign(privateKey);\n\n\t\t /* Update and sign the data */\n\n \t String hexString = readFile(args[0]).trim();\n\t\t byte[] decodedBytes = DatatypeConverter.parseHexBinary(hexString);\t\n\t\t InputStream bufin = new ByteArrayInputStream(decodedBytes);\n\n\n\t\t byte[] buffer = new byte[1024];\n\t\t int len;\n\t\t while (bufin.available() != 0) {\n\t\t\tlen = bufin.read(buffer);\n\t\t\trsa.update(buffer, 0, len);\n\t\t };\n\n\t\t bufin.close();\n\n\t\t /* Now that all the data to be signed has been read in, \n\t\t\t generate a signature for it */\n\n\t\t byte[] realSig = rsa.sign();\n\n\t\t \n\t\t /* Save the signature in a file */\n\n\t\t File file = new File(args[3]);\n\t\t PrintWriter out = new PrintWriter(file);\n\n\t\t\t// if file doesn't exists, then create it\n\t\t\tif (!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\n\t\t out.println(DatatypeConverter.printBase64Binary(realSig));\n\t\t out.close();\n\n\n\t\t /* Save the public key in a file */\n\t\t byte[] key = publicKey.getEncoded();\n\t\t FileOutputStream keyfos = new FileOutputStream(args[4]);\n\t\t keyfos.write(key);\n\n\t\t keyfos.close();\n\n\t\t} catch (Exception e) {\n\t\t System.err.println(\"Caught exception \" + e.toString());\n\t\t}\n\n\t}", "com.microsoft.schemas.office.x2006.digsig.STSignatureType xgetSignatureType();", "int getSignatureProviderDetails();", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "SignatureSource createSignatureSource();", "public byte[] getSignature()\n {\n return Arrays.clone(signature);\n }", "public Signator.Signers getUsedPDFSignerLibrary();", "String componentSignature();", "void setSignature(String signature) {\n this.signature = signature;\n }", "org.apache.xmlbeans.XmlBase64Binary xgetSignatureImage();", "public io.lightcone.data.types.EdDSASignatureOrBuilder getSigOrBuilder() {\n return getSig();\n }", "BlsPoint sign(BigInteger privateKey, byte[] data);", "public interface SignatureFactory \n{\n /** \n * initializes the implementation class \n */\n public void init()\n throws SignedDocException;\n \n /**\n * Method returns an array of strings representing the \n * list of available token names.\n * @return an array of available token names.\n * @throws SignedDocException if reading the token information fails.\n */\n public String[] getAvailableTokenNames()\n throws SignedDocException;\n \n /**\n * Method returns a digital signature. It finds the RSA private \n * key object from the active token and\n * then signs the given data with this key and RSA mechanism.\n * @param digest digest of the data to be signed.\n * @param token token index\n * @param pin users pin code\n * @return an array of bytes containing digital signature.\n * @throws SignedDocException if signing the data fails.\n */\n public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;\n \n /**\n * Method returns a X.509 certificate object readed \n * from the active token and representing an\n * user public key certificate value.\n * @return X.509 certificate object.\n * @throws SignedDocException if getting X.509 public key certificate \n * fails or the requested certificate type X.509 is not available in \n * the default provider package\n */\n public X509Certificate getCertificate(int token, String pin)\n throws SignedDocException;\n \n /**\n * Resets the previous session\n * and other selected values\n */\n public void reset() \n throws SignedDocException;\n \n\t/**\n\t * Method decrypts the data with the RSA private key\n\t * corresponding to this certificate (which was used\n\t * to encrypt it). Decryption will be done on the card.\n\t * This operation closes the possibly opened previous\n\t * session with signature token and opens a new one with\n\t * authentication token if necessary\n\t * @param data data to be decrypted.\n\t * @param token index of authentication token\n\t * @param pin PIN code\n\t * @return decrypted data.\n\t * @throws SignedDocException for all decryption errors\n\t */\n\tpublic byte[] decrypt(byte[] data, int token, String pin) \n\t\tthrows SignedDocException;\n\t\t\t\t\n}", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public byte[] signData(String fitxer, PrivateKey priv) {\n byte[] signature = null;\n FileInputStream datafis;\n BufferedInputStream bufin = null;\n byte[] buffer = new byte[1024];\n int len;\n \n try {\n Signature signer = Signature.getInstance(\"SHA256withRSA\");\n signer.initSign(priv); //Inicialitzem la firma digital a partirde l’algorisme utilitzat\n \n datafis = new FileInputStream(fitxer);\n bufin = new BufferedInputStream(datafis);\n \n while (bufin.available() != 0) {\n len = bufin.read(buffer);\n signer.update(buffer, 0, len);//Li assignem a l’objecte firma les dades afirmar digitalment\n } \n\n bufin.close();\n signature = signer.sign();//Finalment generem la firma\n } catch (Exception ex) {\n System.err.println(\"Error signant les dades: \" + ex);\n }\n return signature;\n }", "private byte getSignatureType() \r\n \t //@ requires [?f]signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures [f]signatureType |-> theSignatureType &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\treturn signatureType[0];\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public\nSIGRecord(Name name, int dclass, long ttl, int covered, int alg, int origttl,\n\t Date expire, Date timeSigned, int footprint, Name signer,\n\t byte [] signature)\n{\n\tthis(name, dclass, ttl);\n\tType.check(covered);\n\tcheckU8(\"alg\", alg);\n\tcheckU8(\"labels\", labels);\n\tTTL.check(origttl);\n\tcheckU16(\"footprint\", footprint);\n\tthis.covered = covered;\n\tthis.alg = alg;\n\tthis.labels = name.labels();\n\tthis.origttl = origttl;\n\tthis.expire = expire;\n\tthis.timeSigned = timeSigned;\n\tthis.footprint = footprint;\n\tif (!signer.isAbsolute())\n\t\tthrow new RelativeNameException(signer);\n\tthis.signer = signer;\n\tthis.signature = signature;\n}", "ReleaseFile parseWithSignature( InputStream is, InputStream signStream, InputStream keyStream ) throws IOException;", "public void setSignature(String signature) {\n\t\tthis.signature = signature;\n\t}", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "ISModifySignature createISModifySignature();", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;", "boolean readSignature(Integer[] sig) {\n Scales.sendByte((byte) 's');\n\t /* Get actual signature */\n sig[2] = Scales.getByte();\n sig[1] = Scales.getByte();\n sig[0] = Scales.getByte();\n return true;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n if (signatureBuilder_ != null) {\n return signatureBuilder_.getMessageOrBuilder();\n } else {\n return signature_ == null ?\n org.apache.calcite.avatica.proto.Common.Signature.getDefaultInstance() : signature_;\n }\n }", "private void validateFermatPacketSignature(FermatPacket fermatPacketReceive){\n\n System.out.println(\" WsCommunicationVPNClient - validateFermatPacketSignature\");\n\n /*\n * Validate the signature\n */\n boolean isValid = AsymmectricCryptography.verifyMessageSignature(fermatPacketReceive.getSignature(), fermatPacketReceive.getMessageContent(), vpnServerIdentity);\n\n System.out.println(\" WsCommunicationVPNClient - isValid = \" + isValid);\n\n /*\n * if not valid signature\n */\n if (!isValid){\n throw new RuntimeException(\"Fermat Packet received has not a valid signature, go to close this connection maybe is compromise\");\n }\n\n }", "public String getSignature() {\n\t\treturn signature;\n\t}", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "public static byte[] SignWithPrivateKey(byte[] buf,PrivateKey pkey) throws Exception{\r\n\t\tSecureRandom secureRandom = new SecureRandom();\r\n\t\tSignature signature = Signature.getInstance(\"SHA1WithECDSA\");\r\n\t\tsignature.initSign(pkey,secureRandom);\r\n\t\tsignature.update(buf);\r\n\t\tbyte[] digitalSignature = signature.sign();\r\n\t\treturn digitalSignature;\r\n\t\t\r\n\t}", "public void setSignature(String Signature) {\n this.Signature = Signature;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n return getSignature();\n }", "public ISignature getSignature() {\n return _signature;\n }", "public String getSignature() {\n return this.Signature;\n }", "@SuppressWarnings(\"all\")\n public static void main(String...args) throws Exception {\n FileInputStream pubKFile = new FileInputStream(\"C:\\\\Demo\\\\publicKey\");\n byte[] encKey = new byte[pubKFile.available()];\n pubKFile.read(encKey);\n pubKFile.close();\n\n // 2. decode the public key\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encKey);\n PublicKey publicKey = KeyFactory.getInstance(\"DSA\").generatePublic(spec);\n\n // 3. read the signature\n FileInputStream signatureFile = new FileInputStream(\"C:\\\\Demo\\\\signature\");\n byte[] sigByte = new byte[signatureFile.available()];\n signatureFile.read(sigByte);\n signatureFile.close();\n\n // 4. generate the signature\n Signature signature = Signature.getInstance(\"SHA1withDSA\");\n signature.initVerify(publicKey);\n\n // 5. supply the data\n FileInputStream dataFile = new FileInputStream(\"C:\\\\Demo\\\\code\");\n BufferedInputStream dataStream = new BufferedInputStream(dataFile);\n byte[] tmpBuf = new byte[dataStream.available()];\n int len;\n while ((len = dataStream.read(tmpBuf)) >= 0) {\n signature.update(tmpBuf, 0, len);\n }\n dataStream.close();\n\n // 6. verify\n boolean result = signature.verify(sigByte);\n System.out.println(\"Result:\" + result);\n }", "public static void main(String[] args) {\n\n String pfx = \"E:\\\\PDFFileTest\\\\1.pfx\";\n String tmpPath = \"E:\\\\PDFFileTest\\\\1562570792439.pdf\";\n String expPath = \"E:\\\\PDFFileTest\\\\11.11\\\\h83.pdf\";\n String gif = \"E:\\\\PDFFileTest\\\\1.gif\";\n String password = \"111111\";\n try {\n sign(pfx, tmpPath, expPath, gif, password);\n System.out.println(\"success\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "private void generatePkcs1Md5Signature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 16) || (byteRead != 16))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// use the correct key\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t\r\n\t\tif (getSignatureType() == NON_REPUDIATION) {\t\t\r\n\t\t\tcipher.init((RSAPrivateCrtKey)nonRepKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\tif (getSignatureType() == AUTHENTICATION) {\r\n\t\t\tcipher.init((RSAPrivateCrtKey)authKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t\t\r\n\t\t////@ open valid(); // todo\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\t\t\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\t////@ open [1/2]valid();\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_MD5_PKCS1, lc);\r\n\t\t// copy the MD5 hash from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA), messageBuffer, (short) (128 - lc), lc);\r\n\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// generate signature\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as1);\r\n\t\t//@ foreachp_remove(messageBuffer, as1);\r\n\t\t//@ open transient_byte_array(messageBuffer);\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as1);\r\n\r\n\t\t////@ close [1/2]valid(); // auto\r\n\r\n\r\n\t}", "boolean hasSig();", "boolean checkSignature(long sig0, long sig1, long sig2) throws Exception {\n Integer[] sig = new Integer[3];\n\t /* Get signature */\n readSignature(sig);\n\t /* Compare signature */\n if (sig[0] != sig0 || sig[1] != sig1 || sig[2] != sig2) {\n throw new Exception(\"Signature does not match selected device! \");\n }\n return true; // Indicate supported command.\n }", "void setSignatureImage(byte[] signatureImage);", "public boolean signRequired() {\n\t\treturn false;\n\t}", "protected byte[] getSignature() {\n return signatureImpl.calculate(content, null);\n }", "dkk mo4509g();", "SignatureSink createSignatureSink();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public void testDoubleX509SignatureThumb() throws Exception {\n WSSecSignature builder = new WSSecSignature();\n builder.setUserInfo(\"16c73ab6-b892-458f-abf5-2f875f74882e\", \"security\");\n // builder.setUserInfo(\"john\", \"keypass\");\n builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER); \n Document doc = unsignedEnvelope.getAsDocument();\n \n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc);\n\n Document signedDoc = builder.build(doc, crypto, secHeader);\n Document signedDoc1 = builder.build(signedDoc, crypto, secHeader);\n verify(signedDoc1);\n }", "public static byte[] sign(String stringPrivateKey,String plaintext){\r\n\t\ttry {\r\n\t\t\tPKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(stringPrivateKey));\r\n\t\t\tKeyFactory kf = KeyFactory.getInstance(\"EC\");\r\n\t\t\tPrivateKey privateKey= kf.generatePrivate(privateKeySpec);\r\n\t\t\tSignature sig = Signature.getInstance(\"SHA256withECDSA\");\r\n\t\t\tsig.initSign(privateKey);\r\n\t\t\tsig.update(plaintext.getBytes(\"UTF-8\"));\r\n\t\t\tbyte[] signature = sig.sign();\r\n\t\t\tSystem.out.println(\"Bytes:\"+signature.length);\r\n\t\t\treturn signature;\r\n\t\t} catch (InvalidKeyException | SignatureException | UnsupportedEncodingException | NoSuchAlgorithmException | InvalidKeySpecException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static void main(String[] args)\n throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, UnsupportedEncodingException {\n final String text = \"We would like to provide data integrity.\";\n\n /**\n * STEP 1.\n * We create a public-private key pair.\n * Standard Algorithm Names\n * http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html\n */\n final KeyPair key = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n /**\n * Alice creates Signature object defining Signature algorithm.\n */\n final Signature signatureAlg = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We initialize the signature object with\n * - Operation modes (SIGN) and\n * - provides appropriate ***Private*** Key\n */\n signatureAlg.initSign(key.getPrivate());\n\n // Finally, we load the message into the signature object and sign it\n signatureAlg.update(text.getBytes(\"UTF-8\"));\n final byte[] signedText = signatureAlg.sign();\n System.out.println(\"Signature: \" + DatatypeConverter.printHexBinary(signedText));\n\n /**\n * To verify the signature, we create another signature object\n * and specify its algorithm\n */\n final Signature signatureAlg2 = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We have to initialize it with the mode. But to verify the algorithm,\n * we only need the public key of the original signee\n */\n signatureAlg2.initVerify(key.getPublic());\n\n //Finally, we can check whether the signature is valid\n signatureAlg2.update(text.getBytes(\"UTF-8\"));\n\n if (signatureAlg2.verify(signedText))\n System.out.println(\"Valid signature.\");\n else\n System.err.println(\"Invalid signature.\");\n }", "public void affiche3(BigInteger signe){\n System.out.println(\"La signature est :\"+signe);\n }", "com.microsoft.schemas.office.x2006.digsig.STSignatureText xgetSignatureText();" ]
[ "0.73976135", "0.704309", "0.70210266", "0.6921052", "0.6921052", "0.6921052", "0.6833218", "0.68208843", "0.66571474", "0.65837884", "0.6580073", "0.6580073", "0.6549985", "0.65176594", "0.6499652", "0.6490479", "0.64046055", "0.63172966", "0.6307634", "0.6307634", "0.62898576", "0.6273093", "0.6249798", "0.62436706", "0.62151176", "0.6214243", "0.6184172", "0.6180248", "0.61655164", "0.6113408", "0.61041343", "0.6092459", "0.6082781", "0.6056683", "0.60500777", "0.5998656", "0.59978396", "0.5959772", "0.593669", "0.59344125", "0.5918469", "0.5916969", "0.5910817", "0.58813316", "0.5864352", "0.58635926", "0.58560973", "0.58560973", "0.58557546", "0.5852426", "0.58436865", "0.5841626", "0.58226836", "0.5803321", "0.5799519", "0.5798923", "0.57931036", "0.57903373", "0.57903373", "0.57903373", "0.5785939", "0.57843107", "0.5747793", "0.5738761", "0.57264227", "0.5724643", "0.5718272", "0.5717422", "0.57154185", "0.57154185", "0.5714451", "0.5714451", "0.5710953", "0.5694987", "0.56920105", "0.5681027", "0.56799185", "0.56781644", "0.5672383", "0.56646734", "0.56491727", "0.5647587", "0.5643544", "0.5643239", "0.5640683", "0.56399196", "0.5639839", "0.5630529", "0.5627866", "0.561977", "0.56098723", "0.56039405", "0.5592808", "0.5580254", "0.55797774", "0.5576713", "0.5566575", "0.5559037", "0.5537511", "0.55128556" ]
0.6214869
25
pkidependent signature optional bytes signature = 5;
private void clearSignature() { bitField0_ = (bitField0_ & ~0x00000010); signature_ = getDefaultInstance().getSignature(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract byte[] getSignature();", "com.google.protobuf.ByteString getSignature();", "int getSignature ();", "String getSignature();", "String getSignature();", "String getSignature();", "BigInteger getDigitalSignature();", "public abstract String getSignature();", "SignatureIdentification createSignatureIdentification();", "org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder();", "com.google.protobuf.ByteString\n getSignatureBytes();", "com.google.protobuf.ByteString\n getSignatureBytes();", "Signature getSignature();", "org.apache.calcite.avatica.proto.Common.Signature getSignature();", "byte[] getSignatureImage();", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }", "public GpgSignature(@NonNull byte[] signature) {\n\t\tthis.signature = signature;\n\t}", "byte[] generateSignature(byte[] message, PrivateKey privateKey, SecureRandom secureRandom) throws IOException;", "boolean hasSignature();", "boolean hasSignature();", "public byte[] getSigAlgParams() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[]\");\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "native String nativeGetSignature(long nativeHandler) throws RuntimeException;", "com.google.protobuf.ByteString getSig();", "private void setSignature(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000010;\n signature_ = value;\n }", "String getUniqueSignature();", "SignatureSpi(com.android.org.bouncycastle.crypto.Digest r1, com.android.org.bouncycastle.crypto.DSA r2, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void\");\n }", "public void setSignature( String pSignature )\r\n {\r\n this.signature = pSignature;\r\n }", "public byte []\ngetSignature() {\n\treturn signature;\n}", "int getSignatureType();", "@Override\n public String buildSignature(RequestDataToSign requestDataToSign, String appKey) {\n // find private key for this app\n final String secretKey = keyStore.getPrivateKey(appKey);\n if (secretKey == null) {\n LOG.error(\"Unknown application key: {}\", appKey);\n throw new PrivateKeyNotFoundException();\n }\n\n // sign\n return super.buildSignature(requestDataToSign, secretKey);\n }", "java.lang.String getSignatureText();", "public boolean verifySignature() {\r\n\t\t\r\n\t\tString data;\r\n\t\t\r\n\t\tif(isTypeCreation){\r\n\t\t\t\r\n\t\t\tdata = StringUtil.getStringFromKey(creator) + name +\r\n\t\t\t\t\tdescription + begin + end+end_subscription+\r\n\t\t\t\t\tlocation+min_capacity+max_capacity;\r\n\t\t\treturn StringUtil.verifyECDSASig(creator, data, signature);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata = StringUtil.getStringFromKey(subscriber)+id_event;\r\n\t\t\treturn StringUtil.verifyECDSASig(subscriber, data, signature);\r\n\t\t}\r\n//\t\tSystem.out.println(\"signature \"+signature);\r\n\t\t\r\n\t}", "public static native String getSignature(long[] msgArgs);", "@Override\n public boolean verifySignature(byte[] signature) {\n try {\n Element[] sig = derDecode(signature);\n CL04SignPublicPairingKeySerParameter pk = (CL04SignPublicPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(pairingKeySerParameter.getParameters());\n Element a = sig[0];\n Element b = sig[1];\n Element c = sig[2];\n List<Element> A = IntStream.range(3, 3 + messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n List<Element> B = IntStream.range(3 + messages.size(), 3 + 2 * messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n return aFormedCorrectly(pairing, a, A, pk) && bFormedCorrectly(pairing, a, b, A, B, pk) && cFormedCorrectly(pairing, a, b, c, B, pk);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return false;\n\n }", "public String getSignature()\r\n {\r\n return signature;\r\n }", "public boolean isSignatureRequired() {\n\t\treturn false;\n\t}", "boolean verifySignature(byte[] message, byte[] signature, PublicKey publicKey) throws IOException;", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public interface SignatureObject {\n}", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "com.google.protobuf.ByteString getArtifactSignature();", "public Signer getPDFSigner();", "public abstract String getSigAlgOID();", "public static void main(String[] args) {\n\n\t\tif (args.length != 5) {\n\t\t System.out.println(\"Usage: GenSig nameOfFileToSign keystore password sign publicKey\");\n\n\t\t }\n\t\telse try{\n\n\t\t KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t ks.load(new FileInputStream(args[1]), args[2].toCharArray());\n\t\t \n\t\t String alias = (String)ks.aliases().nextElement();\n\t\t PrivateKey privateKey = (PrivateKey) ks.getKey(alias, args[2].toCharArray());\n\n\t\t Certificate cert = ks.getCertificate(alias);\n\n\t\t // Get public key\t\n\t\t PublicKey publicKey = cert.getPublicKey();\n\n\t\t /* Create a Signature object and initialize it with the private key */\n\n\t\t Signature rsa = Signature.getInstance(\"SHA256withRSA\");\t\n\t\n\n\t\t rsa.initSign(privateKey);\n\n\t\t /* Update and sign the data */\n\n \t String hexString = readFile(args[0]).trim();\n\t\t byte[] decodedBytes = DatatypeConverter.parseHexBinary(hexString);\t\n\t\t InputStream bufin = new ByteArrayInputStream(decodedBytes);\n\n\n\t\t byte[] buffer = new byte[1024];\n\t\t int len;\n\t\t while (bufin.available() != 0) {\n\t\t\tlen = bufin.read(buffer);\n\t\t\trsa.update(buffer, 0, len);\n\t\t };\n\n\t\t bufin.close();\n\n\t\t /* Now that all the data to be signed has been read in, \n\t\t\t generate a signature for it */\n\n\t\t byte[] realSig = rsa.sign();\n\n\t\t \n\t\t /* Save the signature in a file */\n\n\t\t File file = new File(args[3]);\n\t\t PrintWriter out = new PrintWriter(file);\n\n\t\t\t// if file doesn't exists, then create it\n\t\t\tif (!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\n\t\t out.println(DatatypeConverter.printBase64Binary(realSig));\n\t\t out.close();\n\n\n\t\t /* Save the public key in a file */\n\t\t byte[] key = publicKey.getEncoded();\n\t\t FileOutputStream keyfos = new FileOutputStream(args[4]);\n\t\t keyfos.write(key);\n\n\t\t keyfos.close();\n\n\t\t} catch (Exception e) {\n\t\t System.err.println(\"Caught exception \" + e.toString());\n\t\t}\n\n\t}", "com.microsoft.schemas.office.x2006.digsig.STSignatureType xgetSignatureType();", "int getSignatureProviderDetails();", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "SignatureSource createSignatureSource();", "public byte[] getSignature()\n {\n return Arrays.clone(signature);\n }", "public Signator.Signers getUsedPDFSignerLibrary();", "String componentSignature();", "void setSignature(String signature) {\n this.signature = signature;\n }", "org.apache.xmlbeans.XmlBase64Binary xgetSignatureImage();", "public io.lightcone.data.types.EdDSASignatureOrBuilder getSigOrBuilder() {\n return getSig();\n }", "BlsPoint sign(BigInteger privateKey, byte[] data);", "public interface SignatureFactory \n{\n /** \n * initializes the implementation class \n */\n public void init()\n throws SignedDocException;\n \n /**\n * Method returns an array of strings representing the \n * list of available token names.\n * @return an array of available token names.\n * @throws SignedDocException if reading the token information fails.\n */\n public String[] getAvailableTokenNames()\n throws SignedDocException;\n \n /**\n * Method returns a digital signature. It finds the RSA private \n * key object from the active token and\n * then signs the given data with this key and RSA mechanism.\n * @param digest digest of the data to be signed.\n * @param token token index\n * @param pin users pin code\n * @return an array of bytes containing digital signature.\n * @throws SignedDocException if signing the data fails.\n */\n public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;\n \n /**\n * Method returns a X.509 certificate object readed \n * from the active token and representing an\n * user public key certificate value.\n * @return X.509 certificate object.\n * @throws SignedDocException if getting X.509 public key certificate \n * fails or the requested certificate type X.509 is not available in \n * the default provider package\n */\n public X509Certificate getCertificate(int token, String pin)\n throws SignedDocException;\n \n /**\n * Resets the previous session\n * and other selected values\n */\n public void reset() \n throws SignedDocException;\n \n\t/**\n\t * Method decrypts the data with the RSA private key\n\t * corresponding to this certificate (which was used\n\t * to encrypt it). Decryption will be done on the card.\n\t * This operation closes the possibly opened previous\n\t * session with signature token and opens a new one with\n\t * authentication token if necessary\n\t * @param data data to be decrypted.\n\t * @param token index of authentication token\n\t * @param pin PIN code\n\t * @return decrypted data.\n\t * @throws SignedDocException for all decryption errors\n\t */\n\tpublic byte[] decrypt(byte[] data, int token, String pin) \n\t\tthrows SignedDocException;\n\t\t\t\t\n}", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "private byte getSignatureType() \r\n \t //@ requires [?f]signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures [f]signatureType |-> theSignatureType &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\treturn signatureType[0];\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public byte[] signData(String fitxer, PrivateKey priv) {\n byte[] signature = null;\n FileInputStream datafis;\n BufferedInputStream bufin = null;\n byte[] buffer = new byte[1024];\n int len;\n \n try {\n Signature signer = Signature.getInstance(\"SHA256withRSA\");\n signer.initSign(priv); //Inicialitzem la firma digital a partirde l’algorisme utilitzat\n \n datafis = new FileInputStream(fitxer);\n bufin = new BufferedInputStream(datafis);\n \n while (bufin.available() != 0) {\n len = bufin.read(buffer);\n signer.update(buffer, 0, len);//Li assignem a l’objecte firma les dades afirmar digitalment\n } \n\n bufin.close();\n signature = signer.sign();//Finalment generem la firma\n } catch (Exception ex) {\n System.err.println(\"Error signant les dades: \" + ex);\n }\n return signature;\n }", "public\nSIGRecord(Name name, int dclass, long ttl, int covered, int alg, int origttl,\n\t Date expire, Date timeSigned, int footprint, Name signer,\n\t byte [] signature)\n{\n\tthis(name, dclass, ttl);\n\tType.check(covered);\n\tcheckU8(\"alg\", alg);\n\tcheckU8(\"labels\", labels);\n\tTTL.check(origttl);\n\tcheckU16(\"footprint\", footprint);\n\tthis.covered = covered;\n\tthis.alg = alg;\n\tthis.labels = name.labels();\n\tthis.origttl = origttl;\n\tthis.expire = expire;\n\tthis.timeSigned = timeSigned;\n\tthis.footprint = footprint;\n\tif (!signer.isAbsolute())\n\t\tthrow new RelativeNameException(signer);\n\tthis.signer = signer;\n\tthis.signature = signature;\n}", "ReleaseFile parseWithSignature( InputStream is, InputStream signStream, InputStream keyStream ) throws IOException;", "public void setSignature(String signature) {\n\t\tthis.signature = signature;\n\t}", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "ISModifySignature createISModifySignature();", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;", "boolean readSignature(Integer[] sig) {\n Scales.sendByte((byte) 's');\n\t /* Get actual signature */\n sig[2] = Scales.getByte();\n sig[1] = Scales.getByte();\n sig[0] = Scales.getByte();\n return true;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n if (signatureBuilder_ != null) {\n return signatureBuilder_.getMessageOrBuilder();\n } else {\n return signature_ == null ?\n org.apache.calcite.avatica.proto.Common.Signature.getDefaultInstance() : signature_;\n }\n }", "public String getSignature() {\n\t\treturn signature;\n\t}", "private void validateFermatPacketSignature(FermatPacket fermatPacketReceive){\n\n System.out.println(\" WsCommunicationVPNClient - validateFermatPacketSignature\");\n\n /*\n * Validate the signature\n */\n boolean isValid = AsymmectricCryptography.verifyMessageSignature(fermatPacketReceive.getSignature(), fermatPacketReceive.getMessageContent(), vpnServerIdentity);\n\n System.out.println(\" WsCommunicationVPNClient - isValid = \" + isValid);\n\n /*\n * if not valid signature\n */\n if (!isValid){\n throw new RuntimeException(\"Fermat Packet received has not a valid signature, go to close this connection maybe is compromise\");\n }\n\n }", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "public static byte[] SignWithPrivateKey(byte[] buf,PrivateKey pkey) throws Exception{\r\n\t\tSecureRandom secureRandom = new SecureRandom();\r\n\t\tSignature signature = Signature.getInstance(\"SHA1WithECDSA\");\r\n\t\tsignature.initSign(pkey,secureRandom);\r\n\t\tsignature.update(buf);\r\n\t\tbyte[] digitalSignature = signature.sign();\r\n\t\treturn digitalSignature;\r\n\t\t\r\n\t}", "public void setSignature(String Signature) {\n this.Signature = Signature;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n return getSignature();\n }", "public ISignature getSignature() {\n return _signature;\n }", "public String getSignature() {\n return this.Signature;\n }", "@SuppressWarnings(\"all\")\n public static void main(String...args) throws Exception {\n FileInputStream pubKFile = new FileInputStream(\"C:\\\\Demo\\\\publicKey\");\n byte[] encKey = new byte[pubKFile.available()];\n pubKFile.read(encKey);\n pubKFile.close();\n\n // 2. decode the public key\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encKey);\n PublicKey publicKey = KeyFactory.getInstance(\"DSA\").generatePublic(spec);\n\n // 3. read the signature\n FileInputStream signatureFile = new FileInputStream(\"C:\\\\Demo\\\\signature\");\n byte[] sigByte = new byte[signatureFile.available()];\n signatureFile.read(sigByte);\n signatureFile.close();\n\n // 4. generate the signature\n Signature signature = Signature.getInstance(\"SHA1withDSA\");\n signature.initVerify(publicKey);\n\n // 5. supply the data\n FileInputStream dataFile = new FileInputStream(\"C:\\\\Demo\\\\code\");\n BufferedInputStream dataStream = new BufferedInputStream(dataFile);\n byte[] tmpBuf = new byte[dataStream.available()];\n int len;\n while ((len = dataStream.read(tmpBuf)) >= 0) {\n signature.update(tmpBuf, 0, len);\n }\n dataStream.close();\n\n // 6. verify\n boolean result = signature.verify(sigByte);\n System.out.println(\"Result:\" + result);\n }", "public static void main(String[] args) {\n\n String pfx = \"E:\\\\PDFFileTest\\\\1.pfx\";\n String tmpPath = \"E:\\\\PDFFileTest\\\\1562570792439.pdf\";\n String expPath = \"E:\\\\PDFFileTest\\\\11.11\\\\h83.pdf\";\n String gif = \"E:\\\\PDFFileTest\\\\1.gif\";\n String password = \"111111\";\n try {\n sign(pfx, tmpPath, expPath, gif, password);\n System.out.println(\"success\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void generatePkcs1Md5Signature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 16) || (byteRead != 16))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// use the correct key\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t\r\n\t\tif (getSignatureType() == NON_REPUDIATION) {\t\t\r\n\t\t\tcipher.init((RSAPrivateCrtKey)nonRepKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\tif (getSignatureType() == AUTHENTICATION) {\r\n\t\t\tcipher.init((RSAPrivateCrtKey)authKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t\t\r\n\t\t////@ open valid(); // todo\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\t\t\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\t////@ open [1/2]valid();\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_MD5_PKCS1, lc);\r\n\t\t// copy the MD5 hash from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA), messageBuffer, (short) (128 - lc), lc);\r\n\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// generate signature\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as1);\r\n\t\t//@ foreachp_remove(messageBuffer, as1);\r\n\t\t//@ open transient_byte_array(messageBuffer);\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as1);\r\n\r\n\t\t////@ close [1/2]valid(); // auto\r\n\r\n\r\n\t}", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "boolean hasSig();", "boolean checkSignature(long sig0, long sig1, long sig2) throws Exception {\n Integer[] sig = new Integer[3];\n\t /* Get signature */\n readSignature(sig);\n\t /* Compare signature */\n if (sig[0] != sig0 || sig[1] != sig1 || sig[2] != sig2) {\n throw new Exception(\"Signature does not match selected device! \");\n }\n return true; // Indicate supported command.\n }", "void setSignatureImage(byte[] signatureImage);", "public boolean signRequired() {\n\t\treturn false;\n\t}", "protected byte[] getSignature() {\n return signatureImpl.calculate(content, null);\n }", "dkk mo4509g();", "SignatureSink createSignatureSink();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public void testDoubleX509SignatureThumb() throws Exception {\n WSSecSignature builder = new WSSecSignature();\n builder.setUserInfo(\"16c73ab6-b892-458f-abf5-2f875f74882e\", \"security\");\n // builder.setUserInfo(\"john\", \"keypass\");\n builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER); \n Document doc = unsignedEnvelope.getAsDocument();\n \n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc);\n\n Document signedDoc = builder.build(doc, crypto, secHeader);\n Document signedDoc1 = builder.build(signedDoc, crypto, secHeader);\n verify(signedDoc1);\n }", "public static byte[] sign(String stringPrivateKey,String plaintext){\r\n\t\ttry {\r\n\t\t\tPKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(stringPrivateKey));\r\n\t\t\tKeyFactory kf = KeyFactory.getInstance(\"EC\");\r\n\t\t\tPrivateKey privateKey= kf.generatePrivate(privateKeySpec);\r\n\t\t\tSignature sig = Signature.getInstance(\"SHA256withECDSA\");\r\n\t\t\tsig.initSign(privateKey);\r\n\t\t\tsig.update(plaintext.getBytes(\"UTF-8\"));\r\n\t\t\tbyte[] signature = sig.sign();\r\n\t\t\tSystem.out.println(\"Bytes:\"+signature.length);\r\n\t\t\treturn signature;\r\n\t\t} catch (InvalidKeyException | SignatureException | UnsupportedEncodingException | NoSuchAlgorithmException | InvalidKeySpecException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static void main(String[] args)\n throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, UnsupportedEncodingException {\n final String text = \"We would like to provide data integrity.\";\n\n /**\n * STEP 1.\n * We create a public-private key pair.\n * Standard Algorithm Names\n * http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html\n */\n final KeyPair key = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n /**\n * Alice creates Signature object defining Signature algorithm.\n */\n final Signature signatureAlg = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We initialize the signature object with\n * - Operation modes (SIGN) and\n * - provides appropriate ***Private*** Key\n */\n signatureAlg.initSign(key.getPrivate());\n\n // Finally, we load the message into the signature object and sign it\n signatureAlg.update(text.getBytes(\"UTF-8\"));\n final byte[] signedText = signatureAlg.sign();\n System.out.println(\"Signature: \" + DatatypeConverter.printHexBinary(signedText));\n\n /**\n * To verify the signature, we create another signature object\n * and specify its algorithm\n */\n final Signature signatureAlg2 = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We have to initialize it with the mode. But to verify the algorithm,\n * we only need the public key of the original signee\n */\n signatureAlg2.initVerify(key.getPublic());\n\n //Finally, we can check whether the signature is valid\n signatureAlg2.update(text.getBytes(\"UTF-8\"));\n\n if (signatureAlg2.verify(signedText))\n System.out.println(\"Valid signature.\");\n else\n System.err.println(\"Invalid signature.\");\n }", "public void affiche3(BigInteger signe){\n System.out.println(\"La signature est :\"+signe);\n }", "com.microsoft.schemas.office.x2006.digsig.STSignatureText xgetSignatureText();" ]
[ "0.7398622", "0.70440924", "0.7022031", "0.69217896", "0.69217896", "0.69217896", "0.6832896", "0.6822018", "0.6656805", "0.6584727", "0.6581324", "0.6581324", "0.65508157", "0.65186554", "0.6500605", "0.64922667", "0.6405426", "0.63177353", "0.6309137", "0.6309137", "0.6291624", "0.62736934", "0.62497795", "0.62446547", "0.62165594", "0.62156177", "0.62154174", "0.6184839", "0.6182062", "0.6166634", "0.6114771", "0.61045414", "0.60940474", "0.6082703", "0.6057142", "0.60518956", "0.60011655", "0.5997219", "0.5960978", "0.59380794", "0.5934817", "0.59194785", "0.5916384", "0.5911303", "0.58812356", "0.5865573", "0.5863711", "0.5856585", "0.5856585", "0.5855826", "0.5853409", "0.58434474", "0.5842665", "0.5823415", "0.5804242", "0.579979", "0.57987016", "0.57940054", "0.5792097", "0.5792097", "0.5792097", "0.5786611", "0.5785841", "0.57484907", "0.5737833", "0.5727212", "0.5724433", "0.57179654", "0.57173324", "0.5716925", "0.5716925", "0.57159585", "0.57159585", "0.57102674", "0.5696881", "0.56934804", "0.56818354", "0.56809944", "0.5679553", "0.5671512", "0.5665498", "0.5650605", "0.5649356", "0.56453955", "0.5642767", "0.5640675", "0.5640649", "0.5640535", "0.5631937", "0.5628895", "0.5620545", "0.56121653", "0.560563", "0.559209", "0.55807406", "0.55806303", "0.5575903", "0.556633", "0.5558993", "0.55369806", "0.55133957" ]
0.0
-1
optional uint32 payment_details_version = 1 [default = 1];
@java.lang.Override public boolean hasPaymentDetailsVersion() { return instance.hasPaymentDetailsVersion(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getPaymentDetailsVersion();", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "boolean hasPaymentDetailsVersion();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "public Builder setPaymentDetailsVersion(int value) {\n copyOnWrite();\n instance.setPaymentDetailsVersion(value);\n return this;\n }", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "public CreditCard getDefaultPaymentInfo();", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "boolean hasSerializedPaymentDetails();", "String getPaymentInformation();", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public int getVersion() { return 1; }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "long getVersionNumber();", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\r\npublic int defaultPaymentInfo(int no) {\n\treturn session.insert(\"payments.defaultPayment\",no);\r\n}", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "public Builder clearPaymentDetailsVersion() {\n copyOnWrite();\n instance.clearPaymentDetailsVersion();\n return this;\n }", "void setPaymentInformation(String information);", "public String getMerchantNo();", "public long getVersion(){\n return localVersion;\n }", "public void setVersion(BigDecimal version) {\r\n this.version = version;\r\n }", "public int getPaymentNum() {\n \treturn this.paymentNum;\n }", "private void setPayment(com.dogecoin.protocols.payments.Protos.Payment value) {\n value.getClass();\n payment_ = value;\n bitField0_ |= 0x00000001;\n }", "public int getC_Payment_ID();", "public int updatePayment2(int requestId, int amount);", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "@Override\n\tpublic int updatePayment(RotatePayment record) {\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tif(null==detail.getId()||\"\".equals(detail.getId()))\n\t\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\t\n\t\t}\n\t\treturn paymentDao.updatePayment(record);\n\t}", "private void m50363B() {\n try {\n TokenPaymentParams tokenPaymentParams = new TokenPaymentParams(this.f30711G0, this.f30708D0, this.f30709E0.getBrand(), this.f30737h0.getText().toString());\n StringBuilder sb = new StringBuilder();\n sb.append(this.f30720S.getString(C10232R.string.checkout_ui_callback_scheme));\n sb.append(\"://callback\");\n tokenPaymentParams.mo40895e(sb.toString());\n this.f30754y0.mo41066a(new Transaction((PaymentParams) tokenPaymentParams));\n this.f30728a.mo23628i(C11645a.f33474f, \"credit_card\");\n } catch (PaymentException e) {\n e.printStackTrace();\n }\n }", "public long getPaymentType() {\n return paymentType;\n }", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@ApiModelProperty(value = \"Software Statement version as provided by the organisation's PTC\")\n\n @Valid\n\n public BigDecimal getVersion() {\n return version;\n }", "public static String aPaymentId() {\n return \"123456\";\n }", "public void setVersion(String version){\r\n this.version = version;\r\n }", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "long getVersion();", "long getVersion();", "long getVersion();", "long getVersion();", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_CODE_PAYMENT) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectUpdatePayment(paymentId, rideAccept.getTotalAmount());\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n }\n }\n\n if (requestCode == 3) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n String paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectWaitingCharge(paymentId);\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n showPayment();\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n showPayment();\n }\n }\n }", "public abstract double getVersionNumber();", "public byte[] Bldr_version() {return bldr_version;}", "public long getVersionNo() {\r\n return versionNo;\r\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "int getTcfPolicyVersion();", "public void setVersion(long version) {\n this.version = version;\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\n\tpublic String getVersion() {\n\t\treturn \"0\";\n\t}", "@Override\r\n\tpublic int getVersion() {\n\t\treturn 0;\r\n\t}", "Long getVersion();", "public String getVersionNumber ();", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "@SuppressWarnings(\"unused\")\n private Long getVersion() {\n return version;\n }", "@Override\n public int getVersion() {\n return 0;\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@Override\n public double getVersion() {\n return 0;\n }", "public BigDecimal getVersion() {\r\n return version;\r\n }", "public String getVersion(){\r\n return version;\r\n }", "int getNumberPaymentReceipt();", "public Object getPaymentMode() {\n\t\treturn null;\n\t}", "private void m9894b() {\n if (this.f9489a == null) {\n throw new IllegalStateException(\"PaymentMethod not set.\");\n }\n }", "PaymentHandler createPaymentHandler();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "@Test(priority = 4)\n\tpublic void testPayment() {\n\t\tlogger = extent.startTest(\"passed\");\n\t\tWebDriverWait wait = new WebDriverWait(driver, 100);\n\t\twait.until(ExpectedConditions.presenceOfElementLocated(By.className(\"payment-info\")));\n\n\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"swit\\\"]/div[1]\")).click();\n\t\tdriver.findElement(By.id(\"btn\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t// For netbanking login\n\t\tdriver.findElement(By.name(\"username\")).sendKeys(\"123456\");\n\t\tdriver.findElement(By.name(\"password\")).sendKeys(\"Pass@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='LOGIN']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t//\n\t\tdriver.findElement(By.name(\"transpwd\")).sendKeys(\"Trans@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='PayNow']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Order Details\");\n\t\tlogger.log(LogStatus.PASS, \"testPayment Testcase is passed\");\n\t}", "void setVersion(long version);", "void paymentOrder(long orderId);", "@Override\n\tpublic int savePayment(RotatePayment record) {\n\t\trecord.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\tDate date = Calendar.getInstance().getTime();\n\t\trecord.setReportDate(date);\n\t\tint i =(int)(Math.random()*1000);\n\t\tString serial = String.format(\"%s%s%03d\", PREFIX,date.getTime(),i);\n\t\trecord.setPaySerial(serial);\n//\t\trecord.setOperator(TokenManager.getNickname());\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\t\t\n\t\t}\n\t\treturn paymentDao.savePayment(record);\n\t}", "long version();", "public short getVersion() {\n return version;\n }", "public void setVersion(String version) {\n\t\t\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "public int getVersion()\n {\n return encryptionDictionary.getInt( \"V\", 0 );\n }", "public void setC_Payment_ID (int C_Payment_ID);", "public void setVersion(String version)\n {\n this.ver = version;\n }", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "@Override\r\n\tpublic int updatePaymentInfo(Payment payment) {\n\t\treturn session.update(\"payments.updatePayment\", payment);\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version)\n {\n this.version = version;\n }", "public void makePayment(String amount, String paymentRef) {\n JudoSDKManager.setKeyAndSecret(getApplicationContext(), API_TOKEN, API_SECRET);\n\n// Set environment to Sandbox\n JudoSDKManager.setSandboxMode(getApplicationContext());\n\n String customerRef = Settings.Secure.getString(getApplicationContext().getContentResolver(),\n Settings.Secure.ANDROID_ID);\n\n Intent intent = JudoSDKManager.makeAPayment(getApplicationContext(), JUDO_ID, \"GBP\", amount, paymentRef, customerRef, null);\n startActivityForResult(intent, ACTION_CARD_PAYMENT);\n }", "public byte getVersion() {\n return version;\n }", "public String getLBR_PartialPayment();", "@Override\n public int getVersion() {\n return 4;\n }", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "public void setVersion(Integer version)\r\n {\r\n this.version = version;\r\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public String versionNumber (){\r\n\t\t\treturn _versionNumber;\r\n\t\t}", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "PaymentMethod getPaymentMethod();", "public Version version()\n/* */ {\n/* 518 */ return PackageVersion.VERSION;\n/* */ }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }" ]
[ "0.80034465", "0.7615326", "0.7410622", "0.7088494", "0.6975793", "0.6953307", "0.66936916", "0.62917477", "0.6124444", "0.61168504", "0.582807", "0.5777196", "0.57698876", "0.5674107", "0.5671132", "0.5642232", "0.56046927", "0.5595802", "0.55893826", "0.55744565", "0.5571356", "0.55305934", "0.55155885", "0.55086255", "0.54994094", "0.548515", "0.54823804", "0.54722375", "0.5446413", "0.5446033", "0.5426635", "0.54149896", "0.54134554", "0.54114383", "0.5409497", "0.5403855", "0.5394232", "0.53908634", "0.5384754", "0.53627515", "0.5358914", "0.5358914", "0.5358914", "0.5358914", "0.53581226", "0.53411514", "0.5329674", "0.5324385", "0.5322615", "0.531181", "0.53107846", "0.5310316", "0.5308829", "0.5297846", "0.5289529", "0.5285155", "0.5273382", "0.52730614", "0.5272987", "0.52676976", "0.5253469", "0.52482396", "0.52424824", "0.5242384", "0.5233856", "0.5232086", "0.52307016", "0.5226022", "0.52247953", "0.52215016", "0.5198114", "0.51938814", "0.51917595", "0.51878035", "0.51814425", "0.51811916", "0.5180288", "0.518016", "0.5166862", "0.5165169", "0.5160813", "0.51585674", "0.51547694", "0.51547694", "0.51535845", "0.5148061", "0.51435596", "0.51385784", "0.5137289", "0.51326686", "0.51273745", "0.51149565", "0.51147026", "0.51147026", "0.5109668", "0.5108239", "0.5107287", "0.51018167", "0.51009524", "0.51009524" ]
0.6601788
7
optional uint32 payment_details_version = 1 [default = 1];
@java.lang.Override public int getPaymentDetailsVersion() { return instance.getPaymentDetailsVersion(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getPaymentDetailsVersion();", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "boolean hasPaymentDetailsVersion();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "public Builder setPaymentDetailsVersion(int value) {\n copyOnWrite();\n instance.setPaymentDetailsVersion(value);\n return this;\n }", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "public CreditCard getDefaultPaymentInfo();", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "boolean hasSerializedPaymentDetails();", "String getPaymentInformation();", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public int getVersion() { return 1; }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "long getVersionNumber();", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\r\npublic int defaultPaymentInfo(int no) {\n\treturn session.insert(\"payments.defaultPayment\",no);\r\n}", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "public Builder clearPaymentDetailsVersion() {\n copyOnWrite();\n instance.clearPaymentDetailsVersion();\n return this;\n }", "void setPaymentInformation(String information);", "public String getMerchantNo();", "public long getVersion(){\n return localVersion;\n }", "public void setVersion(BigDecimal version) {\r\n this.version = version;\r\n }", "public int getPaymentNum() {\n \treturn this.paymentNum;\n }", "private void setPayment(com.dogecoin.protocols.payments.Protos.Payment value) {\n value.getClass();\n payment_ = value;\n bitField0_ |= 0x00000001;\n }", "public int getC_Payment_ID();", "public int updatePayment2(int requestId, int amount);", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "@Override\n\tpublic int updatePayment(RotatePayment record) {\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tif(null==detail.getId()||\"\".equals(detail.getId()))\n\t\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\t\n\t\t}\n\t\treturn paymentDao.updatePayment(record);\n\t}", "private void m50363B() {\n try {\n TokenPaymentParams tokenPaymentParams = new TokenPaymentParams(this.f30711G0, this.f30708D0, this.f30709E0.getBrand(), this.f30737h0.getText().toString());\n StringBuilder sb = new StringBuilder();\n sb.append(this.f30720S.getString(C10232R.string.checkout_ui_callback_scheme));\n sb.append(\"://callback\");\n tokenPaymentParams.mo40895e(sb.toString());\n this.f30754y0.mo41066a(new Transaction((PaymentParams) tokenPaymentParams));\n this.f30728a.mo23628i(C11645a.f33474f, \"credit_card\");\n } catch (PaymentException e) {\n e.printStackTrace();\n }\n }", "public long getPaymentType() {\n return paymentType;\n }", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@ApiModelProperty(value = \"Software Statement version as provided by the organisation's PTC\")\n\n @Valid\n\n public BigDecimal getVersion() {\n return version;\n }", "public static String aPaymentId() {\n return \"123456\";\n }", "public void setVersion(String version){\r\n this.version = version;\r\n }", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "long getVersion();", "long getVersion();", "long getVersion();", "long getVersion();", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_CODE_PAYMENT) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectUpdatePayment(paymentId, rideAccept.getTotalAmount());\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n }\n }\n\n if (requestCode == 3) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n String paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectWaitingCharge(paymentId);\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n showPayment();\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n showPayment();\n }\n }\n }", "public abstract double getVersionNumber();", "public byte[] Bldr_version() {return bldr_version;}", "public long getVersionNo() {\r\n return versionNo;\r\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "int getTcfPolicyVersion();", "public void setVersion(long version) {\n this.version = version;\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\n\tpublic String getVersion() {\n\t\treturn \"0\";\n\t}", "@Override\r\n\tpublic int getVersion() {\n\t\treturn 0;\r\n\t}", "Long getVersion();", "public String getVersionNumber ();", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "@SuppressWarnings(\"unused\")\n private Long getVersion() {\n return version;\n }", "@Override\n public int getVersion() {\n return 0;\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@Override\n public double getVersion() {\n return 0;\n }", "public BigDecimal getVersion() {\r\n return version;\r\n }", "public String getVersion(){\r\n return version;\r\n }", "int getNumberPaymentReceipt();", "public Object getPaymentMode() {\n\t\treturn null;\n\t}", "private void m9894b() {\n if (this.f9489a == null) {\n throw new IllegalStateException(\"PaymentMethod not set.\");\n }\n }", "PaymentHandler createPaymentHandler();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "@Test(priority = 4)\n\tpublic void testPayment() {\n\t\tlogger = extent.startTest(\"passed\");\n\t\tWebDriverWait wait = new WebDriverWait(driver, 100);\n\t\twait.until(ExpectedConditions.presenceOfElementLocated(By.className(\"payment-info\")));\n\n\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"swit\\\"]/div[1]\")).click();\n\t\tdriver.findElement(By.id(\"btn\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t// For netbanking login\n\t\tdriver.findElement(By.name(\"username\")).sendKeys(\"123456\");\n\t\tdriver.findElement(By.name(\"password\")).sendKeys(\"Pass@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='LOGIN']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t//\n\t\tdriver.findElement(By.name(\"transpwd\")).sendKeys(\"Trans@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='PayNow']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Order Details\");\n\t\tlogger.log(LogStatus.PASS, \"testPayment Testcase is passed\");\n\t}", "void setVersion(long version);", "void paymentOrder(long orderId);", "@Override\n\tpublic int savePayment(RotatePayment record) {\n\t\trecord.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\tDate date = Calendar.getInstance().getTime();\n\t\trecord.setReportDate(date);\n\t\tint i =(int)(Math.random()*1000);\n\t\tString serial = String.format(\"%s%s%03d\", PREFIX,date.getTime(),i);\n\t\trecord.setPaySerial(serial);\n//\t\trecord.setOperator(TokenManager.getNickname());\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\t\t\n\t\t}\n\t\treturn paymentDao.savePayment(record);\n\t}", "long version();", "public short getVersion() {\n return version;\n }", "public void setVersion(String version) {\n\t\t\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "public int getVersion()\n {\n return encryptionDictionary.getInt( \"V\", 0 );\n }", "public void setC_Payment_ID (int C_Payment_ID);", "public void setVersion(String version)\n {\n this.ver = version;\n }", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "@Override\r\n\tpublic int updatePaymentInfo(Payment payment) {\n\t\treturn session.update(\"payments.updatePayment\", payment);\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version)\n {\n this.version = version;\n }", "public void makePayment(String amount, String paymentRef) {\n JudoSDKManager.setKeyAndSecret(getApplicationContext(), API_TOKEN, API_SECRET);\n\n// Set environment to Sandbox\n JudoSDKManager.setSandboxMode(getApplicationContext());\n\n String customerRef = Settings.Secure.getString(getApplicationContext().getContentResolver(),\n Settings.Secure.ANDROID_ID);\n\n Intent intent = JudoSDKManager.makeAPayment(getApplicationContext(), JUDO_ID, \"GBP\", amount, paymentRef, customerRef, null);\n startActivityForResult(intent, ACTION_CARD_PAYMENT);\n }", "public byte getVersion() {\n return version;\n }", "public String getLBR_PartialPayment();", "@Override\n public int getVersion() {\n return 4;\n }", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "public void setVersion(Integer version)\r\n {\r\n this.version = version;\r\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public String versionNumber (){\r\n\t\t\treturn _versionNumber;\r\n\t\t}", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "PaymentMethod getPaymentMethod();", "public Version version()\n/* */ {\n/* 518 */ return PackageVersion.VERSION;\n/* */ }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }" ]
[ "0.80034465", "0.7615326", "0.7410622", "0.7088494", "0.6953307", "0.66936916", "0.6601788", "0.62917477", "0.6124444", "0.61168504", "0.582807", "0.5777196", "0.57698876", "0.5674107", "0.5671132", "0.5642232", "0.56046927", "0.5595802", "0.55893826", "0.55744565", "0.5571356", "0.55305934", "0.55155885", "0.55086255", "0.54994094", "0.548515", "0.54823804", "0.54722375", "0.5446413", "0.5446033", "0.5426635", "0.54149896", "0.54134554", "0.54114383", "0.5409497", "0.5403855", "0.5394232", "0.53908634", "0.5384754", "0.53627515", "0.5358914", "0.5358914", "0.5358914", "0.5358914", "0.53581226", "0.53411514", "0.5329674", "0.5324385", "0.5322615", "0.531181", "0.53107846", "0.5310316", "0.5308829", "0.5297846", "0.5289529", "0.5285155", "0.5273382", "0.52730614", "0.5272987", "0.52676976", "0.5253469", "0.52482396", "0.52424824", "0.5242384", "0.5233856", "0.5232086", "0.52307016", "0.5226022", "0.52247953", "0.52215016", "0.5198114", "0.51938814", "0.51917595", "0.51878035", "0.51814425", "0.51811916", "0.5180288", "0.518016", "0.5166862", "0.5165169", "0.5160813", "0.51585674", "0.51547694", "0.51547694", "0.51535845", "0.5148061", "0.51435596", "0.51385784", "0.5137289", "0.51326686", "0.51273745", "0.51149565", "0.51147026", "0.51147026", "0.5109668", "0.5108239", "0.5107287", "0.51018167", "0.51009524", "0.51009524" ]
0.6975793
4
optional uint32 payment_details_version = 1 [default = 1];
public Builder setPaymentDetailsVersion(int value) { copyOnWrite(); instance.setPaymentDetailsVersion(value); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getPaymentDetailsVersion();", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "boolean hasPaymentDetailsVersion();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "public CreditCard getDefaultPaymentInfo();", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "boolean hasSerializedPaymentDetails();", "String getPaymentInformation();", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public int getVersion() { return 1; }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "long getVersionNumber();", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\r\npublic int defaultPaymentInfo(int no) {\n\treturn session.insert(\"payments.defaultPayment\",no);\r\n}", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "public Builder clearPaymentDetailsVersion() {\n copyOnWrite();\n instance.clearPaymentDetailsVersion();\n return this;\n }", "void setPaymentInformation(String information);", "public String getMerchantNo();", "public long getVersion(){\n return localVersion;\n }", "public void setVersion(BigDecimal version) {\r\n this.version = version;\r\n }", "public int getPaymentNum() {\n \treturn this.paymentNum;\n }", "public int getC_Payment_ID();", "private void setPayment(com.dogecoin.protocols.payments.Protos.Payment value) {\n value.getClass();\n payment_ = value;\n bitField0_ |= 0x00000001;\n }", "public int updatePayment2(int requestId, int amount);", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "@Override\n\tpublic int updatePayment(RotatePayment record) {\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tif(null==detail.getId()||\"\".equals(detail.getId()))\n\t\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\t\n\t\t}\n\t\treturn paymentDao.updatePayment(record);\n\t}", "private void m50363B() {\n try {\n TokenPaymentParams tokenPaymentParams = new TokenPaymentParams(this.f30711G0, this.f30708D0, this.f30709E0.getBrand(), this.f30737h0.getText().toString());\n StringBuilder sb = new StringBuilder();\n sb.append(this.f30720S.getString(C10232R.string.checkout_ui_callback_scheme));\n sb.append(\"://callback\");\n tokenPaymentParams.mo40895e(sb.toString());\n this.f30754y0.mo41066a(new Transaction((PaymentParams) tokenPaymentParams));\n this.f30728a.mo23628i(C11645a.f33474f, \"credit_card\");\n } catch (PaymentException e) {\n e.printStackTrace();\n }\n }", "public long getPaymentType() {\n return paymentType;\n }", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@ApiModelProperty(value = \"Software Statement version as provided by the organisation's PTC\")\n\n @Valid\n\n public BigDecimal getVersion() {\n return version;\n }", "public static String aPaymentId() {\n return \"123456\";\n }", "public void setVersion(String version){\r\n this.version = version;\r\n }", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "long getVersion();", "long getVersion();", "long getVersion();", "long getVersion();", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_CODE_PAYMENT) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectUpdatePayment(paymentId, rideAccept.getTotalAmount());\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n }\n }\n\n if (requestCode == 3) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n String paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectWaitingCharge(paymentId);\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n showPayment();\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n showPayment();\n }\n }\n }", "public abstract double getVersionNumber();", "public byte[] Bldr_version() {return bldr_version;}", "public long getVersionNo() {\r\n return versionNo;\r\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "int getTcfPolicyVersion();", "public void setVersion(long version) {\n this.version = version;\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\n\tpublic String getVersion() {\n\t\treturn \"0\";\n\t}", "@Override\r\n\tpublic int getVersion() {\n\t\treturn 0;\r\n\t}", "Long getVersion();", "public String getVersionNumber ();", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "@SuppressWarnings(\"unused\")\n private Long getVersion() {\n return version;\n }", "@Override\n public int getVersion() {\n return 0;\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@Override\n public double getVersion() {\n return 0;\n }", "public String getVersion(){\r\n return version;\r\n }", "public BigDecimal getVersion() {\r\n return version;\r\n }", "int getNumberPaymentReceipt();", "public Object getPaymentMode() {\n\t\treturn null;\n\t}", "private void m9894b() {\n if (this.f9489a == null) {\n throw new IllegalStateException(\"PaymentMethod not set.\");\n }\n }", "PaymentHandler createPaymentHandler();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "@Test(priority = 4)\n\tpublic void testPayment() {\n\t\tlogger = extent.startTest(\"passed\");\n\t\tWebDriverWait wait = new WebDriverWait(driver, 100);\n\t\twait.until(ExpectedConditions.presenceOfElementLocated(By.className(\"payment-info\")));\n\n\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"swit\\\"]/div[1]\")).click();\n\t\tdriver.findElement(By.id(\"btn\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t// For netbanking login\n\t\tdriver.findElement(By.name(\"username\")).sendKeys(\"123456\");\n\t\tdriver.findElement(By.name(\"password\")).sendKeys(\"Pass@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='LOGIN']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t//\n\t\tdriver.findElement(By.name(\"transpwd\")).sendKeys(\"Trans@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='PayNow']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Order Details\");\n\t\tlogger.log(LogStatus.PASS, \"testPayment Testcase is passed\");\n\t}", "void setVersion(long version);", "void paymentOrder(long orderId);", "@Override\n\tpublic int savePayment(RotatePayment record) {\n\t\trecord.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\tDate date = Calendar.getInstance().getTime();\n\t\trecord.setReportDate(date);\n\t\tint i =(int)(Math.random()*1000);\n\t\tString serial = String.format(\"%s%s%03d\", PREFIX,date.getTime(),i);\n\t\trecord.setPaySerial(serial);\n//\t\trecord.setOperator(TokenManager.getNickname());\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\t\t\n\t\t}\n\t\treturn paymentDao.savePayment(record);\n\t}", "long version();", "public short getVersion() {\n return version;\n }", "public void setVersion(String version) {\n\t\t\r\n\t}", "public int getVersion()\n {\n return encryptionDictionary.getInt( \"V\", 0 );\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setC_Payment_ID (int C_Payment_ID);", "public void setVersion(String version)\n {\n this.ver = version;\n }", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "@Override\r\n\tpublic int updatePaymentInfo(Payment payment) {\n\t\treturn session.update(\"payments.updatePayment\", payment);\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version)\n {\n this.version = version;\n }", "public void makePayment(String amount, String paymentRef) {\n JudoSDKManager.setKeyAndSecret(getApplicationContext(), API_TOKEN, API_SECRET);\n\n// Set environment to Sandbox\n JudoSDKManager.setSandboxMode(getApplicationContext());\n\n String customerRef = Settings.Secure.getString(getApplicationContext().getContentResolver(),\n Settings.Secure.ANDROID_ID);\n\n Intent intent = JudoSDKManager.makeAPayment(getApplicationContext(), JUDO_ID, \"GBP\", amount, paymentRef, customerRef, null);\n startActivityForResult(intent, ACTION_CARD_PAYMENT);\n }", "public byte getVersion() {\n return version;\n }", "public String getLBR_PartialPayment();", "@Override\n public int getVersion() {\n return 4;\n }", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "public void setVersion(Integer version)\r\n {\r\n this.version = version;\r\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public String versionNumber (){\r\n\t\t\treturn _versionNumber;\r\n\t\t}", "PaymentMethod getPaymentMethod();", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public Version version()\n/* */ {\n/* 518 */ return PackageVersion.VERSION;\n/* */ }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }" ]
[ "0.8003874", "0.7615207", "0.74101", "0.7088673", "0.697602", "0.69522053", "0.66937214", "0.6601176", "0.61239535", "0.611659", "0.58286566", "0.5777521", "0.5769225", "0.56743276", "0.5670999", "0.56420475", "0.56047046", "0.5594619", "0.5589226", "0.55740225", "0.55720717", "0.55314547", "0.55163753", "0.55087274", "0.5499384", "0.54845893", "0.5481322", "0.54725695", "0.5446738", "0.5446641", "0.5427762", "0.5414947", "0.5413848", "0.5411432", "0.5409488", "0.5404151", "0.53936666", "0.5391206", "0.53840125", "0.5363505", "0.5358766", "0.5358766", "0.5358766", "0.5358766", "0.5358199", "0.53405505", "0.5328853", "0.5323514", "0.53233206", "0.5312478", "0.5311192", "0.5309387", "0.5308493", "0.5297332", "0.5288811", "0.5284828", "0.52731156", "0.52724797", "0.52721226", "0.52669126", "0.5252194", "0.5247288", "0.5241985", "0.52417135", "0.52342534", "0.52320915", "0.523048", "0.5227301", "0.5223976", "0.522189", "0.5197352", "0.51936233", "0.5192416", "0.5188104", "0.518117", "0.5180413", "0.5180156", "0.5179672", "0.51669365", "0.5164336", "0.5159831", "0.51593894", "0.51540077", "0.51540077", "0.51528555", "0.5149047", "0.51431334", "0.5138233", "0.5137014", "0.5132955", "0.51279193", "0.51142555", "0.51139617", "0.51139617", "0.5109055", "0.510852", "0.5107375", "0.5101227", "0.5100216", "0.5100216" ]
0.62929416
8
optional uint32 payment_details_version = 1 [default = 1];
public Builder clearPaymentDetailsVersion() { copyOnWrite(); instance.clearPaymentDetailsVersion(); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getPaymentDetailsVersion();", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "boolean hasPaymentDetailsVersion();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "public Builder setPaymentDetailsVersion(int value) {\n copyOnWrite();\n instance.setPaymentDetailsVersion(value);\n return this;\n }", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "public CreditCard getDefaultPaymentInfo();", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "boolean hasSerializedPaymentDetails();", "String getPaymentInformation();", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public int getVersion() { return 1; }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "long getVersionNumber();", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\r\npublic int defaultPaymentInfo(int no) {\n\treturn session.insert(\"payments.defaultPayment\",no);\r\n}", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "void setPaymentInformation(String information);", "public String getMerchantNo();", "public long getVersion(){\n return localVersion;\n }", "public void setVersion(BigDecimal version) {\r\n this.version = version;\r\n }", "public int getPaymentNum() {\n \treturn this.paymentNum;\n }", "private void setPayment(com.dogecoin.protocols.payments.Protos.Payment value) {\n value.getClass();\n payment_ = value;\n bitField0_ |= 0x00000001;\n }", "public int getC_Payment_ID();", "public int updatePayment2(int requestId, int amount);", "@Override\n\tpublic int updatePayment(RotatePayment record) {\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tif(null==detail.getId()||\"\".equals(detail.getId()))\n\t\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\t\n\t\t}\n\t\treturn paymentDao.updatePayment(record);\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "private void m50363B() {\n try {\n TokenPaymentParams tokenPaymentParams = new TokenPaymentParams(this.f30711G0, this.f30708D0, this.f30709E0.getBrand(), this.f30737h0.getText().toString());\n StringBuilder sb = new StringBuilder();\n sb.append(this.f30720S.getString(C10232R.string.checkout_ui_callback_scheme));\n sb.append(\"://callback\");\n tokenPaymentParams.mo40895e(sb.toString());\n this.f30754y0.mo41066a(new Transaction((PaymentParams) tokenPaymentParams));\n this.f30728a.mo23628i(C11645a.f33474f, \"credit_card\");\n } catch (PaymentException e) {\n e.printStackTrace();\n }\n }", "public long getPaymentType() {\n return paymentType;\n }", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@ApiModelProperty(value = \"Software Statement version as provided by the organisation's PTC\")\n\n @Valid\n\n public BigDecimal getVersion() {\n return version;\n }", "public static String aPaymentId() {\n return \"123456\";\n }", "public void setVersion(String version){\r\n this.version = version;\r\n }", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "long getVersion();", "long getVersion();", "long getVersion();", "long getVersion();", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_CODE_PAYMENT) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectUpdatePayment(paymentId, rideAccept.getTotalAmount());\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n }\n }\n\n if (requestCode == 3) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n String paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectWaitingCharge(paymentId);\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n showPayment();\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n showPayment();\n }\n }\n }", "public abstract double getVersionNumber();", "public byte[] Bldr_version() {return bldr_version;}", "public long getVersionNo() {\r\n return versionNo;\r\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "public void setVersion(long version) {\n this.version = version;\n }", "int getTcfPolicyVersion();", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Override\n\tpublic String getVersion() {\n\t\treturn \"0\";\n\t}", "@Override\r\n\tpublic int getVersion() {\n\t\treturn 0;\r\n\t}", "Long getVersion();", "public String getVersionNumber ();", "@SuppressWarnings(\"unused\")\n private Long getVersion() {\n return version;\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "@Override\n public int getVersion() {\n return 0;\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@Override\n public double getVersion() {\n return 0;\n }", "public String getVersion(){\r\n return version;\r\n }", "public BigDecimal getVersion() {\r\n return version;\r\n }", "int getNumberPaymentReceipt();", "private void m9894b() {\n if (this.f9489a == null) {\n throw new IllegalStateException(\"PaymentMethod not set.\");\n }\n }", "public Object getPaymentMode() {\n\t\treturn null;\n\t}", "PaymentHandler createPaymentHandler();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "@Test(priority = 4)\n\tpublic void testPayment() {\n\t\tlogger = extent.startTest(\"passed\");\n\t\tWebDriverWait wait = new WebDriverWait(driver, 100);\n\t\twait.until(ExpectedConditions.presenceOfElementLocated(By.className(\"payment-info\")));\n\n\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"swit\\\"]/div[1]\")).click();\n\t\tdriver.findElement(By.id(\"btn\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t// For netbanking login\n\t\tdriver.findElement(By.name(\"username\")).sendKeys(\"123456\");\n\t\tdriver.findElement(By.name(\"password\")).sendKeys(\"Pass@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='LOGIN']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t//\n\t\tdriver.findElement(By.name(\"transpwd\")).sendKeys(\"Trans@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='PayNow']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Order Details\");\n\t\tlogger.log(LogStatus.PASS, \"testPayment Testcase is passed\");\n\t}", "void setVersion(long version);", "void paymentOrder(long orderId);", "@Override\n\tpublic int savePayment(RotatePayment record) {\n\t\trecord.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\tDate date = Calendar.getInstance().getTime();\n\t\trecord.setReportDate(date);\n\t\tint i =(int)(Math.random()*1000);\n\t\tString serial = String.format(\"%s%s%03d\", PREFIX,date.getTime(),i);\n\t\trecord.setPaySerial(serial);\n//\t\trecord.setOperator(TokenManager.getNickname());\n\t\tList<RotatePaymentDetail> detailList = record.getDetailList();\n\t\tfor(RotatePaymentDetail detail:detailList) {\n\t\t\tdetail.setId(UUID.randomUUID().toString().replaceAll(\"-\", \"\"));\n\t\t\t\n\t\t}\n\t\treturn paymentDao.savePayment(record);\n\t}", "long version();", "public void setVersion(String version) {\n\t\t\r\n\t}", "public short getVersion() {\n return version;\n }", "public int getVersion()\n {\n return encryptionDictionary.getInt( \"V\", 0 );\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version)\n {\n this.ver = version;\n }", "public void setC_Payment_ID (int C_Payment_ID);", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "@Override\r\n\tpublic int updatePaymentInfo(Payment payment) {\n\t\treturn session.update(\"payments.updatePayment\", payment);\r\n\t}", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version)\n {\n this.version = version;\n }", "public void makePayment(String amount, String paymentRef) {\n JudoSDKManager.setKeyAndSecret(getApplicationContext(), API_TOKEN, API_SECRET);\n\n// Set environment to Sandbox\n JudoSDKManager.setSandboxMode(getApplicationContext());\n\n String customerRef = Settings.Secure.getString(getApplicationContext().getContentResolver(),\n Settings.Secure.ANDROID_ID);\n\n Intent intent = JudoSDKManager.makeAPayment(getApplicationContext(), JUDO_ID, \"GBP\", amount, paymentRef, customerRef, null);\n startActivityForResult(intent, ACTION_CARD_PAYMENT);\n }", "public byte getVersion() {\n return version;\n }", "@Override\n public int getVersion() {\n return 4;\n }", "public String getLBR_PartialPayment();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "public void setVersion(Integer version)\r\n {\r\n this.version = version;\r\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public void setVersion(int version) {\n this.version = version;\n }", "public String versionNumber (){\r\n\t\t\treturn _versionNumber;\r\n\t\t}", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "PaymentMethod getPaymentMethod();", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }", "public void setVersion(String version) {\n this.version = version;\n }" ]
[ "0.80033404", "0.76153654", "0.7409321", "0.7087752", "0.69754475", "0.6951989", "0.6692849", "0.6600417", "0.62931544", "0.61232376", "0.61151564", "0.58272123", "0.57759625", "0.5767995", "0.56724226", "0.5670457", "0.5641753", "0.56025696", "0.55940056", "0.55900306", "0.55752903", "0.5571828", "0.55296344", "0.5507845", "0.549894", "0.5485007", "0.54830855", "0.54718226", "0.5445836", "0.5445685", "0.54282063", "0.5413922", "0.5413161", "0.5411478", "0.5408061", "0.54030067", "0.5394123", "0.5390393", "0.5385908", "0.536276", "0.5358878", "0.5358878", "0.5358878", "0.5358878", "0.53573567", "0.5341767", "0.5329126", "0.5324657", "0.5323544", "0.53126985", "0.531203", "0.5310835", "0.53096783", "0.5297628", "0.5289074", "0.52851415", "0.52738047", "0.52731353", "0.5272184", "0.52671415", "0.52521473", "0.52478826", "0.5242297", "0.52420473", "0.52349424", "0.52304155", "0.52302", "0.5226005", "0.52228004", "0.5220261", "0.519926", "0.5194534", "0.5192214", "0.51874834", "0.5182522", "0.51820135", "0.51817393", "0.51817316", "0.5166491", "0.5166081", "0.51606935", "0.515869", "0.5156166", "0.5156166", "0.5154974", "0.5147997", "0.5144217", "0.5137154", "0.5137063", "0.5131639", "0.5127382", "0.5116467", "0.5116454", "0.5116454", "0.51098603", "0.51080173", "0.5107231", "0.51024103", "0.51024103", "0.51024103" ]
0.55157065
23
none / x509+sha256 / x509+sha1 optional string pki_type = 2 [default = "none"];
@java.lang.Override public boolean hasPkiType() { return instance.hasPkiType(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPkiType();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "boolean hasPkiType();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "public static void main(String[] args) throws IcbcApiException {\n\t\tUiIcbcClient client = new UiIcbcClient(APP_ID,IcbcConstants.SIGN_TYPE_RSA,\n\t\t\t\t\"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJCoQe/O+uqpOtyE/2CUjD7wosZw8jI1AlLNJCllOmlX+obA6h97b0JsEL0SjMCAR3xJyw7MKLqkcy5qQ/bBgw2XSrodmjzOVqfT1OXRii0xw0HiVkHR4cEWnEAAdfo0lDc4iuzCIQrnT5gM0+U+qeSV6JFfwVRjgYzBdHQRPCf1AgMBAAECgYAdQUoEe7GXH5591o/nMmOinvvscg8pRDsyD7bOgGBtyZMrCXzP3SDFKCHCeyvoColqg2oDlhpulK+OpYMVNlGQcO4eubOJp9MUc3m4A9RxkVr3dsVrmygM5czPfWHAPVQ4dECDruBJn9zoo1ci0myRTh4KSCq6SxpCE0Pbf3j7iQJBAOdMPFRfOkSQ1hsN9Mg4jd9on8r7+mF8gFPhkNI6qvEKw/prmU3obUWvZL42vRlLOQyyB92mBF24PStR/B6CjR8CQQCgGz0VoqCplurSCapGdgX3D7bNSDtMUmaLJYJxih8v+zghP0YtVgDeV3NjogVjOlz8/9Rebo0PoFcqyJnNA1RrAkEAul3dBoasZm7ldWsrXuDiv66HgoDB4Cb3J59Kl3oaHpp0CqUEI5gx48JNRE7K00SfNTGF0Pxh7Dn1X6Bxqwu6NQJADrdyPfLc4bnFi9jnleJzWepP2z6wdKt+UXv5KYaQp1BoMGYohTJKkiVnrdjOtfg/Y+IAG03+GVmbqYsW2AleUQJBANYQklohKtsmq8ptX3as6hjcuXcTpc2DSpVeOnCueNv107+dDJ+K14tbiVYzF3tkHBNMRkGtr6EuGKJ+A63sJ00=\",\n\t\t\t\tIcbcConstants.CHARSET_UTF8,IcbcConstants.ENCRYPT_TYPE_AES, \"xMh0xFsG7G80ziePFdnT8g==\");\n\t\tEaccountManageRequestV1 request = new EaccountManageRequestV1();\t\t\n\t\trequest.setServiceUrl(\"http://122.64.61.111:8081/ui/eaccount/manage/V1\");///\n\t\tEaccountManageRequestBizV1 bizContent = new EaccountManageRequestBizV1();\n\t\tbizContent.setMobileNo(\"13703878410\");//选输,手机号\n\t\tbizContent.setIdcode(\"128440810108044\");//选输,身份证号\n\t\tbizContent.setName(URLEncoder.encode(\"芡悠\"));//选输,用户姓名\n\t\tbizContent.setUserId(\"128440810108044\");//必输,需控制不能为空,用户唯一标识,送身份证号\n\t\tbizContent.setBacAddr(URLEncoder.encode(\"http://www.test.com\"));//选输,回调地址\n\t\tbizContent.setEpayflag(\"0\");//选输,工银e支付标志,0-短信、1-静态密码,集成客户端SDK的方式能送0-短信或1-静态密码,非APP方式只能送0-短信,不送默认为0-短信\n\t\t\n\t\tbizContent.setCorpAppid(APP_ID);//外公司合作方送APP_ID的值,行内应用如e支付等送外公司合作方的APPID\n\t\tlong systime = System.currentTimeMillis(); // 现时间戳\t\t\n\t\tString orderTimeStamp=new Long(systime).toString();\n\t\t\n\t\tSystem.out.println(\"orderTimeStamp:\"+orderTimeStamp);\n\t\tbizContent.setOrderTimeStamp(orderTimeStamp);//生成请求的时间,必输\n\t\t\n\t\tbizContent.setZoneno(\"00200\");//地区号号,选输,5位数字,上送值联系对接分行提供\n\t\tbizContent.setBrno(\"00260\");//网点号,选输,5位数字,上送值联系对接分行提供\n\t\t\n\t\trequest.setBizContent(bizContent);\n\t\tSystem.out.println(client.buildPostForm(request));// 实际调用时的相关返回结果及异常处理,请自行添加\n\t}", "dkk mo4509g();", "private void generatePrivacyKeyPair(boolean clientMode) throws IOException, UnsupportedEncodingException, NoSuchAlgorithmException, SaslException {\n byte[] ccmagic = CLIENT_CONF_MAGIC.getBytes(encoding);\n byte[] scmagic = SVR_CONF_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n int n;\n if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_40])) {\n n = 5;\n } else if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_56])) {\n n = 7;\n } else {\n n = 16;\n }\n byte[] keyBuffer = new byte[n + ccmagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, n);\n System.arraycopy(ccmagic, 0, keyBuffer, n, ccmagic.length);\n md5.update(keyBuffer);\n byte[] Kcc = md5.digest();\n System.arraycopy(scmagic, 0, keyBuffer, n, scmagic.length);\n md5.update(keyBuffer);\n byte[] Kcs = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST24:Kcc: \", Kcc);\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST25:Kcs: \", Kcs);\n }\n byte[] myKc;\n byte[] peerKc;\n if (clientMode) {\n myKc = Kcc;\n peerKc = Kcs;\n } else {\n myKc = Kcs;\n peerKc = Kcc;\n }\n try {\n SecretKey encKey;\n SecretKey decKey;\n if (negotiatedCipher.indexOf(CIPHER_TOKENS[RC4]) > -1) {\n encCipher = Cipher.getInstance(\"RC4\");\n decCipher = Cipher.getInstance(\"RC4\");\n encKey = new SecretKeySpec(myKc, \"RC4\");\n decKey = new SecretKeySpec(peerKc, \"RC4\");\n encCipher.init(Cipher.ENCRYPT_MODE, encKey);\n decCipher.init(Cipher.DECRYPT_MODE, decKey);\n } else if ((negotiatedCipher.equals(CIPHER_TOKENS[DES])) || (negotiatedCipher.equals(CIPHER_TOKENS[DES3]))) {\n String cipherFullname, cipherShortname;\n if (negotiatedCipher.equals(CIPHER_TOKENS[DES])) {\n cipherFullname = \"DES/CBC/NoPadding\";\n cipherShortname = \"des\";\n } else {\n cipherFullname = \"DESede/CBC/NoPadding\";\n cipherShortname = \"desede\";\n }\n encCipher = Cipher.getInstance(cipherFullname);\n decCipher = Cipher.getInstance(cipherFullname);\n encKey = makeDesKeys(myKc, cipherShortname);\n decKey = makeDesKeys(peerKc, cipherShortname);\n IvParameterSpec encIv = new IvParameterSpec(myKc, 8, 8);\n IvParameterSpec decIv = new IvParameterSpec(peerKc, 8, 8);\n encCipher.init(Cipher.ENCRYPT_MODE, encKey, encIv);\n decCipher.init(Cipher.DECRYPT_MODE, decKey, decIv);\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST26:\" + negotiatedCipher + \" IVcc: \", encIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST27:\" + negotiatedCipher + \" IVcs: \", decIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST28:\" + negotiatedCipher + \" encryption key: \", encKey.getEncoded());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST29:\" + negotiatedCipher + \" decryption key: \", decKey.getEncoded());\n }\n }\n } catch (InvalidKeySpecException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported key \" + \"specification used.\", e);\n } catch (InvalidAlgorithmParameterException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid cipher \" + \"algorithem parameter used to create cipher instance\", e);\n } catch (NoSuchPaddingException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported \" + \"padding used for chosen cipher\", e);\n } catch (InvalidKeyException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid data \" + \"used to initialize keys\", e);\n }\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "java.lang.String getPublicEciesKey();", "OpenSSLKey mo134201a();", "public abstract String getSigAlgOID();", "private void generateIntegrityKeyPair(boolean clientMode) throws UnsupportedEncodingException, IOException, NoSuchAlgorithmException {\n byte[] cimagic = CLIENT_INT_MAGIC.getBytes(encoding);\n byte[] simagic = SVR_INT_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n byte[] keyBuffer = new byte[H_A1.length + cimagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, H_A1.length);\n System.arraycopy(cimagic, 0, keyBuffer, H_A1.length, cimagic.length);\n md5.update(keyBuffer);\n byte[] Kic = md5.digest();\n System.arraycopy(simagic, 0, keyBuffer, H_A1.length, simagic.length);\n md5.update(keyBuffer);\n byte[] Kis = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST12:Kic: \", Kic);\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST13:Kis: \", Kis);\n }\n if (clientMode) {\n myKi = Kic;\n peerKi = Kis;\n } else {\n myKi = Kis;\n peerKi = Kic;\n }\n }", "public final String mo1957a() {\n return \"type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey\";\n }", "private native String native_ks(long cookie, byte[] userKey);", "@Override\n public ConcurrentContentSigner newSigner(\n String type, SignerConf conf, X509Cert[] certificateChain)\n throws ObjectCreationException {\n type = type.toLowerCase(Locale.ROOT);\n if (!types.contains(type)) {\n throw new ObjectCreationException(\"unknown signer type \" + type);\n }\n\n String str = conf.getConfValue(\"parallelism\");\n int parallelism = 20;\n if (str != null) {\n try {\n parallelism = Integer.parseInt(str);\n } catch (NumberFormatException ex) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n\n if (parallelism < 1) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n }\n\n str = conf.getConfValue(\"alias\");\n if (str == null) {\n throw new ObjectCreationException(\"alias is not specified\");\n }\n int keyId = Integer.parseInt(str);\n\n String algoName = conf.getConfValue(\"algo\");\n if (algoName == null) {\n throw new ObjectCreationException(\"algo is not specified\");\n }\n\n try {\n InitStatus initStatus = init(type);\n if (initStatus.status.get() != 1) {\n throw new ObjectCreationException(initStatus.details);\n }\n\n SignAlgo algo = SignAlgo.getInstance(algoName);\n String keyAlgoName;\n String bcKeyAlgoName;\n if (algo.isSM2SigAlgo()) {\n keyAlgoName = \"SM2\";\n bcKeyAlgoName = \"EC\";\n } else if (algo.isRSAPkcs1SigAlgo() || algo.isRSAPSSSigAlgo()) {\n keyAlgoName = \"RSA\";\n bcKeyAlgoName = \"RSA\";\n } else if (algo.isECDSASigAlgo() || algo.isPlainECDSASigAlgo()) {\n keyAlgoName = \"EC\";\n bcKeyAlgoName = \"EC\";\n } else {\n throw new ObjectCreationException(\"unsupported algo \" + algoName);\n }\n\n Provider provider = providerMap.get(type);\n\n // Method to read create PrivateKey and PublicKey object.\n // SANSEC use KeyPairGenerator.generateKeyPair to read the keypair-\n // No new keypair will be generated here.\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(keyAlgoName, provider);\n kpGen.initialize(keyId << 16);\n KeyPair kp = kpGen.generateKeyPair();\n\n PublicKey publicKey = KeyFactory.getInstance(bcKeyAlgoName, \"BC\")\n .generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));\n\n return new JceSignerBuilder(kp.getPrivate(), publicKey, certificateChain, provider)\n .createSigner(algo, parallelism);\n } catch (GeneralSecurityException | XiSecurityException ex) {\n throw new ObjectCreationException(ex.getMessage(), ex);\n }\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv xgetCryptProviderType();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "boolean hasPkiData();", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "public String mo34971a() {\n return \"SHA-384\";\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "public interface JsonKey {\n\n String CLASS = \"class\";\n String DATA = \"data\";\n String EKS = \"eks\";\n String ID = \"id\";\n String LEVEL = \"level\";\n String MESSAGE = \"message\";\n String METHOD = \"method\";\n String REQUEST_MESSAGE_ID = \"msgId\";\n String STACKTRACE = \"stacktrace\";\n String VER = \"ver\";\n String OK = \"ok\";\n String LOG_LEVEL = \"logLevel\";\n String ERROR = \"error\";\n String EMPTY_STRING = \"\";\n String RESPONSE = \"response\";\n String ADDRESS = \"address\";\n String KEY = \"key\";\n String ERROR_MSG = \"error_msg\";\n String ATTRIBUTE = \"attribute\";\n String ERRORS = \"errors\";\n String SUCCESS = \"success\";\n\n String CERTIFICATE = \"certificate\";\n String RECIPIENT_NAME = \"recipientName\";\n String COURSE_NAME = \"courseName\";\n String NAME = \"name\";\n String HTML_TEMPLATE = \"htmlTemplate\";\n String TAG = \"tag\";\n String ISSUER = \"issuer\";\n String URL = \"url\";\n String SIGNATORY_LIST = \"signatoryList\";\n String DESIGNATION = \"designation\";\n String SIGNATORY_IMAGE = \"image\";\n\n String DOMAIN_URL = \"sunbird_cert_domain_url\";\n String ASSESSED_DOMAIN = \"ASSESSED_DOMAIN\";\n String BADGE_URL = \"BADGE_URL\";\n String ISSUER_URL = \"ISSUER_URL\";\n String TEMPLATE_URL = \"TEMPLATE_URL\";\n String CONTEXT = \"CONTEXT\";\n String VERIFICATION_TYPE = \"VERIFICATION_TYPE\";\n String SIGNATORY_EXTENSION = \"SIGNATORY_EXTENSION\";\n String RECIPIENT_EMAIl = \"recipientEmail\";\n String RECIPIENT_PHONE = \"recipientPhone\";\n String RECIPIENT_ID = \"recipientId\";\n String VALID_FROM = \"validFrom\";\n String EXPIRY = \"expiry\";\n String OLD_ID = \"oldId\";\n String PUBLIC_KEY = \"publicKey\";\n String DESCRIPTION = \"description\";\n String LOGO = \"logo\";\n String ISSUE_DATE = \"issueDate\";\n String USER = \"user\";\n String CERTIFICATE_NAME = \"name\";\n\n String CONTAINER_NAME = \"CONTAINER_NAME\";\n String CLOUD_STORAGE_TYPE = \"CLOUD_STORAGE_TYPE\";\n String CLOUD_UPLOAD_RETRY_COUNT = \"CLOUD_UPLOAD_RETRY_COUNT\";\n String AZURE_STORAGE_SECRET = \"AZURE_STORAGE_SECRET\";\n String AZURE_STORAGE_KEY = \"AZURE_STORAGE_KEY\";\n String ACCESS_CODE_LENGTH = \"ACCESS_CODE_LENGTH\";\n String ORG_ID = \"orgId\";\n String KEYS = \"keys\";\n String ENC_SERVICE_URL = \"sunbird_cert_enc_service_url\";\n String SIGN_HEALTH_CHECK_URL = \"SIGN_HEALTH_CHECK_URL\";\n String SIGN_URL = \"SIGN_URL\";\n String SIGN_VERIFY_URL = \"SIGN_VERIFY_URL\";\n String SIGN_CREATOR = \"SIGN_CREATOR\";\n String SIGN = \"sign\";\n String VERIFY = \"verify\";\n String KEY_ID = \"keyId\";\n String JSON_URL = \"jsonUrl\";\n String PDF_URL = \"pdfUrl\";\n String UNIQUE_ID = \"id\";\n String GENERATE_CERT = \"generateCert\";\n String PUBLIC_KEY_URL = \"PUBLIC_KEY_URL\";\n String GET_SIGN_URL = \"getSignUrl\";\n String SIGNED_URL = \"signedUrl\";\n\n String ACCESS_CODE = \"accessCode\";\n String JSON_DATA = \"jsonData\";\n String SLUG = \"sunbird_cert_slug\";\n}", "BigInteger getCEP();", "java.lang.String getPubkey();", "public void setCertiType(java.lang.String certiType) {\n this.certiType = certiType;\n }", "public abstract String getSigAlgName();", "@Schema(required = true, description = \"Contract type (KIP-7, KIP-17, ERC-20, ERC-721)\")\n public String getType() {\n return type;\n }", "public ProfileKey getProfileKey(String username, String type) throws ProfileKeyManagerPersistenceException {\n ParameterHelpers.checkParameter(username, \"username\");\n\n boolean registered = checkType(type);\n\n Connection connection = getConnection();\n\n try {\n return getProfileKey(connection, username, type, registered);\n } finally {\n closeConnection(connection);\n }\n }", "protected CryptoProvider() {\n\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "@ParameterizedTest\n @EnumSource(KeyType.class)\n void testMissingJWTPublicKey(KeyType keyType) throws NoSuchAlgorithmException {\n final Pair<String, PrivateKey> keyPair = generateKeypair(keyType);\n\n final String jwt = Jwts.builder()\n .setHeaderParam(\"kid\", UUID.randomUUID())\n .setAudience(String.format(\"%sToken/auth\", \"here\"))\n .setIssuer(\"macaroon\")\n .setSubject(\"macaroon\")\n .setId(UUID.randomUUID().toString())\n .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES)))\n .signWith(keyPair.getRight(), APIAuthHelpers.getSigningAlgorithm(keyType))\n .compact();\n\n // Submit the JWT\n Response response = RESOURCE.target(\"/v1/Token/auth\")\n .queryParam(\"scope\", \"system/*.*\")\n .queryParam(\"grant_type\", \"client_credentials\")\n .queryParam(\"client_assertion_type\", TokenResource.CLIENT_ASSERTION_TYPE)\n .queryParam(\"client_assertion\", jwt)\n .request()\n .post(Entity.entity(\"\", MediaType.APPLICATION_FORM_URLENCODED));\n\n assertEquals(401, response.getStatus(), \"Should be unauthorized\");\n assertTrue(response.readEntity(String.class).contains(\"Cannot find public key\"), \"Should have correct exception\");\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "public ECP getPublicKGCKey(){return pkS;}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "private TPM_DIGEST createEmptyPubKeyHash()\r\n {\r\n// if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_BROADCOM )\r\n// {\r\n// return null;\r\n// }\r\n// else\r\n// {\r\n// return new TPM_DIGEST();\r\n// }\r\n if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_INFINEON )\r\n {\r\n return new TPM_DIGEST();\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }", "public String getTlsKey();", "@Test\n\tpublic void testSecuirtyConfigsOperations() throws NoSuchAlgorithmException {\n\t\t// Generate and store keys for the first time\n\t\tServerKeyPairs serverKeyPairs1 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair1 = serverKeyPairs1.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair1 = serverKeyPairs1.getSignatureKeyPair();\n\n\t\t// Initialize a new serverKeyPairs to test that it will only read\n\t\t// previously generated keys\n\t\tServerKeyPairs serverKeyPairs2 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair2 = serverKeyPairs2.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair2 = serverKeyPairs2.getSignatureKeyPair();\n\n\t\tassertEquals(\"Wrong loaded encryption public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded encryption private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getPrivateExponent());\n\n\t\tassertEquals(\"Wrong loaded signature public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded signature private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getPrivateExponent());\n\t}", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType.Enum getCryptAlgorithmType();", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public MEKeyTool() {\n keystore = new PublicKeyStoreBuilderBase();\n }", "public PrivateKeyType getPivateKeyType() {\n return PrivateKeyType.SAPLING_EXTENED_SPEND_KEY;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType xgetCryptAlgorithmType();", "public void setPrincipalType(String principalType){\n this.principalType = principalType;\n //Update hashMap value..\n hashMap.put(\"principalType\", principalType);\n }", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "private static String generateServerKey(Poi poi) {\n LonLat viewPoint = poi.getViewPosition();\n int lon = viewPoint.getLonInt();\n int lat = viewPoint.getLatInt();\n int alt = viewPoint.getAltInt();\n return generateServerKey(poi.getName(), poi.getAddress(), lon, lat, alt);\n }", "public static void main(String[] args) {\n String keyFile = \"D:\\\\data\\\\kms\\\\liweigang.idc\";\n String message = \"dksf3r38324hrewjrh3r&^%djfdsjkek\";\n String pubmatrix = \"D:\\\\data\\\\kms\\\\sm2cpk.cn.pkm\";\n\n byte[] keycard = Tool.ReadFile(keyFile);\n System.out.println(\"keyCard:\" + Tool.Bytes2Hex(keycard));\n\n //得到私钥\n byte[] priKey = GMJni.GetPriKey(keycard);\n String priKeyHex = Tool.Bytes2Hex(priKey);\n System.out.println(\"private key:\" + priKeyHex);\n\n //得到密钥标识\n byte[] keyId = GMJni.GetKeyId(keycard);\n System.out.println(\"keyId:\" + Tool.Bytes2String(keyId));\n\n //得到公钥\n byte[] pubKey = GMJni.CalPubKey(Tool.String2Bytes(pubmatrix), keyId);\n System.out.println(\"public key:\" + Tool.Bytes2Hex(pubKey));\n\n //1000个不同message\n List<String> msgList = new ArrayList<>(12);\n for (int i = 0; i < 1000; i++) {\n //message基础上字符串长度+10\n msgList.add(message + RandomUtil.randomString(10));\n }\n long start = System.currentTimeMillis();\n //签名结果\n int rv = 0;\n //缓存\n MapCache cache = new MapCache();\n //命中缓存次数\n int count = 0;\n int count2 = 0;\n for (int i = 0; i < 100000; i++) {\n System.out.println(\"模拟请求第\" + i + \"次数\");\n\n //计算E值\n //30种不同的message,即仅30个不走缓存\n byte[] E = GMJni.SM2GetE(keyId, pubKey, Tool.String2Bytes(msgList.get(new Random().nextInt(30))));\n String hexE = Tool.Bytes2Hex(E);\n// System.out.println(\"E:\" + hexE);\n\n //SM2签名\n byte[] sig = GMJni.SM2Sign(priKey, E);\n// System.out.println(\"private key:\" + Tool.Bytes2Hex(priKey));\n// System.out.println(\"sign value:\" + Tool.Bytes2Hex(sig));\n\n // SM2签名验证\n // 引入Map缓存 E,sig的16进制的MD5值\n String hex = hexE + priKeyHex;\n// System.out.println(\"finalStr:\" + hex);\n String md5 = SecureUtil.md5(hex);\n if (null != cache.get(md5)) {\n count++;\n// System.out.println(\"命中缓存\" + (++count));\n } else {\n rv += GMJni.SM2Verify(pubKey, E, sig);\n count2++;\n cache.add(md5, (byte) 1, 50 * 1000);\n }\n }\n long end = System.currentTimeMillis();\n double v = (end - start) / 1000.0;\n System.out.println(\"time consuming:\" + v + \" sec\");\n System.out.println(Math.round(100000 / v) + \" times/sec\");\n System.out.println(\"命中缓存\" + (count));\n System.out.println(\"未命中\" + (count2));\n if (rv != 0) {\n System.out.println(\"Verify signature fail, error code is \" + String.valueOf(rv));\n } else {\n System.out.println(\"Verify signature success.\");\n }\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public java.lang.String getCertiType() {\n return certiType;\n }", "public static void registerDefaultAlgorithms() {\n/* 390 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#dsa-sha1\", SignatureDSA.class);\n/* */ \n/* */ \n/* 393 */ algorithmHash.put(\"http://www.w3.org/2009/xmldsig11#dsa-sha256\", SignatureDSA.SHA256.class);\n/* */ \n/* */ \n/* 396 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\", SignatureBaseRSA.SignatureRSASHA1.class);\n/* */ \n/* */ \n/* 399 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#hmac-sha1\", IntegrityHmac.IntegrityHmacSHA1.class);\n/* */ \n/* */ \n/* 402 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-md5\", SignatureBaseRSA.SignatureRSAMD5.class);\n/* */ \n/* */ \n/* */ \n/* 406 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160\", SignatureBaseRSA.SignatureRSARIPEMD160.class);\n/* */ \n/* */ \n/* */ \n/* 410 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\", SignatureBaseRSA.SignatureRSASHA256.class);\n/* */ \n/* */ \n/* 413 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384\", SignatureBaseRSA.SignatureRSASHA384.class);\n/* */ \n/* */ \n/* 416 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\", SignatureBaseRSA.SignatureRSASHA512.class);\n/* */ \n/* */ \n/* 419 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1\", SignatureECDSA.SignatureECDSASHA1.class);\n/* */ \n/* */ \n/* 422 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256\", SignatureECDSA.SignatureECDSASHA256.class);\n/* */ \n/* */ \n/* 425 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384\", SignatureECDSA.SignatureECDSASHA384.class);\n/* */ \n/* */ \n/* 428 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512\", SignatureECDSA.SignatureECDSASHA512.class);\n/* */ \n/* */ \n/* 431 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-md5\", IntegrityHmac.IntegrityHmacMD5.class);\n/* */ \n/* */ \n/* 434 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160\", IntegrityHmac.IntegrityHmacRIPEMD160.class);\n/* */ \n/* */ \n/* 437 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha256\", IntegrityHmac.IntegrityHmacSHA256.class);\n/* */ \n/* */ \n/* 440 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha384\", IntegrityHmac.IntegrityHmacSHA384.class);\n/* */ \n/* */ \n/* 443 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha512\", IntegrityHmac.IntegrityHmacSHA512.class);\n/* */ }", "java.lang.String getServerSecret();", "public static void main(String[] args) {\n\t\tString algorithm = SignatureAlgorithm.HS256.getJcaName();\r\n\t\tSystem.out.println(algorithm);\r\n\r\n\t\t// set secret key\r\n\t\tString secret = \"this+is+my+scret+key+AAAAAAAAAAAAAAAAAAAAAAAAA\";\r\n\r\n\t\t// background information\r\n\t\t// =============================================================\r\n\t\t/*\r\n\t\t * the bytes of the secret key will be used by the signature algorithm - must be\r\n\t\t * in base 64 format\r\n\t\t */\r\n//\t\tbyte[] scretKeyEncoded = secret.getBytes(); // java encoding\r\n//\t\tbyte[] scretKeyDecoded = Base64.getDecoder().decode(secret); // base64\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyEncoded));\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyDecoded));\r\n\t\t// =====================================================================================\r\n\r\n\t\t// create the key from the decoded secret\r\n\t\tKey key = new SecretKeySpec(Base64.getDecoder().decode(secret), algorithm);\r\n\r\n\t\tInstant now = Instant.now();\r\n\r\n\t\t// create a JWT instance\r\n\t\tString jwt = Jwts.builder()\r\n\r\n\t\t\t\t.signWith(key)\r\n\r\n\t\t\t\t.setIssuedAt(Date.from(now))\r\n\r\n\t\t\t\t// will be valid for 10 seconds\r\n\t\t\t\t.setExpiration(Date.from(now.plus(10, ChronoUnit.SECONDS)))\r\n\r\n\t\t\t\t.setSubject(\"aaa@mail\")\r\n\r\n\t\t\t\t.claim(\"First name\", \"Dan\")\r\n\r\n\t\t\t\t.claim(\"Last name\", \"Levi\")\r\n\r\n\t\t\t\t.compact();\r\n\r\n\t\tSystem.out.println(jwt);\r\n\r\n\t\t// ==================================================\r\n\t\t// parse the JWS to get the expanded JWT\r\n//\t\tJWS - JSON Web Signature [aaaa.bbbb.cccc]\r\n//\t\tJWT - JSON Web Token [aaaa.bbbb.cccc]\r\n\r\n\t\tSystem.out.println(\"====================\");\r\n\t\tSystem.out.println(\"parsing the JWS to get a JWT\");\r\n\t\tJwtParser jwtParser = Jwts.parserBuilder().setSigningKey(key).build();\r\n\t\t// to demonstrate expiration paste an old JWS\r\n\t\tjwt = \"eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjA2Mzk1MTEsImV4cCI6MTYyMDYzOTUyMSwic3ViIjoiYWFhQG1haWwiLCJGaXJzdCBuYW1lIjoiRGFuIiwiTGFzdCBuYW1lIjoiTGV2aSJ9.cefEbBejjebKVILgOzca0LJZfd0F3qjezegeCaxOrfE\";\r\n\t\tSystem.out.println(jwtParser.parse(jwt));\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getHeader());\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getBody());\r\n\r\n\t}", "private String getSignatureString(Type type)\r\n {\r\n if(type instanceof CompoundType)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n CompoundType cType = (CompoundType)type;\r\n //find key and value types\r\n String keyType = getSignatureString(cType.keyType);\r\n sb.append(\"Ljava/util/HashMap\");\r\n sb.append(\"<\");\r\n sb.append(keyType);\r\n sb.append(getSignatureString(cType.valType));\r\n sb.append(\">;\");\r\n return sb.toString();\r\n }\r\n else if(type instanceof SimpleType)\r\n {\r\n switch(((SimpleType)type).type)\r\n {\r\n case INT:\r\n return \"Ljava/lang/Integer;\";\r\n case BOOLEAN:\r\n return \"Ljava/lang/Boolean;\";\r\n case STRING:\r\n return \"Ljava/lang/String;\";\r\n }\r\n }\r\n return null;\r\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "public String getJCEProviderName() {\n/* 196 */ return this.signatureAlgorithm.engineGetJCEProviderName();\n/* */ }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public String getJCEAlgorithmString() {\n/* 187 */ return this.signatureAlgorithm.engineGetJCEAlgorithmString();\n/* */ }", "com.google.protobuf.ByteString getPublicEciesKeyBytes();", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "long getCryptProviderTypeExt();", "public static String getKeyTypeName(KeyType type)\n {\n // TODO: should be moved to DBProvider ...\n // MySQL : key identifier\n // SQLServer : key identifier\n // Derby : key identifier\n // PostgreSQL: key identifier\n switch (type) {\n // MySQL: key types ...\n case PRIMARY : return \"PRIMARY KEY\"; // table\n case UNIQUE : return \"UNIQUE\"; // table\n case INDEX : return \"INDEX\"; // table/index\n case UNIQUE_INDEX : return \"UNIQUE INDEX\"; // table/index\n default : return \"UNKNOWN\";\n }\n }", "long getCryptAlgorithmSid();", "@PostMapping(\"/createKeyPair\")\n public String createKeyPair() {\n \n AWSKMS kmsClient = AWSKMSClientBuilder.standard().build();\n \n return \"Private uid: \"+ priuid +\"\\nPublic uid: \" + pubuid +\"\\n\";\n }", "switch (buffer[ISO7816.OFFSET_CDATA + 4]) {\r\n\t\tcase BASIC:\r\n\t\t\tsetSignatureType(BASIC);\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tsetSignatureType(AUTHENTICATION);\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tsetSignatureType(NON_REPUDIATION);\r\n\t\t\tbreak;\r\n\t\tcase CA_ROLE:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\tdefault:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "private KeyStore askForPin() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {\n char newPin[] = PinDialog.getPIN(this.providerDesc);\n try {\n KeyStore ks = getKeyStore(newPin);\n pin = newPin;\n return ks;\n } catch (IOException e2) {\n e2.printStackTrace();\n if (e2.getCause() instanceof LoginException) {\n JOptionPane.showMessageDialog(null, \"Wrong PIN\", \"Cryptographic card\", JOptionPane.WARNING_MESSAGE);\n }\n throw e2;\n }\n }", "public String getTlsKeyPath();", "public byte[] getUserKey() throws IOException\n {\n byte[] u = null;\n COSString user = (COSString)encryptionDictionary.getDictionaryObject( COSName.getPDFName( \"U\" ) );\n if( user != null )\n {\n u = user.getBytes();\n }\n return u;\n }", "@Override\n public String getProviderName() {\n return \"SimpleEncryptionKeyStoreProvider\";\n }", "public interface SKey {\n\n String FAIL_STORE = \"job.fail.store\";\n\n String LOADBALANCE = \"loadbalance\";\n\n String EVENT_CENTER = \"event.center\";\n\n String REMOTING = \"lts.remoting\";\n\n String REMOTING_SERIALIZABLE_DFT = \"lts.remoting.serializable.default\";\n\n String ZK_CLIENT_KEY = \"zk.client\";\n\n String JOB_ID_GENERATOR = \"id.generator\";\n\n String JOB_LOGGER = \"job.logger\";\n\n String JOB_QUEUE = \"job.queue\";\n}", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "private void getKeyType(final PdfObject pdfObject, final int i, final byte[] raw, final int length, final int keyLength, final int keyStart, final int type) {\n if(debugFastCode)//used in debug\n {\n PDFkey = PdfDictionary.getKey(keyStart, keyLength, raw);\n }\n \n PDFkeyInt=PdfDictionary.getIntKey(keyStart,keyLength,raw);\n \n //correct mapping\n if(PDFkeyInt==PdfDictionary.Indexed && (type==PdfDictionary.MK ||type==PdfDictionary.Form || type==PdfDictionary.Linearized || type==PdfDictionary.Group)) {\n PDFkeyInt = PdfDictionary.I;\n }\n \n if(isInlineImage) {\n PDFkeyInt = PdfObjectFactory.getInlineID(PDFkeyInt);\n }\n \n final int id=pdfObject.getID();\n \n if(type==PdfDictionary.Resources && (PDFkeyInt==PdfDictionary.ColorSpace\n || PDFkeyInt==PdfDictionary.ExtGState || PDFkeyInt==PdfDictionary.Shading\n || PDFkeyInt==PdfDictionary.XObject || PDFkeyInt==PdfDictionary.Font|| PDFkeyInt==PdfDictionary.Pattern)){\n pdfKeyType=PdfDictionary.VALUE_IS_DICTIONARY_PAIRS;\n //}else if (type==PdfDictionary.Form && id== PdfDictionary.AA && PDFkeyInt== PdfDictionary.K){\n // pdfKeyType= PdfDictionary.VALUE_IS_UNREAD_DICTIONARY;\n }else if (type==PdfDictionary.Outlines && PDFkeyInt== PdfDictionary.D){\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && PDFkeyInt== PdfDictionary.D){\n if(id==PdfDictionary.AP || id==PdfDictionary.AA){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if(id==PdfDictionary.Win){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else{\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && (id==PdfDictionary.AP || id==PdfDictionary.AA) && PDFkeyInt== PdfDictionary.A){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if (PDFkeyInt== PdfDictionary.Order && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary. VALUE_IS_OBJECT_ARRAY;\n }else if (PDFkeyInt== PdfDictionary.Name && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if ((type==PdfDictionary.ColorSpace || type==PdfDictionary.Function) && PDFkeyInt== PdfDictionary.N){\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(PDFkeyInt==PdfDictionary.Gamma && type==PdfDictionary.ColorSpace &&\n pdfObject.getParameterConstant(PdfDictionary.ColorSpace)== ColorSpaces.CalGray){ //its a number not an array\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(id==PdfDictionary.Win && pdfObject.getObjectType()==PdfDictionary.Form &&\n (PDFkeyInt==PdfDictionary.P || PDFkeyInt==PdfDictionary.O)){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if (isInlineImage && PDFkeyInt==PdfDictionary.ColorSpace){\n pdfKeyType= PdfDictionary.VALUE_IS_DICTIONARY;\n }else {\n pdfKeyType = PdfDictionary.getKeyType(PDFkeyInt, type);\n }\n \n \n //handle array of Function in Shading by using keyArray\n if(id==PdfDictionary.Shading && PDFkeyInt==PdfDictionary.Function){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n if(raw[ptr]=='['){\n pdfKeyType=PdfDictionary.VALUE_IS_KEY_ARRAY;\n }\n }\n \n //allow for other values in D,N,R definitions\n if(pdfKeyType==-1 && id== PdfDictionary.ClassMap){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n }else\n //allow for other values in D,N,R definitions as key pairs\n if(((((id==PdfDictionary.N || id==PdfDictionary.D || id==PdfDictionary.R))) &&\n pdfObject.getParentID()==PdfDictionary.AP &&\n pdfObject.getObjectType()==PdfDictionary.Form\n && raw[i]!='[' )){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n //decide if pair\n if(raw[keyStart]=='L' && raw[keyStart+1]=='e' && raw[keyStart+2]=='n' && raw[keyStart+3]=='g' && raw[keyStart+4]=='t' && raw[keyStart+5]=='h'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='n'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='f' && raw[keyStart+2]=='f'){\n }else\n if(raw[ptr]=='R'){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n \n if(debugFastCode) {\n System.out.println(\"new Returns \" + pdfKeyType + \" i=\" + i);\n }\n }\n }\n \n /**/\n \n //DecodeParms can be an array as well as a dictionary so check next char and alter if so\n if(PDFkeyInt==PdfDictionary.DecodeParms) {\n pdfKeyType = setTypeForDecodeParams(i, raw, length, pdfKeyType);\n }\n \n if(debugFastCode && pdfKeyType==-1 && pdfObject.getObjectType()!=PdfDictionary.Page){\n System.out.println(id+\" \"+type);\n System.out.println(padding +PDFkey+\" NO type setting for \"+PdfDictionary.getKey(keyStart,keyLength,raw)+\" id=\"+i);\n }\n }", "public PaymentRecordKey() {\n super();\n }", "private PasskeyContract() {}", "public RSAKeyPairGenerator() {\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum getCryptProviderType();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "java.lang.String getSignatureProviderId();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }" ]
[ "0.6727748", "0.6678317", "0.65109533", "0.6505185", "0.6263132", "0.62514466", "0.6101432", "0.58894575", "0.58158875", "0.5750823", "0.57424897", "0.5544559", "0.5495345", "0.5475865", "0.5266195", "0.5246643", "0.5234547", "0.51766807", "0.5016653", "0.50066125", "0.49636778", "0.49505574", "0.49419945", "0.49173275", "0.4900499", "0.4890469", "0.4850671", "0.4850671", "0.4846046", "0.4838196", "0.4831908", "0.4831908", "0.4831908", "0.4825468", "0.48228103", "0.48206773", "0.48206773", "0.4819316", "0.4801538", "0.47818527", "0.47589698", "0.47572955", "0.47565547", "0.47491077", "0.4728713", "0.47247025", "0.4719931", "0.47070387", "0.47024977", "0.47009662", "0.47000995", "0.46869826", "0.4670702", "0.46633434", "0.46223763", "0.4615428", "0.4615166", "0.46142715", "0.4610485", "0.46074787", "0.46031564", "0.4598209", "0.45926628", "0.4589497", "0.45822904", "0.45822853", "0.45731214", "0.45729804", "0.45704383", "0.45628694", "0.45616642", "0.45607027", "0.4551816", "0.4550097", "0.4547954", "0.4536531", "0.45355284", "0.45310175", "0.45305023", "0.4530499", "0.45229068", "0.4518561", "0.45185053", "0.4512594", "0.451091", "0.45088643", "0.44993877", "0.44969955", "0.44939372", "0.4493796", "0.44936416", "0.44899356", "0.44895783", "0.44872308", "0.4484021", "0.44833055", "0.44777814", "0.44765133", "0.44732615", "0.4471168" ]
0.52942586
14
none / x509+sha256 / x509+sha1 optional string pki_type = 2 [default = "none"];
@java.lang.Override public java.lang.String getPkiType() { return instance.getPkiType(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPkiType();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "boolean hasPkiType();", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "public static void main(String[] args) throws IcbcApiException {\n\t\tUiIcbcClient client = new UiIcbcClient(APP_ID,IcbcConstants.SIGN_TYPE_RSA,\n\t\t\t\t\"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJCoQe/O+uqpOtyE/2CUjD7wosZw8jI1AlLNJCllOmlX+obA6h97b0JsEL0SjMCAR3xJyw7MKLqkcy5qQ/bBgw2XSrodmjzOVqfT1OXRii0xw0HiVkHR4cEWnEAAdfo0lDc4iuzCIQrnT5gM0+U+qeSV6JFfwVRjgYzBdHQRPCf1AgMBAAECgYAdQUoEe7GXH5591o/nMmOinvvscg8pRDsyD7bOgGBtyZMrCXzP3SDFKCHCeyvoColqg2oDlhpulK+OpYMVNlGQcO4eubOJp9MUc3m4A9RxkVr3dsVrmygM5czPfWHAPVQ4dECDruBJn9zoo1ci0myRTh4KSCq6SxpCE0Pbf3j7iQJBAOdMPFRfOkSQ1hsN9Mg4jd9on8r7+mF8gFPhkNI6qvEKw/prmU3obUWvZL42vRlLOQyyB92mBF24PStR/B6CjR8CQQCgGz0VoqCplurSCapGdgX3D7bNSDtMUmaLJYJxih8v+zghP0YtVgDeV3NjogVjOlz8/9Rebo0PoFcqyJnNA1RrAkEAul3dBoasZm7ldWsrXuDiv66HgoDB4Cb3J59Kl3oaHpp0CqUEI5gx48JNRE7K00SfNTGF0Pxh7Dn1X6Bxqwu6NQJADrdyPfLc4bnFi9jnleJzWepP2z6wdKt+UXv5KYaQp1BoMGYohTJKkiVnrdjOtfg/Y+IAG03+GVmbqYsW2AleUQJBANYQklohKtsmq8ptX3as6hjcuXcTpc2DSpVeOnCueNv107+dDJ+K14tbiVYzF3tkHBNMRkGtr6EuGKJ+A63sJ00=\",\n\t\t\t\tIcbcConstants.CHARSET_UTF8,IcbcConstants.ENCRYPT_TYPE_AES, \"xMh0xFsG7G80ziePFdnT8g==\");\n\t\tEaccountManageRequestV1 request = new EaccountManageRequestV1();\t\t\n\t\trequest.setServiceUrl(\"http://122.64.61.111:8081/ui/eaccount/manage/V1\");///\n\t\tEaccountManageRequestBizV1 bizContent = new EaccountManageRequestBizV1();\n\t\tbizContent.setMobileNo(\"13703878410\");//选输,手机号\n\t\tbizContent.setIdcode(\"128440810108044\");//选输,身份证号\n\t\tbizContent.setName(URLEncoder.encode(\"芡悠\"));//选输,用户姓名\n\t\tbizContent.setUserId(\"128440810108044\");//必输,需控制不能为空,用户唯一标识,送身份证号\n\t\tbizContent.setBacAddr(URLEncoder.encode(\"http://www.test.com\"));//选输,回调地址\n\t\tbizContent.setEpayflag(\"0\");//选输,工银e支付标志,0-短信、1-静态密码,集成客户端SDK的方式能送0-短信或1-静态密码,非APP方式只能送0-短信,不送默认为0-短信\n\t\t\n\t\tbizContent.setCorpAppid(APP_ID);//外公司合作方送APP_ID的值,行内应用如e支付等送外公司合作方的APPID\n\t\tlong systime = System.currentTimeMillis(); // 现时间戳\t\t\n\t\tString orderTimeStamp=new Long(systime).toString();\n\t\t\n\t\tSystem.out.println(\"orderTimeStamp:\"+orderTimeStamp);\n\t\tbizContent.setOrderTimeStamp(orderTimeStamp);//生成请求的时间,必输\n\t\t\n\t\tbizContent.setZoneno(\"00200\");//地区号号,选输,5位数字,上送值联系对接分行提供\n\t\tbizContent.setBrno(\"00260\");//网点号,选输,5位数字,上送值联系对接分行提供\n\t\t\n\t\trequest.setBizContent(bizContent);\n\t\tSystem.out.println(client.buildPostForm(request));// 实际调用时的相关返回结果及异常处理,请自行添加\n\t}", "dkk mo4509g();", "private void generatePrivacyKeyPair(boolean clientMode) throws IOException, UnsupportedEncodingException, NoSuchAlgorithmException, SaslException {\n byte[] ccmagic = CLIENT_CONF_MAGIC.getBytes(encoding);\n byte[] scmagic = SVR_CONF_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n int n;\n if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_40])) {\n n = 5;\n } else if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_56])) {\n n = 7;\n } else {\n n = 16;\n }\n byte[] keyBuffer = new byte[n + ccmagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, n);\n System.arraycopy(ccmagic, 0, keyBuffer, n, ccmagic.length);\n md5.update(keyBuffer);\n byte[] Kcc = md5.digest();\n System.arraycopy(scmagic, 0, keyBuffer, n, scmagic.length);\n md5.update(keyBuffer);\n byte[] Kcs = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST24:Kcc: \", Kcc);\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST25:Kcs: \", Kcs);\n }\n byte[] myKc;\n byte[] peerKc;\n if (clientMode) {\n myKc = Kcc;\n peerKc = Kcs;\n } else {\n myKc = Kcs;\n peerKc = Kcc;\n }\n try {\n SecretKey encKey;\n SecretKey decKey;\n if (negotiatedCipher.indexOf(CIPHER_TOKENS[RC4]) > -1) {\n encCipher = Cipher.getInstance(\"RC4\");\n decCipher = Cipher.getInstance(\"RC4\");\n encKey = new SecretKeySpec(myKc, \"RC4\");\n decKey = new SecretKeySpec(peerKc, \"RC4\");\n encCipher.init(Cipher.ENCRYPT_MODE, encKey);\n decCipher.init(Cipher.DECRYPT_MODE, decKey);\n } else if ((negotiatedCipher.equals(CIPHER_TOKENS[DES])) || (negotiatedCipher.equals(CIPHER_TOKENS[DES3]))) {\n String cipherFullname, cipherShortname;\n if (negotiatedCipher.equals(CIPHER_TOKENS[DES])) {\n cipherFullname = \"DES/CBC/NoPadding\";\n cipherShortname = \"des\";\n } else {\n cipherFullname = \"DESede/CBC/NoPadding\";\n cipherShortname = \"desede\";\n }\n encCipher = Cipher.getInstance(cipherFullname);\n decCipher = Cipher.getInstance(cipherFullname);\n encKey = makeDesKeys(myKc, cipherShortname);\n decKey = makeDesKeys(peerKc, cipherShortname);\n IvParameterSpec encIv = new IvParameterSpec(myKc, 8, 8);\n IvParameterSpec decIv = new IvParameterSpec(peerKc, 8, 8);\n encCipher.init(Cipher.ENCRYPT_MODE, encKey, encIv);\n decCipher.init(Cipher.DECRYPT_MODE, decKey, decIv);\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST26:\" + negotiatedCipher + \" IVcc: \", encIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST27:\" + negotiatedCipher + \" IVcs: \", decIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST28:\" + negotiatedCipher + \" encryption key: \", encKey.getEncoded());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST29:\" + negotiatedCipher + \" decryption key: \", decKey.getEncoded());\n }\n }\n } catch (InvalidKeySpecException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported key \" + \"specification used.\", e);\n } catch (InvalidAlgorithmParameterException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid cipher \" + \"algorithem parameter used to create cipher instance\", e);\n } catch (NoSuchPaddingException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported \" + \"padding used for chosen cipher\", e);\n } catch (InvalidKeyException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid data \" + \"used to initialize keys\", e);\n }\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "java.lang.String getPublicEciesKey();", "OpenSSLKey mo134201a();", "public abstract String getSigAlgOID();", "private void generateIntegrityKeyPair(boolean clientMode) throws UnsupportedEncodingException, IOException, NoSuchAlgorithmException {\n byte[] cimagic = CLIENT_INT_MAGIC.getBytes(encoding);\n byte[] simagic = SVR_INT_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n byte[] keyBuffer = new byte[H_A1.length + cimagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, H_A1.length);\n System.arraycopy(cimagic, 0, keyBuffer, H_A1.length, cimagic.length);\n md5.update(keyBuffer);\n byte[] Kic = md5.digest();\n System.arraycopy(simagic, 0, keyBuffer, H_A1.length, simagic.length);\n md5.update(keyBuffer);\n byte[] Kis = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST12:Kic: \", Kic);\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST13:Kis: \", Kis);\n }\n if (clientMode) {\n myKi = Kic;\n peerKi = Kis;\n } else {\n myKi = Kis;\n peerKi = Kic;\n }\n }", "public final String mo1957a() {\n return \"type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey\";\n }", "private native String native_ks(long cookie, byte[] userKey);", "@Override\n public ConcurrentContentSigner newSigner(\n String type, SignerConf conf, X509Cert[] certificateChain)\n throws ObjectCreationException {\n type = type.toLowerCase(Locale.ROOT);\n if (!types.contains(type)) {\n throw new ObjectCreationException(\"unknown signer type \" + type);\n }\n\n String str = conf.getConfValue(\"parallelism\");\n int parallelism = 20;\n if (str != null) {\n try {\n parallelism = Integer.parseInt(str);\n } catch (NumberFormatException ex) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n\n if (parallelism < 1) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n }\n\n str = conf.getConfValue(\"alias\");\n if (str == null) {\n throw new ObjectCreationException(\"alias is not specified\");\n }\n int keyId = Integer.parseInt(str);\n\n String algoName = conf.getConfValue(\"algo\");\n if (algoName == null) {\n throw new ObjectCreationException(\"algo is not specified\");\n }\n\n try {\n InitStatus initStatus = init(type);\n if (initStatus.status.get() != 1) {\n throw new ObjectCreationException(initStatus.details);\n }\n\n SignAlgo algo = SignAlgo.getInstance(algoName);\n String keyAlgoName;\n String bcKeyAlgoName;\n if (algo.isSM2SigAlgo()) {\n keyAlgoName = \"SM2\";\n bcKeyAlgoName = \"EC\";\n } else if (algo.isRSAPkcs1SigAlgo() || algo.isRSAPSSSigAlgo()) {\n keyAlgoName = \"RSA\";\n bcKeyAlgoName = \"RSA\";\n } else if (algo.isECDSASigAlgo() || algo.isPlainECDSASigAlgo()) {\n keyAlgoName = \"EC\";\n bcKeyAlgoName = \"EC\";\n } else {\n throw new ObjectCreationException(\"unsupported algo \" + algoName);\n }\n\n Provider provider = providerMap.get(type);\n\n // Method to read create PrivateKey and PublicKey object.\n // SANSEC use KeyPairGenerator.generateKeyPair to read the keypair-\n // No new keypair will be generated here.\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(keyAlgoName, provider);\n kpGen.initialize(keyId << 16);\n KeyPair kp = kpGen.generateKeyPair();\n\n PublicKey publicKey = KeyFactory.getInstance(bcKeyAlgoName, \"BC\")\n .generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));\n\n return new JceSignerBuilder(kp.getPrivate(), publicKey, certificateChain, provider)\n .createSigner(algo, parallelism);\n } catch (GeneralSecurityException | XiSecurityException ex) {\n throw new ObjectCreationException(ex.getMessage(), ex);\n }\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv xgetCryptProviderType();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "boolean hasPkiData();", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "public String mo34971a() {\n return \"SHA-384\";\n }", "public interface JsonKey {\n\n String CLASS = \"class\";\n String DATA = \"data\";\n String EKS = \"eks\";\n String ID = \"id\";\n String LEVEL = \"level\";\n String MESSAGE = \"message\";\n String METHOD = \"method\";\n String REQUEST_MESSAGE_ID = \"msgId\";\n String STACKTRACE = \"stacktrace\";\n String VER = \"ver\";\n String OK = \"ok\";\n String LOG_LEVEL = \"logLevel\";\n String ERROR = \"error\";\n String EMPTY_STRING = \"\";\n String RESPONSE = \"response\";\n String ADDRESS = \"address\";\n String KEY = \"key\";\n String ERROR_MSG = \"error_msg\";\n String ATTRIBUTE = \"attribute\";\n String ERRORS = \"errors\";\n String SUCCESS = \"success\";\n\n String CERTIFICATE = \"certificate\";\n String RECIPIENT_NAME = \"recipientName\";\n String COURSE_NAME = \"courseName\";\n String NAME = \"name\";\n String HTML_TEMPLATE = \"htmlTemplate\";\n String TAG = \"tag\";\n String ISSUER = \"issuer\";\n String URL = \"url\";\n String SIGNATORY_LIST = \"signatoryList\";\n String DESIGNATION = \"designation\";\n String SIGNATORY_IMAGE = \"image\";\n\n String DOMAIN_URL = \"sunbird_cert_domain_url\";\n String ASSESSED_DOMAIN = \"ASSESSED_DOMAIN\";\n String BADGE_URL = \"BADGE_URL\";\n String ISSUER_URL = \"ISSUER_URL\";\n String TEMPLATE_URL = \"TEMPLATE_URL\";\n String CONTEXT = \"CONTEXT\";\n String VERIFICATION_TYPE = \"VERIFICATION_TYPE\";\n String SIGNATORY_EXTENSION = \"SIGNATORY_EXTENSION\";\n String RECIPIENT_EMAIl = \"recipientEmail\";\n String RECIPIENT_PHONE = \"recipientPhone\";\n String RECIPIENT_ID = \"recipientId\";\n String VALID_FROM = \"validFrom\";\n String EXPIRY = \"expiry\";\n String OLD_ID = \"oldId\";\n String PUBLIC_KEY = \"publicKey\";\n String DESCRIPTION = \"description\";\n String LOGO = \"logo\";\n String ISSUE_DATE = \"issueDate\";\n String USER = \"user\";\n String CERTIFICATE_NAME = \"name\";\n\n String CONTAINER_NAME = \"CONTAINER_NAME\";\n String CLOUD_STORAGE_TYPE = \"CLOUD_STORAGE_TYPE\";\n String CLOUD_UPLOAD_RETRY_COUNT = \"CLOUD_UPLOAD_RETRY_COUNT\";\n String AZURE_STORAGE_SECRET = \"AZURE_STORAGE_SECRET\";\n String AZURE_STORAGE_KEY = \"AZURE_STORAGE_KEY\";\n String ACCESS_CODE_LENGTH = \"ACCESS_CODE_LENGTH\";\n String ORG_ID = \"orgId\";\n String KEYS = \"keys\";\n String ENC_SERVICE_URL = \"sunbird_cert_enc_service_url\";\n String SIGN_HEALTH_CHECK_URL = \"SIGN_HEALTH_CHECK_URL\";\n String SIGN_URL = \"SIGN_URL\";\n String SIGN_VERIFY_URL = \"SIGN_VERIFY_URL\";\n String SIGN_CREATOR = \"SIGN_CREATOR\";\n String SIGN = \"sign\";\n String VERIFY = \"verify\";\n String KEY_ID = \"keyId\";\n String JSON_URL = \"jsonUrl\";\n String PDF_URL = \"pdfUrl\";\n String UNIQUE_ID = \"id\";\n String GENERATE_CERT = \"generateCert\";\n String PUBLIC_KEY_URL = \"PUBLIC_KEY_URL\";\n String GET_SIGN_URL = \"getSignUrl\";\n String SIGNED_URL = \"signedUrl\";\n\n String ACCESS_CODE = \"accessCode\";\n String JSON_DATA = \"jsonData\";\n String SLUG = \"sunbird_cert_slug\";\n}", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "BigInteger getCEP();", "java.lang.String getPubkey();", "public void setCertiType(java.lang.String certiType) {\n this.certiType = certiType;\n }", "public abstract String getSigAlgName();", "@Schema(required = true, description = \"Contract type (KIP-7, KIP-17, ERC-20, ERC-721)\")\n public String getType() {\n return type;\n }", "public ProfileKey getProfileKey(String username, String type) throws ProfileKeyManagerPersistenceException {\n ParameterHelpers.checkParameter(username, \"username\");\n\n boolean registered = checkType(type);\n\n Connection connection = getConnection();\n\n try {\n return getProfileKey(connection, username, type, registered);\n } finally {\n closeConnection(connection);\n }\n }", "protected CryptoProvider() {\n\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "@ParameterizedTest\n @EnumSource(KeyType.class)\n void testMissingJWTPublicKey(KeyType keyType) throws NoSuchAlgorithmException {\n final Pair<String, PrivateKey> keyPair = generateKeypair(keyType);\n\n final String jwt = Jwts.builder()\n .setHeaderParam(\"kid\", UUID.randomUUID())\n .setAudience(String.format(\"%sToken/auth\", \"here\"))\n .setIssuer(\"macaroon\")\n .setSubject(\"macaroon\")\n .setId(UUID.randomUUID().toString())\n .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES)))\n .signWith(keyPair.getRight(), APIAuthHelpers.getSigningAlgorithm(keyType))\n .compact();\n\n // Submit the JWT\n Response response = RESOURCE.target(\"/v1/Token/auth\")\n .queryParam(\"scope\", \"system/*.*\")\n .queryParam(\"grant_type\", \"client_credentials\")\n .queryParam(\"client_assertion_type\", TokenResource.CLIENT_ASSERTION_TYPE)\n .queryParam(\"client_assertion\", jwt)\n .request()\n .post(Entity.entity(\"\", MediaType.APPLICATION_FORM_URLENCODED));\n\n assertEquals(401, response.getStatus(), \"Should be unauthorized\");\n assertTrue(response.readEntity(String.class).contains(\"Cannot find public key\"), \"Should have correct exception\");\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "public ECP getPublicKGCKey(){return pkS;}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "private TPM_DIGEST createEmptyPubKeyHash()\r\n {\r\n// if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_BROADCOM )\r\n// {\r\n// return null;\r\n// }\r\n// else\r\n// {\r\n// return new TPM_DIGEST();\r\n// }\r\n if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_INFINEON )\r\n {\r\n return new TPM_DIGEST();\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }", "public String getTlsKey();", "@Test\n\tpublic void testSecuirtyConfigsOperations() throws NoSuchAlgorithmException {\n\t\t// Generate and store keys for the first time\n\t\tServerKeyPairs serverKeyPairs1 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair1 = serverKeyPairs1.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair1 = serverKeyPairs1.getSignatureKeyPair();\n\n\t\t// Initialize a new serverKeyPairs to test that it will only read\n\t\t// previously generated keys\n\t\tServerKeyPairs serverKeyPairs2 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair2 = serverKeyPairs2.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair2 = serverKeyPairs2.getSignatureKeyPair();\n\n\t\tassertEquals(\"Wrong loaded encryption public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded encryption private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getPrivateExponent());\n\n\t\tassertEquals(\"Wrong loaded signature public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded signature private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getPrivateExponent());\n\t}", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType.Enum getCryptAlgorithmType();", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public MEKeyTool() {\n keystore = new PublicKeyStoreBuilderBase();\n }", "public PrivateKeyType getPivateKeyType() {\n return PrivateKeyType.SAPLING_EXTENED_SPEND_KEY;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType xgetCryptAlgorithmType();", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "public void setPrincipalType(String principalType){\n this.principalType = principalType;\n //Update hashMap value..\n hashMap.put(\"principalType\", principalType);\n }", "public static void main(String[] args) {\n String keyFile = \"D:\\\\data\\\\kms\\\\liweigang.idc\";\n String message = \"dksf3r38324hrewjrh3r&^%djfdsjkek\";\n String pubmatrix = \"D:\\\\data\\\\kms\\\\sm2cpk.cn.pkm\";\n\n byte[] keycard = Tool.ReadFile(keyFile);\n System.out.println(\"keyCard:\" + Tool.Bytes2Hex(keycard));\n\n //得到私钥\n byte[] priKey = GMJni.GetPriKey(keycard);\n String priKeyHex = Tool.Bytes2Hex(priKey);\n System.out.println(\"private key:\" + priKeyHex);\n\n //得到密钥标识\n byte[] keyId = GMJni.GetKeyId(keycard);\n System.out.println(\"keyId:\" + Tool.Bytes2String(keyId));\n\n //得到公钥\n byte[] pubKey = GMJni.CalPubKey(Tool.String2Bytes(pubmatrix), keyId);\n System.out.println(\"public key:\" + Tool.Bytes2Hex(pubKey));\n\n //1000个不同message\n List<String> msgList = new ArrayList<>(12);\n for (int i = 0; i < 1000; i++) {\n //message基础上字符串长度+10\n msgList.add(message + RandomUtil.randomString(10));\n }\n long start = System.currentTimeMillis();\n //签名结果\n int rv = 0;\n //缓存\n MapCache cache = new MapCache();\n //命中缓存次数\n int count = 0;\n int count2 = 0;\n for (int i = 0; i < 100000; i++) {\n System.out.println(\"模拟请求第\" + i + \"次数\");\n\n //计算E值\n //30种不同的message,即仅30个不走缓存\n byte[] E = GMJni.SM2GetE(keyId, pubKey, Tool.String2Bytes(msgList.get(new Random().nextInt(30))));\n String hexE = Tool.Bytes2Hex(E);\n// System.out.println(\"E:\" + hexE);\n\n //SM2签名\n byte[] sig = GMJni.SM2Sign(priKey, E);\n// System.out.println(\"private key:\" + Tool.Bytes2Hex(priKey));\n// System.out.println(\"sign value:\" + Tool.Bytes2Hex(sig));\n\n // SM2签名验证\n // 引入Map缓存 E,sig的16进制的MD5值\n String hex = hexE + priKeyHex;\n// System.out.println(\"finalStr:\" + hex);\n String md5 = SecureUtil.md5(hex);\n if (null != cache.get(md5)) {\n count++;\n// System.out.println(\"命中缓存\" + (++count));\n } else {\n rv += GMJni.SM2Verify(pubKey, E, sig);\n count2++;\n cache.add(md5, (byte) 1, 50 * 1000);\n }\n }\n long end = System.currentTimeMillis();\n double v = (end - start) / 1000.0;\n System.out.println(\"time consuming:\" + v + \" sec\");\n System.out.println(Math.round(100000 / v) + \" times/sec\");\n System.out.println(\"命中缓存\" + (count));\n System.out.println(\"未命中\" + (count2));\n if (rv != 0) {\n System.out.println(\"Verify signature fail, error code is \" + String.valueOf(rv));\n } else {\n System.out.println(\"Verify signature success.\");\n }\n }", "private static String generateServerKey(Poi poi) {\n LonLat viewPoint = poi.getViewPosition();\n int lon = viewPoint.getLonInt();\n int lat = viewPoint.getLatInt();\n int alt = viewPoint.getAltInt();\n return generateServerKey(poi.getName(), poi.getAddress(), lon, lat, alt);\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public static void registerDefaultAlgorithms() {\n/* 390 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#dsa-sha1\", SignatureDSA.class);\n/* */ \n/* */ \n/* 393 */ algorithmHash.put(\"http://www.w3.org/2009/xmldsig11#dsa-sha256\", SignatureDSA.SHA256.class);\n/* */ \n/* */ \n/* 396 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\", SignatureBaseRSA.SignatureRSASHA1.class);\n/* */ \n/* */ \n/* 399 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#hmac-sha1\", IntegrityHmac.IntegrityHmacSHA1.class);\n/* */ \n/* */ \n/* 402 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-md5\", SignatureBaseRSA.SignatureRSAMD5.class);\n/* */ \n/* */ \n/* */ \n/* 406 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160\", SignatureBaseRSA.SignatureRSARIPEMD160.class);\n/* */ \n/* */ \n/* */ \n/* 410 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\", SignatureBaseRSA.SignatureRSASHA256.class);\n/* */ \n/* */ \n/* 413 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384\", SignatureBaseRSA.SignatureRSASHA384.class);\n/* */ \n/* */ \n/* 416 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\", SignatureBaseRSA.SignatureRSASHA512.class);\n/* */ \n/* */ \n/* 419 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1\", SignatureECDSA.SignatureECDSASHA1.class);\n/* */ \n/* */ \n/* 422 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256\", SignatureECDSA.SignatureECDSASHA256.class);\n/* */ \n/* */ \n/* 425 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384\", SignatureECDSA.SignatureECDSASHA384.class);\n/* */ \n/* */ \n/* 428 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512\", SignatureECDSA.SignatureECDSASHA512.class);\n/* */ \n/* */ \n/* 431 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-md5\", IntegrityHmac.IntegrityHmacMD5.class);\n/* */ \n/* */ \n/* 434 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160\", IntegrityHmac.IntegrityHmacRIPEMD160.class);\n/* */ \n/* */ \n/* 437 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha256\", IntegrityHmac.IntegrityHmacSHA256.class);\n/* */ \n/* */ \n/* 440 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha384\", IntegrityHmac.IntegrityHmacSHA384.class);\n/* */ \n/* */ \n/* 443 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha512\", IntegrityHmac.IntegrityHmacSHA512.class);\n/* */ }", "public java.lang.String getCertiType() {\n return certiType;\n }", "java.lang.String getServerSecret();", "public static void main(String[] args) {\n\t\tString algorithm = SignatureAlgorithm.HS256.getJcaName();\r\n\t\tSystem.out.println(algorithm);\r\n\r\n\t\t// set secret key\r\n\t\tString secret = \"this+is+my+scret+key+AAAAAAAAAAAAAAAAAAAAAAAAA\";\r\n\r\n\t\t// background information\r\n\t\t// =============================================================\r\n\t\t/*\r\n\t\t * the bytes of the secret key will be used by the signature algorithm - must be\r\n\t\t * in base 64 format\r\n\t\t */\r\n//\t\tbyte[] scretKeyEncoded = secret.getBytes(); // java encoding\r\n//\t\tbyte[] scretKeyDecoded = Base64.getDecoder().decode(secret); // base64\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyEncoded));\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyDecoded));\r\n\t\t// =====================================================================================\r\n\r\n\t\t// create the key from the decoded secret\r\n\t\tKey key = new SecretKeySpec(Base64.getDecoder().decode(secret), algorithm);\r\n\r\n\t\tInstant now = Instant.now();\r\n\r\n\t\t// create a JWT instance\r\n\t\tString jwt = Jwts.builder()\r\n\r\n\t\t\t\t.signWith(key)\r\n\r\n\t\t\t\t.setIssuedAt(Date.from(now))\r\n\r\n\t\t\t\t// will be valid for 10 seconds\r\n\t\t\t\t.setExpiration(Date.from(now.plus(10, ChronoUnit.SECONDS)))\r\n\r\n\t\t\t\t.setSubject(\"aaa@mail\")\r\n\r\n\t\t\t\t.claim(\"First name\", \"Dan\")\r\n\r\n\t\t\t\t.claim(\"Last name\", \"Levi\")\r\n\r\n\t\t\t\t.compact();\r\n\r\n\t\tSystem.out.println(jwt);\r\n\r\n\t\t// ==================================================\r\n\t\t// parse the JWS to get the expanded JWT\r\n//\t\tJWS - JSON Web Signature [aaaa.bbbb.cccc]\r\n//\t\tJWT - JSON Web Token [aaaa.bbbb.cccc]\r\n\r\n\t\tSystem.out.println(\"====================\");\r\n\t\tSystem.out.println(\"parsing the JWS to get a JWT\");\r\n\t\tJwtParser jwtParser = Jwts.parserBuilder().setSigningKey(key).build();\r\n\t\t// to demonstrate expiration paste an old JWS\r\n\t\tjwt = \"eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjA2Mzk1MTEsImV4cCI6MTYyMDYzOTUyMSwic3ViIjoiYWFhQG1haWwiLCJGaXJzdCBuYW1lIjoiRGFuIiwiTGFzdCBuYW1lIjoiTGV2aSJ9.cefEbBejjebKVILgOzca0LJZfd0F3qjezegeCaxOrfE\";\r\n\t\tSystem.out.println(jwtParser.parse(jwt));\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getHeader());\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getBody());\r\n\r\n\t}", "private String getSignatureString(Type type)\r\n {\r\n if(type instanceof CompoundType)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n CompoundType cType = (CompoundType)type;\r\n //find key and value types\r\n String keyType = getSignatureString(cType.keyType);\r\n sb.append(\"Ljava/util/HashMap\");\r\n sb.append(\"<\");\r\n sb.append(keyType);\r\n sb.append(getSignatureString(cType.valType));\r\n sb.append(\">;\");\r\n return sb.toString();\r\n }\r\n else if(type instanceof SimpleType)\r\n {\r\n switch(((SimpleType)type).type)\r\n {\r\n case INT:\r\n return \"Ljava/lang/Integer;\";\r\n case BOOLEAN:\r\n return \"Ljava/lang/Boolean;\";\r\n case STRING:\r\n return \"Ljava/lang/String;\";\r\n }\r\n }\r\n return null;\r\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public String getJCEProviderName() {\n/* 196 */ return this.signatureAlgorithm.engineGetJCEProviderName();\n/* */ }", "public String getJCEAlgorithmString() {\n/* 187 */ return this.signatureAlgorithm.engineGetJCEAlgorithmString();\n/* */ }", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "com.google.protobuf.ByteString getPublicEciesKeyBytes();", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "public static String getKeyTypeName(KeyType type)\n {\n // TODO: should be moved to DBProvider ...\n // MySQL : key identifier\n // SQLServer : key identifier\n // Derby : key identifier\n // PostgreSQL: key identifier\n switch (type) {\n // MySQL: key types ...\n case PRIMARY : return \"PRIMARY KEY\"; // table\n case UNIQUE : return \"UNIQUE\"; // table\n case INDEX : return \"INDEX\"; // table/index\n case UNIQUE_INDEX : return \"UNIQUE INDEX\"; // table/index\n default : return \"UNKNOWN\";\n }\n }", "long getCryptProviderTypeExt();", "@PostMapping(\"/createKeyPair\")\n public String createKeyPair() {\n \n AWSKMS kmsClient = AWSKMSClientBuilder.standard().build();\n \n return \"Private uid: \"+ priuid +\"\\nPublic uid: \" + pubuid +\"\\n\";\n }", "long getCryptAlgorithmSid();", "switch (buffer[ISO7816.OFFSET_CDATA + 4]) {\r\n\t\tcase BASIC:\r\n\t\t\tsetSignatureType(BASIC);\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tsetSignatureType(AUTHENTICATION);\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tsetSignatureType(NON_REPUDIATION);\r\n\t\t\tbreak;\r\n\t\tcase CA_ROLE:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\tdefault:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "private KeyStore askForPin() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {\n char newPin[] = PinDialog.getPIN(this.providerDesc);\n try {\n KeyStore ks = getKeyStore(newPin);\n pin = newPin;\n return ks;\n } catch (IOException e2) {\n e2.printStackTrace();\n if (e2.getCause() instanceof LoginException) {\n JOptionPane.showMessageDialog(null, \"Wrong PIN\", \"Cryptographic card\", JOptionPane.WARNING_MESSAGE);\n }\n throw e2;\n }\n }", "public String getTlsKeyPath();", "public byte[] getUserKey() throws IOException\n {\n byte[] u = null;\n COSString user = (COSString)encryptionDictionary.getDictionaryObject( COSName.getPDFName( \"U\" ) );\n if( user != null )\n {\n u = user.getBytes();\n }\n return u;\n }", "@Override\n public String getProviderName() {\n return \"SimpleEncryptionKeyStoreProvider\";\n }", "public interface SKey {\n\n String FAIL_STORE = \"job.fail.store\";\n\n String LOADBALANCE = \"loadbalance\";\n\n String EVENT_CENTER = \"event.center\";\n\n String REMOTING = \"lts.remoting\";\n\n String REMOTING_SERIALIZABLE_DFT = \"lts.remoting.serializable.default\";\n\n String ZK_CLIENT_KEY = \"zk.client\";\n\n String JOB_ID_GENERATOR = \"id.generator\";\n\n String JOB_LOGGER = \"job.logger\";\n\n String JOB_QUEUE = \"job.queue\";\n}", "private void getKeyType(final PdfObject pdfObject, final int i, final byte[] raw, final int length, final int keyLength, final int keyStart, final int type) {\n if(debugFastCode)//used in debug\n {\n PDFkey = PdfDictionary.getKey(keyStart, keyLength, raw);\n }\n \n PDFkeyInt=PdfDictionary.getIntKey(keyStart,keyLength,raw);\n \n //correct mapping\n if(PDFkeyInt==PdfDictionary.Indexed && (type==PdfDictionary.MK ||type==PdfDictionary.Form || type==PdfDictionary.Linearized || type==PdfDictionary.Group)) {\n PDFkeyInt = PdfDictionary.I;\n }\n \n if(isInlineImage) {\n PDFkeyInt = PdfObjectFactory.getInlineID(PDFkeyInt);\n }\n \n final int id=pdfObject.getID();\n \n if(type==PdfDictionary.Resources && (PDFkeyInt==PdfDictionary.ColorSpace\n || PDFkeyInt==PdfDictionary.ExtGState || PDFkeyInt==PdfDictionary.Shading\n || PDFkeyInt==PdfDictionary.XObject || PDFkeyInt==PdfDictionary.Font|| PDFkeyInt==PdfDictionary.Pattern)){\n pdfKeyType=PdfDictionary.VALUE_IS_DICTIONARY_PAIRS;\n //}else if (type==PdfDictionary.Form && id== PdfDictionary.AA && PDFkeyInt== PdfDictionary.K){\n // pdfKeyType= PdfDictionary.VALUE_IS_UNREAD_DICTIONARY;\n }else if (type==PdfDictionary.Outlines && PDFkeyInt== PdfDictionary.D){\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && PDFkeyInt== PdfDictionary.D){\n if(id==PdfDictionary.AP || id==PdfDictionary.AA){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if(id==PdfDictionary.Win){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else{\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && (id==PdfDictionary.AP || id==PdfDictionary.AA) && PDFkeyInt== PdfDictionary.A){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if (PDFkeyInt== PdfDictionary.Order && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary. VALUE_IS_OBJECT_ARRAY;\n }else if (PDFkeyInt== PdfDictionary.Name && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if ((type==PdfDictionary.ColorSpace || type==PdfDictionary.Function) && PDFkeyInt== PdfDictionary.N){\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(PDFkeyInt==PdfDictionary.Gamma && type==PdfDictionary.ColorSpace &&\n pdfObject.getParameterConstant(PdfDictionary.ColorSpace)== ColorSpaces.CalGray){ //its a number not an array\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(id==PdfDictionary.Win && pdfObject.getObjectType()==PdfDictionary.Form &&\n (PDFkeyInt==PdfDictionary.P || PDFkeyInt==PdfDictionary.O)){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if (isInlineImage && PDFkeyInt==PdfDictionary.ColorSpace){\n pdfKeyType= PdfDictionary.VALUE_IS_DICTIONARY;\n }else {\n pdfKeyType = PdfDictionary.getKeyType(PDFkeyInt, type);\n }\n \n \n //handle array of Function in Shading by using keyArray\n if(id==PdfDictionary.Shading && PDFkeyInt==PdfDictionary.Function){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n if(raw[ptr]=='['){\n pdfKeyType=PdfDictionary.VALUE_IS_KEY_ARRAY;\n }\n }\n \n //allow for other values in D,N,R definitions\n if(pdfKeyType==-1 && id== PdfDictionary.ClassMap){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n }else\n //allow for other values in D,N,R definitions as key pairs\n if(((((id==PdfDictionary.N || id==PdfDictionary.D || id==PdfDictionary.R))) &&\n pdfObject.getParentID()==PdfDictionary.AP &&\n pdfObject.getObjectType()==PdfDictionary.Form\n && raw[i]!='[' )){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n //decide if pair\n if(raw[keyStart]=='L' && raw[keyStart+1]=='e' && raw[keyStart+2]=='n' && raw[keyStart+3]=='g' && raw[keyStart+4]=='t' && raw[keyStart+5]=='h'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='n'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='f' && raw[keyStart+2]=='f'){\n }else\n if(raw[ptr]=='R'){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n \n if(debugFastCode) {\n System.out.println(\"new Returns \" + pdfKeyType + \" i=\" + i);\n }\n }\n }\n \n /**/\n \n //DecodeParms can be an array as well as a dictionary so check next char and alter if so\n if(PDFkeyInt==PdfDictionary.DecodeParms) {\n pdfKeyType = setTypeForDecodeParams(i, raw, length, pdfKeyType);\n }\n \n if(debugFastCode && pdfKeyType==-1 && pdfObject.getObjectType()!=PdfDictionary.Page){\n System.out.println(id+\" \"+type);\n System.out.println(padding +PDFkey+\" NO type setting for \"+PdfDictionary.getKey(keyStart,keyLength,raw)+\" id=\"+i);\n }\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "public PaymentRecordKey() {\n super();\n }", "private PasskeyContract() {}", "public RSAKeyPairGenerator() {\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum getCryptProviderType();", "java.lang.String getSignatureProviderId();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }" ]
[ "0.6727689", "0.66767913", "0.6510369", "0.65033424", "0.6262288", "0.6251234", "0.6101008", "0.5814989", "0.5750624", "0.57413155", "0.5544094", "0.5496116", "0.547445", "0.52937627", "0.5266566", "0.524678", "0.52335155", "0.51767373", "0.50153226", "0.5006655", "0.4962356", "0.49499023", "0.49411032", "0.49168855", "0.49020067", "0.4888426", "0.48494777", "0.48494777", "0.48460793", "0.48377907", "0.4832051", "0.4832051", "0.4832051", "0.48257953", "0.4821702", "0.48194492", "0.4819314", "0.4819314", "0.47991663", "0.4781225", "0.47571105", "0.4756231", "0.47555733", "0.47499835", "0.47289437", "0.47254056", "0.47212568", "0.47066334", "0.47023937", "0.47019845", "0.46989855", "0.46851024", "0.46719837", "0.46639642", "0.46222693", "0.46156308", "0.46136636", "0.4612661", "0.46108755", "0.46063787", "0.46033537", "0.4599115", "0.45910728", "0.45881075", "0.45822087", "0.4581919", "0.45753542", "0.45734766", "0.45711392", "0.45614913", "0.45610267", "0.45608622", "0.45530447", "0.4550199", "0.4548751", "0.45359287", "0.45348635", "0.45301956", "0.45298547", "0.45289811", "0.45227852", "0.45182446", "0.45164904", "0.45110202", "0.45109597", "0.4506969", "0.44993004", "0.44970086", "0.4493643", "0.4493612", "0.44934398", "0.4490861", "0.44874617", "0.44862193", "0.44837305", "0.44832504", "0.44770813", "0.44753104", "0.44724855", "0.44717774" ]
0.58891505
7
none / x509+sha256 / x509+sha1 optional string pki_type = 2 [default = "none"];
@java.lang.Override public com.google.protobuf.ByteString getPkiTypeBytes() { return instance.getPkiTypeBytes(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPkiType();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "boolean hasPkiType();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "public static void main(String[] args) throws IcbcApiException {\n\t\tUiIcbcClient client = new UiIcbcClient(APP_ID,IcbcConstants.SIGN_TYPE_RSA,\n\t\t\t\t\"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJCoQe/O+uqpOtyE/2CUjD7wosZw8jI1AlLNJCllOmlX+obA6h97b0JsEL0SjMCAR3xJyw7MKLqkcy5qQ/bBgw2XSrodmjzOVqfT1OXRii0xw0HiVkHR4cEWnEAAdfo0lDc4iuzCIQrnT5gM0+U+qeSV6JFfwVRjgYzBdHQRPCf1AgMBAAECgYAdQUoEe7GXH5591o/nMmOinvvscg8pRDsyD7bOgGBtyZMrCXzP3SDFKCHCeyvoColqg2oDlhpulK+OpYMVNlGQcO4eubOJp9MUc3m4A9RxkVr3dsVrmygM5czPfWHAPVQ4dECDruBJn9zoo1ci0myRTh4KSCq6SxpCE0Pbf3j7iQJBAOdMPFRfOkSQ1hsN9Mg4jd9on8r7+mF8gFPhkNI6qvEKw/prmU3obUWvZL42vRlLOQyyB92mBF24PStR/B6CjR8CQQCgGz0VoqCplurSCapGdgX3D7bNSDtMUmaLJYJxih8v+zghP0YtVgDeV3NjogVjOlz8/9Rebo0PoFcqyJnNA1RrAkEAul3dBoasZm7ldWsrXuDiv66HgoDB4Cb3J59Kl3oaHpp0CqUEI5gx48JNRE7K00SfNTGF0Pxh7Dn1X6Bxqwu6NQJADrdyPfLc4bnFi9jnleJzWepP2z6wdKt+UXv5KYaQp1BoMGYohTJKkiVnrdjOtfg/Y+IAG03+GVmbqYsW2AleUQJBANYQklohKtsmq8ptX3as6hjcuXcTpc2DSpVeOnCueNv107+dDJ+K14tbiVYzF3tkHBNMRkGtr6EuGKJ+A63sJ00=\",\n\t\t\t\tIcbcConstants.CHARSET_UTF8,IcbcConstants.ENCRYPT_TYPE_AES, \"xMh0xFsG7G80ziePFdnT8g==\");\n\t\tEaccountManageRequestV1 request = new EaccountManageRequestV1();\t\t\n\t\trequest.setServiceUrl(\"http://122.64.61.111:8081/ui/eaccount/manage/V1\");///\n\t\tEaccountManageRequestBizV1 bizContent = new EaccountManageRequestBizV1();\n\t\tbizContent.setMobileNo(\"13703878410\");//选输,手机号\n\t\tbizContent.setIdcode(\"128440810108044\");//选输,身份证号\n\t\tbizContent.setName(URLEncoder.encode(\"芡悠\"));//选输,用户姓名\n\t\tbizContent.setUserId(\"128440810108044\");//必输,需控制不能为空,用户唯一标识,送身份证号\n\t\tbizContent.setBacAddr(URLEncoder.encode(\"http://www.test.com\"));//选输,回调地址\n\t\tbizContent.setEpayflag(\"0\");//选输,工银e支付标志,0-短信、1-静态密码,集成客户端SDK的方式能送0-短信或1-静态密码,非APP方式只能送0-短信,不送默认为0-短信\n\t\t\n\t\tbizContent.setCorpAppid(APP_ID);//外公司合作方送APP_ID的值,行内应用如e支付等送外公司合作方的APPID\n\t\tlong systime = System.currentTimeMillis(); // 现时间戳\t\t\n\t\tString orderTimeStamp=new Long(systime).toString();\n\t\t\n\t\tSystem.out.println(\"orderTimeStamp:\"+orderTimeStamp);\n\t\tbizContent.setOrderTimeStamp(orderTimeStamp);//生成请求的时间,必输\n\t\t\n\t\tbizContent.setZoneno(\"00200\");//地区号号,选输,5位数字,上送值联系对接分行提供\n\t\tbizContent.setBrno(\"00260\");//网点号,选输,5位数字,上送值联系对接分行提供\n\t\t\n\t\trequest.setBizContent(bizContent);\n\t\tSystem.out.println(client.buildPostForm(request));// 实际调用时的相关返回结果及异常处理,请自行添加\n\t}", "dkk mo4509g();", "private void generatePrivacyKeyPair(boolean clientMode) throws IOException, UnsupportedEncodingException, NoSuchAlgorithmException, SaslException {\n byte[] ccmagic = CLIENT_CONF_MAGIC.getBytes(encoding);\n byte[] scmagic = SVR_CONF_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n int n;\n if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_40])) {\n n = 5;\n } else if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_56])) {\n n = 7;\n } else {\n n = 16;\n }\n byte[] keyBuffer = new byte[n + ccmagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, n);\n System.arraycopy(ccmagic, 0, keyBuffer, n, ccmagic.length);\n md5.update(keyBuffer);\n byte[] Kcc = md5.digest();\n System.arraycopy(scmagic, 0, keyBuffer, n, scmagic.length);\n md5.update(keyBuffer);\n byte[] Kcs = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST24:Kcc: \", Kcc);\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST25:Kcs: \", Kcs);\n }\n byte[] myKc;\n byte[] peerKc;\n if (clientMode) {\n myKc = Kcc;\n peerKc = Kcs;\n } else {\n myKc = Kcs;\n peerKc = Kcc;\n }\n try {\n SecretKey encKey;\n SecretKey decKey;\n if (negotiatedCipher.indexOf(CIPHER_TOKENS[RC4]) > -1) {\n encCipher = Cipher.getInstance(\"RC4\");\n decCipher = Cipher.getInstance(\"RC4\");\n encKey = new SecretKeySpec(myKc, \"RC4\");\n decKey = new SecretKeySpec(peerKc, \"RC4\");\n encCipher.init(Cipher.ENCRYPT_MODE, encKey);\n decCipher.init(Cipher.DECRYPT_MODE, decKey);\n } else if ((negotiatedCipher.equals(CIPHER_TOKENS[DES])) || (negotiatedCipher.equals(CIPHER_TOKENS[DES3]))) {\n String cipherFullname, cipherShortname;\n if (negotiatedCipher.equals(CIPHER_TOKENS[DES])) {\n cipherFullname = \"DES/CBC/NoPadding\";\n cipherShortname = \"des\";\n } else {\n cipherFullname = \"DESede/CBC/NoPadding\";\n cipherShortname = \"desede\";\n }\n encCipher = Cipher.getInstance(cipherFullname);\n decCipher = Cipher.getInstance(cipherFullname);\n encKey = makeDesKeys(myKc, cipherShortname);\n decKey = makeDesKeys(peerKc, cipherShortname);\n IvParameterSpec encIv = new IvParameterSpec(myKc, 8, 8);\n IvParameterSpec decIv = new IvParameterSpec(peerKc, 8, 8);\n encCipher.init(Cipher.ENCRYPT_MODE, encKey, encIv);\n decCipher.init(Cipher.DECRYPT_MODE, decKey, decIv);\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST26:\" + negotiatedCipher + \" IVcc: \", encIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST27:\" + negotiatedCipher + \" IVcs: \", decIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST28:\" + negotiatedCipher + \" encryption key: \", encKey.getEncoded());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST29:\" + negotiatedCipher + \" decryption key: \", decKey.getEncoded());\n }\n }\n } catch (InvalidKeySpecException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported key \" + \"specification used.\", e);\n } catch (InvalidAlgorithmParameterException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid cipher \" + \"algorithem parameter used to create cipher instance\", e);\n } catch (NoSuchPaddingException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported \" + \"padding used for chosen cipher\", e);\n } catch (InvalidKeyException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid data \" + \"used to initialize keys\", e);\n }\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "java.lang.String getPublicEciesKey();", "OpenSSLKey mo134201a();", "public abstract String getSigAlgOID();", "private void generateIntegrityKeyPair(boolean clientMode) throws UnsupportedEncodingException, IOException, NoSuchAlgorithmException {\n byte[] cimagic = CLIENT_INT_MAGIC.getBytes(encoding);\n byte[] simagic = SVR_INT_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n byte[] keyBuffer = new byte[H_A1.length + cimagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, H_A1.length);\n System.arraycopy(cimagic, 0, keyBuffer, H_A1.length, cimagic.length);\n md5.update(keyBuffer);\n byte[] Kic = md5.digest();\n System.arraycopy(simagic, 0, keyBuffer, H_A1.length, simagic.length);\n md5.update(keyBuffer);\n byte[] Kis = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST12:Kic: \", Kic);\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST13:Kis: \", Kis);\n }\n if (clientMode) {\n myKi = Kic;\n peerKi = Kis;\n } else {\n myKi = Kis;\n peerKi = Kic;\n }\n }", "public final String mo1957a() {\n return \"type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey\";\n }", "private native String native_ks(long cookie, byte[] userKey);", "@Override\n public ConcurrentContentSigner newSigner(\n String type, SignerConf conf, X509Cert[] certificateChain)\n throws ObjectCreationException {\n type = type.toLowerCase(Locale.ROOT);\n if (!types.contains(type)) {\n throw new ObjectCreationException(\"unknown signer type \" + type);\n }\n\n String str = conf.getConfValue(\"parallelism\");\n int parallelism = 20;\n if (str != null) {\n try {\n parallelism = Integer.parseInt(str);\n } catch (NumberFormatException ex) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n\n if (parallelism < 1) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n }\n\n str = conf.getConfValue(\"alias\");\n if (str == null) {\n throw new ObjectCreationException(\"alias is not specified\");\n }\n int keyId = Integer.parseInt(str);\n\n String algoName = conf.getConfValue(\"algo\");\n if (algoName == null) {\n throw new ObjectCreationException(\"algo is not specified\");\n }\n\n try {\n InitStatus initStatus = init(type);\n if (initStatus.status.get() != 1) {\n throw new ObjectCreationException(initStatus.details);\n }\n\n SignAlgo algo = SignAlgo.getInstance(algoName);\n String keyAlgoName;\n String bcKeyAlgoName;\n if (algo.isSM2SigAlgo()) {\n keyAlgoName = \"SM2\";\n bcKeyAlgoName = \"EC\";\n } else if (algo.isRSAPkcs1SigAlgo() || algo.isRSAPSSSigAlgo()) {\n keyAlgoName = \"RSA\";\n bcKeyAlgoName = \"RSA\";\n } else if (algo.isECDSASigAlgo() || algo.isPlainECDSASigAlgo()) {\n keyAlgoName = \"EC\";\n bcKeyAlgoName = \"EC\";\n } else {\n throw new ObjectCreationException(\"unsupported algo \" + algoName);\n }\n\n Provider provider = providerMap.get(type);\n\n // Method to read create PrivateKey and PublicKey object.\n // SANSEC use KeyPairGenerator.generateKeyPair to read the keypair-\n // No new keypair will be generated here.\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(keyAlgoName, provider);\n kpGen.initialize(keyId << 16);\n KeyPair kp = kpGen.generateKeyPair();\n\n PublicKey publicKey = KeyFactory.getInstance(bcKeyAlgoName, \"BC\")\n .generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));\n\n return new JceSignerBuilder(kp.getPrivate(), publicKey, certificateChain, provider)\n .createSigner(algo, parallelism);\n } catch (GeneralSecurityException | XiSecurityException ex) {\n throw new ObjectCreationException(ex.getMessage(), ex);\n }\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv xgetCryptProviderType();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "boolean hasPkiData();", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "public String mo34971a() {\n return \"SHA-384\";\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "public interface JsonKey {\n\n String CLASS = \"class\";\n String DATA = \"data\";\n String EKS = \"eks\";\n String ID = \"id\";\n String LEVEL = \"level\";\n String MESSAGE = \"message\";\n String METHOD = \"method\";\n String REQUEST_MESSAGE_ID = \"msgId\";\n String STACKTRACE = \"stacktrace\";\n String VER = \"ver\";\n String OK = \"ok\";\n String LOG_LEVEL = \"logLevel\";\n String ERROR = \"error\";\n String EMPTY_STRING = \"\";\n String RESPONSE = \"response\";\n String ADDRESS = \"address\";\n String KEY = \"key\";\n String ERROR_MSG = \"error_msg\";\n String ATTRIBUTE = \"attribute\";\n String ERRORS = \"errors\";\n String SUCCESS = \"success\";\n\n String CERTIFICATE = \"certificate\";\n String RECIPIENT_NAME = \"recipientName\";\n String COURSE_NAME = \"courseName\";\n String NAME = \"name\";\n String HTML_TEMPLATE = \"htmlTemplate\";\n String TAG = \"tag\";\n String ISSUER = \"issuer\";\n String URL = \"url\";\n String SIGNATORY_LIST = \"signatoryList\";\n String DESIGNATION = \"designation\";\n String SIGNATORY_IMAGE = \"image\";\n\n String DOMAIN_URL = \"sunbird_cert_domain_url\";\n String ASSESSED_DOMAIN = \"ASSESSED_DOMAIN\";\n String BADGE_URL = \"BADGE_URL\";\n String ISSUER_URL = \"ISSUER_URL\";\n String TEMPLATE_URL = \"TEMPLATE_URL\";\n String CONTEXT = \"CONTEXT\";\n String VERIFICATION_TYPE = \"VERIFICATION_TYPE\";\n String SIGNATORY_EXTENSION = \"SIGNATORY_EXTENSION\";\n String RECIPIENT_EMAIl = \"recipientEmail\";\n String RECIPIENT_PHONE = \"recipientPhone\";\n String RECIPIENT_ID = \"recipientId\";\n String VALID_FROM = \"validFrom\";\n String EXPIRY = \"expiry\";\n String OLD_ID = \"oldId\";\n String PUBLIC_KEY = \"publicKey\";\n String DESCRIPTION = \"description\";\n String LOGO = \"logo\";\n String ISSUE_DATE = \"issueDate\";\n String USER = \"user\";\n String CERTIFICATE_NAME = \"name\";\n\n String CONTAINER_NAME = \"CONTAINER_NAME\";\n String CLOUD_STORAGE_TYPE = \"CLOUD_STORAGE_TYPE\";\n String CLOUD_UPLOAD_RETRY_COUNT = \"CLOUD_UPLOAD_RETRY_COUNT\";\n String AZURE_STORAGE_SECRET = \"AZURE_STORAGE_SECRET\";\n String AZURE_STORAGE_KEY = \"AZURE_STORAGE_KEY\";\n String ACCESS_CODE_LENGTH = \"ACCESS_CODE_LENGTH\";\n String ORG_ID = \"orgId\";\n String KEYS = \"keys\";\n String ENC_SERVICE_URL = \"sunbird_cert_enc_service_url\";\n String SIGN_HEALTH_CHECK_URL = \"SIGN_HEALTH_CHECK_URL\";\n String SIGN_URL = \"SIGN_URL\";\n String SIGN_VERIFY_URL = \"SIGN_VERIFY_URL\";\n String SIGN_CREATOR = \"SIGN_CREATOR\";\n String SIGN = \"sign\";\n String VERIFY = \"verify\";\n String KEY_ID = \"keyId\";\n String JSON_URL = \"jsonUrl\";\n String PDF_URL = \"pdfUrl\";\n String UNIQUE_ID = \"id\";\n String GENERATE_CERT = \"generateCert\";\n String PUBLIC_KEY_URL = \"PUBLIC_KEY_URL\";\n String GET_SIGN_URL = \"getSignUrl\";\n String SIGNED_URL = \"signedUrl\";\n\n String ACCESS_CODE = \"accessCode\";\n String JSON_DATA = \"jsonData\";\n String SLUG = \"sunbird_cert_slug\";\n}", "BigInteger getCEP();", "java.lang.String getPubkey();", "public void setCertiType(java.lang.String certiType) {\n this.certiType = certiType;\n }", "@Schema(required = true, description = \"Contract type (KIP-7, KIP-17, ERC-20, ERC-721)\")\n public String getType() {\n return type;\n }", "public abstract String getSigAlgName();", "public ProfileKey getProfileKey(String username, String type) throws ProfileKeyManagerPersistenceException {\n ParameterHelpers.checkParameter(username, \"username\");\n\n boolean registered = checkType(type);\n\n Connection connection = getConnection();\n\n try {\n return getProfileKey(connection, username, type, registered);\n } finally {\n closeConnection(connection);\n }\n }", "protected CryptoProvider() {\n\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "@ParameterizedTest\n @EnumSource(KeyType.class)\n void testMissingJWTPublicKey(KeyType keyType) throws NoSuchAlgorithmException {\n final Pair<String, PrivateKey> keyPair = generateKeypair(keyType);\n\n final String jwt = Jwts.builder()\n .setHeaderParam(\"kid\", UUID.randomUUID())\n .setAudience(String.format(\"%sToken/auth\", \"here\"))\n .setIssuer(\"macaroon\")\n .setSubject(\"macaroon\")\n .setId(UUID.randomUUID().toString())\n .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES)))\n .signWith(keyPair.getRight(), APIAuthHelpers.getSigningAlgorithm(keyType))\n .compact();\n\n // Submit the JWT\n Response response = RESOURCE.target(\"/v1/Token/auth\")\n .queryParam(\"scope\", \"system/*.*\")\n .queryParam(\"grant_type\", \"client_credentials\")\n .queryParam(\"client_assertion_type\", TokenResource.CLIENT_ASSERTION_TYPE)\n .queryParam(\"client_assertion\", jwt)\n .request()\n .post(Entity.entity(\"\", MediaType.APPLICATION_FORM_URLENCODED));\n\n assertEquals(401, response.getStatus(), \"Should be unauthorized\");\n assertTrue(response.readEntity(String.class).contains(\"Cannot find public key\"), \"Should have correct exception\");\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "public ECP getPublicKGCKey(){return pkS;}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "private TPM_DIGEST createEmptyPubKeyHash()\r\n {\r\n// if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_BROADCOM )\r\n// {\r\n// return null;\r\n// }\r\n// else\r\n// {\r\n// return new TPM_DIGEST();\r\n// }\r\n if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_INFINEON )\r\n {\r\n return new TPM_DIGEST();\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }", "public String getTlsKey();", "@Test\n\tpublic void testSecuirtyConfigsOperations() throws NoSuchAlgorithmException {\n\t\t// Generate and store keys for the first time\n\t\tServerKeyPairs serverKeyPairs1 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair1 = serverKeyPairs1.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair1 = serverKeyPairs1.getSignatureKeyPair();\n\n\t\t// Initialize a new serverKeyPairs to test that it will only read\n\t\t// previously generated keys\n\t\tServerKeyPairs serverKeyPairs2 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair2 = serverKeyPairs2.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair2 = serverKeyPairs2.getSignatureKeyPair();\n\n\t\tassertEquals(\"Wrong loaded encryption public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded encryption private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getPrivateExponent());\n\n\t\tassertEquals(\"Wrong loaded signature public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded signature private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getPrivateExponent());\n\t}", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType.Enum getCryptAlgorithmType();", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public MEKeyTool() {\n keystore = new PublicKeyStoreBuilderBase();\n }", "public PrivateKeyType getPivateKeyType() {\n return PrivateKeyType.SAPLING_EXTENED_SPEND_KEY;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType xgetCryptAlgorithmType();", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "public void setPrincipalType(String principalType){\n this.principalType = principalType;\n //Update hashMap value..\n hashMap.put(\"principalType\", principalType);\n }", "private static String generateServerKey(Poi poi) {\n LonLat viewPoint = poi.getViewPosition();\n int lon = viewPoint.getLonInt();\n int lat = viewPoint.getLatInt();\n int alt = viewPoint.getAltInt();\n return generateServerKey(poi.getName(), poi.getAddress(), lon, lat, alt);\n }", "public static void main(String[] args) {\n String keyFile = \"D:\\\\data\\\\kms\\\\liweigang.idc\";\n String message = \"dksf3r38324hrewjrh3r&^%djfdsjkek\";\n String pubmatrix = \"D:\\\\data\\\\kms\\\\sm2cpk.cn.pkm\";\n\n byte[] keycard = Tool.ReadFile(keyFile);\n System.out.println(\"keyCard:\" + Tool.Bytes2Hex(keycard));\n\n //得到私钥\n byte[] priKey = GMJni.GetPriKey(keycard);\n String priKeyHex = Tool.Bytes2Hex(priKey);\n System.out.println(\"private key:\" + priKeyHex);\n\n //得到密钥标识\n byte[] keyId = GMJni.GetKeyId(keycard);\n System.out.println(\"keyId:\" + Tool.Bytes2String(keyId));\n\n //得到公钥\n byte[] pubKey = GMJni.CalPubKey(Tool.String2Bytes(pubmatrix), keyId);\n System.out.println(\"public key:\" + Tool.Bytes2Hex(pubKey));\n\n //1000个不同message\n List<String> msgList = new ArrayList<>(12);\n for (int i = 0; i < 1000; i++) {\n //message基础上字符串长度+10\n msgList.add(message + RandomUtil.randomString(10));\n }\n long start = System.currentTimeMillis();\n //签名结果\n int rv = 0;\n //缓存\n MapCache cache = new MapCache();\n //命中缓存次数\n int count = 0;\n int count2 = 0;\n for (int i = 0; i < 100000; i++) {\n System.out.println(\"模拟请求第\" + i + \"次数\");\n\n //计算E值\n //30种不同的message,即仅30个不走缓存\n byte[] E = GMJni.SM2GetE(keyId, pubKey, Tool.String2Bytes(msgList.get(new Random().nextInt(30))));\n String hexE = Tool.Bytes2Hex(E);\n// System.out.println(\"E:\" + hexE);\n\n //SM2签名\n byte[] sig = GMJni.SM2Sign(priKey, E);\n// System.out.println(\"private key:\" + Tool.Bytes2Hex(priKey));\n// System.out.println(\"sign value:\" + Tool.Bytes2Hex(sig));\n\n // SM2签名验证\n // 引入Map缓存 E,sig的16进制的MD5值\n String hex = hexE + priKeyHex;\n// System.out.println(\"finalStr:\" + hex);\n String md5 = SecureUtil.md5(hex);\n if (null != cache.get(md5)) {\n count++;\n// System.out.println(\"命中缓存\" + (++count));\n } else {\n rv += GMJni.SM2Verify(pubKey, E, sig);\n count2++;\n cache.add(md5, (byte) 1, 50 * 1000);\n }\n }\n long end = System.currentTimeMillis();\n double v = (end - start) / 1000.0;\n System.out.println(\"time consuming:\" + v + \" sec\");\n System.out.println(Math.round(100000 / v) + \" times/sec\");\n System.out.println(\"命中缓存\" + (count));\n System.out.println(\"未命中\" + (count2));\n if (rv != 0) {\n System.out.println(\"Verify signature fail, error code is \" + String.valueOf(rv));\n } else {\n System.out.println(\"Verify signature success.\");\n }\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public java.lang.String getCertiType() {\n return certiType;\n }", "public static void registerDefaultAlgorithms() {\n/* 390 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#dsa-sha1\", SignatureDSA.class);\n/* */ \n/* */ \n/* 393 */ algorithmHash.put(\"http://www.w3.org/2009/xmldsig11#dsa-sha256\", SignatureDSA.SHA256.class);\n/* */ \n/* */ \n/* 396 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\", SignatureBaseRSA.SignatureRSASHA1.class);\n/* */ \n/* */ \n/* 399 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#hmac-sha1\", IntegrityHmac.IntegrityHmacSHA1.class);\n/* */ \n/* */ \n/* 402 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-md5\", SignatureBaseRSA.SignatureRSAMD5.class);\n/* */ \n/* */ \n/* */ \n/* 406 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160\", SignatureBaseRSA.SignatureRSARIPEMD160.class);\n/* */ \n/* */ \n/* */ \n/* 410 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\", SignatureBaseRSA.SignatureRSASHA256.class);\n/* */ \n/* */ \n/* 413 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384\", SignatureBaseRSA.SignatureRSASHA384.class);\n/* */ \n/* */ \n/* 416 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\", SignatureBaseRSA.SignatureRSASHA512.class);\n/* */ \n/* */ \n/* 419 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1\", SignatureECDSA.SignatureECDSASHA1.class);\n/* */ \n/* */ \n/* 422 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256\", SignatureECDSA.SignatureECDSASHA256.class);\n/* */ \n/* */ \n/* 425 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384\", SignatureECDSA.SignatureECDSASHA384.class);\n/* */ \n/* */ \n/* 428 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512\", SignatureECDSA.SignatureECDSASHA512.class);\n/* */ \n/* */ \n/* 431 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-md5\", IntegrityHmac.IntegrityHmacMD5.class);\n/* */ \n/* */ \n/* 434 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160\", IntegrityHmac.IntegrityHmacRIPEMD160.class);\n/* */ \n/* */ \n/* 437 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha256\", IntegrityHmac.IntegrityHmacSHA256.class);\n/* */ \n/* */ \n/* 440 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha384\", IntegrityHmac.IntegrityHmacSHA384.class);\n/* */ \n/* */ \n/* 443 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha512\", IntegrityHmac.IntegrityHmacSHA512.class);\n/* */ }", "java.lang.String getServerSecret();", "public static void main(String[] args) {\n\t\tString algorithm = SignatureAlgorithm.HS256.getJcaName();\r\n\t\tSystem.out.println(algorithm);\r\n\r\n\t\t// set secret key\r\n\t\tString secret = \"this+is+my+scret+key+AAAAAAAAAAAAAAAAAAAAAAAAA\";\r\n\r\n\t\t// background information\r\n\t\t// =============================================================\r\n\t\t/*\r\n\t\t * the bytes of the secret key will be used by the signature algorithm - must be\r\n\t\t * in base 64 format\r\n\t\t */\r\n//\t\tbyte[] scretKeyEncoded = secret.getBytes(); // java encoding\r\n//\t\tbyte[] scretKeyDecoded = Base64.getDecoder().decode(secret); // base64\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyEncoded));\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyDecoded));\r\n\t\t// =====================================================================================\r\n\r\n\t\t// create the key from the decoded secret\r\n\t\tKey key = new SecretKeySpec(Base64.getDecoder().decode(secret), algorithm);\r\n\r\n\t\tInstant now = Instant.now();\r\n\r\n\t\t// create a JWT instance\r\n\t\tString jwt = Jwts.builder()\r\n\r\n\t\t\t\t.signWith(key)\r\n\r\n\t\t\t\t.setIssuedAt(Date.from(now))\r\n\r\n\t\t\t\t// will be valid for 10 seconds\r\n\t\t\t\t.setExpiration(Date.from(now.plus(10, ChronoUnit.SECONDS)))\r\n\r\n\t\t\t\t.setSubject(\"aaa@mail\")\r\n\r\n\t\t\t\t.claim(\"First name\", \"Dan\")\r\n\r\n\t\t\t\t.claim(\"Last name\", \"Levi\")\r\n\r\n\t\t\t\t.compact();\r\n\r\n\t\tSystem.out.println(jwt);\r\n\r\n\t\t// ==================================================\r\n\t\t// parse the JWS to get the expanded JWT\r\n//\t\tJWS - JSON Web Signature [aaaa.bbbb.cccc]\r\n//\t\tJWT - JSON Web Token [aaaa.bbbb.cccc]\r\n\r\n\t\tSystem.out.println(\"====================\");\r\n\t\tSystem.out.println(\"parsing the JWS to get a JWT\");\r\n\t\tJwtParser jwtParser = Jwts.parserBuilder().setSigningKey(key).build();\r\n\t\t// to demonstrate expiration paste an old JWS\r\n\t\tjwt = \"eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjA2Mzk1MTEsImV4cCI6MTYyMDYzOTUyMSwic3ViIjoiYWFhQG1haWwiLCJGaXJzdCBuYW1lIjoiRGFuIiwiTGFzdCBuYW1lIjoiTGV2aSJ9.cefEbBejjebKVILgOzca0LJZfd0F3qjezegeCaxOrfE\";\r\n\t\tSystem.out.println(jwtParser.parse(jwt));\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getHeader());\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getBody());\r\n\r\n\t}", "private String getSignatureString(Type type)\r\n {\r\n if(type instanceof CompoundType)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n CompoundType cType = (CompoundType)type;\r\n //find key and value types\r\n String keyType = getSignatureString(cType.keyType);\r\n sb.append(\"Ljava/util/HashMap\");\r\n sb.append(\"<\");\r\n sb.append(keyType);\r\n sb.append(getSignatureString(cType.valType));\r\n sb.append(\">;\");\r\n return sb.toString();\r\n }\r\n else if(type instanceof SimpleType)\r\n {\r\n switch(((SimpleType)type).type)\r\n {\r\n case INT:\r\n return \"Ljava/lang/Integer;\";\r\n case BOOLEAN:\r\n return \"Ljava/lang/Boolean;\";\r\n case STRING:\r\n return \"Ljava/lang/String;\";\r\n }\r\n }\r\n return null;\r\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "public String getJCEProviderName() {\n/* 196 */ return this.signatureAlgorithm.engineGetJCEProviderName();\n/* */ }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public String getJCEAlgorithmString() {\n/* 187 */ return this.signatureAlgorithm.engineGetJCEAlgorithmString();\n/* */ }", "com.google.protobuf.ByteString getPublicEciesKeyBytes();", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "public static String getKeyTypeName(KeyType type)\n {\n // TODO: should be moved to DBProvider ...\n // MySQL : key identifier\n // SQLServer : key identifier\n // Derby : key identifier\n // PostgreSQL: key identifier\n switch (type) {\n // MySQL: key types ...\n case PRIMARY : return \"PRIMARY KEY\"; // table\n case UNIQUE : return \"UNIQUE\"; // table\n case INDEX : return \"INDEX\"; // table/index\n case UNIQUE_INDEX : return \"UNIQUE INDEX\"; // table/index\n default : return \"UNKNOWN\";\n }\n }", "long getCryptProviderTypeExt();", "@PostMapping(\"/createKeyPair\")\n public String createKeyPair() {\n \n AWSKMS kmsClient = AWSKMSClientBuilder.standard().build();\n \n return \"Private uid: \"+ priuid +\"\\nPublic uid: \" + pubuid +\"\\n\";\n }", "long getCryptAlgorithmSid();", "switch (buffer[ISO7816.OFFSET_CDATA + 4]) {\r\n\t\tcase BASIC:\r\n\t\t\tsetSignatureType(BASIC);\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tsetSignatureType(AUTHENTICATION);\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tsetSignatureType(NON_REPUDIATION);\r\n\t\t\tbreak;\r\n\t\tcase CA_ROLE:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\tdefault:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "private KeyStore askForPin() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {\n char newPin[] = PinDialog.getPIN(this.providerDesc);\n try {\n KeyStore ks = getKeyStore(newPin);\n pin = newPin;\n return ks;\n } catch (IOException e2) {\n e2.printStackTrace();\n if (e2.getCause() instanceof LoginException) {\n JOptionPane.showMessageDialog(null, \"Wrong PIN\", \"Cryptographic card\", JOptionPane.WARNING_MESSAGE);\n }\n throw e2;\n }\n }", "public String getTlsKeyPath();", "@Override\n public String getProviderName() {\n return \"SimpleEncryptionKeyStoreProvider\";\n }", "public byte[] getUserKey() throws IOException\n {\n byte[] u = null;\n COSString user = (COSString)encryptionDictionary.getDictionaryObject( COSName.getPDFName( \"U\" ) );\n if( user != null )\n {\n u = user.getBytes();\n }\n return u;\n }", "public interface SKey {\n\n String FAIL_STORE = \"job.fail.store\";\n\n String LOADBALANCE = \"loadbalance\";\n\n String EVENT_CENTER = \"event.center\";\n\n String REMOTING = \"lts.remoting\";\n\n String REMOTING_SERIALIZABLE_DFT = \"lts.remoting.serializable.default\";\n\n String ZK_CLIENT_KEY = \"zk.client\";\n\n String JOB_ID_GENERATOR = \"id.generator\";\n\n String JOB_LOGGER = \"job.logger\";\n\n String JOB_QUEUE = \"job.queue\";\n}", "private void getKeyType(final PdfObject pdfObject, final int i, final byte[] raw, final int length, final int keyLength, final int keyStart, final int type) {\n if(debugFastCode)//used in debug\n {\n PDFkey = PdfDictionary.getKey(keyStart, keyLength, raw);\n }\n \n PDFkeyInt=PdfDictionary.getIntKey(keyStart,keyLength,raw);\n \n //correct mapping\n if(PDFkeyInt==PdfDictionary.Indexed && (type==PdfDictionary.MK ||type==PdfDictionary.Form || type==PdfDictionary.Linearized || type==PdfDictionary.Group)) {\n PDFkeyInt = PdfDictionary.I;\n }\n \n if(isInlineImage) {\n PDFkeyInt = PdfObjectFactory.getInlineID(PDFkeyInt);\n }\n \n final int id=pdfObject.getID();\n \n if(type==PdfDictionary.Resources && (PDFkeyInt==PdfDictionary.ColorSpace\n || PDFkeyInt==PdfDictionary.ExtGState || PDFkeyInt==PdfDictionary.Shading\n || PDFkeyInt==PdfDictionary.XObject || PDFkeyInt==PdfDictionary.Font|| PDFkeyInt==PdfDictionary.Pattern)){\n pdfKeyType=PdfDictionary.VALUE_IS_DICTIONARY_PAIRS;\n //}else if (type==PdfDictionary.Form && id== PdfDictionary.AA && PDFkeyInt== PdfDictionary.K){\n // pdfKeyType= PdfDictionary.VALUE_IS_UNREAD_DICTIONARY;\n }else if (type==PdfDictionary.Outlines && PDFkeyInt== PdfDictionary.D){\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && PDFkeyInt== PdfDictionary.D){\n if(id==PdfDictionary.AP || id==PdfDictionary.AA){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if(id==PdfDictionary.Win){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else{\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && (id==PdfDictionary.AP || id==PdfDictionary.AA) && PDFkeyInt== PdfDictionary.A){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if (PDFkeyInt== PdfDictionary.Order && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary. VALUE_IS_OBJECT_ARRAY;\n }else if (PDFkeyInt== PdfDictionary.Name && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if ((type==PdfDictionary.ColorSpace || type==PdfDictionary.Function) && PDFkeyInt== PdfDictionary.N){\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(PDFkeyInt==PdfDictionary.Gamma && type==PdfDictionary.ColorSpace &&\n pdfObject.getParameterConstant(PdfDictionary.ColorSpace)== ColorSpaces.CalGray){ //its a number not an array\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(id==PdfDictionary.Win && pdfObject.getObjectType()==PdfDictionary.Form &&\n (PDFkeyInt==PdfDictionary.P || PDFkeyInt==PdfDictionary.O)){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if (isInlineImage && PDFkeyInt==PdfDictionary.ColorSpace){\n pdfKeyType= PdfDictionary.VALUE_IS_DICTIONARY;\n }else {\n pdfKeyType = PdfDictionary.getKeyType(PDFkeyInt, type);\n }\n \n \n //handle array of Function in Shading by using keyArray\n if(id==PdfDictionary.Shading && PDFkeyInt==PdfDictionary.Function){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n if(raw[ptr]=='['){\n pdfKeyType=PdfDictionary.VALUE_IS_KEY_ARRAY;\n }\n }\n \n //allow for other values in D,N,R definitions\n if(pdfKeyType==-1 && id== PdfDictionary.ClassMap){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n }else\n //allow for other values in D,N,R definitions as key pairs\n if(((((id==PdfDictionary.N || id==PdfDictionary.D || id==PdfDictionary.R))) &&\n pdfObject.getParentID()==PdfDictionary.AP &&\n pdfObject.getObjectType()==PdfDictionary.Form\n && raw[i]!='[' )){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n //decide if pair\n if(raw[keyStart]=='L' && raw[keyStart+1]=='e' && raw[keyStart+2]=='n' && raw[keyStart+3]=='g' && raw[keyStart+4]=='t' && raw[keyStart+5]=='h'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='n'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='f' && raw[keyStart+2]=='f'){\n }else\n if(raw[ptr]=='R'){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n \n if(debugFastCode) {\n System.out.println(\"new Returns \" + pdfKeyType + \" i=\" + i);\n }\n }\n }\n \n /**/\n \n //DecodeParms can be an array as well as a dictionary so check next char and alter if so\n if(PDFkeyInt==PdfDictionary.DecodeParms) {\n pdfKeyType = setTypeForDecodeParams(i, raw, length, pdfKeyType);\n }\n \n if(debugFastCode && pdfKeyType==-1 && pdfObject.getObjectType()!=PdfDictionary.Page){\n System.out.println(id+\" \"+type);\n System.out.println(padding +PDFkey+\" NO type setting for \"+PdfDictionary.getKey(keyStart,keyLength,raw)+\" id=\"+i);\n }\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "public PaymentRecordKey() {\n super();\n }", "private PasskeyContract() {}", "public RSAKeyPairGenerator() {\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum getCryptProviderType();", "java.lang.String getSignatureProviderId();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }" ]
[ "0.6726498", "0.6677302", "0.65103334", "0.6503502", "0.62628514", "0.6250372", "0.61004686", "0.5888439", "0.58146834", "0.5749554", "0.5741641", "0.5493693", "0.5474418", "0.52934134", "0.52665645", "0.5246521", "0.52349544", "0.5175871", "0.5017036", "0.5007778", "0.4962969", "0.4950082", "0.49420312", "0.49163356", "0.49024847", "0.48897386", "0.48511118", "0.48511118", "0.4844952", "0.48370767", "0.4831613", "0.4831613", "0.4831613", "0.48279023", "0.4821235", "0.48205858", "0.48205858", "0.48201925", "0.48012882", "0.4783611", "0.47606364", "0.47574088", "0.47566023", "0.47519523", "0.47286636", "0.47235122", "0.47220808", "0.47063407", "0.47040585", "0.47039852", "0.47009808", "0.4687133", "0.46720207", "0.4663095", "0.46227324", "0.46167073", "0.4614823", "0.46146208", "0.46117303", "0.4609115", "0.4605506", "0.45985833", "0.45930865", "0.45889315", "0.45830595", "0.45830226", "0.45740417", "0.45735276", "0.4572773", "0.4563699", "0.4561856", "0.45605567", "0.45527497", "0.45521763", "0.4549838", "0.4536104", "0.45360166", "0.4531036", "0.45309407", "0.45290637", "0.45238796", "0.4519284", "0.45178244", "0.4511146", "0.45110682", "0.4508972", "0.45000508", "0.44973904", "0.44938332", "0.44937173", "0.44929975", "0.44925633", "0.44923615", "0.44870168", "0.44844353", "0.44840944", "0.44768944", "0.44768745", "0.4473516", "0.4471568" ]
0.55435157
11
none / x509+sha256 / x509+sha1 optional string pki_type = 2 [default = "none"];
public Builder setPkiType( java.lang.String value) { copyOnWrite(); instance.setPkiType(value); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPkiType();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "boolean hasPkiType();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "public static void main(String[] args) throws IcbcApiException {\n\t\tUiIcbcClient client = new UiIcbcClient(APP_ID,IcbcConstants.SIGN_TYPE_RSA,\n\t\t\t\t\"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJCoQe/O+uqpOtyE/2CUjD7wosZw8jI1AlLNJCllOmlX+obA6h97b0JsEL0SjMCAR3xJyw7MKLqkcy5qQ/bBgw2XSrodmjzOVqfT1OXRii0xw0HiVkHR4cEWnEAAdfo0lDc4iuzCIQrnT5gM0+U+qeSV6JFfwVRjgYzBdHQRPCf1AgMBAAECgYAdQUoEe7GXH5591o/nMmOinvvscg8pRDsyD7bOgGBtyZMrCXzP3SDFKCHCeyvoColqg2oDlhpulK+OpYMVNlGQcO4eubOJp9MUc3m4A9RxkVr3dsVrmygM5czPfWHAPVQ4dECDruBJn9zoo1ci0myRTh4KSCq6SxpCE0Pbf3j7iQJBAOdMPFRfOkSQ1hsN9Mg4jd9on8r7+mF8gFPhkNI6qvEKw/prmU3obUWvZL42vRlLOQyyB92mBF24PStR/B6CjR8CQQCgGz0VoqCplurSCapGdgX3D7bNSDtMUmaLJYJxih8v+zghP0YtVgDeV3NjogVjOlz8/9Rebo0PoFcqyJnNA1RrAkEAul3dBoasZm7ldWsrXuDiv66HgoDB4Cb3J59Kl3oaHpp0CqUEI5gx48JNRE7K00SfNTGF0Pxh7Dn1X6Bxqwu6NQJADrdyPfLc4bnFi9jnleJzWepP2z6wdKt+UXv5KYaQp1BoMGYohTJKkiVnrdjOtfg/Y+IAG03+GVmbqYsW2AleUQJBANYQklohKtsmq8ptX3as6hjcuXcTpc2DSpVeOnCueNv107+dDJ+K14tbiVYzF3tkHBNMRkGtr6EuGKJ+A63sJ00=\",\n\t\t\t\tIcbcConstants.CHARSET_UTF8,IcbcConstants.ENCRYPT_TYPE_AES, \"xMh0xFsG7G80ziePFdnT8g==\");\n\t\tEaccountManageRequestV1 request = new EaccountManageRequestV1();\t\t\n\t\trequest.setServiceUrl(\"http://122.64.61.111:8081/ui/eaccount/manage/V1\");///\n\t\tEaccountManageRequestBizV1 bizContent = new EaccountManageRequestBizV1();\n\t\tbizContent.setMobileNo(\"13703878410\");//选输,手机号\n\t\tbizContent.setIdcode(\"128440810108044\");//选输,身份证号\n\t\tbizContent.setName(URLEncoder.encode(\"芡悠\"));//选输,用户姓名\n\t\tbizContent.setUserId(\"128440810108044\");//必输,需控制不能为空,用户唯一标识,送身份证号\n\t\tbizContent.setBacAddr(URLEncoder.encode(\"http://www.test.com\"));//选输,回调地址\n\t\tbizContent.setEpayflag(\"0\");//选输,工银e支付标志,0-短信、1-静态密码,集成客户端SDK的方式能送0-短信或1-静态密码,非APP方式只能送0-短信,不送默认为0-短信\n\t\t\n\t\tbizContent.setCorpAppid(APP_ID);//外公司合作方送APP_ID的值,行内应用如e支付等送外公司合作方的APPID\n\t\tlong systime = System.currentTimeMillis(); // 现时间戳\t\t\n\t\tString orderTimeStamp=new Long(systime).toString();\n\t\t\n\t\tSystem.out.println(\"orderTimeStamp:\"+orderTimeStamp);\n\t\tbizContent.setOrderTimeStamp(orderTimeStamp);//生成请求的时间,必输\n\t\t\n\t\tbizContent.setZoneno(\"00200\");//地区号号,选输,5位数字,上送值联系对接分行提供\n\t\tbizContent.setBrno(\"00260\");//网点号,选输,5位数字,上送值联系对接分行提供\n\t\t\n\t\trequest.setBizContent(bizContent);\n\t\tSystem.out.println(client.buildPostForm(request));// 实际调用时的相关返回结果及异常处理,请自行添加\n\t}", "dkk mo4509g();", "private void generatePrivacyKeyPair(boolean clientMode) throws IOException, UnsupportedEncodingException, NoSuchAlgorithmException, SaslException {\n byte[] ccmagic = CLIENT_CONF_MAGIC.getBytes(encoding);\n byte[] scmagic = SVR_CONF_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n int n;\n if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_40])) {\n n = 5;\n } else if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_56])) {\n n = 7;\n } else {\n n = 16;\n }\n byte[] keyBuffer = new byte[n + ccmagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, n);\n System.arraycopy(ccmagic, 0, keyBuffer, n, ccmagic.length);\n md5.update(keyBuffer);\n byte[] Kcc = md5.digest();\n System.arraycopy(scmagic, 0, keyBuffer, n, scmagic.length);\n md5.update(keyBuffer);\n byte[] Kcs = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST24:Kcc: \", Kcc);\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST25:Kcs: \", Kcs);\n }\n byte[] myKc;\n byte[] peerKc;\n if (clientMode) {\n myKc = Kcc;\n peerKc = Kcs;\n } else {\n myKc = Kcs;\n peerKc = Kcc;\n }\n try {\n SecretKey encKey;\n SecretKey decKey;\n if (negotiatedCipher.indexOf(CIPHER_TOKENS[RC4]) > -1) {\n encCipher = Cipher.getInstance(\"RC4\");\n decCipher = Cipher.getInstance(\"RC4\");\n encKey = new SecretKeySpec(myKc, \"RC4\");\n decKey = new SecretKeySpec(peerKc, \"RC4\");\n encCipher.init(Cipher.ENCRYPT_MODE, encKey);\n decCipher.init(Cipher.DECRYPT_MODE, decKey);\n } else if ((negotiatedCipher.equals(CIPHER_TOKENS[DES])) || (negotiatedCipher.equals(CIPHER_TOKENS[DES3]))) {\n String cipherFullname, cipherShortname;\n if (negotiatedCipher.equals(CIPHER_TOKENS[DES])) {\n cipherFullname = \"DES/CBC/NoPadding\";\n cipherShortname = \"des\";\n } else {\n cipherFullname = \"DESede/CBC/NoPadding\";\n cipherShortname = \"desede\";\n }\n encCipher = Cipher.getInstance(cipherFullname);\n decCipher = Cipher.getInstance(cipherFullname);\n encKey = makeDesKeys(myKc, cipherShortname);\n decKey = makeDesKeys(peerKc, cipherShortname);\n IvParameterSpec encIv = new IvParameterSpec(myKc, 8, 8);\n IvParameterSpec decIv = new IvParameterSpec(peerKc, 8, 8);\n encCipher.init(Cipher.ENCRYPT_MODE, encKey, encIv);\n decCipher.init(Cipher.DECRYPT_MODE, decKey, decIv);\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST26:\" + negotiatedCipher + \" IVcc: \", encIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST27:\" + negotiatedCipher + \" IVcs: \", decIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST28:\" + negotiatedCipher + \" encryption key: \", encKey.getEncoded());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST29:\" + negotiatedCipher + \" decryption key: \", decKey.getEncoded());\n }\n }\n } catch (InvalidKeySpecException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported key \" + \"specification used.\", e);\n } catch (InvalidAlgorithmParameterException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid cipher \" + \"algorithem parameter used to create cipher instance\", e);\n } catch (NoSuchPaddingException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported \" + \"padding used for chosen cipher\", e);\n } catch (InvalidKeyException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid data \" + \"used to initialize keys\", e);\n }\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "java.lang.String getPublicEciesKey();", "OpenSSLKey mo134201a();", "public abstract String getSigAlgOID();", "private void generateIntegrityKeyPair(boolean clientMode) throws UnsupportedEncodingException, IOException, NoSuchAlgorithmException {\n byte[] cimagic = CLIENT_INT_MAGIC.getBytes(encoding);\n byte[] simagic = SVR_INT_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n byte[] keyBuffer = new byte[H_A1.length + cimagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, H_A1.length);\n System.arraycopy(cimagic, 0, keyBuffer, H_A1.length, cimagic.length);\n md5.update(keyBuffer);\n byte[] Kic = md5.digest();\n System.arraycopy(simagic, 0, keyBuffer, H_A1.length, simagic.length);\n md5.update(keyBuffer);\n byte[] Kis = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST12:Kic: \", Kic);\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST13:Kis: \", Kis);\n }\n if (clientMode) {\n myKi = Kic;\n peerKi = Kis;\n } else {\n myKi = Kis;\n peerKi = Kic;\n }\n }", "public final String mo1957a() {\n return \"type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey\";\n }", "private native String native_ks(long cookie, byte[] userKey);", "@Override\n public ConcurrentContentSigner newSigner(\n String type, SignerConf conf, X509Cert[] certificateChain)\n throws ObjectCreationException {\n type = type.toLowerCase(Locale.ROOT);\n if (!types.contains(type)) {\n throw new ObjectCreationException(\"unknown signer type \" + type);\n }\n\n String str = conf.getConfValue(\"parallelism\");\n int parallelism = 20;\n if (str != null) {\n try {\n parallelism = Integer.parseInt(str);\n } catch (NumberFormatException ex) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n\n if (parallelism < 1) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n }\n\n str = conf.getConfValue(\"alias\");\n if (str == null) {\n throw new ObjectCreationException(\"alias is not specified\");\n }\n int keyId = Integer.parseInt(str);\n\n String algoName = conf.getConfValue(\"algo\");\n if (algoName == null) {\n throw new ObjectCreationException(\"algo is not specified\");\n }\n\n try {\n InitStatus initStatus = init(type);\n if (initStatus.status.get() != 1) {\n throw new ObjectCreationException(initStatus.details);\n }\n\n SignAlgo algo = SignAlgo.getInstance(algoName);\n String keyAlgoName;\n String bcKeyAlgoName;\n if (algo.isSM2SigAlgo()) {\n keyAlgoName = \"SM2\";\n bcKeyAlgoName = \"EC\";\n } else if (algo.isRSAPkcs1SigAlgo() || algo.isRSAPSSSigAlgo()) {\n keyAlgoName = \"RSA\";\n bcKeyAlgoName = \"RSA\";\n } else if (algo.isECDSASigAlgo() || algo.isPlainECDSASigAlgo()) {\n keyAlgoName = \"EC\";\n bcKeyAlgoName = \"EC\";\n } else {\n throw new ObjectCreationException(\"unsupported algo \" + algoName);\n }\n\n Provider provider = providerMap.get(type);\n\n // Method to read create PrivateKey and PublicKey object.\n // SANSEC use KeyPairGenerator.generateKeyPair to read the keypair-\n // No new keypair will be generated here.\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(keyAlgoName, provider);\n kpGen.initialize(keyId << 16);\n KeyPair kp = kpGen.generateKeyPair();\n\n PublicKey publicKey = KeyFactory.getInstance(bcKeyAlgoName, \"BC\")\n .generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));\n\n return new JceSignerBuilder(kp.getPrivate(), publicKey, certificateChain, provider)\n .createSigner(algo, parallelism);\n } catch (GeneralSecurityException | XiSecurityException ex) {\n throw new ObjectCreationException(ex.getMessage(), ex);\n }\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv xgetCryptProviderType();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "boolean hasPkiData();", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "public String mo34971a() {\n return \"SHA-384\";\n }", "public interface JsonKey {\n\n String CLASS = \"class\";\n String DATA = \"data\";\n String EKS = \"eks\";\n String ID = \"id\";\n String LEVEL = \"level\";\n String MESSAGE = \"message\";\n String METHOD = \"method\";\n String REQUEST_MESSAGE_ID = \"msgId\";\n String STACKTRACE = \"stacktrace\";\n String VER = \"ver\";\n String OK = \"ok\";\n String LOG_LEVEL = \"logLevel\";\n String ERROR = \"error\";\n String EMPTY_STRING = \"\";\n String RESPONSE = \"response\";\n String ADDRESS = \"address\";\n String KEY = \"key\";\n String ERROR_MSG = \"error_msg\";\n String ATTRIBUTE = \"attribute\";\n String ERRORS = \"errors\";\n String SUCCESS = \"success\";\n\n String CERTIFICATE = \"certificate\";\n String RECIPIENT_NAME = \"recipientName\";\n String COURSE_NAME = \"courseName\";\n String NAME = \"name\";\n String HTML_TEMPLATE = \"htmlTemplate\";\n String TAG = \"tag\";\n String ISSUER = \"issuer\";\n String URL = \"url\";\n String SIGNATORY_LIST = \"signatoryList\";\n String DESIGNATION = \"designation\";\n String SIGNATORY_IMAGE = \"image\";\n\n String DOMAIN_URL = \"sunbird_cert_domain_url\";\n String ASSESSED_DOMAIN = \"ASSESSED_DOMAIN\";\n String BADGE_URL = \"BADGE_URL\";\n String ISSUER_URL = \"ISSUER_URL\";\n String TEMPLATE_URL = \"TEMPLATE_URL\";\n String CONTEXT = \"CONTEXT\";\n String VERIFICATION_TYPE = \"VERIFICATION_TYPE\";\n String SIGNATORY_EXTENSION = \"SIGNATORY_EXTENSION\";\n String RECIPIENT_EMAIl = \"recipientEmail\";\n String RECIPIENT_PHONE = \"recipientPhone\";\n String RECIPIENT_ID = \"recipientId\";\n String VALID_FROM = \"validFrom\";\n String EXPIRY = \"expiry\";\n String OLD_ID = \"oldId\";\n String PUBLIC_KEY = \"publicKey\";\n String DESCRIPTION = \"description\";\n String LOGO = \"logo\";\n String ISSUE_DATE = \"issueDate\";\n String USER = \"user\";\n String CERTIFICATE_NAME = \"name\";\n\n String CONTAINER_NAME = \"CONTAINER_NAME\";\n String CLOUD_STORAGE_TYPE = \"CLOUD_STORAGE_TYPE\";\n String CLOUD_UPLOAD_RETRY_COUNT = \"CLOUD_UPLOAD_RETRY_COUNT\";\n String AZURE_STORAGE_SECRET = \"AZURE_STORAGE_SECRET\";\n String AZURE_STORAGE_KEY = \"AZURE_STORAGE_KEY\";\n String ACCESS_CODE_LENGTH = \"ACCESS_CODE_LENGTH\";\n String ORG_ID = \"orgId\";\n String KEYS = \"keys\";\n String ENC_SERVICE_URL = \"sunbird_cert_enc_service_url\";\n String SIGN_HEALTH_CHECK_URL = \"SIGN_HEALTH_CHECK_URL\";\n String SIGN_URL = \"SIGN_URL\";\n String SIGN_VERIFY_URL = \"SIGN_VERIFY_URL\";\n String SIGN_CREATOR = \"SIGN_CREATOR\";\n String SIGN = \"sign\";\n String VERIFY = \"verify\";\n String KEY_ID = \"keyId\";\n String JSON_URL = \"jsonUrl\";\n String PDF_URL = \"pdfUrl\";\n String UNIQUE_ID = \"id\";\n String GENERATE_CERT = \"generateCert\";\n String PUBLIC_KEY_URL = \"PUBLIC_KEY_URL\";\n String GET_SIGN_URL = \"getSignUrl\";\n String SIGNED_URL = \"signedUrl\";\n\n String ACCESS_CODE = \"accessCode\";\n String JSON_DATA = \"jsonData\";\n String SLUG = \"sunbird_cert_slug\";\n}", "BigInteger getCEP();", "java.lang.String getPubkey();", "public void setCertiType(java.lang.String certiType) {\n this.certiType = certiType;\n }", "public abstract String getSigAlgName();", "@Schema(required = true, description = \"Contract type (KIP-7, KIP-17, ERC-20, ERC-721)\")\n public String getType() {\n return type;\n }", "public ProfileKey getProfileKey(String username, String type) throws ProfileKeyManagerPersistenceException {\n ParameterHelpers.checkParameter(username, \"username\");\n\n boolean registered = checkType(type);\n\n Connection connection = getConnection();\n\n try {\n return getProfileKey(connection, username, type, registered);\n } finally {\n closeConnection(connection);\n }\n }", "protected CryptoProvider() {\n\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "@ParameterizedTest\n @EnumSource(KeyType.class)\n void testMissingJWTPublicKey(KeyType keyType) throws NoSuchAlgorithmException {\n final Pair<String, PrivateKey> keyPair = generateKeypair(keyType);\n\n final String jwt = Jwts.builder()\n .setHeaderParam(\"kid\", UUID.randomUUID())\n .setAudience(String.format(\"%sToken/auth\", \"here\"))\n .setIssuer(\"macaroon\")\n .setSubject(\"macaroon\")\n .setId(UUID.randomUUID().toString())\n .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES)))\n .signWith(keyPair.getRight(), APIAuthHelpers.getSigningAlgorithm(keyType))\n .compact();\n\n // Submit the JWT\n Response response = RESOURCE.target(\"/v1/Token/auth\")\n .queryParam(\"scope\", \"system/*.*\")\n .queryParam(\"grant_type\", \"client_credentials\")\n .queryParam(\"client_assertion_type\", TokenResource.CLIENT_ASSERTION_TYPE)\n .queryParam(\"client_assertion\", jwt)\n .request()\n .post(Entity.entity(\"\", MediaType.APPLICATION_FORM_URLENCODED));\n\n assertEquals(401, response.getStatus(), \"Should be unauthorized\");\n assertTrue(response.readEntity(String.class).contains(\"Cannot find public key\"), \"Should have correct exception\");\n }", "public ECP getPublicKGCKey(){return pkS;}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "private TPM_DIGEST createEmptyPubKeyHash()\r\n {\r\n// if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_BROADCOM )\r\n// {\r\n// return null;\r\n// }\r\n// else\r\n// {\r\n// return new TPM_DIGEST();\r\n// }\r\n if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_INFINEON )\r\n {\r\n return new TPM_DIGEST();\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }", "public String getTlsKey();", "@Test\n\tpublic void testSecuirtyConfigsOperations() throws NoSuchAlgorithmException {\n\t\t// Generate and store keys for the first time\n\t\tServerKeyPairs serverKeyPairs1 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair1 = serverKeyPairs1.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair1 = serverKeyPairs1.getSignatureKeyPair();\n\n\t\t// Initialize a new serverKeyPairs to test that it will only read\n\t\t// previously generated keys\n\t\tServerKeyPairs serverKeyPairs2 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair2 = serverKeyPairs2.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair2 = serverKeyPairs2.getSignatureKeyPair();\n\n\t\tassertEquals(\"Wrong loaded encryption public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded encryption private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getPrivateExponent());\n\n\t\tassertEquals(\"Wrong loaded signature public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded signature private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getPrivateExponent());\n\t}", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType.Enum getCryptAlgorithmType();", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public MEKeyTool() {\n keystore = new PublicKeyStoreBuilderBase();\n }", "public PrivateKeyType getPivateKeyType() {\n return PrivateKeyType.SAPLING_EXTENED_SPEND_KEY;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType xgetCryptAlgorithmType();", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "public void setPrincipalType(String principalType){\n this.principalType = principalType;\n //Update hashMap value..\n hashMap.put(\"principalType\", principalType);\n }", "public static void main(String[] args) {\n String keyFile = \"D:\\\\data\\\\kms\\\\liweigang.idc\";\n String message = \"dksf3r38324hrewjrh3r&^%djfdsjkek\";\n String pubmatrix = \"D:\\\\data\\\\kms\\\\sm2cpk.cn.pkm\";\n\n byte[] keycard = Tool.ReadFile(keyFile);\n System.out.println(\"keyCard:\" + Tool.Bytes2Hex(keycard));\n\n //得到私钥\n byte[] priKey = GMJni.GetPriKey(keycard);\n String priKeyHex = Tool.Bytes2Hex(priKey);\n System.out.println(\"private key:\" + priKeyHex);\n\n //得到密钥标识\n byte[] keyId = GMJni.GetKeyId(keycard);\n System.out.println(\"keyId:\" + Tool.Bytes2String(keyId));\n\n //得到公钥\n byte[] pubKey = GMJni.CalPubKey(Tool.String2Bytes(pubmatrix), keyId);\n System.out.println(\"public key:\" + Tool.Bytes2Hex(pubKey));\n\n //1000个不同message\n List<String> msgList = new ArrayList<>(12);\n for (int i = 0; i < 1000; i++) {\n //message基础上字符串长度+10\n msgList.add(message + RandomUtil.randomString(10));\n }\n long start = System.currentTimeMillis();\n //签名结果\n int rv = 0;\n //缓存\n MapCache cache = new MapCache();\n //命中缓存次数\n int count = 0;\n int count2 = 0;\n for (int i = 0; i < 100000; i++) {\n System.out.println(\"模拟请求第\" + i + \"次数\");\n\n //计算E值\n //30种不同的message,即仅30个不走缓存\n byte[] E = GMJni.SM2GetE(keyId, pubKey, Tool.String2Bytes(msgList.get(new Random().nextInt(30))));\n String hexE = Tool.Bytes2Hex(E);\n// System.out.println(\"E:\" + hexE);\n\n //SM2签名\n byte[] sig = GMJni.SM2Sign(priKey, E);\n// System.out.println(\"private key:\" + Tool.Bytes2Hex(priKey));\n// System.out.println(\"sign value:\" + Tool.Bytes2Hex(sig));\n\n // SM2签名验证\n // 引入Map缓存 E,sig的16进制的MD5值\n String hex = hexE + priKeyHex;\n// System.out.println(\"finalStr:\" + hex);\n String md5 = SecureUtil.md5(hex);\n if (null != cache.get(md5)) {\n count++;\n// System.out.println(\"命中缓存\" + (++count));\n } else {\n rv += GMJni.SM2Verify(pubKey, E, sig);\n count2++;\n cache.add(md5, (byte) 1, 50 * 1000);\n }\n }\n long end = System.currentTimeMillis();\n double v = (end - start) / 1000.0;\n System.out.println(\"time consuming:\" + v + \" sec\");\n System.out.println(Math.round(100000 / v) + \" times/sec\");\n System.out.println(\"命中缓存\" + (count));\n System.out.println(\"未命中\" + (count2));\n if (rv != 0) {\n System.out.println(\"Verify signature fail, error code is \" + String.valueOf(rv));\n } else {\n System.out.println(\"Verify signature success.\");\n }\n }", "private static String generateServerKey(Poi poi) {\n LonLat viewPoint = poi.getViewPosition();\n int lon = viewPoint.getLonInt();\n int lat = viewPoint.getLatInt();\n int alt = viewPoint.getAltInt();\n return generateServerKey(poi.getName(), poi.getAddress(), lon, lat, alt);\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public java.lang.String getCertiType() {\n return certiType;\n }", "java.lang.String getServerSecret();", "public static void registerDefaultAlgorithms() {\n/* 390 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#dsa-sha1\", SignatureDSA.class);\n/* */ \n/* */ \n/* 393 */ algorithmHash.put(\"http://www.w3.org/2009/xmldsig11#dsa-sha256\", SignatureDSA.SHA256.class);\n/* */ \n/* */ \n/* 396 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\", SignatureBaseRSA.SignatureRSASHA1.class);\n/* */ \n/* */ \n/* 399 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#hmac-sha1\", IntegrityHmac.IntegrityHmacSHA1.class);\n/* */ \n/* */ \n/* 402 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-md5\", SignatureBaseRSA.SignatureRSAMD5.class);\n/* */ \n/* */ \n/* */ \n/* 406 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160\", SignatureBaseRSA.SignatureRSARIPEMD160.class);\n/* */ \n/* */ \n/* */ \n/* 410 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\", SignatureBaseRSA.SignatureRSASHA256.class);\n/* */ \n/* */ \n/* 413 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384\", SignatureBaseRSA.SignatureRSASHA384.class);\n/* */ \n/* */ \n/* 416 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\", SignatureBaseRSA.SignatureRSASHA512.class);\n/* */ \n/* */ \n/* 419 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1\", SignatureECDSA.SignatureECDSASHA1.class);\n/* */ \n/* */ \n/* 422 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256\", SignatureECDSA.SignatureECDSASHA256.class);\n/* */ \n/* */ \n/* 425 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384\", SignatureECDSA.SignatureECDSASHA384.class);\n/* */ \n/* */ \n/* 428 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512\", SignatureECDSA.SignatureECDSASHA512.class);\n/* */ \n/* */ \n/* 431 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-md5\", IntegrityHmac.IntegrityHmacMD5.class);\n/* */ \n/* */ \n/* 434 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160\", IntegrityHmac.IntegrityHmacRIPEMD160.class);\n/* */ \n/* */ \n/* 437 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha256\", IntegrityHmac.IntegrityHmacSHA256.class);\n/* */ \n/* */ \n/* 440 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha384\", IntegrityHmac.IntegrityHmacSHA384.class);\n/* */ \n/* */ \n/* 443 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha512\", IntegrityHmac.IntegrityHmacSHA512.class);\n/* */ }", "public static void main(String[] args) {\n\t\tString algorithm = SignatureAlgorithm.HS256.getJcaName();\r\n\t\tSystem.out.println(algorithm);\r\n\r\n\t\t// set secret key\r\n\t\tString secret = \"this+is+my+scret+key+AAAAAAAAAAAAAAAAAAAAAAAAA\";\r\n\r\n\t\t// background information\r\n\t\t// =============================================================\r\n\t\t/*\r\n\t\t * the bytes of the secret key will be used by the signature algorithm - must be\r\n\t\t * in base 64 format\r\n\t\t */\r\n//\t\tbyte[] scretKeyEncoded = secret.getBytes(); // java encoding\r\n//\t\tbyte[] scretKeyDecoded = Base64.getDecoder().decode(secret); // base64\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyEncoded));\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyDecoded));\r\n\t\t// =====================================================================================\r\n\r\n\t\t// create the key from the decoded secret\r\n\t\tKey key = new SecretKeySpec(Base64.getDecoder().decode(secret), algorithm);\r\n\r\n\t\tInstant now = Instant.now();\r\n\r\n\t\t// create a JWT instance\r\n\t\tString jwt = Jwts.builder()\r\n\r\n\t\t\t\t.signWith(key)\r\n\r\n\t\t\t\t.setIssuedAt(Date.from(now))\r\n\r\n\t\t\t\t// will be valid for 10 seconds\r\n\t\t\t\t.setExpiration(Date.from(now.plus(10, ChronoUnit.SECONDS)))\r\n\r\n\t\t\t\t.setSubject(\"aaa@mail\")\r\n\r\n\t\t\t\t.claim(\"First name\", \"Dan\")\r\n\r\n\t\t\t\t.claim(\"Last name\", \"Levi\")\r\n\r\n\t\t\t\t.compact();\r\n\r\n\t\tSystem.out.println(jwt);\r\n\r\n\t\t// ==================================================\r\n\t\t// parse the JWS to get the expanded JWT\r\n//\t\tJWS - JSON Web Signature [aaaa.bbbb.cccc]\r\n//\t\tJWT - JSON Web Token [aaaa.bbbb.cccc]\r\n\r\n\t\tSystem.out.println(\"====================\");\r\n\t\tSystem.out.println(\"parsing the JWS to get a JWT\");\r\n\t\tJwtParser jwtParser = Jwts.parserBuilder().setSigningKey(key).build();\r\n\t\t// to demonstrate expiration paste an old JWS\r\n\t\tjwt = \"eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjA2Mzk1MTEsImV4cCI6MTYyMDYzOTUyMSwic3ViIjoiYWFhQG1haWwiLCJGaXJzdCBuYW1lIjoiRGFuIiwiTGFzdCBuYW1lIjoiTGV2aSJ9.cefEbBejjebKVILgOzca0LJZfd0F3qjezegeCaxOrfE\";\r\n\t\tSystem.out.println(jwtParser.parse(jwt));\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getHeader());\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getBody());\r\n\r\n\t}", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "private String getSignatureString(Type type)\r\n {\r\n if(type instanceof CompoundType)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n CompoundType cType = (CompoundType)type;\r\n //find key and value types\r\n String keyType = getSignatureString(cType.keyType);\r\n sb.append(\"Ljava/util/HashMap\");\r\n sb.append(\"<\");\r\n sb.append(keyType);\r\n sb.append(getSignatureString(cType.valType));\r\n sb.append(\">;\");\r\n return sb.toString();\r\n }\r\n else if(type instanceof SimpleType)\r\n {\r\n switch(((SimpleType)type).type)\r\n {\r\n case INT:\r\n return \"Ljava/lang/Integer;\";\r\n case BOOLEAN:\r\n return \"Ljava/lang/Boolean;\";\r\n case STRING:\r\n return \"Ljava/lang/String;\";\r\n }\r\n }\r\n return null;\r\n }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public String getJCEProviderName() {\n/* 196 */ return this.signatureAlgorithm.engineGetJCEProviderName();\n/* */ }", "com.google.protobuf.ByteString getPublicEciesKeyBytes();", "public String getJCEAlgorithmString() {\n/* 187 */ return this.signatureAlgorithm.engineGetJCEAlgorithmString();\n/* */ }", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "long getCryptProviderTypeExt();", "public static String getKeyTypeName(KeyType type)\n {\n // TODO: should be moved to DBProvider ...\n // MySQL : key identifier\n // SQLServer : key identifier\n // Derby : key identifier\n // PostgreSQL: key identifier\n switch (type) {\n // MySQL: key types ...\n case PRIMARY : return \"PRIMARY KEY\"; // table\n case UNIQUE : return \"UNIQUE\"; // table\n case INDEX : return \"INDEX\"; // table/index\n case UNIQUE_INDEX : return \"UNIQUE INDEX\"; // table/index\n default : return \"UNKNOWN\";\n }\n }", "@PostMapping(\"/createKeyPair\")\n public String createKeyPair() {\n \n AWSKMS kmsClient = AWSKMSClientBuilder.standard().build();\n \n return \"Private uid: \"+ priuid +\"\\nPublic uid: \" + pubuid +\"\\n\";\n }", "long getCryptAlgorithmSid();", "switch (buffer[ISO7816.OFFSET_CDATA + 4]) {\r\n\t\tcase BASIC:\r\n\t\t\tsetSignatureType(BASIC);\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tsetSignatureType(AUTHENTICATION);\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tsetSignatureType(NON_REPUDIATION);\r\n\t\t\tbreak;\r\n\t\tcase CA_ROLE:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\tdefault:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "private KeyStore askForPin() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {\n char newPin[] = PinDialog.getPIN(this.providerDesc);\n try {\n KeyStore ks = getKeyStore(newPin);\n pin = newPin;\n return ks;\n } catch (IOException e2) {\n e2.printStackTrace();\n if (e2.getCause() instanceof LoginException) {\n JOptionPane.showMessageDialog(null, \"Wrong PIN\", \"Cryptographic card\", JOptionPane.WARNING_MESSAGE);\n }\n throw e2;\n }\n }", "public String getTlsKeyPath();", "public byte[] getUserKey() throws IOException\n {\n byte[] u = null;\n COSString user = (COSString)encryptionDictionary.getDictionaryObject( COSName.getPDFName( \"U\" ) );\n if( user != null )\n {\n u = user.getBytes();\n }\n return u;\n }", "@Override\n public String getProviderName() {\n return \"SimpleEncryptionKeyStoreProvider\";\n }", "public interface SKey {\n\n String FAIL_STORE = \"job.fail.store\";\n\n String LOADBALANCE = \"loadbalance\";\n\n String EVENT_CENTER = \"event.center\";\n\n String REMOTING = \"lts.remoting\";\n\n String REMOTING_SERIALIZABLE_DFT = \"lts.remoting.serializable.default\";\n\n String ZK_CLIENT_KEY = \"zk.client\";\n\n String JOB_ID_GENERATOR = \"id.generator\";\n\n String JOB_LOGGER = \"job.logger\";\n\n String JOB_QUEUE = \"job.queue\";\n}", "private void getKeyType(final PdfObject pdfObject, final int i, final byte[] raw, final int length, final int keyLength, final int keyStart, final int type) {\n if(debugFastCode)//used in debug\n {\n PDFkey = PdfDictionary.getKey(keyStart, keyLength, raw);\n }\n \n PDFkeyInt=PdfDictionary.getIntKey(keyStart,keyLength,raw);\n \n //correct mapping\n if(PDFkeyInt==PdfDictionary.Indexed && (type==PdfDictionary.MK ||type==PdfDictionary.Form || type==PdfDictionary.Linearized || type==PdfDictionary.Group)) {\n PDFkeyInt = PdfDictionary.I;\n }\n \n if(isInlineImage) {\n PDFkeyInt = PdfObjectFactory.getInlineID(PDFkeyInt);\n }\n \n final int id=pdfObject.getID();\n \n if(type==PdfDictionary.Resources && (PDFkeyInt==PdfDictionary.ColorSpace\n || PDFkeyInt==PdfDictionary.ExtGState || PDFkeyInt==PdfDictionary.Shading\n || PDFkeyInt==PdfDictionary.XObject || PDFkeyInt==PdfDictionary.Font|| PDFkeyInt==PdfDictionary.Pattern)){\n pdfKeyType=PdfDictionary.VALUE_IS_DICTIONARY_PAIRS;\n //}else if (type==PdfDictionary.Form && id== PdfDictionary.AA && PDFkeyInt== PdfDictionary.K){\n // pdfKeyType= PdfDictionary.VALUE_IS_UNREAD_DICTIONARY;\n }else if (type==PdfDictionary.Outlines && PDFkeyInt== PdfDictionary.D){\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && PDFkeyInt== PdfDictionary.D){\n if(id==PdfDictionary.AP || id==PdfDictionary.AA){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if(id==PdfDictionary.Win){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else{\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && (id==PdfDictionary.AP || id==PdfDictionary.AA) && PDFkeyInt== PdfDictionary.A){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if (PDFkeyInt== PdfDictionary.Order && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary. VALUE_IS_OBJECT_ARRAY;\n }else if (PDFkeyInt== PdfDictionary.Name && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if ((type==PdfDictionary.ColorSpace || type==PdfDictionary.Function) && PDFkeyInt== PdfDictionary.N){\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(PDFkeyInt==PdfDictionary.Gamma && type==PdfDictionary.ColorSpace &&\n pdfObject.getParameterConstant(PdfDictionary.ColorSpace)== ColorSpaces.CalGray){ //its a number not an array\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(id==PdfDictionary.Win && pdfObject.getObjectType()==PdfDictionary.Form &&\n (PDFkeyInt==PdfDictionary.P || PDFkeyInt==PdfDictionary.O)){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if (isInlineImage && PDFkeyInt==PdfDictionary.ColorSpace){\n pdfKeyType= PdfDictionary.VALUE_IS_DICTIONARY;\n }else {\n pdfKeyType = PdfDictionary.getKeyType(PDFkeyInt, type);\n }\n \n \n //handle array of Function in Shading by using keyArray\n if(id==PdfDictionary.Shading && PDFkeyInt==PdfDictionary.Function){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n if(raw[ptr]=='['){\n pdfKeyType=PdfDictionary.VALUE_IS_KEY_ARRAY;\n }\n }\n \n //allow for other values in D,N,R definitions\n if(pdfKeyType==-1 && id== PdfDictionary.ClassMap){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n }else\n //allow for other values in D,N,R definitions as key pairs\n if(((((id==PdfDictionary.N || id==PdfDictionary.D || id==PdfDictionary.R))) &&\n pdfObject.getParentID()==PdfDictionary.AP &&\n pdfObject.getObjectType()==PdfDictionary.Form\n && raw[i]!='[' )){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n //decide if pair\n if(raw[keyStart]=='L' && raw[keyStart+1]=='e' && raw[keyStart+2]=='n' && raw[keyStart+3]=='g' && raw[keyStart+4]=='t' && raw[keyStart+5]=='h'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='n'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='f' && raw[keyStart+2]=='f'){\n }else\n if(raw[ptr]=='R'){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n \n if(debugFastCode) {\n System.out.println(\"new Returns \" + pdfKeyType + \" i=\" + i);\n }\n }\n }\n \n /**/\n \n //DecodeParms can be an array as well as a dictionary so check next char and alter if so\n if(PDFkeyInt==PdfDictionary.DecodeParms) {\n pdfKeyType = setTypeForDecodeParams(i, raw, length, pdfKeyType);\n }\n \n if(debugFastCode && pdfKeyType==-1 && pdfObject.getObjectType()!=PdfDictionary.Page){\n System.out.println(id+\" \"+type);\n System.out.println(padding +PDFkey+\" NO type setting for \"+PdfDictionary.getKey(keyStart,keyLength,raw)+\" id=\"+i);\n }\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "public PaymentRecordKey() {\n super();\n }", "public RSAKeyPairGenerator() {\n }", "private PasskeyContract() {}", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum getCryptProviderType();", "java.lang.String getSignatureProviderId();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }" ]
[ "0.67265475", "0.66766536", "0.65099293", "0.65028304", "0.6262208", "0.6249799", "0.610079", "0.5888525", "0.5814085", "0.5741013", "0.55434763", "0.5495098", "0.547463", "0.5293663", "0.5267275", "0.52484345", "0.5236787", "0.51757306", "0.50184387", "0.5009232", "0.4963339", "0.49510905", "0.49432135", "0.49177194", "0.49026552", "0.48897362", "0.4852516", "0.4852516", "0.48464367", "0.4837918", "0.48329684", "0.48329684", "0.48329684", "0.4827723", "0.48225248", "0.48225248", "0.48222625", "0.48206112", "0.48032084", "0.47844216", "0.47589076", "0.47568366", "0.47562766", "0.475171", "0.47300357", "0.47230795", "0.4722094", "0.4707639", "0.47028682", "0.4702566", "0.47019628", "0.46886435", "0.46737474", "0.46649238", "0.46241516", "0.46185207", "0.46162042", "0.4614444", "0.46140233", "0.46073017", "0.46071345", "0.4599757", "0.45933524", "0.45887133", "0.45851716", "0.4582875", "0.45752436", "0.45748132", "0.45720893", "0.45628002", "0.4562682", "0.4560899", "0.45528138", "0.45517504", "0.45498374", "0.45371762", "0.45361403", "0.4531953", "0.453109", "0.45296288", "0.4523701", "0.45182464", "0.45178583", "0.45135707", "0.4513127", "0.4508099", "0.45017824", "0.44983628", "0.4494895", "0.44948786", "0.44942138", "0.4491818", "0.44907737", "0.4488338", "0.4486263", "0.4485628", "0.44769597", "0.44763568", "0.4473159", "0.44716462" ]
0.57488453
9
none / x509+sha256 / x509+sha1 optional string pki_type = 2 [default = "none"];
public Builder clearPkiType() { copyOnWrite(); instance.clearPkiType(); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPkiType();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "boolean hasPkiType();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "public static void main(String[] args) throws IcbcApiException {\n\t\tUiIcbcClient client = new UiIcbcClient(APP_ID,IcbcConstants.SIGN_TYPE_RSA,\n\t\t\t\t\"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJCoQe/O+uqpOtyE/2CUjD7wosZw8jI1AlLNJCllOmlX+obA6h97b0JsEL0SjMCAR3xJyw7MKLqkcy5qQ/bBgw2XSrodmjzOVqfT1OXRii0xw0HiVkHR4cEWnEAAdfo0lDc4iuzCIQrnT5gM0+U+qeSV6JFfwVRjgYzBdHQRPCf1AgMBAAECgYAdQUoEe7GXH5591o/nMmOinvvscg8pRDsyD7bOgGBtyZMrCXzP3SDFKCHCeyvoColqg2oDlhpulK+OpYMVNlGQcO4eubOJp9MUc3m4A9RxkVr3dsVrmygM5czPfWHAPVQ4dECDruBJn9zoo1ci0myRTh4KSCq6SxpCE0Pbf3j7iQJBAOdMPFRfOkSQ1hsN9Mg4jd9on8r7+mF8gFPhkNI6qvEKw/prmU3obUWvZL42vRlLOQyyB92mBF24PStR/B6CjR8CQQCgGz0VoqCplurSCapGdgX3D7bNSDtMUmaLJYJxih8v+zghP0YtVgDeV3NjogVjOlz8/9Rebo0PoFcqyJnNA1RrAkEAul3dBoasZm7ldWsrXuDiv66HgoDB4Cb3J59Kl3oaHpp0CqUEI5gx48JNRE7K00SfNTGF0Pxh7Dn1X6Bxqwu6NQJADrdyPfLc4bnFi9jnleJzWepP2z6wdKt+UXv5KYaQp1BoMGYohTJKkiVnrdjOtfg/Y+IAG03+GVmbqYsW2AleUQJBANYQklohKtsmq8ptX3as6hjcuXcTpc2DSpVeOnCueNv107+dDJ+K14tbiVYzF3tkHBNMRkGtr6EuGKJ+A63sJ00=\",\n\t\t\t\tIcbcConstants.CHARSET_UTF8,IcbcConstants.ENCRYPT_TYPE_AES, \"xMh0xFsG7G80ziePFdnT8g==\");\n\t\tEaccountManageRequestV1 request = new EaccountManageRequestV1();\t\t\n\t\trequest.setServiceUrl(\"http://122.64.61.111:8081/ui/eaccount/manage/V1\");///\n\t\tEaccountManageRequestBizV1 bizContent = new EaccountManageRequestBizV1();\n\t\tbizContent.setMobileNo(\"13703878410\");//选输,手机号\n\t\tbizContent.setIdcode(\"128440810108044\");//选输,身份证号\n\t\tbizContent.setName(URLEncoder.encode(\"芡悠\"));//选输,用户姓名\n\t\tbizContent.setUserId(\"128440810108044\");//必输,需控制不能为空,用户唯一标识,送身份证号\n\t\tbizContent.setBacAddr(URLEncoder.encode(\"http://www.test.com\"));//选输,回调地址\n\t\tbizContent.setEpayflag(\"0\");//选输,工银e支付标志,0-短信、1-静态密码,集成客户端SDK的方式能送0-短信或1-静态密码,非APP方式只能送0-短信,不送默认为0-短信\n\t\t\n\t\tbizContent.setCorpAppid(APP_ID);//外公司合作方送APP_ID的值,行内应用如e支付等送外公司合作方的APPID\n\t\tlong systime = System.currentTimeMillis(); // 现时间戳\t\t\n\t\tString orderTimeStamp=new Long(systime).toString();\n\t\t\n\t\tSystem.out.println(\"orderTimeStamp:\"+orderTimeStamp);\n\t\tbizContent.setOrderTimeStamp(orderTimeStamp);//生成请求的时间,必输\n\t\t\n\t\tbizContent.setZoneno(\"00200\");//地区号号,选输,5位数字,上送值联系对接分行提供\n\t\tbizContent.setBrno(\"00260\");//网点号,选输,5位数字,上送值联系对接分行提供\n\t\t\n\t\trequest.setBizContent(bizContent);\n\t\tSystem.out.println(client.buildPostForm(request));// 实际调用时的相关返回结果及异常处理,请自行添加\n\t}", "dkk mo4509g();", "private void generatePrivacyKeyPair(boolean clientMode) throws IOException, UnsupportedEncodingException, NoSuchAlgorithmException, SaslException {\n byte[] ccmagic = CLIENT_CONF_MAGIC.getBytes(encoding);\n byte[] scmagic = SVR_CONF_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n int n;\n if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_40])) {\n n = 5;\n } else if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_56])) {\n n = 7;\n } else {\n n = 16;\n }\n byte[] keyBuffer = new byte[n + ccmagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, n);\n System.arraycopy(ccmagic, 0, keyBuffer, n, ccmagic.length);\n md5.update(keyBuffer);\n byte[] Kcc = md5.digest();\n System.arraycopy(scmagic, 0, keyBuffer, n, scmagic.length);\n md5.update(keyBuffer);\n byte[] Kcs = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST24:Kcc: \", Kcc);\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST25:Kcs: \", Kcs);\n }\n byte[] myKc;\n byte[] peerKc;\n if (clientMode) {\n myKc = Kcc;\n peerKc = Kcs;\n } else {\n myKc = Kcs;\n peerKc = Kcc;\n }\n try {\n SecretKey encKey;\n SecretKey decKey;\n if (negotiatedCipher.indexOf(CIPHER_TOKENS[RC4]) > -1) {\n encCipher = Cipher.getInstance(\"RC4\");\n decCipher = Cipher.getInstance(\"RC4\");\n encKey = new SecretKeySpec(myKc, \"RC4\");\n decKey = new SecretKeySpec(peerKc, \"RC4\");\n encCipher.init(Cipher.ENCRYPT_MODE, encKey);\n decCipher.init(Cipher.DECRYPT_MODE, decKey);\n } else if ((negotiatedCipher.equals(CIPHER_TOKENS[DES])) || (negotiatedCipher.equals(CIPHER_TOKENS[DES3]))) {\n String cipherFullname, cipherShortname;\n if (negotiatedCipher.equals(CIPHER_TOKENS[DES])) {\n cipherFullname = \"DES/CBC/NoPadding\";\n cipherShortname = \"des\";\n } else {\n cipherFullname = \"DESede/CBC/NoPadding\";\n cipherShortname = \"desede\";\n }\n encCipher = Cipher.getInstance(cipherFullname);\n decCipher = Cipher.getInstance(cipherFullname);\n encKey = makeDesKeys(myKc, cipherShortname);\n decKey = makeDesKeys(peerKc, cipherShortname);\n IvParameterSpec encIv = new IvParameterSpec(myKc, 8, 8);\n IvParameterSpec decIv = new IvParameterSpec(peerKc, 8, 8);\n encCipher.init(Cipher.ENCRYPT_MODE, encKey, encIv);\n decCipher.init(Cipher.DECRYPT_MODE, decKey, decIv);\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST26:\" + negotiatedCipher + \" IVcc: \", encIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST27:\" + negotiatedCipher + \" IVcs: \", decIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST28:\" + negotiatedCipher + \" encryption key: \", encKey.getEncoded());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST29:\" + negotiatedCipher + \" decryption key: \", decKey.getEncoded());\n }\n }\n } catch (InvalidKeySpecException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported key \" + \"specification used.\", e);\n } catch (InvalidAlgorithmParameterException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid cipher \" + \"algorithem parameter used to create cipher instance\", e);\n } catch (NoSuchPaddingException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported \" + \"padding used for chosen cipher\", e);\n } catch (InvalidKeyException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid data \" + \"used to initialize keys\", e);\n }\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "java.lang.String getPublicEciesKey();", "OpenSSLKey mo134201a();", "public abstract String getSigAlgOID();", "private void generateIntegrityKeyPair(boolean clientMode) throws UnsupportedEncodingException, IOException, NoSuchAlgorithmException {\n byte[] cimagic = CLIENT_INT_MAGIC.getBytes(encoding);\n byte[] simagic = SVR_INT_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n byte[] keyBuffer = new byte[H_A1.length + cimagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, H_A1.length);\n System.arraycopy(cimagic, 0, keyBuffer, H_A1.length, cimagic.length);\n md5.update(keyBuffer);\n byte[] Kic = md5.digest();\n System.arraycopy(simagic, 0, keyBuffer, H_A1.length, simagic.length);\n md5.update(keyBuffer);\n byte[] Kis = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST12:Kic: \", Kic);\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST13:Kis: \", Kis);\n }\n if (clientMode) {\n myKi = Kic;\n peerKi = Kis;\n } else {\n myKi = Kis;\n peerKi = Kic;\n }\n }", "public final String mo1957a() {\n return \"type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey\";\n }", "private native String native_ks(long cookie, byte[] userKey);", "@Override\n public ConcurrentContentSigner newSigner(\n String type, SignerConf conf, X509Cert[] certificateChain)\n throws ObjectCreationException {\n type = type.toLowerCase(Locale.ROOT);\n if (!types.contains(type)) {\n throw new ObjectCreationException(\"unknown signer type \" + type);\n }\n\n String str = conf.getConfValue(\"parallelism\");\n int parallelism = 20;\n if (str != null) {\n try {\n parallelism = Integer.parseInt(str);\n } catch (NumberFormatException ex) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n\n if (parallelism < 1) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n }\n\n str = conf.getConfValue(\"alias\");\n if (str == null) {\n throw new ObjectCreationException(\"alias is not specified\");\n }\n int keyId = Integer.parseInt(str);\n\n String algoName = conf.getConfValue(\"algo\");\n if (algoName == null) {\n throw new ObjectCreationException(\"algo is not specified\");\n }\n\n try {\n InitStatus initStatus = init(type);\n if (initStatus.status.get() != 1) {\n throw new ObjectCreationException(initStatus.details);\n }\n\n SignAlgo algo = SignAlgo.getInstance(algoName);\n String keyAlgoName;\n String bcKeyAlgoName;\n if (algo.isSM2SigAlgo()) {\n keyAlgoName = \"SM2\";\n bcKeyAlgoName = \"EC\";\n } else if (algo.isRSAPkcs1SigAlgo() || algo.isRSAPSSSigAlgo()) {\n keyAlgoName = \"RSA\";\n bcKeyAlgoName = \"RSA\";\n } else if (algo.isECDSASigAlgo() || algo.isPlainECDSASigAlgo()) {\n keyAlgoName = \"EC\";\n bcKeyAlgoName = \"EC\";\n } else {\n throw new ObjectCreationException(\"unsupported algo \" + algoName);\n }\n\n Provider provider = providerMap.get(type);\n\n // Method to read create PrivateKey and PublicKey object.\n // SANSEC use KeyPairGenerator.generateKeyPair to read the keypair-\n // No new keypair will be generated here.\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(keyAlgoName, provider);\n kpGen.initialize(keyId << 16);\n KeyPair kp = kpGen.generateKeyPair();\n\n PublicKey publicKey = KeyFactory.getInstance(bcKeyAlgoName, \"BC\")\n .generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));\n\n return new JceSignerBuilder(kp.getPrivate(), publicKey, certificateChain, provider)\n .createSigner(algo, parallelism);\n } catch (GeneralSecurityException | XiSecurityException ex) {\n throw new ObjectCreationException(ex.getMessage(), ex);\n }\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv xgetCryptProviderType();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "boolean hasPkiData();", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "public String mo34971a() {\n return \"SHA-384\";\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "public interface JsonKey {\n\n String CLASS = \"class\";\n String DATA = \"data\";\n String EKS = \"eks\";\n String ID = \"id\";\n String LEVEL = \"level\";\n String MESSAGE = \"message\";\n String METHOD = \"method\";\n String REQUEST_MESSAGE_ID = \"msgId\";\n String STACKTRACE = \"stacktrace\";\n String VER = \"ver\";\n String OK = \"ok\";\n String LOG_LEVEL = \"logLevel\";\n String ERROR = \"error\";\n String EMPTY_STRING = \"\";\n String RESPONSE = \"response\";\n String ADDRESS = \"address\";\n String KEY = \"key\";\n String ERROR_MSG = \"error_msg\";\n String ATTRIBUTE = \"attribute\";\n String ERRORS = \"errors\";\n String SUCCESS = \"success\";\n\n String CERTIFICATE = \"certificate\";\n String RECIPIENT_NAME = \"recipientName\";\n String COURSE_NAME = \"courseName\";\n String NAME = \"name\";\n String HTML_TEMPLATE = \"htmlTemplate\";\n String TAG = \"tag\";\n String ISSUER = \"issuer\";\n String URL = \"url\";\n String SIGNATORY_LIST = \"signatoryList\";\n String DESIGNATION = \"designation\";\n String SIGNATORY_IMAGE = \"image\";\n\n String DOMAIN_URL = \"sunbird_cert_domain_url\";\n String ASSESSED_DOMAIN = \"ASSESSED_DOMAIN\";\n String BADGE_URL = \"BADGE_URL\";\n String ISSUER_URL = \"ISSUER_URL\";\n String TEMPLATE_URL = \"TEMPLATE_URL\";\n String CONTEXT = \"CONTEXT\";\n String VERIFICATION_TYPE = \"VERIFICATION_TYPE\";\n String SIGNATORY_EXTENSION = \"SIGNATORY_EXTENSION\";\n String RECIPIENT_EMAIl = \"recipientEmail\";\n String RECIPIENT_PHONE = \"recipientPhone\";\n String RECIPIENT_ID = \"recipientId\";\n String VALID_FROM = \"validFrom\";\n String EXPIRY = \"expiry\";\n String OLD_ID = \"oldId\";\n String PUBLIC_KEY = \"publicKey\";\n String DESCRIPTION = \"description\";\n String LOGO = \"logo\";\n String ISSUE_DATE = \"issueDate\";\n String USER = \"user\";\n String CERTIFICATE_NAME = \"name\";\n\n String CONTAINER_NAME = \"CONTAINER_NAME\";\n String CLOUD_STORAGE_TYPE = \"CLOUD_STORAGE_TYPE\";\n String CLOUD_UPLOAD_RETRY_COUNT = \"CLOUD_UPLOAD_RETRY_COUNT\";\n String AZURE_STORAGE_SECRET = \"AZURE_STORAGE_SECRET\";\n String AZURE_STORAGE_KEY = \"AZURE_STORAGE_KEY\";\n String ACCESS_CODE_LENGTH = \"ACCESS_CODE_LENGTH\";\n String ORG_ID = \"orgId\";\n String KEYS = \"keys\";\n String ENC_SERVICE_URL = \"sunbird_cert_enc_service_url\";\n String SIGN_HEALTH_CHECK_URL = \"SIGN_HEALTH_CHECK_URL\";\n String SIGN_URL = \"SIGN_URL\";\n String SIGN_VERIFY_URL = \"SIGN_VERIFY_URL\";\n String SIGN_CREATOR = \"SIGN_CREATOR\";\n String SIGN = \"sign\";\n String VERIFY = \"verify\";\n String KEY_ID = \"keyId\";\n String JSON_URL = \"jsonUrl\";\n String PDF_URL = \"pdfUrl\";\n String UNIQUE_ID = \"id\";\n String GENERATE_CERT = \"generateCert\";\n String PUBLIC_KEY_URL = \"PUBLIC_KEY_URL\";\n String GET_SIGN_URL = \"getSignUrl\";\n String SIGNED_URL = \"signedUrl\";\n\n String ACCESS_CODE = \"accessCode\";\n String JSON_DATA = \"jsonData\";\n String SLUG = \"sunbird_cert_slug\";\n}", "BigInteger getCEP();", "java.lang.String getPubkey();", "public void setCertiType(java.lang.String certiType) {\n this.certiType = certiType;\n }", "public abstract String getSigAlgName();", "@Schema(required = true, description = \"Contract type (KIP-7, KIP-17, ERC-20, ERC-721)\")\n public String getType() {\n return type;\n }", "public ProfileKey getProfileKey(String username, String type) throws ProfileKeyManagerPersistenceException {\n ParameterHelpers.checkParameter(username, \"username\");\n\n boolean registered = checkType(type);\n\n Connection connection = getConnection();\n\n try {\n return getProfileKey(connection, username, type, registered);\n } finally {\n closeConnection(connection);\n }\n }", "protected CryptoProvider() {\n\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "@ParameterizedTest\n @EnumSource(KeyType.class)\n void testMissingJWTPublicKey(KeyType keyType) throws NoSuchAlgorithmException {\n final Pair<String, PrivateKey> keyPair = generateKeypair(keyType);\n\n final String jwt = Jwts.builder()\n .setHeaderParam(\"kid\", UUID.randomUUID())\n .setAudience(String.format(\"%sToken/auth\", \"here\"))\n .setIssuer(\"macaroon\")\n .setSubject(\"macaroon\")\n .setId(UUID.randomUUID().toString())\n .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES)))\n .signWith(keyPair.getRight(), APIAuthHelpers.getSigningAlgorithm(keyType))\n .compact();\n\n // Submit the JWT\n Response response = RESOURCE.target(\"/v1/Token/auth\")\n .queryParam(\"scope\", \"system/*.*\")\n .queryParam(\"grant_type\", \"client_credentials\")\n .queryParam(\"client_assertion_type\", TokenResource.CLIENT_ASSERTION_TYPE)\n .queryParam(\"client_assertion\", jwt)\n .request()\n .post(Entity.entity(\"\", MediaType.APPLICATION_FORM_URLENCODED));\n\n assertEquals(401, response.getStatus(), \"Should be unauthorized\");\n assertTrue(response.readEntity(String.class).contains(\"Cannot find public key\"), \"Should have correct exception\");\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "public ECP getPublicKGCKey(){return pkS;}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "private TPM_DIGEST createEmptyPubKeyHash()\r\n {\r\n// if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_BROADCOM )\r\n// {\r\n// return null;\r\n// }\r\n// else\r\n// {\r\n// return new TPM_DIGEST();\r\n// }\r\n if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_INFINEON )\r\n {\r\n return new TPM_DIGEST();\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }", "public String getTlsKey();", "@Test\n\tpublic void testSecuirtyConfigsOperations() throws NoSuchAlgorithmException {\n\t\t// Generate and store keys for the first time\n\t\tServerKeyPairs serverKeyPairs1 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair1 = serverKeyPairs1.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair1 = serverKeyPairs1.getSignatureKeyPair();\n\n\t\t// Initialize a new serverKeyPairs to test that it will only read\n\t\t// previously generated keys\n\t\tServerKeyPairs serverKeyPairs2 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair2 = serverKeyPairs2.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair2 = serverKeyPairs2.getSignatureKeyPair();\n\n\t\tassertEquals(\"Wrong loaded encryption public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded encryption private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getPrivateExponent());\n\n\t\tassertEquals(\"Wrong loaded signature public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded signature private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getPrivateExponent());\n\t}", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType.Enum getCryptAlgorithmType();", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public MEKeyTool() {\n keystore = new PublicKeyStoreBuilderBase();\n }", "public PrivateKeyType getPivateKeyType() {\n return PrivateKeyType.SAPLING_EXTENED_SPEND_KEY;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType xgetCryptAlgorithmType();", "public void setPrincipalType(String principalType){\n this.principalType = principalType;\n //Update hashMap value..\n hashMap.put(\"principalType\", principalType);\n }", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "private static String generateServerKey(Poi poi) {\n LonLat viewPoint = poi.getViewPosition();\n int lon = viewPoint.getLonInt();\n int lat = viewPoint.getLatInt();\n int alt = viewPoint.getAltInt();\n return generateServerKey(poi.getName(), poi.getAddress(), lon, lat, alt);\n }", "public static void main(String[] args) {\n String keyFile = \"D:\\\\data\\\\kms\\\\liweigang.idc\";\n String message = \"dksf3r38324hrewjrh3r&^%djfdsjkek\";\n String pubmatrix = \"D:\\\\data\\\\kms\\\\sm2cpk.cn.pkm\";\n\n byte[] keycard = Tool.ReadFile(keyFile);\n System.out.println(\"keyCard:\" + Tool.Bytes2Hex(keycard));\n\n //得到私钥\n byte[] priKey = GMJni.GetPriKey(keycard);\n String priKeyHex = Tool.Bytes2Hex(priKey);\n System.out.println(\"private key:\" + priKeyHex);\n\n //得到密钥标识\n byte[] keyId = GMJni.GetKeyId(keycard);\n System.out.println(\"keyId:\" + Tool.Bytes2String(keyId));\n\n //得到公钥\n byte[] pubKey = GMJni.CalPubKey(Tool.String2Bytes(pubmatrix), keyId);\n System.out.println(\"public key:\" + Tool.Bytes2Hex(pubKey));\n\n //1000个不同message\n List<String> msgList = new ArrayList<>(12);\n for (int i = 0; i < 1000; i++) {\n //message基础上字符串长度+10\n msgList.add(message + RandomUtil.randomString(10));\n }\n long start = System.currentTimeMillis();\n //签名结果\n int rv = 0;\n //缓存\n MapCache cache = new MapCache();\n //命中缓存次数\n int count = 0;\n int count2 = 0;\n for (int i = 0; i < 100000; i++) {\n System.out.println(\"模拟请求第\" + i + \"次数\");\n\n //计算E值\n //30种不同的message,即仅30个不走缓存\n byte[] E = GMJni.SM2GetE(keyId, pubKey, Tool.String2Bytes(msgList.get(new Random().nextInt(30))));\n String hexE = Tool.Bytes2Hex(E);\n// System.out.println(\"E:\" + hexE);\n\n //SM2签名\n byte[] sig = GMJni.SM2Sign(priKey, E);\n// System.out.println(\"private key:\" + Tool.Bytes2Hex(priKey));\n// System.out.println(\"sign value:\" + Tool.Bytes2Hex(sig));\n\n // SM2签名验证\n // 引入Map缓存 E,sig的16进制的MD5值\n String hex = hexE + priKeyHex;\n// System.out.println(\"finalStr:\" + hex);\n String md5 = SecureUtil.md5(hex);\n if (null != cache.get(md5)) {\n count++;\n// System.out.println(\"命中缓存\" + (++count));\n } else {\n rv += GMJni.SM2Verify(pubKey, E, sig);\n count2++;\n cache.add(md5, (byte) 1, 50 * 1000);\n }\n }\n long end = System.currentTimeMillis();\n double v = (end - start) / 1000.0;\n System.out.println(\"time consuming:\" + v + \" sec\");\n System.out.println(Math.round(100000 / v) + \" times/sec\");\n System.out.println(\"命中缓存\" + (count));\n System.out.println(\"未命中\" + (count2));\n if (rv != 0) {\n System.out.println(\"Verify signature fail, error code is \" + String.valueOf(rv));\n } else {\n System.out.println(\"Verify signature success.\");\n }\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public java.lang.String getCertiType() {\n return certiType;\n }", "public static void registerDefaultAlgorithms() {\n/* 390 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#dsa-sha1\", SignatureDSA.class);\n/* */ \n/* */ \n/* 393 */ algorithmHash.put(\"http://www.w3.org/2009/xmldsig11#dsa-sha256\", SignatureDSA.SHA256.class);\n/* */ \n/* */ \n/* 396 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\", SignatureBaseRSA.SignatureRSASHA1.class);\n/* */ \n/* */ \n/* 399 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#hmac-sha1\", IntegrityHmac.IntegrityHmacSHA1.class);\n/* */ \n/* */ \n/* 402 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-md5\", SignatureBaseRSA.SignatureRSAMD5.class);\n/* */ \n/* */ \n/* */ \n/* 406 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160\", SignatureBaseRSA.SignatureRSARIPEMD160.class);\n/* */ \n/* */ \n/* */ \n/* 410 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\", SignatureBaseRSA.SignatureRSASHA256.class);\n/* */ \n/* */ \n/* 413 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384\", SignatureBaseRSA.SignatureRSASHA384.class);\n/* */ \n/* */ \n/* 416 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\", SignatureBaseRSA.SignatureRSASHA512.class);\n/* */ \n/* */ \n/* 419 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1\", SignatureECDSA.SignatureECDSASHA1.class);\n/* */ \n/* */ \n/* 422 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256\", SignatureECDSA.SignatureECDSASHA256.class);\n/* */ \n/* */ \n/* 425 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384\", SignatureECDSA.SignatureECDSASHA384.class);\n/* */ \n/* */ \n/* 428 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512\", SignatureECDSA.SignatureECDSASHA512.class);\n/* */ \n/* */ \n/* 431 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-md5\", IntegrityHmac.IntegrityHmacMD5.class);\n/* */ \n/* */ \n/* 434 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160\", IntegrityHmac.IntegrityHmacRIPEMD160.class);\n/* */ \n/* */ \n/* 437 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha256\", IntegrityHmac.IntegrityHmacSHA256.class);\n/* */ \n/* */ \n/* 440 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha384\", IntegrityHmac.IntegrityHmacSHA384.class);\n/* */ \n/* */ \n/* 443 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha512\", IntegrityHmac.IntegrityHmacSHA512.class);\n/* */ }", "java.lang.String getServerSecret();", "public static void main(String[] args) {\n\t\tString algorithm = SignatureAlgorithm.HS256.getJcaName();\r\n\t\tSystem.out.println(algorithm);\r\n\r\n\t\t// set secret key\r\n\t\tString secret = \"this+is+my+scret+key+AAAAAAAAAAAAAAAAAAAAAAAAA\";\r\n\r\n\t\t// background information\r\n\t\t// =============================================================\r\n\t\t/*\r\n\t\t * the bytes of the secret key will be used by the signature algorithm - must be\r\n\t\t * in base 64 format\r\n\t\t */\r\n//\t\tbyte[] scretKeyEncoded = secret.getBytes(); // java encoding\r\n//\t\tbyte[] scretKeyDecoded = Base64.getDecoder().decode(secret); // base64\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyEncoded));\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyDecoded));\r\n\t\t// =====================================================================================\r\n\r\n\t\t// create the key from the decoded secret\r\n\t\tKey key = new SecretKeySpec(Base64.getDecoder().decode(secret), algorithm);\r\n\r\n\t\tInstant now = Instant.now();\r\n\r\n\t\t// create a JWT instance\r\n\t\tString jwt = Jwts.builder()\r\n\r\n\t\t\t\t.signWith(key)\r\n\r\n\t\t\t\t.setIssuedAt(Date.from(now))\r\n\r\n\t\t\t\t// will be valid for 10 seconds\r\n\t\t\t\t.setExpiration(Date.from(now.plus(10, ChronoUnit.SECONDS)))\r\n\r\n\t\t\t\t.setSubject(\"aaa@mail\")\r\n\r\n\t\t\t\t.claim(\"First name\", \"Dan\")\r\n\r\n\t\t\t\t.claim(\"Last name\", \"Levi\")\r\n\r\n\t\t\t\t.compact();\r\n\r\n\t\tSystem.out.println(jwt);\r\n\r\n\t\t// ==================================================\r\n\t\t// parse the JWS to get the expanded JWT\r\n//\t\tJWS - JSON Web Signature [aaaa.bbbb.cccc]\r\n//\t\tJWT - JSON Web Token [aaaa.bbbb.cccc]\r\n\r\n\t\tSystem.out.println(\"====================\");\r\n\t\tSystem.out.println(\"parsing the JWS to get a JWT\");\r\n\t\tJwtParser jwtParser = Jwts.parserBuilder().setSigningKey(key).build();\r\n\t\t// to demonstrate expiration paste an old JWS\r\n\t\tjwt = \"eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjA2Mzk1MTEsImV4cCI6MTYyMDYzOTUyMSwic3ViIjoiYWFhQG1haWwiLCJGaXJzdCBuYW1lIjoiRGFuIiwiTGFzdCBuYW1lIjoiTGV2aSJ9.cefEbBejjebKVILgOzca0LJZfd0F3qjezegeCaxOrfE\";\r\n\t\tSystem.out.println(jwtParser.parse(jwt));\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getHeader());\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getBody());\r\n\r\n\t}", "private String getSignatureString(Type type)\r\n {\r\n if(type instanceof CompoundType)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n CompoundType cType = (CompoundType)type;\r\n //find key and value types\r\n String keyType = getSignatureString(cType.keyType);\r\n sb.append(\"Ljava/util/HashMap\");\r\n sb.append(\"<\");\r\n sb.append(keyType);\r\n sb.append(getSignatureString(cType.valType));\r\n sb.append(\">;\");\r\n return sb.toString();\r\n }\r\n else if(type instanceof SimpleType)\r\n {\r\n switch(((SimpleType)type).type)\r\n {\r\n case INT:\r\n return \"Ljava/lang/Integer;\";\r\n case BOOLEAN:\r\n return \"Ljava/lang/Boolean;\";\r\n case STRING:\r\n return \"Ljava/lang/String;\";\r\n }\r\n }\r\n return null;\r\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "public String getJCEProviderName() {\n/* 196 */ return this.signatureAlgorithm.engineGetJCEProviderName();\n/* */ }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public String getJCEAlgorithmString() {\n/* 187 */ return this.signatureAlgorithm.engineGetJCEAlgorithmString();\n/* */ }", "com.google.protobuf.ByteString getPublicEciesKeyBytes();", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "long getCryptProviderTypeExt();", "public static String getKeyTypeName(KeyType type)\n {\n // TODO: should be moved to DBProvider ...\n // MySQL : key identifier\n // SQLServer : key identifier\n // Derby : key identifier\n // PostgreSQL: key identifier\n switch (type) {\n // MySQL: key types ...\n case PRIMARY : return \"PRIMARY KEY\"; // table\n case UNIQUE : return \"UNIQUE\"; // table\n case INDEX : return \"INDEX\"; // table/index\n case UNIQUE_INDEX : return \"UNIQUE INDEX\"; // table/index\n default : return \"UNKNOWN\";\n }\n }", "long getCryptAlgorithmSid();", "@PostMapping(\"/createKeyPair\")\n public String createKeyPair() {\n \n AWSKMS kmsClient = AWSKMSClientBuilder.standard().build();\n \n return \"Private uid: \"+ priuid +\"\\nPublic uid: \" + pubuid +\"\\n\";\n }", "switch (buffer[ISO7816.OFFSET_CDATA + 4]) {\r\n\t\tcase BASIC:\r\n\t\t\tsetSignatureType(BASIC);\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tsetSignatureType(AUTHENTICATION);\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tsetSignatureType(NON_REPUDIATION);\r\n\t\t\tbreak;\r\n\t\tcase CA_ROLE:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\tdefault:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "private KeyStore askForPin() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {\n char newPin[] = PinDialog.getPIN(this.providerDesc);\n try {\n KeyStore ks = getKeyStore(newPin);\n pin = newPin;\n return ks;\n } catch (IOException e2) {\n e2.printStackTrace();\n if (e2.getCause() instanceof LoginException) {\n JOptionPane.showMessageDialog(null, \"Wrong PIN\", \"Cryptographic card\", JOptionPane.WARNING_MESSAGE);\n }\n throw e2;\n }\n }", "public String getTlsKeyPath();", "public byte[] getUserKey() throws IOException\n {\n byte[] u = null;\n COSString user = (COSString)encryptionDictionary.getDictionaryObject( COSName.getPDFName( \"U\" ) );\n if( user != null )\n {\n u = user.getBytes();\n }\n return u;\n }", "@Override\n public String getProviderName() {\n return \"SimpleEncryptionKeyStoreProvider\";\n }", "public interface SKey {\n\n String FAIL_STORE = \"job.fail.store\";\n\n String LOADBALANCE = \"loadbalance\";\n\n String EVENT_CENTER = \"event.center\";\n\n String REMOTING = \"lts.remoting\";\n\n String REMOTING_SERIALIZABLE_DFT = \"lts.remoting.serializable.default\";\n\n String ZK_CLIENT_KEY = \"zk.client\";\n\n String JOB_ID_GENERATOR = \"id.generator\";\n\n String JOB_LOGGER = \"job.logger\";\n\n String JOB_QUEUE = \"job.queue\";\n}", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "private void getKeyType(final PdfObject pdfObject, final int i, final byte[] raw, final int length, final int keyLength, final int keyStart, final int type) {\n if(debugFastCode)//used in debug\n {\n PDFkey = PdfDictionary.getKey(keyStart, keyLength, raw);\n }\n \n PDFkeyInt=PdfDictionary.getIntKey(keyStart,keyLength,raw);\n \n //correct mapping\n if(PDFkeyInt==PdfDictionary.Indexed && (type==PdfDictionary.MK ||type==PdfDictionary.Form || type==PdfDictionary.Linearized || type==PdfDictionary.Group)) {\n PDFkeyInt = PdfDictionary.I;\n }\n \n if(isInlineImage) {\n PDFkeyInt = PdfObjectFactory.getInlineID(PDFkeyInt);\n }\n \n final int id=pdfObject.getID();\n \n if(type==PdfDictionary.Resources && (PDFkeyInt==PdfDictionary.ColorSpace\n || PDFkeyInt==PdfDictionary.ExtGState || PDFkeyInt==PdfDictionary.Shading\n || PDFkeyInt==PdfDictionary.XObject || PDFkeyInt==PdfDictionary.Font|| PDFkeyInt==PdfDictionary.Pattern)){\n pdfKeyType=PdfDictionary.VALUE_IS_DICTIONARY_PAIRS;\n //}else if (type==PdfDictionary.Form && id== PdfDictionary.AA && PDFkeyInt== PdfDictionary.K){\n // pdfKeyType= PdfDictionary.VALUE_IS_UNREAD_DICTIONARY;\n }else if (type==PdfDictionary.Outlines && PDFkeyInt== PdfDictionary.D){\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && PDFkeyInt== PdfDictionary.D){\n if(id==PdfDictionary.AP || id==PdfDictionary.AA){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if(id==PdfDictionary.Win){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else{\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && (id==PdfDictionary.AP || id==PdfDictionary.AA) && PDFkeyInt== PdfDictionary.A){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if (PDFkeyInt== PdfDictionary.Order && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary. VALUE_IS_OBJECT_ARRAY;\n }else if (PDFkeyInt== PdfDictionary.Name && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if ((type==PdfDictionary.ColorSpace || type==PdfDictionary.Function) && PDFkeyInt== PdfDictionary.N){\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(PDFkeyInt==PdfDictionary.Gamma && type==PdfDictionary.ColorSpace &&\n pdfObject.getParameterConstant(PdfDictionary.ColorSpace)== ColorSpaces.CalGray){ //its a number not an array\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(id==PdfDictionary.Win && pdfObject.getObjectType()==PdfDictionary.Form &&\n (PDFkeyInt==PdfDictionary.P || PDFkeyInt==PdfDictionary.O)){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if (isInlineImage && PDFkeyInt==PdfDictionary.ColorSpace){\n pdfKeyType= PdfDictionary.VALUE_IS_DICTIONARY;\n }else {\n pdfKeyType = PdfDictionary.getKeyType(PDFkeyInt, type);\n }\n \n \n //handle array of Function in Shading by using keyArray\n if(id==PdfDictionary.Shading && PDFkeyInt==PdfDictionary.Function){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n if(raw[ptr]=='['){\n pdfKeyType=PdfDictionary.VALUE_IS_KEY_ARRAY;\n }\n }\n \n //allow for other values in D,N,R definitions\n if(pdfKeyType==-1 && id== PdfDictionary.ClassMap){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n }else\n //allow for other values in D,N,R definitions as key pairs\n if(((((id==PdfDictionary.N || id==PdfDictionary.D || id==PdfDictionary.R))) &&\n pdfObject.getParentID()==PdfDictionary.AP &&\n pdfObject.getObjectType()==PdfDictionary.Form\n && raw[i]!='[' )){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n //decide if pair\n if(raw[keyStart]=='L' && raw[keyStart+1]=='e' && raw[keyStart+2]=='n' && raw[keyStart+3]=='g' && raw[keyStart+4]=='t' && raw[keyStart+5]=='h'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='n'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='f' && raw[keyStart+2]=='f'){\n }else\n if(raw[ptr]=='R'){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n \n if(debugFastCode) {\n System.out.println(\"new Returns \" + pdfKeyType + \" i=\" + i);\n }\n }\n }\n \n /**/\n \n //DecodeParms can be an array as well as a dictionary so check next char and alter if so\n if(PDFkeyInt==PdfDictionary.DecodeParms) {\n pdfKeyType = setTypeForDecodeParams(i, raw, length, pdfKeyType);\n }\n \n if(debugFastCode && pdfKeyType==-1 && pdfObject.getObjectType()!=PdfDictionary.Page){\n System.out.println(id+\" \"+type);\n System.out.println(padding +PDFkey+\" NO type setting for \"+PdfDictionary.getKey(keyStart,keyLength,raw)+\" id=\"+i);\n }\n }", "public PaymentRecordKey() {\n super();\n }", "private PasskeyContract() {}", "public RSAKeyPairGenerator() {\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum getCryptProviderType();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "java.lang.String getSignatureProviderId();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }" ]
[ "0.6727748", "0.6678317", "0.65109533", "0.6505185", "0.6263132", "0.62514466", "0.6101432", "0.58894575", "0.58158875", "0.5750823", "0.57424897", "0.5544559", "0.5495345", "0.5475865", "0.52942586", "0.5266195", "0.5246643", "0.5234547", "0.51766807", "0.5016653", "0.50066125", "0.49636778", "0.49505574", "0.49419945", "0.49173275", "0.4900499", "0.4890469", "0.4850671", "0.4850671", "0.4846046", "0.4838196", "0.4831908", "0.4831908", "0.4831908", "0.4825468", "0.48228103", "0.48206773", "0.48206773", "0.4819316", "0.4801538", "0.47818527", "0.47589698", "0.47572955", "0.47565547", "0.47491077", "0.4728713", "0.4719931", "0.47070387", "0.47024977", "0.47009662", "0.47000995", "0.46869826", "0.4670702", "0.46633434", "0.46223763", "0.4615428", "0.4615166", "0.46142715", "0.4610485", "0.46074787", "0.46031564", "0.4598209", "0.45926628", "0.4589497", "0.45822904", "0.45822853", "0.45731214", "0.45729804", "0.45704383", "0.45628694", "0.45616642", "0.45607027", "0.4551816", "0.4550097", "0.4547954", "0.4536531", "0.45355284", "0.45310175", "0.45305023", "0.4530499", "0.45229068", "0.4518561", "0.45185053", "0.4512594", "0.451091", "0.45088643", "0.44993877", "0.44969955", "0.44939372", "0.4493796", "0.44936416", "0.44899356", "0.44895783", "0.44872308", "0.4484021", "0.44833055", "0.44777814", "0.44765133", "0.44732615", "0.4471168" ]
0.47247025
46
none / x509+sha256 / x509+sha1 optional string pki_type = 2 [default = "none"];
public Builder setPkiTypeBytes( com.google.protobuf.ByteString value) { copyOnWrite(); instance.setPkiTypeBytes(value); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPkiType();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "boolean hasPkiType();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "public static void main(String[] args) throws IcbcApiException {\n\t\tUiIcbcClient client = new UiIcbcClient(APP_ID,IcbcConstants.SIGN_TYPE_RSA,\n\t\t\t\t\"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJCoQe/O+uqpOtyE/2CUjD7wosZw8jI1AlLNJCllOmlX+obA6h97b0JsEL0SjMCAR3xJyw7MKLqkcy5qQ/bBgw2XSrodmjzOVqfT1OXRii0xw0HiVkHR4cEWnEAAdfo0lDc4iuzCIQrnT5gM0+U+qeSV6JFfwVRjgYzBdHQRPCf1AgMBAAECgYAdQUoEe7GXH5591o/nMmOinvvscg8pRDsyD7bOgGBtyZMrCXzP3SDFKCHCeyvoColqg2oDlhpulK+OpYMVNlGQcO4eubOJp9MUc3m4A9RxkVr3dsVrmygM5czPfWHAPVQ4dECDruBJn9zoo1ci0myRTh4KSCq6SxpCE0Pbf3j7iQJBAOdMPFRfOkSQ1hsN9Mg4jd9on8r7+mF8gFPhkNI6qvEKw/prmU3obUWvZL42vRlLOQyyB92mBF24PStR/B6CjR8CQQCgGz0VoqCplurSCapGdgX3D7bNSDtMUmaLJYJxih8v+zghP0YtVgDeV3NjogVjOlz8/9Rebo0PoFcqyJnNA1RrAkEAul3dBoasZm7ldWsrXuDiv66HgoDB4Cb3J59Kl3oaHpp0CqUEI5gx48JNRE7K00SfNTGF0Pxh7Dn1X6Bxqwu6NQJADrdyPfLc4bnFi9jnleJzWepP2z6wdKt+UXv5KYaQp1BoMGYohTJKkiVnrdjOtfg/Y+IAG03+GVmbqYsW2AleUQJBANYQklohKtsmq8ptX3as6hjcuXcTpc2DSpVeOnCueNv107+dDJ+K14tbiVYzF3tkHBNMRkGtr6EuGKJ+A63sJ00=\",\n\t\t\t\tIcbcConstants.CHARSET_UTF8,IcbcConstants.ENCRYPT_TYPE_AES, \"xMh0xFsG7G80ziePFdnT8g==\");\n\t\tEaccountManageRequestV1 request = new EaccountManageRequestV1();\t\t\n\t\trequest.setServiceUrl(\"http://122.64.61.111:8081/ui/eaccount/manage/V1\");///\n\t\tEaccountManageRequestBizV1 bizContent = new EaccountManageRequestBizV1();\n\t\tbizContent.setMobileNo(\"13703878410\");//选输,手机号\n\t\tbizContent.setIdcode(\"128440810108044\");//选输,身份证号\n\t\tbizContent.setName(URLEncoder.encode(\"芡悠\"));//选输,用户姓名\n\t\tbizContent.setUserId(\"128440810108044\");//必输,需控制不能为空,用户唯一标识,送身份证号\n\t\tbizContent.setBacAddr(URLEncoder.encode(\"http://www.test.com\"));//选输,回调地址\n\t\tbizContent.setEpayflag(\"0\");//选输,工银e支付标志,0-短信、1-静态密码,集成客户端SDK的方式能送0-短信或1-静态密码,非APP方式只能送0-短信,不送默认为0-短信\n\t\t\n\t\tbizContent.setCorpAppid(APP_ID);//外公司合作方送APP_ID的值,行内应用如e支付等送外公司合作方的APPID\n\t\tlong systime = System.currentTimeMillis(); // 现时间戳\t\t\n\t\tString orderTimeStamp=new Long(systime).toString();\n\t\t\n\t\tSystem.out.println(\"orderTimeStamp:\"+orderTimeStamp);\n\t\tbizContent.setOrderTimeStamp(orderTimeStamp);//生成请求的时间,必输\n\t\t\n\t\tbizContent.setZoneno(\"00200\");//地区号号,选输,5位数字,上送值联系对接分行提供\n\t\tbizContent.setBrno(\"00260\");//网点号,选输,5位数字,上送值联系对接分行提供\n\t\t\n\t\trequest.setBizContent(bizContent);\n\t\tSystem.out.println(client.buildPostForm(request));// 实际调用时的相关返回结果及异常处理,请自行添加\n\t}", "dkk mo4509g();", "private void generatePrivacyKeyPair(boolean clientMode) throws IOException, UnsupportedEncodingException, NoSuchAlgorithmException, SaslException {\n byte[] ccmagic = CLIENT_CONF_MAGIC.getBytes(encoding);\n byte[] scmagic = SVR_CONF_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n int n;\n if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_40])) {\n n = 5;\n } else if (negotiatedCipher.equals(CIPHER_TOKENS[RC4_56])) {\n n = 7;\n } else {\n n = 16;\n }\n byte[] keyBuffer = new byte[n + ccmagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, n);\n System.arraycopy(ccmagic, 0, keyBuffer, n, ccmagic.length);\n md5.update(keyBuffer);\n byte[] Kcc = md5.digest();\n System.arraycopy(scmagic, 0, keyBuffer, n, scmagic.length);\n md5.update(keyBuffer);\n byte[] Kcs = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST24:Kcc: \", Kcc);\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST25:Kcs: \", Kcs);\n }\n byte[] myKc;\n byte[] peerKc;\n if (clientMode) {\n myKc = Kcc;\n peerKc = Kcs;\n } else {\n myKc = Kcs;\n peerKc = Kcc;\n }\n try {\n SecretKey encKey;\n SecretKey decKey;\n if (negotiatedCipher.indexOf(CIPHER_TOKENS[RC4]) > -1) {\n encCipher = Cipher.getInstance(\"RC4\");\n decCipher = Cipher.getInstance(\"RC4\");\n encKey = new SecretKeySpec(myKc, \"RC4\");\n decKey = new SecretKeySpec(peerKc, \"RC4\");\n encCipher.init(Cipher.ENCRYPT_MODE, encKey);\n decCipher.init(Cipher.DECRYPT_MODE, decKey);\n } else if ((negotiatedCipher.equals(CIPHER_TOKENS[DES])) || (negotiatedCipher.equals(CIPHER_TOKENS[DES3]))) {\n String cipherFullname, cipherShortname;\n if (negotiatedCipher.equals(CIPHER_TOKENS[DES])) {\n cipherFullname = \"DES/CBC/NoPadding\";\n cipherShortname = \"des\";\n } else {\n cipherFullname = \"DESede/CBC/NoPadding\";\n cipherShortname = \"desede\";\n }\n encCipher = Cipher.getInstance(cipherFullname);\n decCipher = Cipher.getInstance(cipherFullname);\n encKey = makeDesKeys(myKc, cipherShortname);\n decKey = makeDesKeys(peerKc, cipherShortname);\n IvParameterSpec encIv = new IvParameterSpec(myKc, 8, 8);\n IvParameterSpec decIv = new IvParameterSpec(peerKc, 8, 8);\n encCipher.init(Cipher.ENCRYPT_MODE, encKey, encIv);\n decCipher.init(Cipher.DECRYPT_MODE, decKey, decIv);\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST26:\" + negotiatedCipher + \" IVcc: \", encIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST27:\" + negotiatedCipher + \" IVcs: \", decIv.getIV());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST28:\" + negotiatedCipher + \" encryption key: \", encKey.getEncoded());\n traceOutput(DP_CLASS_NAME, \"generatePrivacyKeyPair\", \"DIGEST29:\" + negotiatedCipher + \" decryption key: \", decKey.getEncoded());\n }\n }\n } catch (InvalidKeySpecException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported key \" + \"specification used.\", e);\n } catch (InvalidAlgorithmParameterException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid cipher \" + \"algorithem parameter used to create cipher instance\", e);\n } catch (NoSuchPaddingException e) {\n throw new SaslException(\"DIGEST-MD5: Unsupported \" + \"padding used for chosen cipher\", e);\n } catch (InvalidKeyException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid data \" + \"used to initialize keys\", e);\n }\n }", "java.lang.String getPublicEciesKey();", "OpenSSLKey mo134201a();", "public abstract String getSigAlgOID();", "private void generateIntegrityKeyPair(boolean clientMode) throws UnsupportedEncodingException, IOException, NoSuchAlgorithmException {\n byte[] cimagic = CLIENT_INT_MAGIC.getBytes(encoding);\n byte[] simagic = SVR_INT_MAGIC.getBytes(encoding);\n MessageDigest md5 = MessageDigest.getInstance(\"MD5\");\n byte[] keyBuffer = new byte[H_A1.length + cimagic.length];\n System.arraycopy(H_A1, 0, keyBuffer, 0, H_A1.length);\n System.arraycopy(cimagic, 0, keyBuffer, H_A1.length, cimagic.length);\n md5.update(keyBuffer);\n byte[] Kic = md5.digest();\n System.arraycopy(simagic, 0, keyBuffer, H_A1.length, simagic.length);\n md5.update(keyBuffer);\n byte[] Kis = md5.digest();\n if (logger.isLoggable(Level.FINER)) {\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST12:Kic: \", Kic);\n traceOutput(DI_CLASS_NAME, \"generateIntegrityKeyPair\", \"DIGEST13:Kis: \", Kis);\n }\n if (clientMode) {\n myKi = Kic;\n peerKi = Kis;\n } else {\n myKi = Kis;\n peerKi = Kic;\n }\n }", "public final String mo1957a() {\n return \"type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey\";\n }", "private native String native_ks(long cookie, byte[] userKey);", "@Override\n public ConcurrentContentSigner newSigner(\n String type, SignerConf conf, X509Cert[] certificateChain)\n throws ObjectCreationException {\n type = type.toLowerCase(Locale.ROOT);\n if (!types.contains(type)) {\n throw new ObjectCreationException(\"unknown signer type \" + type);\n }\n\n String str = conf.getConfValue(\"parallelism\");\n int parallelism = 20;\n if (str != null) {\n try {\n parallelism = Integer.parseInt(str);\n } catch (NumberFormatException ex) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n\n if (parallelism < 1) {\n throw new ObjectCreationException(\"invalid parallelism \" + str);\n }\n }\n\n str = conf.getConfValue(\"alias\");\n if (str == null) {\n throw new ObjectCreationException(\"alias is not specified\");\n }\n int keyId = Integer.parseInt(str);\n\n String algoName = conf.getConfValue(\"algo\");\n if (algoName == null) {\n throw new ObjectCreationException(\"algo is not specified\");\n }\n\n try {\n InitStatus initStatus = init(type);\n if (initStatus.status.get() != 1) {\n throw new ObjectCreationException(initStatus.details);\n }\n\n SignAlgo algo = SignAlgo.getInstance(algoName);\n String keyAlgoName;\n String bcKeyAlgoName;\n if (algo.isSM2SigAlgo()) {\n keyAlgoName = \"SM2\";\n bcKeyAlgoName = \"EC\";\n } else if (algo.isRSAPkcs1SigAlgo() || algo.isRSAPSSSigAlgo()) {\n keyAlgoName = \"RSA\";\n bcKeyAlgoName = \"RSA\";\n } else if (algo.isECDSASigAlgo() || algo.isPlainECDSASigAlgo()) {\n keyAlgoName = \"EC\";\n bcKeyAlgoName = \"EC\";\n } else {\n throw new ObjectCreationException(\"unsupported algo \" + algoName);\n }\n\n Provider provider = providerMap.get(type);\n\n // Method to read create PrivateKey and PublicKey object.\n // SANSEC use KeyPairGenerator.generateKeyPair to read the keypair-\n // No new keypair will be generated here.\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(keyAlgoName, provider);\n kpGen.initialize(keyId << 16);\n KeyPair kp = kpGen.generateKeyPair();\n\n PublicKey publicKey = KeyFactory.getInstance(bcKeyAlgoName, \"BC\")\n .generatePublic(new X509EncodedKeySpec(kp.getPublic().getEncoded()));\n\n return new JceSignerBuilder(kp.getPrivate(), publicKey, certificateChain, provider)\n .createSigner(algo, parallelism);\n } catch (GeneralSecurityException | XiSecurityException ex) {\n throw new ObjectCreationException(ex.getMessage(), ex);\n }\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv xgetCryptProviderType();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "boolean hasPkiData();", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "public String mo34971a() {\n return \"SHA-384\";\n }", "public interface JsonKey {\n\n String CLASS = \"class\";\n String DATA = \"data\";\n String EKS = \"eks\";\n String ID = \"id\";\n String LEVEL = \"level\";\n String MESSAGE = \"message\";\n String METHOD = \"method\";\n String REQUEST_MESSAGE_ID = \"msgId\";\n String STACKTRACE = \"stacktrace\";\n String VER = \"ver\";\n String OK = \"ok\";\n String LOG_LEVEL = \"logLevel\";\n String ERROR = \"error\";\n String EMPTY_STRING = \"\";\n String RESPONSE = \"response\";\n String ADDRESS = \"address\";\n String KEY = \"key\";\n String ERROR_MSG = \"error_msg\";\n String ATTRIBUTE = \"attribute\";\n String ERRORS = \"errors\";\n String SUCCESS = \"success\";\n\n String CERTIFICATE = \"certificate\";\n String RECIPIENT_NAME = \"recipientName\";\n String COURSE_NAME = \"courseName\";\n String NAME = \"name\";\n String HTML_TEMPLATE = \"htmlTemplate\";\n String TAG = \"tag\";\n String ISSUER = \"issuer\";\n String URL = \"url\";\n String SIGNATORY_LIST = \"signatoryList\";\n String DESIGNATION = \"designation\";\n String SIGNATORY_IMAGE = \"image\";\n\n String DOMAIN_URL = \"sunbird_cert_domain_url\";\n String ASSESSED_DOMAIN = \"ASSESSED_DOMAIN\";\n String BADGE_URL = \"BADGE_URL\";\n String ISSUER_URL = \"ISSUER_URL\";\n String TEMPLATE_URL = \"TEMPLATE_URL\";\n String CONTEXT = \"CONTEXT\";\n String VERIFICATION_TYPE = \"VERIFICATION_TYPE\";\n String SIGNATORY_EXTENSION = \"SIGNATORY_EXTENSION\";\n String RECIPIENT_EMAIl = \"recipientEmail\";\n String RECIPIENT_PHONE = \"recipientPhone\";\n String RECIPIENT_ID = \"recipientId\";\n String VALID_FROM = \"validFrom\";\n String EXPIRY = \"expiry\";\n String OLD_ID = \"oldId\";\n String PUBLIC_KEY = \"publicKey\";\n String DESCRIPTION = \"description\";\n String LOGO = \"logo\";\n String ISSUE_DATE = \"issueDate\";\n String USER = \"user\";\n String CERTIFICATE_NAME = \"name\";\n\n String CONTAINER_NAME = \"CONTAINER_NAME\";\n String CLOUD_STORAGE_TYPE = \"CLOUD_STORAGE_TYPE\";\n String CLOUD_UPLOAD_RETRY_COUNT = \"CLOUD_UPLOAD_RETRY_COUNT\";\n String AZURE_STORAGE_SECRET = \"AZURE_STORAGE_SECRET\";\n String AZURE_STORAGE_KEY = \"AZURE_STORAGE_KEY\";\n String ACCESS_CODE_LENGTH = \"ACCESS_CODE_LENGTH\";\n String ORG_ID = \"orgId\";\n String KEYS = \"keys\";\n String ENC_SERVICE_URL = \"sunbird_cert_enc_service_url\";\n String SIGN_HEALTH_CHECK_URL = \"SIGN_HEALTH_CHECK_URL\";\n String SIGN_URL = \"SIGN_URL\";\n String SIGN_VERIFY_URL = \"SIGN_VERIFY_URL\";\n String SIGN_CREATOR = \"SIGN_CREATOR\";\n String SIGN = \"sign\";\n String VERIFY = \"verify\";\n String KEY_ID = \"keyId\";\n String JSON_URL = \"jsonUrl\";\n String PDF_URL = \"pdfUrl\";\n String UNIQUE_ID = \"id\";\n String GENERATE_CERT = \"generateCert\";\n String PUBLIC_KEY_URL = \"PUBLIC_KEY_URL\";\n String GET_SIGN_URL = \"getSignUrl\";\n String SIGNED_URL = \"signedUrl\";\n\n String ACCESS_CODE = \"accessCode\";\n String JSON_DATA = \"jsonData\";\n String SLUG = \"sunbird_cert_slug\";\n}", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "BigInteger getCEP();", "java.lang.String getPubkey();", "public void setCertiType(java.lang.String certiType) {\n this.certiType = certiType;\n }", "public abstract String getSigAlgName();", "@Schema(required = true, description = \"Contract type (KIP-7, KIP-17, ERC-20, ERC-721)\")\n public String getType() {\n return type;\n }", "public ProfileKey getProfileKey(String username, String type) throws ProfileKeyManagerPersistenceException {\n ParameterHelpers.checkParameter(username, \"username\");\n\n boolean registered = checkType(type);\n\n Connection connection = getConnection();\n\n try {\n return getProfileKey(connection, username, type, registered);\n } finally {\n closeConnection(connection);\n }\n }", "protected CryptoProvider() {\n\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "@ParameterizedTest\n @EnumSource(KeyType.class)\n void testMissingJWTPublicKey(KeyType keyType) throws NoSuchAlgorithmException {\n final Pair<String, PrivateKey> keyPair = generateKeypair(keyType);\n\n final String jwt = Jwts.builder()\n .setHeaderParam(\"kid\", UUID.randomUUID())\n .setAudience(String.format(\"%sToken/auth\", \"here\"))\n .setIssuer(\"macaroon\")\n .setSubject(\"macaroon\")\n .setId(UUID.randomUUID().toString())\n .setExpiration(Date.from(Instant.now().plus(5, ChronoUnit.MINUTES)))\n .signWith(keyPair.getRight(), APIAuthHelpers.getSigningAlgorithm(keyType))\n .compact();\n\n // Submit the JWT\n Response response = RESOURCE.target(\"/v1/Token/auth\")\n .queryParam(\"scope\", \"system/*.*\")\n .queryParam(\"grant_type\", \"client_credentials\")\n .queryParam(\"client_assertion_type\", TokenResource.CLIENT_ASSERTION_TYPE)\n .queryParam(\"client_assertion\", jwt)\n .request()\n .post(Entity.entity(\"\", MediaType.APPLICATION_FORM_URLENCODED));\n\n assertEquals(401, response.getStatus(), \"Should be unauthorized\");\n assertTrue(response.readEntity(String.class).contains(\"Cannot find public key\"), \"Should have correct exception\");\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "public ECP getPublicKGCKey(){return pkS;}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "private TPM_DIGEST createEmptyPubKeyHash()\r\n {\r\n// if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_BROADCOM )\r\n// {\r\n// return null;\r\n// }\r\n// else\r\n// {\r\n// return new TPM_DIGEST();\r\n// }\r\n if ( this.getTpmManufacturer() == TPMDriver.TPM_MANUFACTURER_INFINEON )\r\n {\r\n return new TPM_DIGEST();\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }", "public String getTlsKey();", "@Test\n\tpublic void testSecuirtyConfigsOperations() throws NoSuchAlgorithmException {\n\t\t// Generate and store keys for the first time\n\t\tServerKeyPairs serverKeyPairs1 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair1 = serverKeyPairs1.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair1 = serverKeyPairs1.getSignatureKeyPair();\n\n\t\t// Initialize a new serverKeyPairs to test that it will only read\n\t\t// previously generated keys\n\t\tServerKeyPairs serverKeyPairs2 = new ServerKeyPairs();\n\t\tKeyPair encryptionKeyPair2 = serverKeyPairs2.getEncryptionKeyPair();\n\t\tKeyPair signatureKeyPair2 = serverKeyPairs2.getSignatureKeyPair();\n\n\t\tassertEquals(\"Wrong loaded encryption public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) encryptionKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) encryptionKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded encryption private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded encryption private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) encryptionKeyPair2.getPrivate()).getPrivateExponent());\n\n\t\tassertEquals(\"Wrong loaded signature public key modulas parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getModulus(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature public key exponent parameter\",\n\t\t\t\t((RSAPublicKey) signatureKeyPair1.getPublic()).getPublicExponent(),\n\t\t\t\t((RSAPublicKey) signatureKeyPair2.getPublic()).getPublicExponent());\n\n\t\tassertEquals(\"Wrong loaded signature private key modulas parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getModulus(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getModulus());\n\n\t\tassertEquals(\"Wrong loaded signature private key exponent parameter\",\n\t\t\t\t((RSAPrivateKey) signatureKeyPair1.getPrivate()).getPrivateExponent(),\n\t\t\t\t((RSAPrivateKey) signatureKeyPair2.getPrivate()).getPrivateExponent());\n\t}", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType.Enum getCryptAlgorithmType();", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public MEKeyTool() {\n keystore = new PublicKeyStoreBuilderBase();\n }", "public PrivateKeyType getPivateKeyType() {\n return PrivateKeyType.SAPLING_EXTENED_SPEND_KEY;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STAlgType xgetCryptAlgorithmType();", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "public void setPrincipalType(String principalType){\n this.principalType = principalType;\n //Update hashMap value..\n hashMap.put(\"principalType\", principalType);\n }", "public static void main(String[] args) {\n String keyFile = \"D:\\\\data\\\\kms\\\\liweigang.idc\";\n String message = \"dksf3r38324hrewjrh3r&^%djfdsjkek\";\n String pubmatrix = \"D:\\\\data\\\\kms\\\\sm2cpk.cn.pkm\";\n\n byte[] keycard = Tool.ReadFile(keyFile);\n System.out.println(\"keyCard:\" + Tool.Bytes2Hex(keycard));\n\n //得到私钥\n byte[] priKey = GMJni.GetPriKey(keycard);\n String priKeyHex = Tool.Bytes2Hex(priKey);\n System.out.println(\"private key:\" + priKeyHex);\n\n //得到密钥标识\n byte[] keyId = GMJni.GetKeyId(keycard);\n System.out.println(\"keyId:\" + Tool.Bytes2String(keyId));\n\n //得到公钥\n byte[] pubKey = GMJni.CalPubKey(Tool.String2Bytes(pubmatrix), keyId);\n System.out.println(\"public key:\" + Tool.Bytes2Hex(pubKey));\n\n //1000个不同message\n List<String> msgList = new ArrayList<>(12);\n for (int i = 0; i < 1000; i++) {\n //message基础上字符串长度+10\n msgList.add(message + RandomUtil.randomString(10));\n }\n long start = System.currentTimeMillis();\n //签名结果\n int rv = 0;\n //缓存\n MapCache cache = new MapCache();\n //命中缓存次数\n int count = 0;\n int count2 = 0;\n for (int i = 0; i < 100000; i++) {\n System.out.println(\"模拟请求第\" + i + \"次数\");\n\n //计算E值\n //30种不同的message,即仅30个不走缓存\n byte[] E = GMJni.SM2GetE(keyId, pubKey, Tool.String2Bytes(msgList.get(new Random().nextInt(30))));\n String hexE = Tool.Bytes2Hex(E);\n// System.out.println(\"E:\" + hexE);\n\n //SM2签名\n byte[] sig = GMJni.SM2Sign(priKey, E);\n// System.out.println(\"private key:\" + Tool.Bytes2Hex(priKey));\n// System.out.println(\"sign value:\" + Tool.Bytes2Hex(sig));\n\n // SM2签名验证\n // 引入Map缓存 E,sig的16进制的MD5值\n String hex = hexE + priKeyHex;\n// System.out.println(\"finalStr:\" + hex);\n String md5 = SecureUtil.md5(hex);\n if (null != cache.get(md5)) {\n count++;\n// System.out.println(\"命中缓存\" + (++count));\n } else {\n rv += GMJni.SM2Verify(pubKey, E, sig);\n count2++;\n cache.add(md5, (byte) 1, 50 * 1000);\n }\n }\n long end = System.currentTimeMillis();\n double v = (end - start) / 1000.0;\n System.out.println(\"time consuming:\" + v + \" sec\");\n System.out.println(Math.round(100000 / v) + \" times/sec\");\n System.out.println(\"命中缓存\" + (count));\n System.out.println(\"未命中\" + (count2));\n if (rv != 0) {\n System.out.println(\"Verify signature fail, error code is \" + String.valueOf(rv));\n } else {\n System.out.println(\"Verify signature success.\");\n }\n }", "private static String generateServerKey(Poi poi) {\n LonLat viewPoint = poi.getViewPosition();\n int lon = viewPoint.getLonInt();\n int lat = viewPoint.getLatInt();\n int alt = viewPoint.getAltInt();\n return generateServerKey(poi.getName(), poi.getAddress(), lon, lat, alt);\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public static void registerDefaultAlgorithms() {\n/* 390 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#dsa-sha1\", SignatureDSA.class);\n/* */ \n/* */ \n/* 393 */ algorithmHash.put(\"http://www.w3.org/2009/xmldsig11#dsa-sha256\", SignatureDSA.SHA256.class);\n/* */ \n/* */ \n/* 396 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\", SignatureBaseRSA.SignatureRSASHA1.class);\n/* */ \n/* */ \n/* 399 */ algorithmHash.put(\"http://www.w3.org/2000/09/xmldsig#hmac-sha1\", IntegrityHmac.IntegrityHmacSHA1.class);\n/* */ \n/* */ \n/* 402 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-md5\", SignatureBaseRSA.SignatureRSAMD5.class);\n/* */ \n/* */ \n/* */ \n/* 406 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160\", SignatureBaseRSA.SignatureRSARIPEMD160.class);\n/* */ \n/* */ \n/* */ \n/* 410 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\", SignatureBaseRSA.SignatureRSASHA256.class);\n/* */ \n/* */ \n/* 413 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha384\", SignatureBaseRSA.SignatureRSASHA384.class);\n/* */ \n/* */ \n/* 416 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\", SignatureBaseRSA.SignatureRSASHA512.class);\n/* */ \n/* */ \n/* 419 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1\", SignatureECDSA.SignatureECDSASHA1.class);\n/* */ \n/* */ \n/* 422 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256\", SignatureECDSA.SignatureECDSASHA256.class);\n/* */ \n/* */ \n/* 425 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384\", SignatureECDSA.SignatureECDSASHA384.class);\n/* */ \n/* */ \n/* 428 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512\", SignatureECDSA.SignatureECDSASHA512.class);\n/* */ \n/* */ \n/* 431 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-md5\", IntegrityHmac.IntegrityHmacMD5.class);\n/* */ \n/* */ \n/* 434 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160\", IntegrityHmac.IntegrityHmacRIPEMD160.class);\n/* */ \n/* */ \n/* 437 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha256\", IntegrityHmac.IntegrityHmacSHA256.class);\n/* */ \n/* */ \n/* 440 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha384\", IntegrityHmac.IntegrityHmacSHA384.class);\n/* */ \n/* */ \n/* 443 */ algorithmHash.put(\"http://www.w3.org/2001/04/xmldsig-more#hmac-sha512\", IntegrityHmac.IntegrityHmacSHA512.class);\n/* */ }", "public java.lang.String getCertiType() {\n return certiType;\n }", "java.lang.String getServerSecret();", "public static void main(String[] args) {\n\t\tString algorithm = SignatureAlgorithm.HS256.getJcaName();\r\n\t\tSystem.out.println(algorithm);\r\n\r\n\t\t// set secret key\r\n\t\tString secret = \"this+is+my+scret+key+AAAAAAAAAAAAAAAAAAAAAAAAA\";\r\n\r\n\t\t// background information\r\n\t\t// =============================================================\r\n\t\t/*\r\n\t\t * the bytes of the secret key will be used by the signature algorithm - must be\r\n\t\t * in base 64 format\r\n\t\t */\r\n//\t\tbyte[] scretKeyEncoded = secret.getBytes(); // java encoding\r\n//\t\tbyte[] scretKeyDecoded = Base64.getDecoder().decode(secret); // base64\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyEncoded));\r\n//\t\tSystem.out.println(Arrays.toString(scretKeyDecoded));\r\n\t\t// =====================================================================================\r\n\r\n\t\t// create the key from the decoded secret\r\n\t\tKey key = new SecretKeySpec(Base64.getDecoder().decode(secret), algorithm);\r\n\r\n\t\tInstant now = Instant.now();\r\n\r\n\t\t// create a JWT instance\r\n\t\tString jwt = Jwts.builder()\r\n\r\n\t\t\t\t.signWith(key)\r\n\r\n\t\t\t\t.setIssuedAt(Date.from(now))\r\n\r\n\t\t\t\t// will be valid for 10 seconds\r\n\t\t\t\t.setExpiration(Date.from(now.plus(10, ChronoUnit.SECONDS)))\r\n\r\n\t\t\t\t.setSubject(\"aaa@mail\")\r\n\r\n\t\t\t\t.claim(\"First name\", \"Dan\")\r\n\r\n\t\t\t\t.claim(\"Last name\", \"Levi\")\r\n\r\n\t\t\t\t.compact();\r\n\r\n\t\tSystem.out.println(jwt);\r\n\r\n\t\t// ==================================================\r\n\t\t// parse the JWS to get the expanded JWT\r\n//\t\tJWS - JSON Web Signature [aaaa.bbbb.cccc]\r\n//\t\tJWT - JSON Web Token [aaaa.bbbb.cccc]\r\n\r\n\t\tSystem.out.println(\"====================\");\r\n\t\tSystem.out.println(\"parsing the JWS to get a JWT\");\r\n\t\tJwtParser jwtParser = Jwts.parserBuilder().setSigningKey(key).build();\r\n\t\t// to demonstrate expiration paste an old JWS\r\n\t\tjwt = \"eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjA2Mzk1MTEsImV4cCI6MTYyMDYzOTUyMSwic3ViIjoiYWFhQG1haWwiLCJGaXJzdCBuYW1lIjoiRGFuIiwiTGFzdCBuYW1lIjoiTGV2aSJ9.cefEbBejjebKVILgOzca0LJZfd0F3qjezegeCaxOrfE\";\r\n\t\tSystem.out.println(jwtParser.parse(jwt));\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getHeader());\r\n\t\tSystem.out.println(jwtParser.parse(jwt).getBody());\r\n\r\n\t}", "private String getSignatureString(Type type)\r\n {\r\n if(type instanceof CompoundType)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n CompoundType cType = (CompoundType)type;\r\n //find key and value types\r\n String keyType = getSignatureString(cType.keyType);\r\n sb.append(\"Ljava/util/HashMap\");\r\n sb.append(\"<\");\r\n sb.append(keyType);\r\n sb.append(getSignatureString(cType.valType));\r\n sb.append(\">;\");\r\n return sb.toString();\r\n }\r\n else if(type instanceof SimpleType)\r\n {\r\n switch(((SimpleType)type).type)\r\n {\r\n case INT:\r\n return \"Ljava/lang/Integer;\";\r\n case BOOLEAN:\r\n return \"Ljava/lang/Boolean;\";\r\n case STRING:\r\n return \"Ljava/lang/String;\";\r\n }\r\n }\r\n return null;\r\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public String getJCEProviderName() {\n/* 196 */ return this.signatureAlgorithm.engineGetJCEProviderName();\n/* */ }", "public String getJCEAlgorithmString() {\n/* 187 */ return this.signatureAlgorithm.engineGetJCEAlgorithmString();\n/* */ }", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "com.google.protobuf.ByteString getPublicEciesKeyBytes();", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "public static String getKeyTypeName(KeyType type)\n {\n // TODO: should be moved to DBProvider ...\n // MySQL : key identifier\n // SQLServer : key identifier\n // Derby : key identifier\n // PostgreSQL: key identifier\n switch (type) {\n // MySQL: key types ...\n case PRIMARY : return \"PRIMARY KEY\"; // table\n case UNIQUE : return \"UNIQUE\"; // table\n case INDEX : return \"INDEX\"; // table/index\n case UNIQUE_INDEX : return \"UNIQUE INDEX\"; // table/index\n default : return \"UNKNOWN\";\n }\n }", "long getCryptProviderTypeExt();", "@PostMapping(\"/createKeyPair\")\n public String createKeyPair() {\n \n AWSKMS kmsClient = AWSKMSClientBuilder.standard().build();\n \n return \"Private uid: \"+ priuid +\"\\nPublic uid: \" + pubuid +\"\\n\";\n }", "long getCryptAlgorithmSid();", "switch (buffer[ISO7816.OFFSET_CDATA + 4]) {\r\n\t\tcase BASIC:\r\n\t\t\tsetSignatureType(BASIC);\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tsetSignatureType(AUTHENTICATION);\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tsetSignatureType(NON_REPUDIATION);\r\n\t\t\tbreak;\r\n\t\tcase CA_ROLE:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\tdefault:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "private KeyStore askForPin() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {\n char newPin[] = PinDialog.getPIN(this.providerDesc);\n try {\n KeyStore ks = getKeyStore(newPin);\n pin = newPin;\n return ks;\n } catch (IOException e2) {\n e2.printStackTrace();\n if (e2.getCause() instanceof LoginException) {\n JOptionPane.showMessageDialog(null, \"Wrong PIN\", \"Cryptographic card\", JOptionPane.WARNING_MESSAGE);\n }\n throw e2;\n }\n }", "public String getTlsKeyPath();", "public byte[] getUserKey() throws IOException\n {\n byte[] u = null;\n COSString user = (COSString)encryptionDictionary.getDictionaryObject( COSName.getPDFName( \"U\" ) );\n if( user != null )\n {\n u = user.getBytes();\n }\n return u;\n }", "@Override\n public String getProviderName() {\n return \"SimpleEncryptionKeyStoreProvider\";\n }", "public interface SKey {\n\n String FAIL_STORE = \"job.fail.store\";\n\n String LOADBALANCE = \"loadbalance\";\n\n String EVENT_CENTER = \"event.center\";\n\n String REMOTING = \"lts.remoting\";\n\n String REMOTING_SERIALIZABLE_DFT = \"lts.remoting.serializable.default\";\n\n String ZK_CLIENT_KEY = \"zk.client\";\n\n String JOB_ID_GENERATOR = \"id.generator\";\n\n String JOB_LOGGER = \"job.logger\";\n\n String JOB_QUEUE = \"job.queue\";\n}", "private void getKeyType(final PdfObject pdfObject, final int i, final byte[] raw, final int length, final int keyLength, final int keyStart, final int type) {\n if(debugFastCode)//used in debug\n {\n PDFkey = PdfDictionary.getKey(keyStart, keyLength, raw);\n }\n \n PDFkeyInt=PdfDictionary.getIntKey(keyStart,keyLength,raw);\n \n //correct mapping\n if(PDFkeyInt==PdfDictionary.Indexed && (type==PdfDictionary.MK ||type==PdfDictionary.Form || type==PdfDictionary.Linearized || type==PdfDictionary.Group)) {\n PDFkeyInt = PdfDictionary.I;\n }\n \n if(isInlineImage) {\n PDFkeyInt = PdfObjectFactory.getInlineID(PDFkeyInt);\n }\n \n final int id=pdfObject.getID();\n \n if(type==PdfDictionary.Resources && (PDFkeyInt==PdfDictionary.ColorSpace\n || PDFkeyInt==PdfDictionary.ExtGState || PDFkeyInt==PdfDictionary.Shading\n || PDFkeyInt==PdfDictionary.XObject || PDFkeyInt==PdfDictionary.Font|| PDFkeyInt==PdfDictionary.Pattern)){\n pdfKeyType=PdfDictionary.VALUE_IS_DICTIONARY_PAIRS;\n //}else if (type==PdfDictionary.Form && id== PdfDictionary.AA && PDFkeyInt== PdfDictionary.K){\n // pdfKeyType= PdfDictionary.VALUE_IS_UNREAD_DICTIONARY;\n }else if (type==PdfDictionary.Outlines && PDFkeyInt== PdfDictionary.D){\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && PDFkeyInt== PdfDictionary.D){\n if(id==PdfDictionary.AP || id==PdfDictionary.AA){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if(id==PdfDictionary.Win){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else{\n PDFkeyInt= PdfDictionary.Dest;\n pdfKeyType= PdfDictionary.VALUE_IS_MIXED_ARRAY;\n }\n }else if ((type==PdfDictionary.Form || type==PdfDictionary.MK) && (id==PdfDictionary.AP || id==PdfDictionary.AA) && PDFkeyInt== PdfDictionary.A){\n pdfKeyType= PdfDictionary.VALUE_IS_VARIOUS;\n }else if (PDFkeyInt== PdfDictionary.Order && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary. VALUE_IS_OBJECT_ARRAY;\n }else if (PDFkeyInt== PdfDictionary.Name && type==PdfDictionary.OCProperties){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if ((type==PdfDictionary.ColorSpace || type==PdfDictionary.Function) && PDFkeyInt== PdfDictionary.N){\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(PDFkeyInt==PdfDictionary.Gamma && type==PdfDictionary.ColorSpace &&\n pdfObject.getParameterConstant(PdfDictionary.ColorSpace)== ColorSpaces.CalGray){ //its a number not an array\n pdfKeyType= PdfDictionary.VALUE_IS_FLOAT;\n }else if(id==PdfDictionary.Win && pdfObject.getObjectType()==PdfDictionary.Form &&\n (PDFkeyInt==PdfDictionary.P || PDFkeyInt==PdfDictionary.O)){\n pdfKeyType= PdfDictionary.VALUE_IS_TEXTSTREAM;\n }else if (isInlineImage && PDFkeyInt==PdfDictionary.ColorSpace){\n pdfKeyType= PdfDictionary.VALUE_IS_DICTIONARY;\n }else {\n pdfKeyType = PdfDictionary.getKeyType(PDFkeyInt, type);\n }\n \n \n //handle array of Function in Shading by using keyArray\n if(id==PdfDictionary.Shading && PDFkeyInt==PdfDictionary.Function){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n if(raw[ptr]=='['){\n pdfKeyType=PdfDictionary.VALUE_IS_KEY_ARRAY;\n }\n }\n \n //allow for other values in D,N,R definitions\n if(pdfKeyType==-1 && id== PdfDictionary.ClassMap){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n }else\n //allow for other values in D,N,R definitions as key pairs\n if(((((id==PdfDictionary.N || id==PdfDictionary.D || id==PdfDictionary.R))) &&\n pdfObject.getParentID()==PdfDictionary.AP &&\n pdfObject.getObjectType()==PdfDictionary.Form\n && raw[i]!='[' )){\n \n //get next non number/char value\n int ptr=i;\n while((raw[ptr]>=48 && raw[ptr]<58) || raw[ptr]==32){\n ptr++;\n }\n \n //decide if pair\n if(raw[keyStart]=='L' && raw[keyStart+1]=='e' && raw[keyStart+2]=='n' && raw[keyStart+3]=='g' && raw[keyStart+4]=='t' && raw[keyStart+5]=='h'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='n'){\n }else if(raw[keyStart]=='O' && raw[keyStart+1]=='f' && raw[keyStart+2]=='f'){\n }else\n if(raw[ptr]=='R'){\n pdfKeyType = Dictionary.getPairedValues(pdfObject, i, raw, pdfKeyType, length, keyLength, keyStart);\n \n if(debugFastCode) {\n System.out.println(\"new Returns \" + pdfKeyType + \" i=\" + i);\n }\n }\n }\n \n /**/\n \n //DecodeParms can be an array as well as a dictionary so check next char and alter if so\n if(PDFkeyInt==PdfDictionary.DecodeParms) {\n pdfKeyType = setTypeForDecodeParams(i, raw, length, pdfKeyType);\n }\n \n if(debugFastCode && pdfKeyType==-1 && pdfObject.getObjectType()!=PdfDictionary.Page){\n System.out.println(id+\" \"+type);\n System.out.println(padding +PDFkey+\" NO type setting for \"+PdfDictionary.getKey(keyStart,keyLength,raw)+\" id=\"+i);\n }\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "public PaymentRecordKey() {\n super();\n }", "private PasskeyContract() {}", "public RSAKeyPairGenerator() {\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum getCryptProviderType();", "java.lang.String getSignatureProviderId();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }" ]
[ "0.6727689", "0.66767913", "0.6510369", "0.65033424", "0.6262288", "0.6251234", "0.6101008", "0.58891505", "0.5814989", "0.5750624", "0.57413155", "0.5544094", "0.5496116", "0.547445", "0.52937627", "0.5266566", "0.524678", "0.52335155", "0.50153226", "0.5006655", "0.4962356", "0.49499023", "0.49411032", "0.49168855", "0.49020067", "0.4888426", "0.48494777", "0.48494777", "0.48460793", "0.48377907", "0.4832051", "0.4832051", "0.4832051", "0.48257953", "0.4821702", "0.48194492", "0.4819314", "0.4819314", "0.47991663", "0.4781225", "0.47571105", "0.4756231", "0.47555733", "0.47499835", "0.47289437", "0.47254056", "0.47212568", "0.47066334", "0.47023937", "0.47019845", "0.46989855", "0.46851024", "0.46719837", "0.46639642", "0.46222693", "0.46156308", "0.46136636", "0.4612661", "0.46108755", "0.46063787", "0.46033537", "0.4599115", "0.45910728", "0.45881075", "0.45822087", "0.4581919", "0.45753542", "0.45734766", "0.45711392", "0.45614913", "0.45610267", "0.45608622", "0.45530447", "0.4550199", "0.4548751", "0.45359287", "0.45348635", "0.45301956", "0.45298547", "0.45289811", "0.45227852", "0.45182446", "0.45164904", "0.45110202", "0.45109597", "0.4506969", "0.44993004", "0.44970086", "0.4493643", "0.4493612", "0.44934398", "0.4490861", "0.44874617", "0.44862193", "0.44837305", "0.44832504", "0.44770813", "0.44753104", "0.44724855", "0.44717774" ]
0.51767373
18
depends on pki_type optional bytes pki_data = 3;
@java.lang.Override public boolean hasPkiData() { return instance.hasPkiData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "java.lang.String getPkiType();", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "boolean hasPkiType();", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "boolean hasPkiData();", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "public Builder setPkiData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiData(value);\n return this;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "@java.lang.Override\n public boolean hasPkiData() {\n return ((bitField0_ & 0x00000004) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return instance.getPkiData();\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "void setPQ( byte[] buffer, short offset, short length) throws CryptoException;", "public byte[] getPKP(final TrzbaDataType data) throws DataSigningException {\n return this.clientKey.sign(serializeData(data));\n }", "@Override\r\n protected String getPrymaryType(Integer key) {\r\n return NodeTypes.SECTOR.getId();\r\n }", "com.hps.july.persistence.WorkerKey getTechStuffKey() throws java.rmi.RemoteException;", "public String reqsetpkt(byte []p,byte[] id,byte[] T,byte[] ip,byte[] no)\r\n\t{\n\t\treturn \"hi\";\r\n\t}", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "void privateSetTechStuffKey(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException;", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "public Builder clearPkiData() {\n copyOnWrite();\n instance.clearPkiData();\n return this;\n }", "protected byte[] getBathWaterVolumeSetting3() {return null;}", "public interface ICloudRequest {\n \n public int getOp();\n public void incrementRetries();\n public void resetRetries();\n public int getRetries();\n \n /**\n * Retrieve the data unit associated with this request\n * @return {@link DepSkyDataUnit}\n */\n public DepSkyDataUnit getDataUnit();\n \n /**\n * Determine when this procedure started originally\n * @return long - start time of this procedure\n */\n public long getStartTime();\n \n /**\n * Determine the sequence of this request\n * @return long\n */\n public long getSequenceNumber();\n \n /**\n * Get the data resulting from this request\n * @return byte[] consisting of the data\n */\n public byte[] getData();\n \n \n}", "public static Object PQinit(Object... arg) {\nUNSUPPORTED(\"c01vxogao855zs8fe94tpim9g\"); // void\nUNSUPPORTED(\"3p0cdanvp4f13d8omi42lvjl1\"); // PQinit(void)\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\nUNSUPPORTED(\"akljrpu8bej9lq4rmsktz8u2e\"); // PQcnt = 0;\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\n\nthrow new UnsupportedOperationException();\n}", "com.zzsong.netty.protobuff.two.ProtoData.MyDataInfo.DataType getDataType();", "@Override\n\tpublic void put(String key, String cat, byte[] data) throws RemoteException {\n\t\t\n\t}", "public static void setKPIsInCache(Map<String,String> dataMap){ \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tmemcache.delete(ALL_KPI_KEY);\n \t}\n \tmemcache.put(ALL_KPI_KEY, dataMap);\n\t}", "@Override //Client\n public void prepareAMServiceData(ClusterDescription clusterSpec,\n Map<String, ByteBuffer> serviceData) {\n \n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "Key[] getPq();", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public byte getType() {\n return TYPE_DATA;\n }", "KijiDataRequest getClientRequest();", "public void setStorageType(short type) {\n\tstorageType = type;\n }", "public void setPartProducedKey(long value) {\n\t\tthis.partProducedKey = value;\n\t}", "public static Map<String,String> getKPIsFromCache(){\n\t\tMap<String,String> dataMap=null;\n \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tdataMap=(Map<String,String>) memcache.get(ALL_KPI_KEY);\n \t\tlog.info(\"Memcache getKPIsFromCache size = \"+dataMap.size());\n \t} \t\n \treturn dataMap;\n\t}", "public void setParentContainerType(IPartitionType type)\n\t{\n\t\tthis.parentContainerType = (PartitionType) type;\n\t}", "private IDataKey(Queue<Part> parts) {\n super(parts);\n }", "public static byte[] readFile(File file, int valueType) {\n if (!file.exists()) {\n Log.e(TAG, \"The file doesn't exist\");\n }\n try {\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n FileInputStream fileInputStream = new FileInputStream(file);\n BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);\n byte[] buf = new byte[4096];\n switch (valueType) {\n case 0:\n case 1:\n case 2:\n case 3:\n while (bufferedInputStream.read(buf) != -1) {\n byteArrayOutputStream.write(buf, 16 * valueType, 16);\n }\n break;\n case 4:\n if (!file.getName().equals(\"E_SK2\")) {\n if (!file.getName().equals(\"E_PIN2\")) {\n while (true) {\n int len = bufferedInputStream.read(buf);\n if (len == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, (len - 32) - (16 * 1));\n }\n }\n } else {\n while (true) {\n int len2 = bufferedInputStream.read(buf);\n if (len2 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, ((len2 - 32) - (16 * 1)) - PKLENGTH);\n }\n }\n }\n } else {\n while (true) {\n int len3 = bufferedInputStream.read(buf);\n if (len3 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 4, (len3 - 32) - (16 * 4));\n }\n }\n }\n case 5:\n while (true) {\n int len4 = bufferedInputStream.read(buf);\n if (len4 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, len4 - 32, 32);\n }\n }\n case PUBLICKEY /* 7 */:\n while (true) {\n int len5 = bufferedInputStream.read(buf);\n if (len5 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, (len5 - 32) - PKLENGTH, PKLENGTH);\n }\n }\n case 8:\n while (true) {\n int len6 = bufferedInputStream.read(buf);\n if (len6 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 0, len6 - 32);\n }\n }\n }\n byte[] buffer = byteArrayOutputStream.toByteArray();\n bufferedInputStream.close();\n fileInputStream.close();\n byteArrayOutputStream.close();\n return buffer;\n } catch (IOException e) {\n Log.e(TAG, \"read file exception!\" + e.getMessage());\n return new byte[0];\n }\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public byte [] getKos()\n {\n return kosBytes;\n }", "private <T> Pair<KademliaNode, Boolean> storeGRPC(KademliaNode node, byte[] key, T info) {\n\n StoreRequest.Builder request = StoreRequest.newBuilder()\n .setNode(KademliaUtils.KademliaNodeToKademliaNodeProto(bucketManager.getMyNode()))\n .setKey(ByteString.copyFrom(key));\n\n\n if(info.getClass() == Transaction.class) {\n request.setTransaction(KademliaUtils.TransactionToTransactionProto((Transaction) info));\n }\n else if(info.getClass() == Block.class) {\n request.setBlock(KademliaUtils.BlockToBlockProto((Block) info));\n }\n else if(info.getClass() == Auction.class) {\n request.setAuction(KademliaUtils.AuctionToAuctionProto((Auction) info));\n }\n else if(info.getClass() == Bid.class) {\n request.setBid(KademliaUtils.BidToBidProto((Bid) info));\n }\n else {\n logger.log(Level.SEVERE, \"Error: store value type not valid - \" + info.getClass());\n return new Pair(null, false);\n }\n\n ManagedChannel channel = ManagedChannelBuilder.forTarget(node.getIpAddress() + \":\" + node.getPort()).usePlaintext().build();\n AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel);\n// AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel).withDeadlineAfter(KademliaUtils.networkTimeoutMsecs, TimeUnit.MILLISECONDS);\n\n StoreResponse response;\n\n try {\n response = blockingStub.store(request .build());\n } catch (StatusRuntimeException e) {\n// logger.log(Level.WARNING, \"STORE RPC failed for \" + node.getIpAddress() + \":\" + node.getPort() + \" - \" + e.getStatus());\n logger.log(Level.WARNING, \"STORE RPC failed for \" + node);\n closeChannel(channel);\n return new Pair(null, false);\n }\n\n\n KademliaNode nodeInResponse = KademliaUtils.KademliaNodeProtoToKademliaNode(response.getNode());\n\n if (!Arrays.equals(node.getNodeID(), nodeInResponse.getNodeID())) {\n logger.log(Level.WARNING, \"Response returned with different nodeID\");\n closeChannel(channel);\n return new Pair(nodeInResponse, false);\n }\n\n closeChannel(channel);\n\n// logger.log(Level.INFO, \"Successfully sent STORE RPC to \" + node + \" for key \" + Utils.bytesToHexString(key));\n return new Pair(nodeInResponse, response.getSuccess());\n }", "public interface PacketFormatKeyContext {\n\n}", "public int send(Object key, Packet p) throws IOException {\n if (p instanceof NIOPacket) {\n NIOPacket n = (NIOPacket) p;\n return send(key, n.getBuffer());\n } else {\n if (T.t) {\n T.warn(\"This has not been tested\");\n }\n int len = p.getAvailable();\n p.readArray(byteArray, 0, len);\n return send(key, byteArray, 0, len);\n }\n }", "public abstract PartitionType getType();", "public String getBKP(final byte[] pkp) throws DataSigningException {\n final byte[] bytes = sha1(pkp);\n final String base16 = StringUtils.leftPad(toBase16(bytes), 40, '0');\n final String[] blocks = StringUtils.splitBlocks(base16, 8);\n final StringJoiner stringJoiner = new StringJoiner(\"-\");\n for(final String block : blocks) {\n stringJoiner.add(block);\n }\n return stringJoiner.toString().toUpperCase();\n }", "public void setPkCacheSize(int pkCacheSize) {\n }", "public ECP getPublicEphemeralKey(){return epk;}", "protected byte[] getBathWaterVolumeSetting2() {return null;}", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "byte[] get_node_secret();", "public static KubevirtNode buildKubevirtNode(Node node) {\n String hostname = node.getMetadata().getName();\n IpAddress managementIp = null;\n IpAddress dataIp = null;\n\n for (NodeAddress nodeAddress:node.getStatus().getAddresses()) {\n if (nodeAddress.getType().equals(INTERNAL_IP)) {\n managementIp = IpAddress.valueOf(nodeAddress.getAddress());\n dataIp = IpAddress.valueOf(nodeAddress.getAddress());\n }\n }\n\n Set<String> rolesFull = node.getMetadata().getLabels().keySet().stream()\n .filter(l -> l.contains(K8S_ROLE))\n .collect(Collectors.toSet());\n\n KubevirtNode.Type nodeType = WORKER;\n\n for (String roleStr : rolesFull) {\n String role = roleStr.split(\"/\")[1];\n if (MASTER.name().equalsIgnoreCase(role)) {\n nodeType = MASTER;\n break;\n }\n }\n\n // start to parse kubernetes annotation\n Map<String, String> annots = node.getMetadata().getAnnotations();\n String physnetConfig = annots.get(PHYSNET_CONFIG_KEY);\n String gatewayConfig = annots.get(GATEWAY_CONFIG_KEY);\n String dataIpStr = annots.get(DATA_IP_KEY);\n Set<KubevirtPhyInterface> phys = new HashSet<>();\n String gatewayBridgeName = null;\n try {\n if (physnetConfig != null) {\n JsonArray configJson = JsonArray.readFrom(physnetConfig);\n\n for (int i = 0; i < configJson.size(); i++) {\n JsonObject object = configJson.get(i).asObject();\n String network = object.get(NETWORK_KEY).asString();\n String intf = object.get(INTERFACE_KEY).asString();\n\n if (network != null && intf != null) {\n String physBridgeId;\n if (object.get(PHYS_BRIDGE_ID) != null) {\n physBridgeId = object.get(PHYS_BRIDGE_ID).asString();\n } else {\n physBridgeId = genDpidFromName(network + intf + hostname);\n log.trace(\"host {} physnet dpid for network {} intf {} is null so generate dpid {}\",\n hostname, network, intf, physBridgeId);\n }\n\n phys.add(DefaultKubevirtPhyInterface.builder()\n .network(network)\n .intf(intf)\n .physBridge(DeviceId.deviceId(physBridgeId))\n .build());\n }\n }\n }\n\n if (dataIpStr != null) {\n dataIp = IpAddress.valueOf(dataIpStr);\n }\n\n if (gatewayConfig != null) {\n JsonNode jsonNode = new ObjectMapper().readTree(gatewayConfig);\n\n nodeType = GATEWAY;\n gatewayBridgeName = jsonNode.get(GATEWAY_BRIDGE_NAME).asText();\n }\n } catch (JsonProcessingException e) {\n log.error(\"Failed to parse physnet config or gateway config object\", e);\n }\n\n // if the node is taint with kubevirt.io key configured,\n // we mark this node as OTHER type, and do not add it into the cluster\n NodeSpec spec = node.getSpec();\n if (spec.getTaints() != null) {\n for (Taint taint : spec.getTaints()) {\n String effect = taint.getEffect();\n String key = taint.getKey();\n String value = taint.getValue();\n\n if (StringUtils.equals(effect, NO_SCHEDULE_EFFECT) &&\n StringUtils.equals(key, KUBEVIRT_IO_KEY) &&\n StringUtils.equals(value, DRAINING_VALUE)) {\n nodeType = OTHER;\n }\n }\n }\n\n return DefaultKubevirtNode.builder()\n .hostname(hostname)\n .managementIp(managementIp)\n .dataIp(dataIp)\n .type(nodeType)\n .state(KubevirtNodeState.ON_BOARDED)\n .phyIntfs(phys)\n .gatewayBridgeName(gatewayBridgeName)\n .build();\n }", "public int getByteSizeBasedOnDataType(String dataType)\n\t{\n\t\tif (dataType.equals(\"String\"))\n\t\t\treturn charInBytes;\n\t\treturn intInBytes;\n\t}", "private DataKeys(String pKey) {\n key = pKey;\n }", "com.google.protobuf.ByteString\n getHowToUseBytes();", "com.google.protobuf.ByteString\n getHowToUseBytes();", "public static void main(String[] args) {\n Pair<String, Integer> pair = new Pair<String, Integer>(\"testeString\", 12);\n System.out.println(pair.getTipo1());\n System.out.println(pair.getTipo2());\n pair.setTipo1(\"TESTEAGAIN\");\n System.out.println(pair.getTipo1());\n\n }", "String getProcessingInstructionData(Object pi);", "public String getType() {\r\n return \"Block Data Long\";\r\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "private static String nodeKey(Player player, TYPE type) {\n return \"{playerId:\" + player.getId() + \", teamId:\" + player.getTeamId() + \", gameId:\" + player.getGameId() + \", type:\\\"\" + type.toString() + \"\\\"}\";\n }", "protected byte[] getBathWaterVolumeSetting1() {return null;}", "public PlugwiseMQTTDeviceInfo()\n\t{\n\t\t// initialize internal variables\n\t\tthis.macAddress = \"\";\n\t\tthis.type = \"circle\";\n\t}", "public interface KudoClient {\n MixedOperation<Operator, OperatorList, DoneableOperator, Resource<Operator, DoneableOperator>> operators();\n\n MixedOperation<Instance, InstanceList, DoneableInstance, Resource<Instance, DoneableInstance>> instances();\n\n MixedOperation<OperatorVersion, OperatorVersionList, DoneableOperatorVersion, Resource<OperatorVersion, DoneableOperatorVersion>> operatorVersion();\n\n void close();\n}", "ByteBuffer getApplicationData();", "public interface JobMemcachedKeys {\n String JOB_DETAIL = \"JOB_DETAIL_\";\n String JOB_STATUS = \"JOB_STATUS_\";\n}", "public interface C0003a {\n public static final String ah = \"image_manager_disk_cache\";\n public static final int hP = 262144000;\n\n @Nullable\n a bz();\n }", "short getPQ( byte[] buffer, short offset );", "public ClientPacket(PacketType type, byte[] data){\r\n\t\tthis.type = type;\r\n\t\tthis.dataSize = data.length;\r\n\t\tthis.data = data;\r\n\t}", "private void ipcSend(JSONObject data) {\n JSONObject json = data;\n try {\n json.put(IPC_MESSAGE_APPID, mAppId);\n\n if (mIpcChannel != null) {\n log.e(\"ipcSend:[\" + json.toString() + \"]\");\n\n mIpcChannel.send(json.toString());\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void setOpckeytype(java.lang.Long value) {\n\t\tsetValue(test.generated.pg_catalog.tables.PgOpclass.PG_OPCLASS.OPCKEYTYPE, value);\n\t}", "private String createKey(OwObject object_p, OwPluginEntry pluginEntry_p) throws Exception\r\n {\r\n String objectId = object_p.getDMSID();\r\n String key = objectId + \"_\" + pluginEntry_p.getIndex();\r\n return key;\r\n }", "public void setAvailableExtraData(List<String> extraDataKeys) {\n/* 502 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public int getCapacity( Resource.Type type );", "public TableValue(short type) {\n\tkey = null; // No name by default.\n\tstorageType = type; // Type of data. \n\tattrs = null; // No attributes yet.\n\tflags = -1; // No flags yet. \n\n\t// Create a generic, default vector clock. \n\tvclock = new VectorClock(\"s\".getBytes(), 0);\n }", "void setP( byte[] buffer, short offset, short length) throws CryptoException;", "private void uniPerfGetConfig(Parcel data, Parcel reply) {\n int tagsSize = data.readInt();\n if (tagsSize <= 0 || tagsSize >= 128) {\n AwareLog.e(TAG, \"uniPerfGetConfig tags size invalid.\");\n return;\n }\n int[] tags = new int[tagsSize];\n for (int i = 0; i < tagsSize; i++) {\n tags[i] = data.readInt();\n }\n int[] values = new int[tagsSize];\n reply.writeInt(UniPerf.getInstance().uniPerfGetConfig(tags, values));\n for (int value : values) {\n reply.writeInt(value);\n }\n }", "void setQ( byte[] buffer, short offset, short length) throws CryptoException;", "public void setProcessType(String currentProcess) {\n this.currentProcess=currentProcess;\n if(currentProcess.startsWith(\"ENCRYPTION\")) {\n processCaption=\"Encrypting\";\n }\n else {\n processCaption=\"Decrypting\";\n } \n }", "public MessageClackData(String userName, String message, String key, int type) {\n super(userName, type);\n this.message = encrypt(message, key);\n }", "PNMMetadata(ImageTypeSpecifier imageType, ImageWriteParam param) {\n/* 145 */ this();\n/* 146 */ initialize(imageType, param);\n/* */ }", "@Override\n\tpublic Map<String, String> modifyInstanceChargeType(\n\t\t\tMap<String, String> paramsMap, Map<String, String> defaultParamsMap,String requestId) throws Exception {\n\t\tMap<String, String> resultMap = new HashMap<String, String>();\n\t\tif(null==requestId || requestId.length()<1) {\n\t\t\tlogger.info(\"RequestId is null or is error!\");\n\t\t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"The request processing has failed due to some unknown error.\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_INTERNAL_SERVER_ERROR+\"\");\n\t\t\treturn resultMap;\n\t\t}\n\t\tString appKeyId = paramsMap.get(Constants.APPKEY_ID);\n\t\tVmUser vmuser = vmUserProxy.getByAppKeyId(appKeyId);\n\t\tString uuid = paramsMap.get(Constants.INSTANCE_ID);\n\t\tVmInstance instance = vmInstanceProxy.getByUuid(uuid, false, true, false, true, true, true, false, false);\n\t\tInteger userId = vmuser.getUserId();\n\t\tInteger clusterid = instance.getCluster().getId();\n\t\tInteger cpuNum = instance.getVmInstanceType().getVcpus();\n\t\tInteger memNum = instance.getVmInstanceType().getMemoryMb();\n\t\tInteger bandNum = -1;\n\t\tInteger hdNum = instance.getVmInstanceType().getLocalGb();\n\t\tList<VmInstanceMetadata> bandNumlist = instance.getVmInstanceMetadatas();\n\t\tfor(VmInstanceMetadata md : bandNumlist) {\n\t\t\tif(md.getKey().equals(Constants.PUBLIC_BANDWIDTH)) {\n\t\t\t\tbandNum = Integer.valueOf(md.getValue());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(-1 == bandNum)\n\t\t{\n\t\t\tlogger.info(\"带宽获取失败!\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"This instance do not have band\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n\t\t}\n\t\tString instanceChargeType;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_TYPE))\n\t\t\tinstanceChargeType = defaultParamsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\telse\n\t\t\tinstanceChargeType = paramsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\tString instanceChargeLength;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH))\n\t\t\tinstanceChargeLength = defaultParamsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\telse\n\t\t\tinstanceChargeLength = paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\tInteger paymentType = convertToPaymentType(instanceChargeType);\n\t\tDouble count = Double.valueOf(instanceChargeLength);\n\t\tint times = 0;\n\t\tString type = new VmHdEndtimeManager().getVmEndtimeByUuid(uuid).getType().toLowerCase();\n\t\tString PTYPE = Constants.INSTANCE_TYPE;\n\t\t\n\t\t\n logger.info(\"clusterid: \" + clusterid + \"cpu: \" + cpuNum + \" ,mem: \" + memNum + \" ,hd: \" + hdNum + \" ,band: \" + bandNum);\n \n //计算时间,算各种份数,然后扣费,设每个月份定为30天,每年定为360天\n //计算旧计费规则的份数\n VmHdEndtimeManager vmHdEndtimeManager = new VmHdEndtimeManager();\n VmHdEndtime vm = vmHdEndtimeManager.getVmEndtimeByUuid(uuid);\n\t\tTimestamp currentTime = new Timestamp(System.currentTimeMillis());\n\t\tSimpleDateFormat timeformat = new SimpleDateFormat(\"yyyy-MM-dd,HH:mm:ss\");\n\t long t1 = 0L;\n\t long t2 = 0L;\n \n Timestamp endTime = new Timestamp(vm.getEndTime().getTime());\n t1 = timeformat.parse(getTimeStampNumberFormat(endTime)).getTime();\n t2 = timeformat.parse(getTimeStampNumberFormat(currentTime)).getTime();\n //账号余额\n HashMap<String, String> params = new HashMap<String, String>();\n\t\tparams.put(\"uid\", String.valueOf(userId));\n\t\tparams.put(\"source\", com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n\t\tInteger balance = BillingAPI.balance(userId ,null, AccountUtil.getSignature(params, com.appcloud.vm.fe.common.Constants.CLIENT_SECRET_KEY),com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n //本次应付款金额\n Integer payamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, paymentType, count);\n if (t1 - t2 >= 0) {//不过期才对其退费\n \tInteger oldPaymentType = vmHdEndtimeManager.convertToPaymentType(vm.getPayType());\n \tdouble oldCount = 1.00000;\n \tif(oldPaymentType == 1){\n \t\toldCount = (t1 - t2) / (Constants.yearDays*24*3600*1000.0);\n \t}else if(oldPaymentType == 2){\n \t\toldCount = (t1 - t2) / (Constants.monthDays*24*3600*1000.0); \n \t}else if(oldPaymentType == 3){\n \t\toldCount = (t1 - t2) / (24*3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除3600000得出小时\n \t}else if(oldPaymentType == 4){\n \t\toldCount = (t1 - t2) / (3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除1000得出秒\n \t}\n \tlogger.info(\"oldCount:\"+oldCount);\n \t//计算手续费的份数\n \tdouble chargecount = 1.0;\n \t//先判断余额是否充足,再进行扣费等操作\n \tInteger reamount = 0;\n \tInteger chargeamount = 0;\n \treamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, oldPaymentType, oldCount);\n \tchargeamount = BillingAPI.getPrice(\"charge\", clusterid, -1, -1, -1, -1, userId, oldPaymentType, chargecount);\n \tlogger.info(balance);\n \tlogger.info(payamount);\n \tlogger.info(reamount);\n \tlogger.info(chargeamount);\n \tif(balance < (payamount - reamount + chargeamount)){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t\n \t//根据旧的计费规则退费\n \tString PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum +\"G硬盘和\" + bandNum + \n \t\t\t\"M带宽,未到期,退费\";\n \tlogger.debug(\"PID = \" + PID);\n \tString item = \"\";\n \tif(type.equalsIgnoreCase(\"vm\")){\n \t\titem = \"CPU/内存/硬盘/带宽\";\n \t}else if(type.equalsIgnoreCase(\"instancetype\")){\n \t\tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n \t\titem = rate.getName();\n \t}\n \tlogger.debug(\"item = \" + item);\n \tString message = \"\";\n \tString payment_type = new VmHdEndtimeManager().convertToType(oldPaymentType);\n \tmessage = BillingAPI.pay(RECID, userId, item, payment_type, times, oldCount, PTYPE, PID, reamount, null);\n \tif(!message.equalsIgnoreCase(\"success\")){\n \t\tlogger.info(\"payment fail\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap; //退费不成功\n \t} \n \t //收取手续费\n item = \"手续费\";\n PID=\"修改付费规则的手续费\";\n payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, chargecount, PTYPE, PID, chargeamount, null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n } else {\n \tif(balance < payamount){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t}\n \n //查询余额,扣费\n logger.info(\"start payment!\");\n String PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum + \"G硬盘和\" + bandNum + \"M带宽\";\n logger.debug(\"PID = \" + PID);\n String item = \"\";\n String message = \"\";\n logger.info(\"type = \" + type);\n if(type.equalsIgnoreCase(\"vm\")){\n \titem = \"CPU/内存/硬盘/带宽\";\n logger.debug(\"item = \" + item);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n \tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n\t\t\titem = rate.getName();\n }\n String payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, count, PTYPE, PID, payamount,null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n resultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n \n //修改虚拟机到期时间以及付费类型\n logger.info(\"start modify endtime!\");\n if(type.equalsIgnoreCase(\"vm\")){\n logger.info(\"vm\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \" tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_VM);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_VM, paymentType, count);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n logger.info(\"instancetype\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \"tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_INSTANCETYPE);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_INSTANCETYPE, paymentType, count);\n }\n resultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_OK);\n return resultMap;\n\t}", "private void parseCommandPut(DataInputStream in) throws IOException {\n int ksize = in.readInt();\n int vsize = in.readInt();\n byte[] key = new byte[ksize];\n in.read(key);\n byte[] value = new byte[vsize];\n in.read(value);\n // int err = \n in.readUnsignedByte(); // unused\n elements = new LinkedHashMap<String, String>(1);\n elements.put(new String(key), new String(value));\n if (LOG.isDebugEnabled()) LOG.debug(\"parseCommandPut: elements -> \" + elements);\n }" ]
[ "0.74609065", "0.72702616", "0.7188906", "0.68515867", "0.6624186", "0.65576494", "0.6447282", "0.6300339", "0.62993044", "0.6214387", "0.6163452", "0.60877526", "0.6003346", "0.5976778", "0.5938548", "0.59072435", "0.57994956", "0.5727161", "0.57116103", "0.5686058", "0.5584766", "0.55599767", "0.49216807", "0.47093555", "0.46954027", "0.46736592", "0.46566015", "0.46395743", "0.4619744", "0.46090588", "0.45961025", "0.45867506", "0.45867506", "0.4572135", "0.45664158", "0.4551403", "0.4537767", "0.45178577", "0.4517383", "0.4514775", "0.45038578", "0.44908682", "0.4472411", "0.44683048", "0.44683048", "0.44617105", "0.44367328", "0.44311747", "0.4430882", "0.44296244", "0.44141042", "0.4411593", "0.4408321", "0.44020844", "0.43990982", "0.43889695", "0.43869603", "0.43864048", "0.43717378", "0.4364568", "0.43434846", "0.43381876", "0.4328569", "0.431848", "0.431848", "0.431848", "0.431848", "0.43157503", "0.43153298", "0.43080008", "0.43079925", "0.4307515", "0.4307515", "0.43064898", "0.43032137", "0.42942187", "0.42856467", "0.42779836", "0.42730728", "0.42689502", "0.42660895", "0.42593196", "0.4255383", "0.4253359", "0.42450884", "0.42404717", "0.42379627", "0.42292163", "0.42238173", "0.42210498", "0.42171282", "0.421253", "0.42108163", "0.42089555", "0.41871208", "0.41820946", "0.4181567", "0.41791067", "0.41725397", "0.417151" ]
0.52510893
22
depends on pki_type optional bytes pki_data = 3;
@java.lang.Override public com.google.protobuf.ByteString getPkiData() { return instance.getPkiData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "java.lang.String getPkiType();", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "boolean hasPkiType();", "boolean hasPkiData();", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "public Builder setPkiData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiData(value);\n return this;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "@java.lang.Override\n public boolean hasPkiData() {\n return ((bitField0_ & 0x00000004) != 0);\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "@java.lang.Override\n public boolean hasPkiData() {\n return instance.hasPkiData();\n }", "void setPQ( byte[] buffer, short offset, short length) throws CryptoException;", "public byte[] getPKP(final TrzbaDataType data) throws DataSigningException {\n return this.clientKey.sign(serializeData(data));\n }", "@Override\r\n protected String getPrymaryType(Integer key) {\r\n return NodeTypes.SECTOR.getId();\r\n }", "com.hps.july.persistence.WorkerKey getTechStuffKey() throws java.rmi.RemoteException;", "public String reqsetpkt(byte []p,byte[] id,byte[] T,byte[] ip,byte[] no)\r\n\t{\n\t\treturn \"hi\";\r\n\t}", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "void privateSetTechStuffKey(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException;", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "public Builder clearPkiData() {\n copyOnWrite();\n instance.clearPkiData();\n return this;\n }", "protected byte[] getBathWaterVolumeSetting3() {return null;}", "public interface ICloudRequest {\n \n public int getOp();\n public void incrementRetries();\n public void resetRetries();\n public int getRetries();\n \n /**\n * Retrieve the data unit associated with this request\n * @return {@link DepSkyDataUnit}\n */\n public DepSkyDataUnit getDataUnit();\n \n /**\n * Determine when this procedure started originally\n * @return long - start time of this procedure\n */\n public long getStartTime();\n \n /**\n * Determine the sequence of this request\n * @return long\n */\n public long getSequenceNumber();\n \n /**\n * Get the data resulting from this request\n * @return byte[] consisting of the data\n */\n public byte[] getData();\n \n \n}", "public static Object PQinit(Object... arg) {\nUNSUPPORTED(\"c01vxogao855zs8fe94tpim9g\"); // void\nUNSUPPORTED(\"3p0cdanvp4f13d8omi42lvjl1\"); // PQinit(void)\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\nUNSUPPORTED(\"akljrpu8bej9lq4rmsktz8u2e\"); // PQcnt = 0;\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\n\nthrow new UnsupportedOperationException();\n}", "@Override\n\tpublic void put(String key, String cat, byte[] data) throws RemoteException {\n\t\t\n\t}", "com.zzsong.netty.protobuff.two.ProtoData.MyDataInfo.DataType getDataType();", "public static void setKPIsInCache(Map<String,String> dataMap){ \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tmemcache.delete(ALL_KPI_KEY);\n \t}\n \tmemcache.put(ALL_KPI_KEY, dataMap);\n\t}", "@Override //Client\n public void prepareAMServiceData(ClusterDescription clusterSpec,\n Map<String, ByteBuffer> serviceData) {\n \n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "Key[] getPq();", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public byte getType() {\n return TYPE_DATA;\n }", "KijiDataRequest getClientRequest();", "public static Map<String,String> getKPIsFromCache(){\n\t\tMap<String,String> dataMap=null;\n \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tdataMap=(Map<String,String>) memcache.get(ALL_KPI_KEY);\n \t\tlog.info(\"Memcache getKPIsFromCache size = \"+dataMap.size());\n \t} \t\n \treturn dataMap;\n\t}", "public void setPartProducedKey(long value) {\n\t\tthis.partProducedKey = value;\n\t}", "public void setStorageType(short type) {\n\tstorageType = type;\n }", "public void setParentContainerType(IPartitionType type)\n\t{\n\t\tthis.parentContainerType = (PartitionType) type;\n\t}", "private IDataKey(Queue<Part> parts) {\n super(parts);\n }", "public static byte[] readFile(File file, int valueType) {\n if (!file.exists()) {\n Log.e(TAG, \"The file doesn't exist\");\n }\n try {\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n FileInputStream fileInputStream = new FileInputStream(file);\n BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);\n byte[] buf = new byte[4096];\n switch (valueType) {\n case 0:\n case 1:\n case 2:\n case 3:\n while (bufferedInputStream.read(buf) != -1) {\n byteArrayOutputStream.write(buf, 16 * valueType, 16);\n }\n break;\n case 4:\n if (!file.getName().equals(\"E_SK2\")) {\n if (!file.getName().equals(\"E_PIN2\")) {\n while (true) {\n int len = bufferedInputStream.read(buf);\n if (len == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, (len - 32) - (16 * 1));\n }\n }\n } else {\n while (true) {\n int len2 = bufferedInputStream.read(buf);\n if (len2 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, ((len2 - 32) - (16 * 1)) - PKLENGTH);\n }\n }\n }\n } else {\n while (true) {\n int len3 = bufferedInputStream.read(buf);\n if (len3 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 4, (len3 - 32) - (16 * 4));\n }\n }\n }\n case 5:\n while (true) {\n int len4 = bufferedInputStream.read(buf);\n if (len4 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, len4 - 32, 32);\n }\n }\n case PUBLICKEY /* 7 */:\n while (true) {\n int len5 = bufferedInputStream.read(buf);\n if (len5 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, (len5 - 32) - PKLENGTH, PKLENGTH);\n }\n }\n case 8:\n while (true) {\n int len6 = bufferedInputStream.read(buf);\n if (len6 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 0, len6 - 32);\n }\n }\n }\n byte[] buffer = byteArrayOutputStream.toByteArray();\n bufferedInputStream.close();\n fileInputStream.close();\n byteArrayOutputStream.close();\n return buffer;\n } catch (IOException e) {\n Log.e(TAG, \"read file exception!\" + e.getMessage());\n return new byte[0];\n }\n }", "public byte [] getKos()\n {\n return kosBytes;\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "private <T> Pair<KademliaNode, Boolean> storeGRPC(KademliaNode node, byte[] key, T info) {\n\n StoreRequest.Builder request = StoreRequest.newBuilder()\n .setNode(KademliaUtils.KademliaNodeToKademliaNodeProto(bucketManager.getMyNode()))\n .setKey(ByteString.copyFrom(key));\n\n\n if(info.getClass() == Transaction.class) {\n request.setTransaction(KademliaUtils.TransactionToTransactionProto((Transaction) info));\n }\n else if(info.getClass() == Block.class) {\n request.setBlock(KademliaUtils.BlockToBlockProto((Block) info));\n }\n else if(info.getClass() == Auction.class) {\n request.setAuction(KademliaUtils.AuctionToAuctionProto((Auction) info));\n }\n else if(info.getClass() == Bid.class) {\n request.setBid(KademliaUtils.BidToBidProto((Bid) info));\n }\n else {\n logger.log(Level.SEVERE, \"Error: store value type not valid - \" + info.getClass());\n return new Pair(null, false);\n }\n\n ManagedChannel channel = ManagedChannelBuilder.forTarget(node.getIpAddress() + \":\" + node.getPort()).usePlaintext().build();\n AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel);\n// AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel).withDeadlineAfter(KademliaUtils.networkTimeoutMsecs, TimeUnit.MILLISECONDS);\n\n StoreResponse response;\n\n try {\n response = blockingStub.store(request .build());\n } catch (StatusRuntimeException e) {\n// logger.log(Level.WARNING, \"STORE RPC failed for \" + node.getIpAddress() + \":\" + node.getPort() + \" - \" + e.getStatus());\n logger.log(Level.WARNING, \"STORE RPC failed for \" + node);\n closeChannel(channel);\n return new Pair(null, false);\n }\n\n\n KademliaNode nodeInResponse = KademliaUtils.KademliaNodeProtoToKademliaNode(response.getNode());\n\n if (!Arrays.equals(node.getNodeID(), nodeInResponse.getNodeID())) {\n logger.log(Level.WARNING, \"Response returned with different nodeID\");\n closeChannel(channel);\n return new Pair(nodeInResponse, false);\n }\n\n closeChannel(channel);\n\n// logger.log(Level.INFO, \"Successfully sent STORE RPC to \" + node + \" for key \" + Utils.bytesToHexString(key));\n return new Pair(nodeInResponse, response.getSuccess());\n }", "public interface PacketFormatKeyContext {\n\n}", "public int send(Object key, Packet p) throws IOException {\n if (p instanceof NIOPacket) {\n NIOPacket n = (NIOPacket) p;\n return send(key, n.getBuffer());\n } else {\n if (T.t) {\n T.warn(\"This has not been tested\");\n }\n int len = p.getAvailable();\n p.readArray(byteArray, 0, len);\n return send(key, byteArray, 0, len);\n }\n }", "public abstract PartitionType getType();", "public String getBKP(final byte[] pkp) throws DataSigningException {\n final byte[] bytes = sha1(pkp);\n final String base16 = StringUtils.leftPad(toBase16(bytes), 40, '0');\n final String[] blocks = StringUtils.splitBlocks(base16, 8);\n final StringJoiner stringJoiner = new StringJoiner(\"-\");\n for(final String block : blocks) {\n stringJoiner.add(block);\n }\n return stringJoiner.toString().toUpperCase();\n }", "public void setPkCacheSize(int pkCacheSize) {\n }", "public ECP getPublicEphemeralKey(){return epk;}", "protected byte[] getBathWaterVolumeSetting2() {return null;}", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "public static KubevirtNode buildKubevirtNode(Node node) {\n String hostname = node.getMetadata().getName();\n IpAddress managementIp = null;\n IpAddress dataIp = null;\n\n for (NodeAddress nodeAddress:node.getStatus().getAddresses()) {\n if (nodeAddress.getType().equals(INTERNAL_IP)) {\n managementIp = IpAddress.valueOf(nodeAddress.getAddress());\n dataIp = IpAddress.valueOf(nodeAddress.getAddress());\n }\n }\n\n Set<String> rolesFull = node.getMetadata().getLabels().keySet().stream()\n .filter(l -> l.contains(K8S_ROLE))\n .collect(Collectors.toSet());\n\n KubevirtNode.Type nodeType = WORKER;\n\n for (String roleStr : rolesFull) {\n String role = roleStr.split(\"/\")[1];\n if (MASTER.name().equalsIgnoreCase(role)) {\n nodeType = MASTER;\n break;\n }\n }\n\n // start to parse kubernetes annotation\n Map<String, String> annots = node.getMetadata().getAnnotations();\n String physnetConfig = annots.get(PHYSNET_CONFIG_KEY);\n String gatewayConfig = annots.get(GATEWAY_CONFIG_KEY);\n String dataIpStr = annots.get(DATA_IP_KEY);\n Set<KubevirtPhyInterface> phys = new HashSet<>();\n String gatewayBridgeName = null;\n try {\n if (physnetConfig != null) {\n JsonArray configJson = JsonArray.readFrom(physnetConfig);\n\n for (int i = 0; i < configJson.size(); i++) {\n JsonObject object = configJson.get(i).asObject();\n String network = object.get(NETWORK_KEY).asString();\n String intf = object.get(INTERFACE_KEY).asString();\n\n if (network != null && intf != null) {\n String physBridgeId;\n if (object.get(PHYS_BRIDGE_ID) != null) {\n physBridgeId = object.get(PHYS_BRIDGE_ID).asString();\n } else {\n physBridgeId = genDpidFromName(network + intf + hostname);\n log.trace(\"host {} physnet dpid for network {} intf {} is null so generate dpid {}\",\n hostname, network, intf, physBridgeId);\n }\n\n phys.add(DefaultKubevirtPhyInterface.builder()\n .network(network)\n .intf(intf)\n .physBridge(DeviceId.deviceId(physBridgeId))\n .build());\n }\n }\n }\n\n if (dataIpStr != null) {\n dataIp = IpAddress.valueOf(dataIpStr);\n }\n\n if (gatewayConfig != null) {\n JsonNode jsonNode = new ObjectMapper().readTree(gatewayConfig);\n\n nodeType = GATEWAY;\n gatewayBridgeName = jsonNode.get(GATEWAY_BRIDGE_NAME).asText();\n }\n } catch (JsonProcessingException e) {\n log.error(\"Failed to parse physnet config or gateway config object\", e);\n }\n\n // if the node is taint with kubevirt.io key configured,\n // we mark this node as OTHER type, and do not add it into the cluster\n NodeSpec spec = node.getSpec();\n if (spec.getTaints() != null) {\n for (Taint taint : spec.getTaints()) {\n String effect = taint.getEffect();\n String key = taint.getKey();\n String value = taint.getValue();\n\n if (StringUtils.equals(effect, NO_SCHEDULE_EFFECT) &&\n StringUtils.equals(key, KUBEVIRT_IO_KEY) &&\n StringUtils.equals(value, DRAINING_VALUE)) {\n nodeType = OTHER;\n }\n }\n }\n\n return DefaultKubevirtNode.builder()\n .hostname(hostname)\n .managementIp(managementIp)\n .dataIp(dataIp)\n .type(nodeType)\n .state(KubevirtNodeState.ON_BOARDED)\n .phyIntfs(phys)\n .gatewayBridgeName(gatewayBridgeName)\n .build();\n }", "byte[] get_node_secret();", "public int getByteSizeBasedOnDataType(String dataType)\n\t{\n\t\tif (dataType.equals(\"String\"))\n\t\t\treturn charInBytes;\n\t\treturn intInBytes;\n\t}", "private DataKeys(String pKey) {\n key = pKey;\n }", "com.google.protobuf.ByteString\n getHowToUseBytes();", "com.google.protobuf.ByteString\n getHowToUseBytes();", "public static void main(String[] args) {\n Pair<String, Integer> pair = new Pair<String, Integer>(\"testeString\", 12);\n System.out.println(pair.getTipo1());\n System.out.println(pair.getTipo2());\n pair.setTipo1(\"TESTEAGAIN\");\n System.out.println(pair.getTipo1());\n\n }", "String getProcessingInstructionData(Object pi);", "public String getType() {\r\n return \"Block Data Long\";\r\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "private static String nodeKey(Player player, TYPE type) {\n return \"{playerId:\" + player.getId() + \", teamId:\" + player.getTeamId() + \", gameId:\" + player.getGameId() + \", type:\\\"\" + type.toString() + \"\\\"}\";\n }", "protected byte[] getBathWaterVolumeSetting1() {return null;}", "public PlugwiseMQTTDeviceInfo()\n\t{\n\t\t// initialize internal variables\n\t\tthis.macAddress = \"\";\n\t\tthis.type = \"circle\";\n\t}", "public interface KudoClient {\n MixedOperation<Operator, OperatorList, DoneableOperator, Resource<Operator, DoneableOperator>> operators();\n\n MixedOperation<Instance, InstanceList, DoneableInstance, Resource<Instance, DoneableInstance>> instances();\n\n MixedOperation<OperatorVersion, OperatorVersionList, DoneableOperatorVersion, Resource<OperatorVersion, DoneableOperatorVersion>> operatorVersion();\n\n void close();\n}", "ByteBuffer getApplicationData();", "public interface JobMemcachedKeys {\n String JOB_DETAIL = \"JOB_DETAIL_\";\n String JOB_STATUS = \"JOB_STATUS_\";\n}", "public interface C0003a {\n public static final String ah = \"image_manager_disk_cache\";\n public static final int hP = 262144000;\n\n @Nullable\n a bz();\n }", "short getPQ( byte[] buffer, short offset );", "public ClientPacket(PacketType type, byte[] data){\r\n\t\tthis.type = type;\r\n\t\tthis.dataSize = data.length;\r\n\t\tthis.data = data;\r\n\t}", "private void ipcSend(JSONObject data) {\n JSONObject json = data;\n try {\n json.put(IPC_MESSAGE_APPID, mAppId);\n\n if (mIpcChannel != null) {\n log.e(\"ipcSend:[\" + json.toString() + \"]\");\n\n mIpcChannel.send(json.toString());\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void setOpckeytype(java.lang.Long value) {\n\t\tsetValue(test.generated.pg_catalog.tables.PgOpclass.PG_OPCLASS.OPCKEYTYPE, value);\n\t}", "private String createKey(OwObject object_p, OwPluginEntry pluginEntry_p) throws Exception\r\n {\r\n String objectId = object_p.getDMSID();\r\n String key = objectId + \"_\" + pluginEntry_p.getIndex();\r\n return key;\r\n }", "public void setAvailableExtraData(List<String> extraDataKeys) {\n/* 502 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public int getCapacity( Resource.Type type );", "public TableValue(short type) {\n\tkey = null; // No name by default.\n\tstorageType = type; // Type of data. \n\tattrs = null; // No attributes yet.\n\tflags = -1; // No flags yet. \n\n\t// Create a generic, default vector clock. \n\tvclock = new VectorClock(\"s\".getBytes(), 0);\n }", "private void uniPerfGetConfig(Parcel data, Parcel reply) {\n int tagsSize = data.readInt();\n if (tagsSize <= 0 || tagsSize >= 128) {\n AwareLog.e(TAG, \"uniPerfGetConfig tags size invalid.\");\n return;\n }\n int[] tags = new int[tagsSize];\n for (int i = 0; i < tagsSize; i++) {\n tags[i] = data.readInt();\n }\n int[] values = new int[tagsSize];\n reply.writeInt(UniPerf.getInstance().uniPerfGetConfig(tags, values));\n for (int value : values) {\n reply.writeInt(value);\n }\n }", "void setP( byte[] buffer, short offset, short length) throws CryptoException;", "void setQ( byte[] buffer, short offset, short length) throws CryptoException;", "public void setProcessType(String currentProcess) {\n this.currentProcess=currentProcess;\n if(currentProcess.startsWith(\"ENCRYPTION\")) {\n processCaption=\"Encrypting\";\n }\n else {\n processCaption=\"Decrypting\";\n } \n }", "public MessageClackData(String userName, String message, String key, int type) {\n super(userName, type);\n this.message = encrypt(message, key);\n }", "PNMMetadata(ImageTypeSpecifier imageType, ImageWriteParam param) {\n/* 145 */ this();\n/* 146 */ initialize(imageType, param);\n/* */ }", "private void parseCommandPut(DataInputStream in) throws IOException {\n int ksize = in.readInt();\n int vsize = in.readInt();\n byte[] key = new byte[ksize];\n in.read(key);\n byte[] value = new byte[vsize];\n in.read(value);\n // int err = \n in.readUnsignedByte(); // unused\n elements = new LinkedHashMap<String, String>(1);\n elements.put(new String(key), new String(value));\n if (LOG.isDebugEnabled()) LOG.debug(\"parseCommandPut: elements -> \" + elements);\n }", "@Override\n\tpublic Map<String, String> modifyInstanceChargeType(\n\t\t\tMap<String, String> paramsMap, Map<String, String> defaultParamsMap,String requestId) throws Exception {\n\t\tMap<String, String> resultMap = new HashMap<String, String>();\n\t\tif(null==requestId || requestId.length()<1) {\n\t\t\tlogger.info(\"RequestId is null or is error!\");\n\t\t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"The request processing has failed due to some unknown error.\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_INTERNAL_SERVER_ERROR+\"\");\n\t\t\treturn resultMap;\n\t\t}\n\t\tString appKeyId = paramsMap.get(Constants.APPKEY_ID);\n\t\tVmUser vmuser = vmUserProxy.getByAppKeyId(appKeyId);\n\t\tString uuid = paramsMap.get(Constants.INSTANCE_ID);\n\t\tVmInstance instance = vmInstanceProxy.getByUuid(uuid, false, true, false, true, true, true, false, false);\n\t\tInteger userId = vmuser.getUserId();\n\t\tInteger clusterid = instance.getCluster().getId();\n\t\tInteger cpuNum = instance.getVmInstanceType().getVcpus();\n\t\tInteger memNum = instance.getVmInstanceType().getMemoryMb();\n\t\tInteger bandNum = -1;\n\t\tInteger hdNum = instance.getVmInstanceType().getLocalGb();\n\t\tList<VmInstanceMetadata> bandNumlist = instance.getVmInstanceMetadatas();\n\t\tfor(VmInstanceMetadata md : bandNumlist) {\n\t\t\tif(md.getKey().equals(Constants.PUBLIC_BANDWIDTH)) {\n\t\t\t\tbandNum = Integer.valueOf(md.getValue());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(-1 == bandNum)\n\t\t{\n\t\t\tlogger.info(\"带宽获取失败!\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"This instance do not have band\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n\t\t}\n\t\tString instanceChargeType;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_TYPE))\n\t\t\tinstanceChargeType = defaultParamsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\telse\n\t\t\tinstanceChargeType = paramsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\tString instanceChargeLength;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH))\n\t\t\tinstanceChargeLength = defaultParamsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\telse\n\t\t\tinstanceChargeLength = paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\tInteger paymentType = convertToPaymentType(instanceChargeType);\n\t\tDouble count = Double.valueOf(instanceChargeLength);\n\t\tint times = 0;\n\t\tString type = new VmHdEndtimeManager().getVmEndtimeByUuid(uuid).getType().toLowerCase();\n\t\tString PTYPE = Constants.INSTANCE_TYPE;\n\t\t\n\t\t\n logger.info(\"clusterid: \" + clusterid + \"cpu: \" + cpuNum + \" ,mem: \" + memNum + \" ,hd: \" + hdNum + \" ,band: \" + bandNum);\n \n //计算时间,算各种份数,然后扣费,设每个月份定为30天,每年定为360天\n //计算旧计费规则的份数\n VmHdEndtimeManager vmHdEndtimeManager = new VmHdEndtimeManager();\n VmHdEndtime vm = vmHdEndtimeManager.getVmEndtimeByUuid(uuid);\n\t\tTimestamp currentTime = new Timestamp(System.currentTimeMillis());\n\t\tSimpleDateFormat timeformat = new SimpleDateFormat(\"yyyy-MM-dd,HH:mm:ss\");\n\t long t1 = 0L;\n\t long t2 = 0L;\n \n Timestamp endTime = new Timestamp(vm.getEndTime().getTime());\n t1 = timeformat.parse(getTimeStampNumberFormat(endTime)).getTime();\n t2 = timeformat.parse(getTimeStampNumberFormat(currentTime)).getTime();\n //账号余额\n HashMap<String, String> params = new HashMap<String, String>();\n\t\tparams.put(\"uid\", String.valueOf(userId));\n\t\tparams.put(\"source\", com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n\t\tInteger balance = BillingAPI.balance(userId ,null, AccountUtil.getSignature(params, com.appcloud.vm.fe.common.Constants.CLIENT_SECRET_KEY),com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n //本次应付款金额\n Integer payamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, paymentType, count);\n if (t1 - t2 >= 0) {//不过期才对其退费\n \tInteger oldPaymentType = vmHdEndtimeManager.convertToPaymentType(vm.getPayType());\n \tdouble oldCount = 1.00000;\n \tif(oldPaymentType == 1){\n \t\toldCount = (t1 - t2) / (Constants.yearDays*24*3600*1000.0);\n \t}else if(oldPaymentType == 2){\n \t\toldCount = (t1 - t2) / (Constants.monthDays*24*3600*1000.0); \n \t}else if(oldPaymentType == 3){\n \t\toldCount = (t1 - t2) / (24*3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除3600000得出小时\n \t}else if(oldPaymentType == 4){\n \t\toldCount = (t1 - t2) / (3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除1000得出秒\n \t}\n \tlogger.info(\"oldCount:\"+oldCount);\n \t//计算手续费的份数\n \tdouble chargecount = 1.0;\n \t//先判断余额是否充足,再进行扣费等操作\n \tInteger reamount = 0;\n \tInteger chargeamount = 0;\n \treamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, oldPaymentType, oldCount);\n \tchargeamount = BillingAPI.getPrice(\"charge\", clusterid, -1, -1, -1, -1, userId, oldPaymentType, chargecount);\n \tlogger.info(balance);\n \tlogger.info(payamount);\n \tlogger.info(reamount);\n \tlogger.info(chargeamount);\n \tif(balance < (payamount - reamount + chargeamount)){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t\n \t//根据旧的计费规则退费\n \tString PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum +\"G硬盘和\" + bandNum + \n \t\t\t\"M带宽,未到期,退费\";\n \tlogger.debug(\"PID = \" + PID);\n \tString item = \"\";\n \tif(type.equalsIgnoreCase(\"vm\")){\n \t\titem = \"CPU/内存/硬盘/带宽\";\n \t}else if(type.equalsIgnoreCase(\"instancetype\")){\n \t\tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n \t\titem = rate.getName();\n \t}\n \tlogger.debug(\"item = \" + item);\n \tString message = \"\";\n \tString payment_type = new VmHdEndtimeManager().convertToType(oldPaymentType);\n \tmessage = BillingAPI.pay(RECID, userId, item, payment_type, times, oldCount, PTYPE, PID, reamount, null);\n \tif(!message.equalsIgnoreCase(\"success\")){\n \t\tlogger.info(\"payment fail\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap; //退费不成功\n \t} \n \t //收取手续费\n item = \"手续费\";\n PID=\"修改付费规则的手续费\";\n payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, chargecount, PTYPE, PID, chargeamount, null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n } else {\n \tif(balance < payamount){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t}\n \n //查询余额,扣费\n logger.info(\"start payment!\");\n String PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum + \"G硬盘和\" + bandNum + \"M带宽\";\n logger.debug(\"PID = \" + PID);\n String item = \"\";\n String message = \"\";\n logger.info(\"type = \" + type);\n if(type.equalsIgnoreCase(\"vm\")){\n \titem = \"CPU/内存/硬盘/带宽\";\n logger.debug(\"item = \" + item);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n \tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n\t\t\titem = rate.getName();\n }\n String payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, count, PTYPE, PID, payamount,null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n resultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n \n //修改虚拟机到期时间以及付费类型\n logger.info(\"start modify endtime!\");\n if(type.equalsIgnoreCase(\"vm\")){\n logger.info(\"vm\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \" tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_VM);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_VM, paymentType, count);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n logger.info(\"instancetype\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \"tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_INSTANCETYPE);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_INSTANCETYPE, paymentType, count);\n }\n resultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_OK);\n return resultMap;\n\t}" ]
[ "0.74614704", "0.7271446", "0.7187013", "0.6850256", "0.6621789", "0.6556366", "0.64460635", "0.63007164", "0.6299884", "0.62162364", "0.61634666", "0.608813", "0.600272", "0.5976003", "0.59405404", "0.57980275", "0.5725797", "0.57124394", "0.5683758", "0.5583458", "0.5559882", "0.52533853", "0.49202198", "0.4709511", "0.46935123", "0.46732992", "0.46562645", "0.46382543", "0.46172744", "0.4606832", "0.45954546", "0.45859295", "0.45859295", "0.45725587", "0.45670766", "0.45511073", "0.45372626", "0.45191044", "0.45187593", "0.4516374", "0.45052835", "0.44903407", "0.44712907", "0.44699317", "0.44699317", "0.4463045", "0.44374177", "0.44312462", "0.44295922", "0.44291282", "0.44117898", "0.44114977", "0.44080195", "0.43996993", "0.439895", "0.43890876", "0.43872997", "0.43863404", "0.43695232", "0.43634602", "0.43436053", "0.43374926", "0.43290338", "0.4320167", "0.4320167", "0.4320167", "0.4320167", "0.43163896", "0.43162048", "0.43084076", "0.4307591", "0.4307521", "0.4307521", "0.43048373", "0.43043423", "0.4293991", "0.4283441", "0.42764074", "0.42732084", "0.4269577", "0.42665264", "0.4261938", "0.42549407", "0.4253268", "0.4244664", "0.42402878", "0.42402416", "0.42274034", "0.4222254", "0.42221525", "0.42159265", "0.42110968", "0.42107412", "0.42092377", "0.41862085", "0.41819403", "0.418059", "0.41781998", "0.41728628", "0.41716337" ]
0.5908821
15
depends on pki_type optional bytes pki_data = 3;
public Builder setPkiData(com.google.protobuf.ByteString value) { copyOnWrite(); instance.setPkiData(value); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "java.lang.String getPkiType();", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "boolean hasPkiType();", "boolean hasPkiData();", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "@java.lang.Override\n public boolean hasPkiData() {\n return ((bitField0_ & 0x00000004) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return instance.getPkiData();\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "@java.lang.Override\n public boolean hasPkiData() {\n return instance.hasPkiData();\n }", "void setPQ( byte[] buffer, short offset, short length) throws CryptoException;", "public byte[] getPKP(final TrzbaDataType data) throws DataSigningException {\n return this.clientKey.sign(serializeData(data));\n }", "@Override\r\n protected String getPrymaryType(Integer key) {\r\n return NodeTypes.SECTOR.getId();\r\n }", "com.hps.july.persistence.WorkerKey getTechStuffKey() throws java.rmi.RemoteException;", "public String reqsetpkt(byte []p,byte[] id,byte[] T,byte[] ip,byte[] no)\r\n\t{\n\t\treturn \"hi\";\r\n\t}", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "void privateSetTechStuffKey(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException;", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "public Builder clearPkiData() {\n copyOnWrite();\n instance.clearPkiData();\n return this;\n }", "protected byte[] getBathWaterVolumeSetting3() {return null;}", "public interface ICloudRequest {\n \n public int getOp();\n public void incrementRetries();\n public void resetRetries();\n public int getRetries();\n \n /**\n * Retrieve the data unit associated with this request\n * @return {@link DepSkyDataUnit}\n */\n public DepSkyDataUnit getDataUnit();\n \n /**\n * Determine when this procedure started originally\n * @return long - start time of this procedure\n */\n public long getStartTime();\n \n /**\n * Determine the sequence of this request\n * @return long\n */\n public long getSequenceNumber();\n \n /**\n * Get the data resulting from this request\n * @return byte[] consisting of the data\n */\n public byte[] getData();\n \n \n}", "public static Object PQinit(Object... arg) {\nUNSUPPORTED(\"c01vxogao855zs8fe94tpim9g\"); // void\nUNSUPPORTED(\"3p0cdanvp4f13d8omi42lvjl1\"); // PQinit(void)\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\nUNSUPPORTED(\"akljrpu8bej9lq4rmsktz8u2e\"); // PQcnt = 0;\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\n\nthrow new UnsupportedOperationException();\n}", "com.zzsong.netty.protobuff.two.ProtoData.MyDataInfo.DataType getDataType();", "@Override\n\tpublic void put(String key, String cat, byte[] data) throws RemoteException {\n\t\t\n\t}", "public static void setKPIsInCache(Map<String,String> dataMap){ \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tmemcache.delete(ALL_KPI_KEY);\n \t}\n \tmemcache.put(ALL_KPI_KEY, dataMap);\n\t}", "@Override //Client\n public void prepareAMServiceData(ClusterDescription clusterSpec,\n Map<String, ByteBuffer> serviceData) {\n \n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "Key[] getPq();", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public byte getType() {\n return TYPE_DATA;\n }", "KijiDataRequest getClientRequest();", "public void setPartProducedKey(long value) {\n\t\tthis.partProducedKey = value;\n\t}", "public void setStorageType(short type) {\n\tstorageType = type;\n }", "public static Map<String,String> getKPIsFromCache(){\n\t\tMap<String,String> dataMap=null;\n \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tdataMap=(Map<String,String>) memcache.get(ALL_KPI_KEY);\n \t\tlog.info(\"Memcache getKPIsFromCache size = \"+dataMap.size());\n \t} \t\n \treturn dataMap;\n\t}", "public void setParentContainerType(IPartitionType type)\n\t{\n\t\tthis.parentContainerType = (PartitionType) type;\n\t}", "private IDataKey(Queue<Part> parts) {\n super(parts);\n }", "public static byte[] readFile(File file, int valueType) {\n if (!file.exists()) {\n Log.e(TAG, \"The file doesn't exist\");\n }\n try {\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n FileInputStream fileInputStream = new FileInputStream(file);\n BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);\n byte[] buf = new byte[4096];\n switch (valueType) {\n case 0:\n case 1:\n case 2:\n case 3:\n while (bufferedInputStream.read(buf) != -1) {\n byteArrayOutputStream.write(buf, 16 * valueType, 16);\n }\n break;\n case 4:\n if (!file.getName().equals(\"E_SK2\")) {\n if (!file.getName().equals(\"E_PIN2\")) {\n while (true) {\n int len = bufferedInputStream.read(buf);\n if (len == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, (len - 32) - (16 * 1));\n }\n }\n } else {\n while (true) {\n int len2 = bufferedInputStream.read(buf);\n if (len2 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, ((len2 - 32) - (16 * 1)) - PKLENGTH);\n }\n }\n }\n } else {\n while (true) {\n int len3 = bufferedInputStream.read(buf);\n if (len3 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 4, (len3 - 32) - (16 * 4));\n }\n }\n }\n case 5:\n while (true) {\n int len4 = bufferedInputStream.read(buf);\n if (len4 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, len4 - 32, 32);\n }\n }\n case PUBLICKEY /* 7 */:\n while (true) {\n int len5 = bufferedInputStream.read(buf);\n if (len5 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, (len5 - 32) - PKLENGTH, PKLENGTH);\n }\n }\n case 8:\n while (true) {\n int len6 = bufferedInputStream.read(buf);\n if (len6 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 0, len6 - 32);\n }\n }\n }\n byte[] buffer = byteArrayOutputStream.toByteArray();\n bufferedInputStream.close();\n fileInputStream.close();\n byteArrayOutputStream.close();\n return buffer;\n } catch (IOException e) {\n Log.e(TAG, \"read file exception!\" + e.getMessage());\n return new byte[0];\n }\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public byte [] getKos()\n {\n return kosBytes;\n }", "private <T> Pair<KademliaNode, Boolean> storeGRPC(KademliaNode node, byte[] key, T info) {\n\n StoreRequest.Builder request = StoreRequest.newBuilder()\n .setNode(KademliaUtils.KademliaNodeToKademliaNodeProto(bucketManager.getMyNode()))\n .setKey(ByteString.copyFrom(key));\n\n\n if(info.getClass() == Transaction.class) {\n request.setTransaction(KademliaUtils.TransactionToTransactionProto((Transaction) info));\n }\n else if(info.getClass() == Block.class) {\n request.setBlock(KademliaUtils.BlockToBlockProto((Block) info));\n }\n else if(info.getClass() == Auction.class) {\n request.setAuction(KademliaUtils.AuctionToAuctionProto((Auction) info));\n }\n else if(info.getClass() == Bid.class) {\n request.setBid(KademliaUtils.BidToBidProto((Bid) info));\n }\n else {\n logger.log(Level.SEVERE, \"Error: store value type not valid - \" + info.getClass());\n return new Pair(null, false);\n }\n\n ManagedChannel channel = ManagedChannelBuilder.forTarget(node.getIpAddress() + \":\" + node.getPort()).usePlaintext().build();\n AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel);\n// AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel).withDeadlineAfter(KademliaUtils.networkTimeoutMsecs, TimeUnit.MILLISECONDS);\n\n StoreResponse response;\n\n try {\n response = blockingStub.store(request .build());\n } catch (StatusRuntimeException e) {\n// logger.log(Level.WARNING, \"STORE RPC failed for \" + node.getIpAddress() + \":\" + node.getPort() + \" - \" + e.getStatus());\n logger.log(Level.WARNING, \"STORE RPC failed for \" + node);\n closeChannel(channel);\n return new Pair(null, false);\n }\n\n\n KademliaNode nodeInResponse = KademliaUtils.KademliaNodeProtoToKademliaNode(response.getNode());\n\n if (!Arrays.equals(node.getNodeID(), nodeInResponse.getNodeID())) {\n logger.log(Level.WARNING, \"Response returned with different nodeID\");\n closeChannel(channel);\n return new Pair(nodeInResponse, false);\n }\n\n closeChannel(channel);\n\n// logger.log(Level.INFO, \"Successfully sent STORE RPC to \" + node + \" for key \" + Utils.bytesToHexString(key));\n return new Pair(nodeInResponse, response.getSuccess());\n }", "public int send(Object key, Packet p) throws IOException {\n if (p instanceof NIOPacket) {\n NIOPacket n = (NIOPacket) p;\n return send(key, n.getBuffer());\n } else {\n if (T.t) {\n T.warn(\"This has not been tested\");\n }\n int len = p.getAvailable();\n p.readArray(byteArray, 0, len);\n return send(key, byteArray, 0, len);\n }\n }", "public interface PacketFormatKeyContext {\n\n}", "public abstract PartitionType getType();", "public String getBKP(final byte[] pkp) throws DataSigningException {\n final byte[] bytes = sha1(pkp);\n final String base16 = StringUtils.leftPad(toBase16(bytes), 40, '0');\n final String[] blocks = StringUtils.splitBlocks(base16, 8);\n final StringJoiner stringJoiner = new StringJoiner(\"-\");\n for(final String block : blocks) {\n stringJoiner.add(block);\n }\n return stringJoiner.toString().toUpperCase();\n }", "public void setPkCacheSize(int pkCacheSize) {\n }", "public ECP getPublicEphemeralKey(){return epk;}", "protected byte[] getBathWaterVolumeSetting2() {return null;}", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "byte[] get_node_secret();", "public static KubevirtNode buildKubevirtNode(Node node) {\n String hostname = node.getMetadata().getName();\n IpAddress managementIp = null;\n IpAddress dataIp = null;\n\n for (NodeAddress nodeAddress:node.getStatus().getAddresses()) {\n if (nodeAddress.getType().equals(INTERNAL_IP)) {\n managementIp = IpAddress.valueOf(nodeAddress.getAddress());\n dataIp = IpAddress.valueOf(nodeAddress.getAddress());\n }\n }\n\n Set<String> rolesFull = node.getMetadata().getLabels().keySet().stream()\n .filter(l -> l.contains(K8S_ROLE))\n .collect(Collectors.toSet());\n\n KubevirtNode.Type nodeType = WORKER;\n\n for (String roleStr : rolesFull) {\n String role = roleStr.split(\"/\")[1];\n if (MASTER.name().equalsIgnoreCase(role)) {\n nodeType = MASTER;\n break;\n }\n }\n\n // start to parse kubernetes annotation\n Map<String, String> annots = node.getMetadata().getAnnotations();\n String physnetConfig = annots.get(PHYSNET_CONFIG_KEY);\n String gatewayConfig = annots.get(GATEWAY_CONFIG_KEY);\n String dataIpStr = annots.get(DATA_IP_KEY);\n Set<KubevirtPhyInterface> phys = new HashSet<>();\n String gatewayBridgeName = null;\n try {\n if (physnetConfig != null) {\n JsonArray configJson = JsonArray.readFrom(physnetConfig);\n\n for (int i = 0; i < configJson.size(); i++) {\n JsonObject object = configJson.get(i).asObject();\n String network = object.get(NETWORK_KEY).asString();\n String intf = object.get(INTERFACE_KEY).asString();\n\n if (network != null && intf != null) {\n String physBridgeId;\n if (object.get(PHYS_BRIDGE_ID) != null) {\n physBridgeId = object.get(PHYS_BRIDGE_ID).asString();\n } else {\n physBridgeId = genDpidFromName(network + intf + hostname);\n log.trace(\"host {} physnet dpid for network {} intf {} is null so generate dpid {}\",\n hostname, network, intf, physBridgeId);\n }\n\n phys.add(DefaultKubevirtPhyInterface.builder()\n .network(network)\n .intf(intf)\n .physBridge(DeviceId.deviceId(physBridgeId))\n .build());\n }\n }\n }\n\n if (dataIpStr != null) {\n dataIp = IpAddress.valueOf(dataIpStr);\n }\n\n if (gatewayConfig != null) {\n JsonNode jsonNode = new ObjectMapper().readTree(gatewayConfig);\n\n nodeType = GATEWAY;\n gatewayBridgeName = jsonNode.get(GATEWAY_BRIDGE_NAME).asText();\n }\n } catch (JsonProcessingException e) {\n log.error(\"Failed to parse physnet config or gateway config object\", e);\n }\n\n // if the node is taint with kubevirt.io key configured,\n // we mark this node as OTHER type, and do not add it into the cluster\n NodeSpec spec = node.getSpec();\n if (spec.getTaints() != null) {\n for (Taint taint : spec.getTaints()) {\n String effect = taint.getEffect();\n String key = taint.getKey();\n String value = taint.getValue();\n\n if (StringUtils.equals(effect, NO_SCHEDULE_EFFECT) &&\n StringUtils.equals(key, KUBEVIRT_IO_KEY) &&\n StringUtils.equals(value, DRAINING_VALUE)) {\n nodeType = OTHER;\n }\n }\n }\n\n return DefaultKubevirtNode.builder()\n .hostname(hostname)\n .managementIp(managementIp)\n .dataIp(dataIp)\n .type(nodeType)\n .state(KubevirtNodeState.ON_BOARDED)\n .phyIntfs(phys)\n .gatewayBridgeName(gatewayBridgeName)\n .build();\n }", "public int getByteSizeBasedOnDataType(String dataType)\n\t{\n\t\tif (dataType.equals(\"String\"))\n\t\t\treturn charInBytes;\n\t\treturn intInBytes;\n\t}", "private DataKeys(String pKey) {\n key = pKey;\n }", "com.google.protobuf.ByteString\n getHowToUseBytes();", "com.google.protobuf.ByteString\n getHowToUseBytes();", "public static void main(String[] args) {\n Pair<String, Integer> pair = new Pair<String, Integer>(\"testeString\", 12);\n System.out.println(pair.getTipo1());\n System.out.println(pair.getTipo2());\n pair.setTipo1(\"TESTEAGAIN\");\n System.out.println(pair.getTipo1());\n\n }", "String getProcessingInstructionData(Object pi);", "public String getType() {\r\n return \"Block Data Long\";\r\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "private static String nodeKey(Player player, TYPE type) {\n return \"{playerId:\" + player.getId() + \", teamId:\" + player.getTeamId() + \", gameId:\" + player.getGameId() + \", type:\\\"\" + type.toString() + \"\\\"}\";\n }", "protected byte[] getBathWaterVolumeSetting1() {return null;}", "public PlugwiseMQTTDeviceInfo()\n\t{\n\t\t// initialize internal variables\n\t\tthis.macAddress = \"\";\n\t\tthis.type = \"circle\";\n\t}", "public interface KudoClient {\n MixedOperation<Operator, OperatorList, DoneableOperator, Resource<Operator, DoneableOperator>> operators();\n\n MixedOperation<Instance, InstanceList, DoneableInstance, Resource<Instance, DoneableInstance>> instances();\n\n MixedOperation<OperatorVersion, OperatorVersionList, DoneableOperatorVersion, Resource<OperatorVersion, DoneableOperatorVersion>> operatorVersion();\n\n void close();\n}", "ByteBuffer getApplicationData();", "public interface JobMemcachedKeys {\n String JOB_DETAIL = \"JOB_DETAIL_\";\n String JOB_STATUS = \"JOB_STATUS_\";\n}", "public interface C0003a {\n public static final String ah = \"image_manager_disk_cache\";\n public static final int hP = 262144000;\n\n @Nullable\n a bz();\n }", "short getPQ( byte[] buffer, short offset );", "public ClientPacket(PacketType type, byte[] data){\r\n\t\tthis.type = type;\r\n\t\tthis.dataSize = data.length;\r\n\t\tthis.data = data;\r\n\t}", "private void ipcSend(JSONObject data) {\n JSONObject json = data;\n try {\n json.put(IPC_MESSAGE_APPID, mAppId);\n\n if (mIpcChannel != null) {\n log.e(\"ipcSend:[\" + json.toString() + \"]\");\n\n mIpcChannel.send(json.toString());\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void setOpckeytype(java.lang.Long value) {\n\t\tsetValue(test.generated.pg_catalog.tables.PgOpclass.PG_OPCLASS.OPCKEYTYPE, value);\n\t}", "private String createKey(OwObject object_p, OwPluginEntry pluginEntry_p) throws Exception\r\n {\r\n String objectId = object_p.getDMSID();\r\n String key = objectId + \"_\" + pluginEntry_p.getIndex();\r\n return key;\r\n }", "public void setAvailableExtraData(List<String> extraDataKeys) {\n/* 502 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public int getCapacity( Resource.Type type );", "public TableValue(short type) {\n\tkey = null; // No name by default.\n\tstorageType = type; // Type of data. \n\tattrs = null; // No attributes yet.\n\tflags = -1; // No flags yet. \n\n\t// Create a generic, default vector clock. \n\tvclock = new VectorClock(\"s\".getBytes(), 0);\n }", "void setP( byte[] buffer, short offset, short length) throws CryptoException;", "private void uniPerfGetConfig(Parcel data, Parcel reply) {\n int tagsSize = data.readInt();\n if (tagsSize <= 0 || tagsSize >= 128) {\n AwareLog.e(TAG, \"uniPerfGetConfig tags size invalid.\");\n return;\n }\n int[] tags = new int[tagsSize];\n for (int i = 0; i < tagsSize; i++) {\n tags[i] = data.readInt();\n }\n int[] values = new int[tagsSize];\n reply.writeInt(UniPerf.getInstance().uniPerfGetConfig(tags, values));\n for (int value : values) {\n reply.writeInt(value);\n }\n }", "void setQ( byte[] buffer, short offset, short length) throws CryptoException;", "public MessageClackData(String userName, String message, String key, int type) {\n super(userName, type);\n this.message = encrypt(message, key);\n }", "public void setProcessType(String currentProcess) {\n this.currentProcess=currentProcess;\n if(currentProcess.startsWith(\"ENCRYPTION\")) {\n processCaption=\"Encrypting\";\n }\n else {\n processCaption=\"Decrypting\";\n } \n }", "PNMMetadata(ImageTypeSpecifier imageType, ImageWriteParam param) {\n/* 145 */ this();\n/* 146 */ initialize(imageType, param);\n/* */ }", "private void parseCommandPut(DataInputStream in) throws IOException {\n int ksize = in.readInt();\n int vsize = in.readInt();\n byte[] key = new byte[ksize];\n in.read(key);\n byte[] value = new byte[vsize];\n in.read(value);\n // int err = \n in.readUnsignedByte(); // unused\n elements = new LinkedHashMap<String, String>(1);\n elements.put(new String(key), new String(value));\n if (LOG.isDebugEnabled()) LOG.debug(\"parseCommandPut: elements -> \" + elements);\n }", "@Override\n\tpublic Map<String, String> modifyInstanceChargeType(\n\t\t\tMap<String, String> paramsMap, Map<String, String> defaultParamsMap,String requestId) throws Exception {\n\t\tMap<String, String> resultMap = new HashMap<String, String>();\n\t\tif(null==requestId || requestId.length()<1) {\n\t\t\tlogger.info(\"RequestId is null or is error!\");\n\t\t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"The request processing has failed due to some unknown error.\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_INTERNAL_SERVER_ERROR+\"\");\n\t\t\treturn resultMap;\n\t\t}\n\t\tString appKeyId = paramsMap.get(Constants.APPKEY_ID);\n\t\tVmUser vmuser = vmUserProxy.getByAppKeyId(appKeyId);\n\t\tString uuid = paramsMap.get(Constants.INSTANCE_ID);\n\t\tVmInstance instance = vmInstanceProxy.getByUuid(uuid, false, true, false, true, true, true, false, false);\n\t\tInteger userId = vmuser.getUserId();\n\t\tInteger clusterid = instance.getCluster().getId();\n\t\tInteger cpuNum = instance.getVmInstanceType().getVcpus();\n\t\tInteger memNum = instance.getVmInstanceType().getMemoryMb();\n\t\tInteger bandNum = -1;\n\t\tInteger hdNum = instance.getVmInstanceType().getLocalGb();\n\t\tList<VmInstanceMetadata> bandNumlist = instance.getVmInstanceMetadatas();\n\t\tfor(VmInstanceMetadata md : bandNumlist) {\n\t\t\tif(md.getKey().equals(Constants.PUBLIC_BANDWIDTH)) {\n\t\t\t\tbandNum = Integer.valueOf(md.getValue());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(-1 == bandNum)\n\t\t{\n\t\t\tlogger.info(\"带宽获取失败!\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"This instance do not have band\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n\t\t}\n\t\tString instanceChargeType;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_TYPE))\n\t\t\tinstanceChargeType = defaultParamsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\telse\n\t\t\tinstanceChargeType = paramsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\tString instanceChargeLength;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH))\n\t\t\tinstanceChargeLength = defaultParamsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\telse\n\t\t\tinstanceChargeLength = paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\tInteger paymentType = convertToPaymentType(instanceChargeType);\n\t\tDouble count = Double.valueOf(instanceChargeLength);\n\t\tint times = 0;\n\t\tString type = new VmHdEndtimeManager().getVmEndtimeByUuid(uuid).getType().toLowerCase();\n\t\tString PTYPE = Constants.INSTANCE_TYPE;\n\t\t\n\t\t\n logger.info(\"clusterid: \" + clusterid + \"cpu: \" + cpuNum + \" ,mem: \" + memNum + \" ,hd: \" + hdNum + \" ,band: \" + bandNum);\n \n //计算时间,算各种份数,然后扣费,设每个月份定为30天,每年定为360天\n //计算旧计费规则的份数\n VmHdEndtimeManager vmHdEndtimeManager = new VmHdEndtimeManager();\n VmHdEndtime vm = vmHdEndtimeManager.getVmEndtimeByUuid(uuid);\n\t\tTimestamp currentTime = new Timestamp(System.currentTimeMillis());\n\t\tSimpleDateFormat timeformat = new SimpleDateFormat(\"yyyy-MM-dd,HH:mm:ss\");\n\t long t1 = 0L;\n\t long t2 = 0L;\n \n Timestamp endTime = new Timestamp(vm.getEndTime().getTime());\n t1 = timeformat.parse(getTimeStampNumberFormat(endTime)).getTime();\n t2 = timeformat.parse(getTimeStampNumberFormat(currentTime)).getTime();\n //账号余额\n HashMap<String, String> params = new HashMap<String, String>();\n\t\tparams.put(\"uid\", String.valueOf(userId));\n\t\tparams.put(\"source\", com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n\t\tInteger balance = BillingAPI.balance(userId ,null, AccountUtil.getSignature(params, com.appcloud.vm.fe.common.Constants.CLIENT_SECRET_KEY),com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n //本次应付款金额\n Integer payamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, paymentType, count);\n if (t1 - t2 >= 0) {//不过期才对其退费\n \tInteger oldPaymentType = vmHdEndtimeManager.convertToPaymentType(vm.getPayType());\n \tdouble oldCount = 1.00000;\n \tif(oldPaymentType == 1){\n \t\toldCount = (t1 - t2) / (Constants.yearDays*24*3600*1000.0);\n \t}else if(oldPaymentType == 2){\n \t\toldCount = (t1 - t2) / (Constants.monthDays*24*3600*1000.0); \n \t}else if(oldPaymentType == 3){\n \t\toldCount = (t1 - t2) / (24*3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除3600000得出小时\n \t}else if(oldPaymentType == 4){\n \t\toldCount = (t1 - t2) / (3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除1000得出秒\n \t}\n \tlogger.info(\"oldCount:\"+oldCount);\n \t//计算手续费的份数\n \tdouble chargecount = 1.0;\n \t//先判断余额是否充足,再进行扣费等操作\n \tInteger reamount = 0;\n \tInteger chargeamount = 0;\n \treamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, oldPaymentType, oldCount);\n \tchargeamount = BillingAPI.getPrice(\"charge\", clusterid, -1, -1, -1, -1, userId, oldPaymentType, chargecount);\n \tlogger.info(balance);\n \tlogger.info(payamount);\n \tlogger.info(reamount);\n \tlogger.info(chargeamount);\n \tif(balance < (payamount - reamount + chargeamount)){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t\n \t//根据旧的计费规则退费\n \tString PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum +\"G硬盘和\" + bandNum + \n \t\t\t\"M带宽,未到期,退费\";\n \tlogger.debug(\"PID = \" + PID);\n \tString item = \"\";\n \tif(type.equalsIgnoreCase(\"vm\")){\n \t\titem = \"CPU/内存/硬盘/带宽\";\n \t}else if(type.equalsIgnoreCase(\"instancetype\")){\n \t\tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n \t\titem = rate.getName();\n \t}\n \tlogger.debug(\"item = \" + item);\n \tString message = \"\";\n \tString payment_type = new VmHdEndtimeManager().convertToType(oldPaymentType);\n \tmessage = BillingAPI.pay(RECID, userId, item, payment_type, times, oldCount, PTYPE, PID, reamount, null);\n \tif(!message.equalsIgnoreCase(\"success\")){\n \t\tlogger.info(\"payment fail\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap; //退费不成功\n \t} \n \t //收取手续费\n item = \"手续费\";\n PID=\"修改付费规则的手续费\";\n payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, chargecount, PTYPE, PID, chargeamount, null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n } else {\n \tif(balance < payamount){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t}\n \n //查询余额,扣费\n logger.info(\"start payment!\");\n String PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum + \"G硬盘和\" + bandNum + \"M带宽\";\n logger.debug(\"PID = \" + PID);\n String item = \"\";\n String message = \"\";\n logger.info(\"type = \" + type);\n if(type.equalsIgnoreCase(\"vm\")){\n \titem = \"CPU/内存/硬盘/带宽\";\n logger.debug(\"item = \" + item);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n \tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n\t\t\titem = rate.getName();\n }\n String payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, count, PTYPE, PID, payamount,null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n resultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n \n //修改虚拟机到期时间以及付费类型\n logger.info(\"start modify endtime!\");\n if(type.equalsIgnoreCase(\"vm\")){\n logger.info(\"vm\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \" tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_VM);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_VM, paymentType, count);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n logger.info(\"instancetype\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \"tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_INSTANCETYPE);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_INSTANCETYPE, paymentType, count);\n }\n resultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_OK);\n return resultMap;\n\t}" ]
[ "0.7461772", "0.7270173", "0.7188162", "0.6849862", "0.6622877", "0.6556345", "0.644622", "0.630002", "0.6299455", "0.62147033", "0.6163412", "0.6002228", "0.5975709", "0.59395826", "0.5907646", "0.57982445", "0.5726266", "0.5712276", "0.5684582", "0.5584436", "0.5559634", "0.5252141", "0.49216577", "0.47094396", "0.4694811", "0.46729812", "0.4656656", "0.46391153", "0.46205348", "0.46073896", "0.45961434", "0.45853224", "0.45853224", "0.4572385", "0.45663446", "0.45509598", "0.453728", "0.45189363", "0.45187464", "0.45142606", "0.45046827", "0.4490483", "0.44709814", "0.44686854", "0.44686854", "0.4463381", "0.44375443", "0.4430811", "0.44306394", "0.44279918", "0.4413793", "0.4411431", "0.44075605", "0.44003716", "0.43986735", "0.43878996", "0.43874544", "0.43870187", "0.4370455", "0.43632102", "0.43427208", "0.43381727", "0.43282798", "0.43189391", "0.43189391", "0.43189391", "0.43189391", "0.4315619", "0.4315214", "0.43085253", "0.43080577", "0.43076736", "0.43076736", "0.43066546", "0.43042377", "0.4295094", "0.4285528", "0.42770728", "0.42726806", "0.4271019", "0.4267067", "0.42609677", "0.4253753", "0.4252036", "0.42447025", "0.4242165", "0.42407113", "0.422909", "0.42224765", "0.4221811", "0.42164075", "0.42121062", "0.42113987", "0.42101535", "0.41872218", "0.4183457", "0.4183175", "0.4179106", "0.41723317", "0.41705495" ]
0.6087984
11
depends on pki_type optional bytes pki_data = 3;
public Builder clearPkiData() { copyOnWrite(); instance.clearPkiData(); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setPkiData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000004;\n pkiData_ = value;\n }", "com.google.protobuf.ByteString getPkiData();", "private void setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n pkiType_ = value.toStringUtf8();\n bitField0_ |= 0x00000002;\n }", "java.lang.String getPkiType();", "private void setPkiType(\n java.lang.String value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000002;\n pkiType_ = value;\n }", "com.google.protobuf.ByteString\n getPkiTypeBytes();", "@java.lang.Override\n public java.lang.String getPkiType() {\n return pkiType_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return pkiData_;\n }", "boolean hasPkiType();", "boolean hasPkiData();", "@java.lang.Override\n public boolean hasPkiType() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "public Builder setPkiData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiData(value);\n return this;\n }", "@java.lang.Override\n public java.lang.String getPkiType() {\n return instance.getPkiType();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return instance.getPkiTypeBytes();\n }", "@java.lang.Override\n public boolean hasPkiData() {\n return ((bitField0_ & 0x00000004) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getPkiData() {\n return instance.getPkiData();\n }", "public Builder setPkiTypeBytes(\n com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setPkiTypeBytes(value);\n return this;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPkiTypeBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(pkiType_);\n }", "private void clearPkiData() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pkiData_ = getDefaultInstance().getPkiData();\n }", "public Builder setPkiType(\n java.lang.String value) {\n copyOnWrite();\n instance.setPkiType(value);\n return this;\n }", "private void clearPkiType() {\n bitField0_ = (bitField0_ & ~0x00000002);\n pkiType_ = getDefaultInstance().getPkiType();\n }", "@java.lang.Override\n public boolean hasPkiType() {\n return instance.hasPkiType();\n }", "@java.lang.Override\n public boolean hasPkiData() {\n return instance.hasPkiData();\n }", "void setPQ( byte[] buffer, short offset, short length) throws CryptoException;", "public byte[] getPKP(final TrzbaDataType data) throws DataSigningException {\n return this.clientKey.sign(serializeData(data));\n }", "@Override\r\n protected String getPrymaryType(Integer key) {\r\n return NodeTypes.SECTOR.getId();\r\n }", "com.hps.july.persistence.WorkerKey getTechStuffKey() throws java.rmi.RemoteException;", "public String reqsetpkt(byte []p,byte[] id,byte[] T,byte[] ip,byte[] no)\r\n\t{\n\t\treturn \"hi\";\r\n\t}", "public Builder clearPkiType() {\n copyOnWrite();\n instance.clearPkiType();\n return this;\n }", "public void setP_type(String p_type) {\n this.p_type = p_type;\n }", "private byte[] getKey(KeyType keytype) {\n byte[] key = new byte[1];\n key[0] = (byte) keytype.ordinal();\n return key;\n }", "void privateSetTechStuffKey(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException;", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE getPakringFree();", "protected byte[] getBathWaterVolumeSetting3() {return null;}", "public interface ICloudRequest {\n \n public int getOp();\n public void incrementRetries();\n public void resetRetries();\n public int getRetries();\n \n /**\n * Retrieve the data unit associated with this request\n * @return {@link DepSkyDataUnit}\n */\n public DepSkyDataUnit getDataUnit();\n \n /**\n * Determine when this procedure started originally\n * @return long - start time of this procedure\n */\n public long getStartTime();\n \n /**\n * Determine the sequence of this request\n * @return long\n */\n public long getSequenceNumber();\n \n /**\n * Get the data resulting from this request\n * @return byte[] consisting of the data\n */\n public byte[] getData();\n \n \n}", "public static Object PQinit(Object... arg) {\nUNSUPPORTED(\"c01vxogao855zs8fe94tpim9g\"); // void\nUNSUPPORTED(\"3p0cdanvp4f13d8omi42lvjl1\"); // PQinit(void)\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\nUNSUPPORTED(\"akljrpu8bej9lq4rmsktz8u2e\"); // PQcnt = 0;\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\n\nthrow new UnsupportedOperationException();\n}", "com.zzsong.netty.protobuff.two.ProtoData.MyDataInfo.DataType getDataType();", "@Override\n\tpublic void put(String key, String cat, byte[] data) throws RemoteException {\n\t\t\n\t}", "public static void setKPIsInCache(Map<String,String> dataMap){ \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tmemcache.delete(ALL_KPI_KEY);\n \t}\n \tmemcache.put(ALL_KPI_KEY, dataMap);\n\t}", "@Override //Client\n public void prepareAMServiceData(ClusterDescription clusterSpec,\n Map<String, ByteBuffer> serviceData) {\n \n }", "public interface Key {\n\n String SHARE_KEY = \"userIndo\";//用户信息\n String SHARE_USER_ID = \"userId\";//用户账号\n\n}", "Key[] getPq();", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public Map<UUID, byte[]> getPsshInfo() {\n return null;\n }", "@Override\n public byte getType() {\n return TYPE_DATA;\n }", "KijiDataRequest getClientRequest();", "public void setPartProducedKey(long value) {\n\t\tthis.partProducedKey = value;\n\t}", "public void setStorageType(short type) {\n\tstorageType = type;\n }", "public static Map<String,String> getKPIsFromCache(){\n\t\tMap<String,String> dataMap=null;\n \t\n \tif(memcache !=null && memcache.contains(ALL_KPI_KEY)){\n \t\tdataMap=(Map<String,String>) memcache.get(ALL_KPI_KEY);\n \t\tlog.info(\"Memcache getKPIsFromCache size = \"+dataMap.size());\n \t} \t\n \treturn dataMap;\n\t}", "public void setParentContainerType(IPartitionType type)\n\t{\n\t\tthis.parentContainerType = (PartitionType) type;\n\t}", "private IDataKey(Queue<Part> parts) {\n super(parts);\n }", "public static byte[] readFile(File file, int valueType) {\n if (!file.exists()) {\n Log.e(TAG, \"The file doesn't exist\");\n }\n try {\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n FileInputStream fileInputStream = new FileInputStream(file);\n BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);\n byte[] buf = new byte[4096];\n switch (valueType) {\n case 0:\n case 1:\n case 2:\n case 3:\n while (bufferedInputStream.read(buf) != -1) {\n byteArrayOutputStream.write(buf, 16 * valueType, 16);\n }\n break;\n case 4:\n if (!file.getName().equals(\"E_SK2\")) {\n if (!file.getName().equals(\"E_PIN2\")) {\n while (true) {\n int len = bufferedInputStream.read(buf);\n if (len == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, (len - 32) - (16 * 1));\n }\n }\n } else {\n while (true) {\n int len2 = bufferedInputStream.read(buf);\n if (len2 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, ((len2 - 32) - (16 * 1)) - PKLENGTH);\n }\n }\n }\n } else {\n while (true) {\n int len3 = bufferedInputStream.read(buf);\n if (len3 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 4, (len3 - 32) - (16 * 4));\n }\n }\n }\n case 5:\n while (true) {\n int len4 = bufferedInputStream.read(buf);\n if (len4 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, len4 - 32, 32);\n }\n }\n case PUBLICKEY /* 7 */:\n while (true) {\n int len5 = bufferedInputStream.read(buf);\n if (len5 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, (len5 - 32) - PKLENGTH, PKLENGTH);\n }\n }\n case 8:\n while (true) {\n int len6 = bufferedInputStream.read(buf);\n if (len6 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 0, len6 - 32);\n }\n }\n }\n byte[] buffer = byteArrayOutputStream.toByteArray();\n bufferedInputStream.close();\n fileInputStream.close();\n byteArrayOutputStream.close();\n return buffer;\n } catch (IOException e) {\n Log.e(TAG, \"read file exception!\" + e.getMessage());\n return new byte[0];\n }\n }", "private String createTypeKey(int type, String key) {\r\n\t\treturn type + \"-\" + key;\r\n\t}", "public byte [] getKos()\n {\n return kosBytes;\n }", "private <T> Pair<KademliaNode, Boolean> storeGRPC(KademliaNode node, byte[] key, T info) {\n\n StoreRequest.Builder request = StoreRequest.newBuilder()\n .setNode(KademliaUtils.KademliaNodeToKademliaNodeProto(bucketManager.getMyNode()))\n .setKey(ByteString.copyFrom(key));\n\n\n if(info.getClass() == Transaction.class) {\n request.setTransaction(KademliaUtils.TransactionToTransactionProto((Transaction) info));\n }\n else if(info.getClass() == Block.class) {\n request.setBlock(KademliaUtils.BlockToBlockProto((Block) info));\n }\n else if(info.getClass() == Auction.class) {\n request.setAuction(KademliaUtils.AuctionToAuctionProto((Auction) info));\n }\n else if(info.getClass() == Bid.class) {\n request.setBid(KademliaUtils.BidToBidProto((Bid) info));\n }\n else {\n logger.log(Level.SEVERE, \"Error: store value type not valid - \" + info.getClass());\n return new Pair(null, false);\n }\n\n ManagedChannel channel = ManagedChannelBuilder.forTarget(node.getIpAddress() + \":\" + node.getPort()).usePlaintext().build();\n AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel);\n// AuctionBlockchainBlockingStub blockingStub = AuctionBlockchainGrpc.newBlockingStub(channel).withDeadlineAfter(KademliaUtils.networkTimeoutMsecs, TimeUnit.MILLISECONDS);\n\n StoreResponse response;\n\n try {\n response = blockingStub.store(request .build());\n } catch (StatusRuntimeException e) {\n// logger.log(Level.WARNING, \"STORE RPC failed for \" + node.getIpAddress() + \":\" + node.getPort() + \" - \" + e.getStatus());\n logger.log(Level.WARNING, \"STORE RPC failed for \" + node);\n closeChannel(channel);\n return new Pair(null, false);\n }\n\n\n KademliaNode nodeInResponse = KademliaUtils.KademliaNodeProtoToKademliaNode(response.getNode());\n\n if (!Arrays.equals(node.getNodeID(), nodeInResponse.getNodeID())) {\n logger.log(Level.WARNING, \"Response returned with different nodeID\");\n closeChannel(channel);\n return new Pair(nodeInResponse, false);\n }\n\n closeChannel(channel);\n\n// logger.log(Level.INFO, \"Successfully sent STORE RPC to \" + node + \" for key \" + Utils.bytesToHexString(key));\n return new Pair(nodeInResponse, response.getSuccess());\n }", "public int send(Object key, Packet p) throws IOException {\n if (p instanceof NIOPacket) {\n NIOPacket n = (NIOPacket) p;\n return send(key, n.getBuffer());\n } else {\n if (T.t) {\n T.warn(\"This has not been tested\");\n }\n int len = p.getAvailable();\n p.readArray(byteArray, 0, len);\n return send(key, byteArray, 0, len);\n }\n }", "public interface PacketFormatKeyContext {\n\n}", "public abstract PartitionType getType();", "public String getBKP(final byte[] pkp) throws DataSigningException {\n final byte[] bytes = sha1(pkp);\n final String base16 = StringUtils.leftPad(toBase16(bytes), 40, '0');\n final String[] blocks = StringUtils.splitBlocks(base16, 8);\n final StringJoiner stringJoiner = new StringJoiner(\"-\");\n for(final String block : blocks) {\n stringJoiner.add(block);\n }\n return stringJoiner.toString().toUpperCase();\n }", "public void setPkCacheSize(int pkCacheSize) {\n }", "public ECP getPublicEphemeralKey(){return epk;}", "protected byte[] getBathWaterVolumeSetting2() {return null;}", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "byte[] get_node_secret();", "public static KubevirtNode buildKubevirtNode(Node node) {\n String hostname = node.getMetadata().getName();\n IpAddress managementIp = null;\n IpAddress dataIp = null;\n\n for (NodeAddress nodeAddress:node.getStatus().getAddresses()) {\n if (nodeAddress.getType().equals(INTERNAL_IP)) {\n managementIp = IpAddress.valueOf(nodeAddress.getAddress());\n dataIp = IpAddress.valueOf(nodeAddress.getAddress());\n }\n }\n\n Set<String> rolesFull = node.getMetadata().getLabels().keySet().stream()\n .filter(l -> l.contains(K8S_ROLE))\n .collect(Collectors.toSet());\n\n KubevirtNode.Type nodeType = WORKER;\n\n for (String roleStr : rolesFull) {\n String role = roleStr.split(\"/\")[1];\n if (MASTER.name().equalsIgnoreCase(role)) {\n nodeType = MASTER;\n break;\n }\n }\n\n // start to parse kubernetes annotation\n Map<String, String> annots = node.getMetadata().getAnnotations();\n String physnetConfig = annots.get(PHYSNET_CONFIG_KEY);\n String gatewayConfig = annots.get(GATEWAY_CONFIG_KEY);\n String dataIpStr = annots.get(DATA_IP_KEY);\n Set<KubevirtPhyInterface> phys = new HashSet<>();\n String gatewayBridgeName = null;\n try {\n if (physnetConfig != null) {\n JsonArray configJson = JsonArray.readFrom(physnetConfig);\n\n for (int i = 0; i < configJson.size(); i++) {\n JsonObject object = configJson.get(i).asObject();\n String network = object.get(NETWORK_KEY).asString();\n String intf = object.get(INTERFACE_KEY).asString();\n\n if (network != null && intf != null) {\n String physBridgeId;\n if (object.get(PHYS_BRIDGE_ID) != null) {\n physBridgeId = object.get(PHYS_BRIDGE_ID).asString();\n } else {\n physBridgeId = genDpidFromName(network + intf + hostname);\n log.trace(\"host {} physnet dpid for network {} intf {} is null so generate dpid {}\",\n hostname, network, intf, physBridgeId);\n }\n\n phys.add(DefaultKubevirtPhyInterface.builder()\n .network(network)\n .intf(intf)\n .physBridge(DeviceId.deviceId(physBridgeId))\n .build());\n }\n }\n }\n\n if (dataIpStr != null) {\n dataIp = IpAddress.valueOf(dataIpStr);\n }\n\n if (gatewayConfig != null) {\n JsonNode jsonNode = new ObjectMapper().readTree(gatewayConfig);\n\n nodeType = GATEWAY;\n gatewayBridgeName = jsonNode.get(GATEWAY_BRIDGE_NAME).asText();\n }\n } catch (JsonProcessingException e) {\n log.error(\"Failed to parse physnet config or gateway config object\", e);\n }\n\n // if the node is taint with kubevirt.io key configured,\n // we mark this node as OTHER type, and do not add it into the cluster\n NodeSpec spec = node.getSpec();\n if (spec.getTaints() != null) {\n for (Taint taint : spec.getTaints()) {\n String effect = taint.getEffect();\n String key = taint.getKey();\n String value = taint.getValue();\n\n if (StringUtils.equals(effect, NO_SCHEDULE_EFFECT) &&\n StringUtils.equals(key, KUBEVIRT_IO_KEY) &&\n StringUtils.equals(value, DRAINING_VALUE)) {\n nodeType = OTHER;\n }\n }\n }\n\n return DefaultKubevirtNode.builder()\n .hostname(hostname)\n .managementIp(managementIp)\n .dataIp(dataIp)\n .type(nodeType)\n .state(KubevirtNodeState.ON_BOARDED)\n .phyIntfs(phys)\n .gatewayBridgeName(gatewayBridgeName)\n .build();\n }", "public int getByteSizeBasedOnDataType(String dataType)\n\t{\n\t\tif (dataType.equals(\"String\"))\n\t\t\treturn charInBytes;\n\t\treturn intInBytes;\n\t}", "private DataKeys(String pKey) {\n key = pKey;\n }", "com.google.protobuf.ByteString\n getHowToUseBytes();", "com.google.protobuf.ByteString\n getHowToUseBytes();", "public static void main(String[] args) {\n Pair<String, Integer> pair = new Pair<String, Integer>(\"testeString\", 12);\n System.out.println(pair.getTipo1());\n System.out.println(pair.getTipo2());\n pair.setTipo1(\"TESTEAGAIN\");\n System.out.println(pair.getTipo1());\n\n }", "String getProcessingInstructionData(Object pi);", "public String getType() {\r\n return \"Block Data Long\";\r\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "private static String nodeKey(Player player, TYPE type) {\n return \"{playerId:\" + player.getId() + \", teamId:\" + player.getTeamId() + \", gameId:\" + player.getGameId() + \", type:\\\"\" + type.toString() + \"\\\"}\";\n }", "protected byte[] getBathWaterVolumeSetting1() {return null;}", "public PlugwiseMQTTDeviceInfo()\n\t{\n\t\t// initialize internal variables\n\t\tthis.macAddress = \"\";\n\t\tthis.type = \"circle\";\n\t}", "public interface KudoClient {\n MixedOperation<Operator, OperatorList, DoneableOperator, Resource<Operator, DoneableOperator>> operators();\n\n MixedOperation<Instance, InstanceList, DoneableInstance, Resource<Instance, DoneableInstance>> instances();\n\n MixedOperation<OperatorVersion, OperatorVersionList, DoneableOperatorVersion, Resource<OperatorVersion, DoneableOperatorVersion>> operatorVersion();\n\n void close();\n}", "ByteBuffer getApplicationData();", "public interface JobMemcachedKeys {\n String JOB_DETAIL = \"JOB_DETAIL_\";\n String JOB_STATUS = \"JOB_STATUS_\";\n}", "public interface C0003a {\n public static final String ah = \"image_manager_disk_cache\";\n public static final int hP = 262144000;\n\n @Nullable\n a bz();\n }", "short getPQ( byte[] buffer, short offset );", "public ClientPacket(PacketType type, byte[] data){\r\n\t\tthis.type = type;\r\n\t\tthis.dataSize = data.length;\r\n\t\tthis.data = data;\r\n\t}", "private void ipcSend(JSONObject data) {\n JSONObject json = data;\n try {\n json.put(IPC_MESSAGE_APPID, mAppId);\n\n if (mIpcChannel != null) {\n log.e(\"ipcSend:[\" + json.toString() + \"]\");\n\n mIpcChannel.send(json.toString());\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void setOpckeytype(java.lang.Long value) {\n\t\tsetValue(test.generated.pg_catalog.tables.PgOpclass.PG_OPCLASS.OPCKEYTYPE, value);\n\t}", "private String createKey(OwObject object_p, OwPluginEntry pluginEntry_p) throws Exception\r\n {\r\n String objectId = object_p.getDMSID();\r\n String key = objectId + \"_\" + pluginEntry_p.getIndex();\r\n return key;\r\n }", "public void setAvailableExtraData(List<String> extraDataKeys) {\n/* 502 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public int getCapacity( Resource.Type type );", "public TableValue(short type) {\n\tkey = null; // No name by default.\n\tstorageType = type; // Type of data. \n\tattrs = null; // No attributes yet.\n\tflags = -1; // No flags yet. \n\n\t// Create a generic, default vector clock. \n\tvclock = new VectorClock(\"s\".getBytes(), 0);\n }", "void setP( byte[] buffer, short offset, short length) throws CryptoException;", "private void uniPerfGetConfig(Parcel data, Parcel reply) {\n int tagsSize = data.readInt();\n if (tagsSize <= 0 || tagsSize >= 128) {\n AwareLog.e(TAG, \"uniPerfGetConfig tags size invalid.\");\n return;\n }\n int[] tags = new int[tagsSize];\n for (int i = 0; i < tagsSize; i++) {\n tags[i] = data.readInt();\n }\n int[] values = new int[tagsSize];\n reply.writeInt(UniPerf.getInstance().uniPerfGetConfig(tags, values));\n for (int value : values) {\n reply.writeInt(value);\n }\n }", "void setQ( byte[] buffer, short offset, short length) throws CryptoException;", "public MessageClackData(String userName, String message, String key, int type) {\n super(userName, type);\n this.message = encrypt(message, key);\n }", "public void setProcessType(String currentProcess) {\n this.currentProcess=currentProcess;\n if(currentProcess.startsWith(\"ENCRYPTION\")) {\n processCaption=\"Encrypting\";\n }\n else {\n processCaption=\"Decrypting\";\n } \n }", "PNMMetadata(ImageTypeSpecifier imageType, ImageWriteParam param) {\n/* 145 */ this();\n/* 146 */ initialize(imageType, param);\n/* */ }", "private void parseCommandPut(DataInputStream in) throws IOException {\n int ksize = in.readInt();\n int vsize = in.readInt();\n byte[] key = new byte[ksize];\n in.read(key);\n byte[] value = new byte[vsize];\n in.read(value);\n // int err = \n in.readUnsignedByte(); // unused\n elements = new LinkedHashMap<String, String>(1);\n elements.put(new String(key), new String(value));\n if (LOG.isDebugEnabled()) LOG.debug(\"parseCommandPut: elements -> \" + elements);\n }", "@Override\n\tpublic Map<String, String> modifyInstanceChargeType(\n\t\t\tMap<String, String> paramsMap, Map<String, String> defaultParamsMap,String requestId) throws Exception {\n\t\tMap<String, String> resultMap = new HashMap<String, String>();\n\t\tif(null==requestId || requestId.length()<1) {\n\t\t\tlogger.info(\"RequestId is null or is error!\");\n\t\t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"The request processing has failed due to some unknown error.\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_INTERNAL_SERVER_ERROR+\"\");\n\t\t\treturn resultMap;\n\t\t}\n\t\tString appKeyId = paramsMap.get(Constants.APPKEY_ID);\n\t\tVmUser vmuser = vmUserProxy.getByAppKeyId(appKeyId);\n\t\tString uuid = paramsMap.get(Constants.INSTANCE_ID);\n\t\tVmInstance instance = vmInstanceProxy.getByUuid(uuid, false, true, false, true, true, true, false, false);\n\t\tInteger userId = vmuser.getUserId();\n\t\tInteger clusterid = instance.getCluster().getId();\n\t\tInteger cpuNum = instance.getVmInstanceType().getVcpus();\n\t\tInteger memNum = instance.getVmInstanceType().getMemoryMb();\n\t\tInteger bandNum = -1;\n\t\tInteger hdNum = instance.getVmInstanceType().getLocalGb();\n\t\tList<VmInstanceMetadata> bandNumlist = instance.getVmInstanceMetadatas();\n\t\tfor(VmInstanceMetadata md : bandNumlist) {\n\t\t\tif(md.getKey().equals(Constants.PUBLIC_BANDWIDTH)) {\n\t\t\t\tbandNum = Integer.valueOf(md.getValue());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(-1 == bandNum)\n\t\t{\n\t\t\tlogger.info(\"带宽获取失败!\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"This instance do not have band\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n\t\t}\n\t\tString instanceChargeType;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_TYPE))\n\t\t\tinstanceChargeType = defaultParamsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\telse\n\t\t\tinstanceChargeType = paramsMap.get(Constants.INSTANCE_CHARGE_TYPE);\n\t\tString instanceChargeLength;\n\t\tif (null == paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH))\n\t\t\tinstanceChargeLength = defaultParamsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\telse\n\t\t\tinstanceChargeLength = paramsMap.get(Constants.INSTANCE_CHARGE_LENGTH);\n\t\tInteger paymentType = convertToPaymentType(instanceChargeType);\n\t\tDouble count = Double.valueOf(instanceChargeLength);\n\t\tint times = 0;\n\t\tString type = new VmHdEndtimeManager().getVmEndtimeByUuid(uuid).getType().toLowerCase();\n\t\tString PTYPE = Constants.INSTANCE_TYPE;\n\t\t\n\t\t\n logger.info(\"clusterid: \" + clusterid + \"cpu: \" + cpuNum + \" ,mem: \" + memNum + \" ,hd: \" + hdNum + \" ,band: \" + bandNum);\n \n //计算时间,算各种份数,然后扣费,设每个月份定为30天,每年定为360天\n //计算旧计费规则的份数\n VmHdEndtimeManager vmHdEndtimeManager = new VmHdEndtimeManager();\n VmHdEndtime vm = vmHdEndtimeManager.getVmEndtimeByUuid(uuid);\n\t\tTimestamp currentTime = new Timestamp(System.currentTimeMillis());\n\t\tSimpleDateFormat timeformat = new SimpleDateFormat(\"yyyy-MM-dd,HH:mm:ss\");\n\t long t1 = 0L;\n\t long t2 = 0L;\n \n Timestamp endTime = new Timestamp(vm.getEndTime().getTime());\n t1 = timeformat.parse(getTimeStampNumberFormat(endTime)).getTime();\n t2 = timeformat.parse(getTimeStampNumberFormat(currentTime)).getTime();\n //账号余额\n HashMap<String, String> params = new HashMap<String, String>();\n\t\tparams.put(\"uid\", String.valueOf(userId));\n\t\tparams.put(\"source\", com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n\t\tInteger balance = BillingAPI.balance(userId ,null, AccountUtil.getSignature(params, com.appcloud.vm.fe.common.Constants.CLIENT_SECRET_KEY),com.appcloud.vm.fe.common.Constants.CLIENT_ID);\n //本次应付款金额\n Integer payamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, paymentType, count);\n if (t1 - t2 >= 0) {//不过期才对其退费\n \tInteger oldPaymentType = vmHdEndtimeManager.convertToPaymentType(vm.getPayType());\n \tdouble oldCount = 1.00000;\n \tif(oldPaymentType == 1){\n \t\toldCount = (t1 - t2) / (Constants.yearDays*24*3600*1000.0);\n \t}else if(oldPaymentType == 2){\n \t\toldCount = (t1 - t2) / (Constants.monthDays*24*3600*1000.0); \n \t}else if(oldPaymentType == 3){\n \t\toldCount = (t1 - t2) / (24*3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除3600000得出小时\n \t}else if(oldPaymentType == 4){\n \t\toldCount = (t1 - t2) / (3600*1000.0); //因为t1-t2得到的是毫秒级,所以要除1000得出秒\n \t}\n \tlogger.info(\"oldCount:\"+oldCount);\n \t//计算手续费的份数\n \tdouble chargecount = 1.0;\n \t//先判断余额是否充足,再进行扣费等操作\n \tInteger reamount = 0;\n \tInteger chargeamount = 0;\n \treamount = BillingAPI.getPrice(type, clusterid, cpuNum, memNum, hdNum, bandNum, userId, oldPaymentType, oldCount);\n \tchargeamount = BillingAPI.getPrice(\"charge\", clusterid, -1, -1, -1, -1, userId, oldPaymentType, chargecount);\n \tlogger.info(balance);\n \tlogger.info(payamount);\n \tlogger.info(reamount);\n \tlogger.info(chargeamount);\n \tif(balance < (payamount - reamount + chargeamount)){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t\n \t//根据旧的计费规则退费\n \tString PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum +\"G硬盘和\" + bandNum + \n \t\t\t\"M带宽,未到期,退费\";\n \tlogger.debug(\"PID = \" + PID);\n \tString item = \"\";\n \tif(type.equalsIgnoreCase(\"vm\")){\n \t\titem = \"CPU/内存/硬盘/带宽\";\n \t}else if(type.equalsIgnoreCase(\"instancetype\")){\n \t\tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n \t\titem = rate.getName();\n \t}\n \tlogger.debug(\"item = \" + item);\n \tString message = \"\";\n \tString payment_type = new VmHdEndtimeManager().convertToType(oldPaymentType);\n \tmessage = BillingAPI.pay(RECID, userId, item, payment_type, times, oldCount, PTYPE, PID, reamount, null);\n \tif(!message.equalsIgnoreCase(\"success\")){\n \t\tlogger.info(\"payment fail\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap; //退费不成功\n \t} \n \t //收取手续费\n item = \"手续费\";\n PID=\"修改付费规则的手续费\";\n payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, chargecount, PTYPE, PID, chargeamount, null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n } else {\n \tif(balance < payamount){\n \t\tlogger.info(\"余额不足,返回\");\n \t\tresultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n \t\t\tresultMap.put(Constants.ERRORMESSAGE,\"your money is not enough!\");\n \t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n \t\treturn resultMap;\n \t}\n \t}\n \n //查询余额,扣费\n logger.info(\"start payment!\");\n String PID=\"购买\" + cpuNum + \"核CPU\" + memNum + \"G内存\" + hdNum + \"G硬盘和\" + bandNum + \"M带宽\";\n logger.debug(\"PID = \" + PID);\n String item = \"\";\n String message = \"\";\n logger.info(\"type = \" + type);\n if(type.equalsIgnoreCase(\"vm\")){\n \titem = \"CPU/内存/硬盘/带宽\";\n logger.debug(\"item = \" + item);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n \tcom.appcloud.vm.fe.billing.Billingrate rate = BillingAPI.getRate(type, clusterid, cpuNum, memNum, hdNum, bandNum).get(0);\n\t\t\titem = rate.getName();\n }\n String payment_type = new VmHdEndtimeManager().convertToType(paymentType);\n message = BillingAPI.pay(userId, RECID, item, payment_type, times, count, PTYPE, PID, payamount,null);\n if(!message.equalsIgnoreCase(\"success\")){\n logger.info(\"payment fail\");\n resultMap.put(Constants.ERRORCODE, Constants.INTERNAL_ERROR);\n\t\t\tresultMap.put(Constants.ERRORMESSAGE,\"payment fail\");\n\t\t\tresultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_FORBIDDEN+\"\");\n return resultMap; \n }\n logger.info(\"payment success!\");\n \n //修改虚拟机到期时间以及付费类型\n logger.info(\"start modify endtime!\");\n if(type.equalsIgnoreCase(\"vm\")){\n logger.info(\"vm\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \" tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_VM);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_VM, paymentType, count);\n }else if(type.equalsIgnoreCase(\"instancetype\")){\n logger.info(\"instancetype\");\n Timestamp tempStamp = new Timestamp(System.currentTimeMillis());\n logger.info(\"userId = \" + userId + \" uuid = \" + uuid + \" paymentType = \" + paymentType \n + \" count = \" + count + \"tempStamp = \" + tempStamp + \" \" + VmHdEndtime.TYPE_INSTANCETYPE);\n vmHdEndtimeManager.updateVmHdEndtime(userId, uuid, tempStamp, VmHdEndtime.TYPE_INSTANCETYPE, paymentType, count);\n }\n resultMap.put(Constants.HTTP_CODE, HttpConstants.STATUS_OK);\n return resultMap;\n\t}" ]
[ "0.7461772", "0.7270173", "0.7188162", "0.6849862", "0.6622877", "0.6556345", "0.644622", "0.630002", "0.6299455", "0.62147033", "0.6163412", "0.6087984", "0.6002228", "0.5975709", "0.59395826", "0.5907646", "0.57982445", "0.5726266", "0.5712276", "0.5684582", "0.5584436", "0.5559634", "0.5252141", "0.49216577", "0.47094396", "0.4694811", "0.46729812", "0.4656656", "0.46391153", "0.46205348", "0.46073896", "0.45961434", "0.45853224", "0.45853224", "0.45663446", "0.45509598", "0.453728", "0.45189363", "0.45187464", "0.45142606", "0.45046827", "0.4490483", "0.44709814", "0.44686854", "0.44686854", "0.4463381", "0.44375443", "0.4430811", "0.44306394", "0.44279918", "0.4413793", "0.4411431", "0.44075605", "0.44003716", "0.43986735", "0.43878996", "0.43874544", "0.43870187", "0.4370455", "0.43632102", "0.43427208", "0.43381727", "0.43282798", "0.43189391", "0.43189391", "0.43189391", "0.43189391", "0.4315619", "0.4315214", "0.43085253", "0.43080577", "0.43076736", "0.43076736", "0.43066546", "0.43042377", "0.4295094", "0.4285528", "0.42770728", "0.42726806", "0.4271019", "0.4267067", "0.42609677", "0.4253753", "0.4252036", "0.42447025", "0.4242165", "0.42407113", "0.422909", "0.42224765", "0.4221811", "0.42164075", "0.42121062", "0.42113987", "0.42101535", "0.41872218", "0.4183457", "0.4183175", "0.4179106", "0.41723317", "0.41705495" ]
0.4572385
34
PaymentDetails required bytes serialized_payment_details = 4;
@java.lang.Override public boolean hasSerializedPaymentDetails() { return instance.hasSerializedPaymentDetails(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.google.protobuf.ByteString getSerializedPaymentDetails();", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "boolean hasSerializedPaymentDetails();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "private void clearSerializedPaymentDetails() {\n bitField0_ = (bitField0_ & ~0x00000008);\n serializedPaymentDetails_ = getDefaultInstance().getSerializedPaymentDetails();\n }", "public Builder setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setSerializedPaymentDetails(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "public String getPaymentData() {\n return paymentData;\n }", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "String getPaymentInformation();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "com.google.protobuf.ByteString getDetailsBytes();", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "void setPaymentInformation(String information);", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "boolean hasPaymentDetailsVersion();", "int getPaymentDetailsVersion();", "public Builder clearSerializedPaymentDetails() {\n copyOnWrite();\n instance.clearSerializedPaymentDetails();\n return this;\n }", "public java.lang.String getPaymentinformation () {\r\n\t\treturn paymentinformation;\r\n\t}", "public static PaymentManifestParserParsePaymentMethodManifestParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "public static PaymentManifestParserParsePaymentMethodManifestResponseParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public PaymentDetails () {\n\t}", "public Payment[] getPaymentInfo(){\n \t\n \treturn paymentArr;\n }", "com.google.protobuf.ByteString\n getField1504Bytes();", "com.google.protobuf.ByteString\n getField1704Bytes();", "public PolicyDetailsRecord() {\n\t\tsuper(PolicyDetails.POLICY_DETAILS);\n\t}", "@Override\r\n\tpublic byte[] getBytes() throws UnsupportedEncodingException {\r\n\t\tbyte[] bytes = new byte[RECORD_SIZE];\r\n\t\tbytes = Utilities.completeBytes(bytes, this.bidInfo.getBytes(), 0);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(biddingName, 30)), 32);\r\n\t\tbytes = Utilities.completeBytes(bytes, Utilities.intToBytes(typeProduct.ordinal()), 62);\r\n\t\tbytes = Utilities.completeBytes(bytes, product.getBytes(), 66);\r\n\t\tbytes = Utilities.completeBytes(bytes, publicationTime.getBytes(), 157);\r\n\t\tbytes = Utilities.completeBytes(bytes, initTime.getBytes(), 171);\r\n\t\tbytes = Utilities.completeBytes(bytes, finishTime.getBytes(), 185);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isAutomaticIncremet)?0:1), 199);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isPublic)?0:1), 200);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(owner, 20)), 201);\r\n\t\treturn bytes;\r\n\t}", "public PaymentmethodRecord() {\n super(Paymentmethod.PAYMENTMETHOD);\n }", "com.google.protobuf.ByteString\n getField1544Bytes();", "com.google.protobuf.ByteString\n getField1404Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "com.google.protobuf.ByteString\n getField1204Bytes();", "com.google.protobuf.ByteString\n getField1711Bytes();", "com.google.protobuf.ByteString\n getField1512Bytes();", "com.google.protobuf.ByteString\n getField1304Bytes();", "com.google.protobuf.ByteString\n getField1517Bytes();", "com.google.protobuf.ByteString\n getField1117Bytes();", "com.google.protobuf.ByteString\n getField1804Bytes();", "com.google.protobuf.ByteString\n getField1217Bytes();", "com.google.protobuf.ByteString\n getField1545Bytes();", "com.google.protobuf.ByteString\n getField1756Bytes();", "com.google.protobuf.ByteString\n getField1744Bytes();", "com.google.protobuf.ByteString\n getField1556Bytes();", "com.google.protobuf.ByteString\n getField1557Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@Override\n public byte getSubtype() {\n return SUBTYPE_PAYMENT_ORDINARY_PAYMENT;\n }", "com.google.protobuf.ByteString\n getField1757Bytes();", "com.google.protobuf.ByteString\n getField1748Bytes();", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "com.google.protobuf.ByteString\n getField1257Bytes();", "com.google.protobuf.ByteString\n getField1549Bytes();", "com.google.protobuf.ByteString\n getField1543Bytes();", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPayment getPayment();", "com.google.protobuf.ByteString\n getField1745Bytes();", "com.google.protobuf.ByteString\n getField1714Bytes();", "com.google.protobuf.ByteString\n getField1445Bytes();", "com.google.protobuf.ByteString\n getField1417Bytes();", "public CreditCard getDefaultPaymentInfo();", "com.google.protobuf.ByteString\n getField1511Bytes();", "com.google.protobuf.ByteString\n getField1215Bytes();", "com.google.protobuf.ByteString\n getField1244Bytes();", "com.google.protobuf.ByteString\n getField1715Bytes();", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPaymentUrlBytes() {\n return instance.getPaymentUrlBytes();\n }", "com.google.protobuf.ByteString\n getField1548Bytes();", "com.google.protobuf.ByteString\n getField1812Bytes();", "public void setDetail(byte[] detail) {\r\n this.detail = detail;\r\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString\n getField1412Bytes();", "com.google.protobuf.ByteString\n getField1558Bytes();", "com.google.protobuf.ByteString\n getField1214Bytes();", "com.google.protobuf.ByteString\n getField1604Bytes();", "com.google.protobuf.ByteString\n getField1144Bytes();", "com.google.protobuf.ByteString\n getField1218Bytes();", "com.google.protobuf.ByteString\n getField1212Bytes();", "com.google.protobuf.ByteString\n getField1114Bytes();", "public byte[] getDetail() {\r\n return detail;\r\n }", "public boolean isPartialPaymentSupported();", "com.google.protobuf.ByteString\n getField1856Bytes();", "com.google.protobuf.ByteString\n getField1115Bytes();", "com.google.protobuf.ByteString\n getField1857Bytes();", "com.google.protobuf.ByteString\n getField1248Bytes();", "com.google.protobuf.ByteString\n getField1518Bytes();", "com.google.protobuf.ByteString\n getField1578Bytes();", "com.google.protobuf.ByteString\n getField1456Bytes();", "com.google.protobuf.ByteString\n getField1345Bytes();", "public void setPaymentinformation (java.lang.String paymentinformation) {\r\n\t\tthis.paymentinformation = paymentinformation;\r\n\t}", "com.google.protobuf.ByteString\n getField1755Bytes();" ]
[ "0.82038945", "0.78406984", "0.7672053", "0.7183968", "0.6965263", "0.695285", "0.67179716", "0.66342545", "0.65559834", "0.64448136", "0.6223145", "0.5956644", "0.5953231", "0.5951428", "0.59144926", "0.5891327", "0.57743084", "0.5749999", "0.5703974", "0.570069", "0.56634367", "0.5659935", "0.5657271", "0.5648342", "0.56400573", "0.56288546", "0.56113607", "0.5547695", "0.5542958", "0.55104643", "0.54973465", "0.5447462", "0.5435767", "0.5381711", "0.53777254", "0.5341594", "0.53340733", "0.5317032", "0.5309946", "0.53096765", "0.5283365", "0.5280656", "0.52784044", "0.5277518", "0.52692145", "0.5264747", "0.5263717", "0.5254973", "0.5252406", "0.5240902", "0.5240224", "0.5238198", "0.52337265", "0.52285266", "0.5227106", "0.52270997", "0.52267087", "0.5224098", "0.5217402", "0.5214952", "0.5214295", "0.52085435", "0.52082986", "0.52054614", "0.5203705", "0.5200687", "0.52006096", "0.51887554", "0.5186415", "0.5186199", "0.5185867", "0.5184772", "0.51840425", "0.5181835", "0.51812506", "0.51810455", "0.51807725", "0.517789", "0.5177483", "0.5177483", "0.5177114", "0.51766247", "0.5175826", "0.5174838", "0.5168", "0.51665026", "0.51644826", "0.5163361", "0.5163318", "0.5161598", "0.51615274", "0.5155481", "0.5154738", "0.5153608", "0.5149883", "0.5148344", "0.51455677", "0.51438934", "0.51423377", "0.51416725" ]
0.6480167
9
PaymentDetails required bytes serialized_payment_details = 4;
@java.lang.Override public com.google.protobuf.ByteString getSerializedPaymentDetails() { return instance.getSerializedPaymentDetails(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.google.protobuf.ByteString getSerializedPaymentDetails();", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "boolean hasSerializedPaymentDetails();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "private void clearSerializedPaymentDetails() {\n bitField0_ = (bitField0_ & ~0x00000008);\n serializedPaymentDetails_ = getDefaultInstance().getSerializedPaymentDetails();\n }", "public Builder setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setSerializedPaymentDetails(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "public String getPaymentData() {\n return paymentData;\n }", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "String getPaymentInformation();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "com.google.protobuf.ByteString getDetailsBytes();", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "void setPaymentInformation(String information);", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "boolean hasPaymentDetailsVersion();", "int getPaymentDetailsVersion();", "public Builder clearSerializedPaymentDetails() {\n copyOnWrite();\n instance.clearSerializedPaymentDetails();\n return this;\n }", "public java.lang.String getPaymentinformation () {\r\n\t\treturn paymentinformation;\r\n\t}", "public static PaymentManifestParserParsePaymentMethodManifestParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "public static PaymentManifestParserParsePaymentMethodManifestResponseParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public PaymentDetails () {\n\t}", "public Payment[] getPaymentInfo(){\n \t\n \treturn paymentArr;\n }", "com.google.protobuf.ByteString\n getField1504Bytes();", "com.google.protobuf.ByteString\n getField1704Bytes();", "public PolicyDetailsRecord() {\n\t\tsuper(PolicyDetails.POLICY_DETAILS);\n\t}", "@Override\r\n\tpublic byte[] getBytes() throws UnsupportedEncodingException {\r\n\t\tbyte[] bytes = new byte[RECORD_SIZE];\r\n\t\tbytes = Utilities.completeBytes(bytes, this.bidInfo.getBytes(), 0);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(biddingName, 30)), 32);\r\n\t\tbytes = Utilities.completeBytes(bytes, Utilities.intToBytes(typeProduct.ordinal()), 62);\r\n\t\tbytes = Utilities.completeBytes(bytes, product.getBytes(), 66);\r\n\t\tbytes = Utilities.completeBytes(bytes, publicationTime.getBytes(), 157);\r\n\t\tbytes = Utilities.completeBytes(bytes, initTime.getBytes(), 171);\r\n\t\tbytes = Utilities.completeBytes(bytes, finishTime.getBytes(), 185);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isAutomaticIncremet)?0:1), 199);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isPublic)?0:1), 200);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(owner, 20)), 201);\r\n\t\treturn bytes;\r\n\t}", "public PaymentmethodRecord() {\n super(Paymentmethod.PAYMENTMETHOD);\n }", "com.google.protobuf.ByteString\n getField1544Bytes();", "com.google.protobuf.ByteString\n getField1404Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "com.google.protobuf.ByteString\n getField1204Bytes();", "com.google.protobuf.ByteString\n getField1711Bytes();", "com.google.protobuf.ByteString\n getField1512Bytes();", "com.google.protobuf.ByteString\n getField1304Bytes();", "com.google.protobuf.ByteString\n getField1517Bytes();", "com.google.protobuf.ByteString\n getField1117Bytes();", "com.google.protobuf.ByteString\n getField1804Bytes();", "com.google.protobuf.ByteString\n getField1217Bytes();", "com.google.protobuf.ByteString\n getField1545Bytes();", "com.google.protobuf.ByteString\n getField1756Bytes();", "com.google.protobuf.ByteString\n getField1744Bytes();", "com.google.protobuf.ByteString\n getField1556Bytes();", "com.google.protobuf.ByteString\n getField1557Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "com.google.protobuf.ByteString\n getField1757Bytes();", "com.google.protobuf.ByteString\n getField1748Bytes();", "@Override\n public byte getSubtype() {\n return SUBTYPE_PAYMENT_ORDINARY_PAYMENT;\n }", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "com.google.protobuf.ByteString\n getField1257Bytes();", "com.google.protobuf.ByteString\n getField1549Bytes();", "com.google.protobuf.ByteString\n getField1543Bytes();", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPayment getPayment();", "com.google.protobuf.ByteString\n getField1714Bytes();", "com.google.protobuf.ByteString\n getField1745Bytes();", "com.google.protobuf.ByteString\n getField1445Bytes();", "com.google.protobuf.ByteString\n getField1417Bytes();", "public CreditCard getDefaultPaymentInfo();", "com.google.protobuf.ByteString\n getField1511Bytes();", "com.google.protobuf.ByteString\n getField1215Bytes();", "com.google.protobuf.ByteString\n getField1244Bytes();", "com.google.protobuf.ByteString\n getField1715Bytes();", "com.google.protobuf.ByteString\n getField1548Bytes();", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPaymentUrlBytes() {\n return instance.getPaymentUrlBytes();\n }", "com.google.protobuf.ByteString\n getField1812Bytes();", "public void setDetail(byte[] detail) {\r\n this.detail = detail;\r\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString\n getField1412Bytes();", "com.google.protobuf.ByteString\n getField1558Bytes();", "com.google.protobuf.ByteString\n getField1214Bytes();", "com.google.protobuf.ByteString\n getField1604Bytes();", "com.google.protobuf.ByteString\n getField1144Bytes();", "com.google.protobuf.ByteString\n getField1218Bytes();", "com.google.protobuf.ByteString\n getField1212Bytes();", "com.google.protobuf.ByteString\n getField1114Bytes();", "public byte[] getDetail() {\r\n return detail;\r\n }", "com.google.protobuf.ByteString\n getField1856Bytes();", "public boolean isPartialPaymentSupported();", "com.google.protobuf.ByteString\n getField1115Bytes();", "com.google.protobuf.ByteString\n getField1857Bytes();", "com.google.protobuf.ByteString\n getField1248Bytes();", "com.google.protobuf.ByteString\n getField1518Bytes();", "com.google.protobuf.ByteString\n getField1578Bytes();", "com.google.protobuf.ByteString\n getField1456Bytes();", "com.google.protobuf.ByteString\n getField1345Bytes();", "public void setPaymentinformation (java.lang.String paymentinformation) {\r\n\t\tthis.paymentinformation = paymentinformation;\r\n\t}", "com.google.protobuf.ByteString\n getField1755Bytes();" ]
[ "0.82038236", "0.7840572", "0.7671914", "0.6965419", "0.6952939", "0.6718031", "0.663439", "0.6556068", "0.64802945", "0.64450496", "0.62232286", "0.5956749", "0.5953476", "0.59514207", "0.59146225", "0.5891537", "0.5773729", "0.5749882", "0.5703619", "0.5700829", "0.5663459", "0.5660361", "0.56575745", "0.5648787", "0.5640096", "0.5628598", "0.5611652", "0.55473053", "0.5543063", "0.55112493", "0.54972523", "0.54473674", "0.5435961", "0.53820443", "0.53773415", "0.53416026", "0.53340745", "0.53170466", "0.53097826", "0.5309769", "0.528339", "0.52810353", "0.5278492", "0.5277579", "0.52695304", "0.526513", "0.52637506", "0.52553463", "0.525242", "0.52412224", "0.5240505", "0.5238267", "0.52338886", "0.5228416", "0.52275294", "0.52271813", "0.52265006", "0.5223971", "0.5217591", "0.5215202", "0.52144265", "0.5208838", "0.5208109", "0.52052635", "0.52039796", "0.52010757", "0.5201014", "0.5188866", "0.5186855", "0.5186324", "0.5185992", "0.5184915", "0.5184059", "0.51822084", "0.518124", "0.5181134", "0.5180921", "0.517788", "0.5177446", "0.5177446", "0.51772887", "0.5176707", "0.51760477", "0.5174731", "0.5168059", "0.5166679", "0.5164655", "0.51636064", "0.5163509", "0.5161658", "0.5161565", "0.51556575", "0.51549417", "0.51538014", "0.5150051", "0.5148467", "0.5145721", "0.51440066", "0.51422024", "0.51419675" ]
0.7183848
3
PaymentDetails required bytes serialized_payment_details = 4;
public Builder setSerializedPaymentDetails(com.google.protobuf.ByteString value) { copyOnWrite(); instance.setSerializedPaymentDetails(value); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.google.protobuf.ByteString getSerializedPaymentDetails();", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "boolean hasSerializedPaymentDetails();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "private void clearSerializedPaymentDetails() {\n bitField0_ = (bitField0_ & ~0x00000008);\n serializedPaymentDetails_ = getDefaultInstance().getSerializedPaymentDetails();\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "public String getPaymentData() {\n return paymentData;\n }", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "String getPaymentInformation();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "com.google.protobuf.ByteString getDetailsBytes();", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "void setPaymentInformation(String information);", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "boolean hasPaymentDetailsVersion();", "int getPaymentDetailsVersion();", "public Builder clearSerializedPaymentDetails() {\n copyOnWrite();\n instance.clearSerializedPaymentDetails();\n return this;\n }", "public java.lang.String getPaymentinformation () {\r\n\t\treturn paymentinformation;\r\n\t}", "public static PaymentManifestParserParsePaymentMethodManifestParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "public static PaymentManifestParserParsePaymentMethodManifestResponseParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public PaymentDetails () {\n\t}", "public Payment[] getPaymentInfo(){\n \t\n \treturn paymentArr;\n }", "com.google.protobuf.ByteString\n getField1504Bytes();", "com.google.protobuf.ByteString\n getField1704Bytes();", "public PolicyDetailsRecord() {\n\t\tsuper(PolicyDetails.POLICY_DETAILS);\n\t}", "@Override\r\n\tpublic byte[] getBytes() throws UnsupportedEncodingException {\r\n\t\tbyte[] bytes = new byte[RECORD_SIZE];\r\n\t\tbytes = Utilities.completeBytes(bytes, this.bidInfo.getBytes(), 0);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(biddingName, 30)), 32);\r\n\t\tbytes = Utilities.completeBytes(bytes, Utilities.intToBytes(typeProduct.ordinal()), 62);\r\n\t\tbytes = Utilities.completeBytes(bytes, product.getBytes(), 66);\r\n\t\tbytes = Utilities.completeBytes(bytes, publicationTime.getBytes(), 157);\r\n\t\tbytes = Utilities.completeBytes(bytes, initTime.getBytes(), 171);\r\n\t\tbytes = Utilities.completeBytes(bytes, finishTime.getBytes(), 185);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isAutomaticIncremet)?0:1), 199);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isPublic)?0:1), 200);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(owner, 20)), 201);\r\n\t\treturn bytes;\r\n\t}", "public PaymentmethodRecord() {\n super(Paymentmethod.PAYMENTMETHOD);\n }", "com.google.protobuf.ByteString\n getField1544Bytes();", "com.google.protobuf.ByteString\n getField1404Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "com.google.protobuf.ByteString\n getField1204Bytes();", "com.google.protobuf.ByteString\n getField1711Bytes();", "com.google.protobuf.ByteString\n getField1512Bytes();", "com.google.protobuf.ByteString\n getField1304Bytes();", "com.google.protobuf.ByteString\n getField1517Bytes();", "com.google.protobuf.ByteString\n getField1117Bytes();", "com.google.protobuf.ByteString\n getField1804Bytes();", "com.google.protobuf.ByteString\n getField1217Bytes();", "com.google.protobuf.ByteString\n getField1545Bytes();", "com.google.protobuf.ByteString\n getField1756Bytes();", "com.google.protobuf.ByteString\n getField1744Bytes();", "com.google.protobuf.ByteString\n getField1556Bytes();", "com.google.protobuf.ByteString\n getField1557Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@Override\n public byte getSubtype() {\n return SUBTYPE_PAYMENT_ORDINARY_PAYMENT;\n }", "com.google.protobuf.ByteString\n getField1757Bytes();", "com.google.protobuf.ByteString\n getField1748Bytes();", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "com.google.protobuf.ByteString\n getField1257Bytes();", "com.google.protobuf.ByteString\n getField1549Bytes();", "com.google.protobuf.ByteString\n getField1543Bytes();", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPayment getPayment();", "com.google.protobuf.ByteString\n getField1745Bytes();", "com.google.protobuf.ByteString\n getField1714Bytes();", "com.google.protobuf.ByteString\n getField1445Bytes();", "com.google.protobuf.ByteString\n getField1417Bytes();", "public CreditCard getDefaultPaymentInfo();", "com.google.protobuf.ByteString\n getField1511Bytes();", "com.google.protobuf.ByteString\n getField1215Bytes();", "com.google.protobuf.ByteString\n getField1244Bytes();", "com.google.protobuf.ByteString\n getField1715Bytes();", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPaymentUrlBytes() {\n return instance.getPaymentUrlBytes();\n }", "com.google.protobuf.ByteString\n getField1548Bytes();", "com.google.protobuf.ByteString\n getField1812Bytes();", "public void setDetail(byte[] detail) {\r\n this.detail = detail;\r\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString\n getField1412Bytes();", "com.google.protobuf.ByteString\n getField1558Bytes();", "com.google.protobuf.ByteString\n getField1214Bytes();", "com.google.protobuf.ByteString\n getField1604Bytes();", "com.google.protobuf.ByteString\n getField1144Bytes();", "com.google.protobuf.ByteString\n getField1218Bytes();", "com.google.protobuf.ByteString\n getField1212Bytes();", "com.google.protobuf.ByteString\n getField1114Bytes();", "public byte[] getDetail() {\r\n return detail;\r\n }", "public boolean isPartialPaymentSupported();", "com.google.protobuf.ByteString\n getField1856Bytes();", "com.google.protobuf.ByteString\n getField1115Bytes();", "com.google.protobuf.ByteString\n getField1857Bytes();", "com.google.protobuf.ByteString\n getField1248Bytes();", "com.google.protobuf.ByteString\n getField1518Bytes();", "com.google.protobuf.ByteString\n getField1578Bytes();", "com.google.protobuf.ByteString\n getField1456Bytes();", "com.google.protobuf.ByteString\n getField1345Bytes();", "public void setPaymentinformation (java.lang.String paymentinformation) {\r\n\t\tthis.paymentinformation = paymentinformation;\r\n\t}", "com.google.protobuf.ByteString\n getField1755Bytes();" ]
[ "0.82038945", "0.78406984", "0.7672053", "0.7183968", "0.6965263", "0.695285", "0.67179716", "0.65559834", "0.6480167", "0.64448136", "0.6223145", "0.5956644", "0.5953231", "0.5951428", "0.59144926", "0.5891327", "0.57743084", "0.5749999", "0.5703974", "0.570069", "0.56634367", "0.5659935", "0.5657271", "0.5648342", "0.56400573", "0.56288546", "0.56113607", "0.5547695", "0.5542958", "0.55104643", "0.54973465", "0.5447462", "0.5435767", "0.5381711", "0.53777254", "0.5341594", "0.53340733", "0.5317032", "0.5309946", "0.53096765", "0.5283365", "0.5280656", "0.52784044", "0.5277518", "0.52692145", "0.5264747", "0.5263717", "0.5254973", "0.5252406", "0.5240902", "0.5240224", "0.5238198", "0.52337265", "0.52285266", "0.5227106", "0.52270997", "0.52267087", "0.5224098", "0.5217402", "0.5214952", "0.5214295", "0.52085435", "0.52082986", "0.52054614", "0.5203705", "0.5200687", "0.52006096", "0.51887554", "0.5186415", "0.5186199", "0.5185867", "0.5184772", "0.51840425", "0.5181835", "0.51812506", "0.51810455", "0.51807725", "0.517789", "0.5177483", "0.5177483", "0.5177114", "0.51766247", "0.5175826", "0.5174838", "0.5168", "0.51665026", "0.51644826", "0.5163361", "0.5163318", "0.5161598", "0.51615274", "0.5155481", "0.5154738", "0.5153608", "0.5149883", "0.5148344", "0.51455677", "0.51438934", "0.51423377", "0.51416725" ]
0.66342545
7
PaymentDetails required bytes serialized_payment_details = 4;
public Builder clearSerializedPaymentDetails() { copyOnWrite(); instance.clearSerializedPaymentDetails(); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.google.protobuf.ByteString getSerializedPaymentDetails();", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return instance.getSerializedPaymentDetails();\n }", "boolean hasSerializedPaymentDetails();", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "private void clearSerializedPaymentDetails() {\n bitField0_ = (bitField0_ & ~0x00000008);\n serializedPaymentDetails_ = getDefaultInstance().getSerializedPaymentDetails();\n }", "public Builder setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setSerializedPaymentDetails(value);\n return this;\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public boolean hasSerializedPaymentDetails() {\n return instance.hasSerializedPaymentDetails();\n }", "private void clearPaymentDetailsVersion() {\n bitField0_ = (bitField0_ & ~0x00000001);\n paymentDetailsVersion_ = 1;\n }", "public String getPaymentData() {\n return paymentData;\n }", "private void setPaymentDetailsVersion(int value) {\n bitField0_ |= 0x00000001;\n paymentDetailsVersion_ = value;\n }", "String getPaymentInformation();", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return paymentDetailsVersion_;\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPaymentOrBuilder getPaymentOrBuilder();", "com.google.protobuf.ByteString getDetailsBytes();", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "void setPaymentInformation(String information);", "public PaymentInformation getPaymentInformation(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.paymentinformation.v1.PaymentInformation res){\n\t\tPaymentInformation paymentInformation = new PaymentInformation();\n\t\t\n\t\tpaymentInformation.setBookingNo( res.getBookingNo() );\n\t\tif( res.getCreditCardFlag() != null ){\n\t\t\tpaymentInformation.setCreditCardFlag( res.getCreditCardFlag().charAt(0) );\n\t\t}\n\t\tif( res.getGuaranteedCheckFlag() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheckFlag( res.getGuaranteedCheckFlag().charAt(0) );\n\t\t}\n\t\tif( res.getMoneyTransferFlag() != null ){\n\t\t\tpaymentInformation.setMoneyTransferFlag( res.getMoneyTransferFlag().charAt(0) );\n\t\t}\n\t\tif( res.getImApplicationInfo() != null ){\n\t\t\tpaymentInformation.setImApplicationInfo( this.getIMApplicationInfo( res.getImApplicationInfo() ) );\n\t\t}\n\t\tif( res.getGuaranteedCheck() != null ){\n\t\t\tpaymentInformation.setGuaranteedCheck( this.getGuaranteedCheck( res.getGuaranteedCheck() ) );\n\t\t}\n\t\tif( res.getMoneyTransfer() != null ){\n\t\t\tpaymentInformation.setMoneyTransfer( this.getMoneyTransfer( res.getMoneyTransfer() ) );\n\t\t}\n\t\tif( res.getCreditCard() != null ){\n\t\t\tpaymentInformation.setCreditCard( this.getCreditCard( res.getCreditCard() ) );\n\t\t}\n\t\t\n\t\treturn paymentInformation;\n\t}", "@java.lang.Override\n public int getPaymentDetailsVersion() {\n return instance.getPaymentDetailsVersion();\n }", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "boolean hasPaymentDetailsVersion();", "int getPaymentDetailsVersion();", "public java.lang.String getPaymentinformation () {\r\n\t\treturn paymentinformation;\r\n\t}", "public static PaymentManifestParserParsePaymentMethodManifestParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "public static PaymentManifestParserParsePaymentMethodManifestResponseParams deserialize(java.nio.ByteBuffer data) {\n if (data == null)\n return null;\n \n return deserialize(new org.chromium.mojo.bindings.Message(\n data, new java.util.ArrayList<org.chromium.mojo.system.Handle>()));\n }", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public PaymentDetails () {\n\t}", "public Payment[] getPaymentInfo(){\n \t\n \treturn paymentArr;\n }", "com.google.protobuf.ByteString\n getField1504Bytes();", "com.google.protobuf.ByteString\n getField1704Bytes();", "public PolicyDetailsRecord() {\n\t\tsuper(PolicyDetails.POLICY_DETAILS);\n\t}", "@Override\r\n\tpublic byte[] getBytes() throws UnsupportedEncodingException {\r\n\t\tbyte[] bytes = new byte[RECORD_SIZE];\r\n\t\tbytes = Utilities.completeBytes(bytes, this.bidInfo.getBytes(), 0);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(biddingName, 30)), 32);\r\n\t\tbytes = Utilities.completeBytes(bytes, Utilities.intToBytes(typeProduct.ordinal()), 62);\r\n\t\tbytes = Utilities.completeBytes(bytes, product.getBytes(), 66);\r\n\t\tbytes = Utilities.completeBytes(bytes, publicationTime.getBytes(), 157);\r\n\t\tbytes = Utilities.completeBytes(bytes, initTime.getBytes(), 171);\r\n\t\tbytes = Utilities.completeBytes(bytes, finishTime.getBytes(), 185);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isAutomaticIncremet)?0:1), 199);\r\n\t\tbytes = Utilities.completeBytes(bytes, (byte) ((isPublic)?0:1), 200);\r\n\t\tbytes = Utilities.completeBytes(bytes,\r\n\t\t\t\tUtilities.stringToBytes(Utilities.completeLength(owner, 20)), 201);\r\n\t\treturn bytes;\r\n\t}", "public PaymentmethodRecord() {\n super(Paymentmethod.PAYMENTMETHOD);\n }", "com.google.protobuf.ByteString\n getField1544Bytes();", "com.google.protobuf.ByteString\n getField1404Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "com.google.protobuf.ByteString\n getField1204Bytes();", "com.google.protobuf.ByteString\n getField1711Bytes();", "com.google.protobuf.ByteString\n getField1512Bytes();", "com.google.protobuf.ByteString\n getField1304Bytes();", "com.google.protobuf.ByteString\n getField1517Bytes();", "com.google.protobuf.ByteString\n getField1117Bytes();", "com.google.protobuf.ByteString\n getField1804Bytes();", "com.google.protobuf.ByteString\n getField1217Bytes();", "com.google.protobuf.ByteString\n getField1545Bytes();", "com.google.protobuf.ByteString\n getField1756Bytes();", "com.google.protobuf.ByteString\n getField1744Bytes();", "com.google.protobuf.ByteString\n getField1556Bytes();", "com.google.protobuf.ByteString\n getField1557Bytes();", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@Override\n public byte getSubtype() {\n return SUBTYPE_PAYMENT_ORDINARY_PAYMENT;\n }", "com.google.protobuf.ByteString\n getField1757Bytes();", "com.google.protobuf.ByteString\n getField1748Bytes();", "static String m13919a(Context context, C6924p paymentStateHandler) {\n JSONObject deviceInfo = new JSONObject();\n try {\n String androidId = Secure.getString(context.getContentResolver(), \"android_id\");\n deviceInfo.put(\"deviceFingerprintVersion\", \"1.0\");\n deviceInfo.put(\"platform\", \"android\");\n deviceInfo.put(\"apiVersion\", \"4\");\n deviceInfo.put(\"osVersion\", VERSION.SDK_INT);\n deviceInfo.put(\"sdkVersion\", \"1.10.0\");\n deviceInfo.put(\"deviceIdentifier\", androidId);\n deviceInfo.put(\"locale\", C6912j.m14059a(context));\n return Base64.encodeToString(deviceInfo.toString().getBytes(Charset.forName(\"UTF-8\")), 2);\n } catch (JSONException jsonException) {\n Log.e(f12559a, \"Token could not be created\", jsonException);\n paymentStateHandler.mo22387b((Throwable) jsonException);\n return \"\";\n }\n }", "com.google.protobuf.ByteString\n getField1257Bytes();", "com.google.protobuf.ByteString\n getField1549Bytes();", "com.google.protobuf.ByteString\n getField1543Bytes();", "private Payment(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderPayment getPayment();", "com.google.protobuf.ByteString\n getField1745Bytes();", "com.google.protobuf.ByteString\n getField1714Bytes();", "com.google.protobuf.ByteString\n getField1445Bytes();", "com.google.protobuf.ByteString\n getField1417Bytes();", "public CreditCard getDefaultPaymentInfo();", "com.google.protobuf.ByteString\n getField1511Bytes();", "com.google.protobuf.ByteString\n getField1215Bytes();", "com.google.protobuf.ByteString\n getField1244Bytes();", "com.google.protobuf.ByteString\n getField1715Bytes();", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPaymentUrlBytes() {\n return instance.getPaymentUrlBytes();\n }", "com.google.protobuf.ByteString\n getField1548Bytes();", "com.google.protobuf.ByteString\n getField1812Bytes();", "public void setDetail(byte[] detail) {\r\n this.detail = detail;\r\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString\n getField1412Bytes();", "com.google.protobuf.ByteString\n getField1558Bytes();", "com.google.protobuf.ByteString\n getField1214Bytes();", "com.google.protobuf.ByteString\n getField1604Bytes();", "com.google.protobuf.ByteString\n getField1144Bytes();", "com.google.protobuf.ByteString\n getField1218Bytes();", "com.google.protobuf.ByteString\n getField1212Bytes();", "com.google.protobuf.ByteString\n getField1114Bytes();", "public byte[] getDetail() {\r\n return detail;\r\n }", "public boolean isPartialPaymentSupported();", "com.google.protobuf.ByteString\n getField1856Bytes();", "com.google.protobuf.ByteString\n getField1115Bytes();", "com.google.protobuf.ByteString\n getField1857Bytes();", "com.google.protobuf.ByteString\n getField1248Bytes();", "com.google.protobuf.ByteString\n getField1518Bytes();", "com.google.protobuf.ByteString\n getField1578Bytes();", "com.google.protobuf.ByteString\n getField1456Bytes();", "com.google.protobuf.ByteString\n getField1345Bytes();", "public void setPaymentinformation (java.lang.String paymentinformation) {\r\n\t\tthis.paymentinformation = paymentinformation;\r\n\t}", "com.google.protobuf.ByteString\n getField1755Bytes();" ]
[ "0.82038945", "0.78406984", "0.7672053", "0.7183968", "0.6965263", "0.695285", "0.67179716", "0.66342545", "0.65559834", "0.6480167", "0.64448136", "0.6223145", "0.5956644", "0.5953231", "0.5951428", "0.59144926", "0.5891327", "0.57743084", "0.5749999", "0.5703974", "0.570069", "0.56634367", "0.5659935", "0.5657271", "0.56400573", "0.56288546", "0.56113607", "0.5547695", "0.5542958", "0.55104643", "0.54973465", "0.5447462", "0.5435767", "0.5381711", "0.53777254", "0.5341594", "0.53340733", "0.5317032", "0.5309946", "0.53096765", "0.5283365", "0.5280656", "0.52784044", "0.5277518", "0.52692145", "0.5264747", "0.5263717", "0.5254973", "0.5252406", "0.5240902", "0.5240224", "0.5238198", "0.52337265", "0.52285266", "0.5227106", "0.52270997", "0.52267087", "0.5224098", "0.5217402", "0.5214952", "0.5214295", "0.52085435", "0.52082986", "0.52054614", "0.5203705", "0.5200687", "0.52006096", "0.51887554", "0.5186415", "0.5186199", "0.5185867", "0.5184772", "0.51840425", "0.5181835", "0.51812506", "0.51810455", "0.51807725", "0.517789", "0.5177483", "0.5177483", "0.5177114", "0.51766247", "0.5175826", "0.5174838", "0.5168", "0.51665026", "0.51644826", "0.5163361", "0.5163318", "0.5161598", "0.51615274", "0.5155481", "0.5154738", "0.5153608", "0.5149883", "0.5148344", "0.51455677", "0.51438934", "0.51423377", "0.51416725" ]
0.5648342
24
pkidependent signature optional bytes signature = 5;
@java.lang.Override public boolean hasSignature() { return instance.hasSignature(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract byte[] getSignature();", "com.google.protobuf.ByteString getSignature();", "int getSignature ();", "String getSignature();", "String getSignature();", "String getSignature();", "BigInteger getDigitalSignature();", "public abstract String getSignature();", "SignatureIdentification createSignatureIdentification();", "org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder();", "com.google.protobuf.ByteString\n getSignatureBytes();", "com.google.protobuf.ByteString\n getSignatureBytes();", "Signature getSignature();", "org.apache.calcite.avatica.proto.Common.Signature getSignature();", "byte[] getSignatureImage();", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }", "public GpgSignature(@NonNull byte[] signature) {\n\t\tthis.signature = signature;\n\t}", "byte[] generateSignature(byte[] message, PrivateKey privateKey, SecureRandom secureRandom) throws IOException;", "boolean hasSignature();", "boolean hasSignature();", "public byte[] getSigAlgParams() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[]\");\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "native String nativeGetSignature(long nativeHandler) throws RuntimeException;", "com.google.protobuf.ByteString getSig();", "SignatureSpi(com.android.org.bouncycastle.crypto.Digest r1, com.android.org.bouncycastle.crypto.DSA r2, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void\");\n }", "private void setSignature(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000010;\n signature_ = value;\n }", "String getUniqueSignature();", "public void setSignature( String pSignature )\r\n {\r\n this.signature = pSignature;\r\n }", "public byte []\ngetSignature() {\n\treturn signature;\n}", "int getSignatureType();", "@Override\n public String buildSignature(RequestDataToSign requestDataToSign, String appKey) {\n // find private key for this app\n final String secretKey = keyStore.getPrivateKey(appKey);\n if (secretKey == null) {\n LOG.error(\"Unknown application key: {}\", appKey);\n throw new PrivateKeyNotFoundException();\n }\n\n // sign\n return super.buildSignature(requestDataToSign, secretKey);\n }", "java.lang.String getSignatureText();", "public boolean verifySignature() {\r\n\t\t\r\n\t\tString data;\r\n\t\t\r\n\t\tif(isTypeCreation){\r\n\t\t\t\r\n\t\t\tdata = StringUtil.getStringFromKey(creator) + name +\r\n\t\t\t\t\tdescription + begin + end+end_subscription+\r\n\t\t\t\t\tlocation+min_capacity+max_capacity;\r\n\t\t\treturn StringUtil.verifyECDSASig(creator, data, signature);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata = StringUtil.getStringFromKey(subscriber)+id_event;\r\n\t\t\treturn StringUtil.verifyECDSASig(subscriber, data, signature);\r\n\t\t}\r\n//\t\tSystem.out.println(\"signature \"+signature);\r\n\t\t\r\n\t}", "public static native String getSignature(long[] msgArgs);", "@Override\n public boolean verifySignature(byte[] signature) {\n try {\n Element[] sig = derDecode(signature);\n CL04SignPublicPairingKeySerParameter pk = (CL04SignPublicPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(pairingKeySerParameter.getParameters());\n Element a = sig[0];\n Element b = sig[1];\n Element c = sig[2];\n List<Element> A = IntStream.range(3, 3 + messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n List<Element> B = IntStream.range(3 + messages.size(), 3 + 2 * messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n return aFormedCorrectly(pairing, a, A, pk) && bFormedCorrectly(pairing, a, b, A, B, pk) && cFormedCorrectly(pairing, a, b, c, B, pk);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return false;\n\n }", "public String getSignature()\r\n {\r\n return signature;\r\n }", "public boolean isSignatureRequired() {\n\t\treturn false;\n\t}", "boolean verifySignature(byte[] message, byte[] signature, PublicKey publicKey) throws IOException;", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public interface SignatureObject {\n}", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "com.google.protobuf.ByteString getArtifactSignature();", "public Signer getPDFSigner();", "public abstract String getSigAlgOID();", "public static void main(String[] args) {\n\n\t\tif (args.length != 5) {\n\t\t System.out.println(\"Usage: GenSig nameOfFileToSign keystore password sign publicKey\");\n\n\t\t }\n\t\telse try{\n\n\t\t KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t ks.load(new FileInputStream(args[1]), args[2].toCharArray());\n\t\t \n\t\t String alias = (String)ks.aliases().nextElement();\n\t\t PrivateKey privateKey = (PrivateKey) ks.getKey(alias, args[2].toCharArray());\n\n\t\t Certificate cert = ks.getCertificate(alias);\n\n\t\t // Get public key\t\n\t\t PublicKey publicKey = cert.getPublicKey();\n\n\t\t /* Create a Signature object and initialize it with the private key */\n\n\t\t Signature rsa = Signature.getInstance(\"SHA256withRSA\");\t\n\t\n\n\t\t rsa.initSign(privateKey);\n\n\t\t /* Update and sign the data */\n\n \t String hexString = readFile(args[0]).trim();\n\t\t byte[] decodedBytes = DatatypeConverter.parseHexBinary(hexString);\t\n\t\t InputStream bufin = new ByteArrayInputStream(decodedBytes);\n\n\n\t\t byte[] buffer = new byte[1024];\n\t\t int len;\n\t\t while (bufin.available() != 0) {\n\t\t\tlen = bufin.read(buffer);\n\t\t\trsa.update(buffer, 0, len);\n\t\t };\n\n\t\t bufin.close();\n\n\t\t /* Now that all the data to be signed has been read in, \n\t\t\t generate a signature for it */\n\n\t\t byte[] realSig = rsa.sign();\n\n\t\t \n\t\t /* Save the signature in a file */\n\n\t\t File file = new File(args[3]);\n\t\t PrintWriter out = new PrintWriter(file);\n\n\t\t\t// if file doesn't exists, then create it\n\t\t\tif (!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\n\t\t out.println(DatatypeConverter.printBase64Binary(realSig));\n\t\t out.close();\n\n\n\t\t /* Save the public key in a file */\n\t\t byte[] key = publicKey.getEncoded();\n\t\t FileOutputStream keyfos = new FileOutputStream(args[4]);\n\t\t keyfos.write(key);\n\n\t\t keyfos.close();\n\n\t\t} catch (Exception e) {\n\t\t System.err.println(\"Caught exception \" + e.toString());\n\t\t}\n\n\t}", "com.microsoft.schemas.office.x2006.digsig.STSignatureType xgetSignatureType();", "int getSignatureProviderDetails();", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "SignatureSource createSignatureSource();", "public byte[] getSignature()\n {\n return Arrays.clone(signature);\n }", "public Signator.Signers getUsedPDFSignerLibrary();", "String componentSignature();", "void setSignature(String signature) {\n this.signature = signature;\n }", "org.apache.xmlbeans.XmlBase64Binary xgetSignatureImage();", "public io.lightcone.data.types.EdDSASignatureOrBuilder getSigOrBuilder() {\n return getSig();\n }", "BlsPoint sign(BigInteger privateKey, byte[] data);", "public interface SignatureFactory \n{\n /** \n * initializes the implementation class \n */\n public void init()\n throws SignedDocException;\n \n /**\n * Method returns an array of strings representing the \n * list of available token names.\n * @return an array of available token names.\n * @throws SignedDocException if reading the token information fails.\n */\n public String[] getAvailableTokenNames()\n throws SignedDocException;\n \n /**\n * Method returns a digital signature. It finds the RSA private \n * key object from the active token and\n * then signs the given data with this key and RSA mechanism.\n * @param digest digest of the data to be signed.\n * @param token token index\n * @param pin users pin code\n * @return an array of bytes containing digital signature.\n * @throws SignedDocException if signing the data fails.\n */\n public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;\n \n /**\n * Method returns a X.509 certificate object readed \n * from the active token and representing an\n * user public key certificate value.\n * @return X.509 certificate object.\n * @throws SignedDocException if getting X.509 public key certificate \n * fails or the requested certificate type X.509 is not available in \n * the default provider package\n */\n public X509Certificate getCertificate(int token, String pin)\n throws SignedDocException;\n \n /**\n * Resets the previous session\n * and other selected values\n */\n public void reset() \n throws SignedDocException;\n \n\t/**\n\t * Method decrypts the data with the RSA private key\n\t * corresponding to this certificate (which was used\n\t * to encrypt it). Decryption will be done on the card.\n\t * This operation closes the possibly opened previous\n\t * session with signature token and opens a new one with\n\t * authentication token if necessary\n\t * @param data data to be decrypted.\n\t * @param token index of authentication token\n\t * @param pin PIN code\n\t * @return decrypted data.\n\t * @throws SignedDocException for all decryption errors\n\t */\n\tpublic byte[] decrypt(byte[] data, int token, String pin) \n\t\tthrows SignedDocException;\n\t\t\t\t\n}", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public byte[] signData(String fitxer, PrivateKey priv) {\n byte[] signature = null;\n FileInputStream datafis;\n BufferedInputStream bufin = null;\n byte[] buffer = new byte[1024];\n int len;\n \n try {\n Signature signer = Signature.getInstance(\"SHA256withRSA\");\n signer.initSign(priv); //Inicialitzem la firma digital a partirde l’algorisme utilitzat\n \n datafis = new FileInputStream(fitxer);\n bufin = new BufferedInputStream(datafis);\n \n while (bufin.available() != 0) {\n len = bufin.read(buffer);\n signer.update(buffer, 0, len);//Li assignem a l’objecte firma les dades afirmar digitalment\n } \n\n bufin.close();\n signature = signer.sign();//Finalment generem la firma\n } catch (Exception ex) {\n System.err.println(\"Error signant les dades: \" + ex);\n }\n return signature;\n }", "private byte getSignatureType() \r\n \t //@ requires [?f]signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures [f]signatureType |-> theSignatureType &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\treturn signatureType[0];\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public\nSIGRecord(Name name, int dclass, long ttl, int covered, int alg, int origttl,\n\t Date expire, Date timeSigned, int footprint, Name signer,\n\t byte [] signature)\n{\n\tthis(name, dclass, ttl);\n\tType.check(covered);\n\tcheckU8(\"alg\", alg);\n\tcheckU8(\"labels\", labels);\n\tTTL.check(origttl);\n\tcheckU16(\"footprint\", footprint);\n\tthis.covered = covered;\n\tthis.alg = alg;\n\tthis.labels = name.labels();\n\tthis.origttl = origttl;\n\tthis.expire = expire;\n\tthis.timeSigned = timeSigned;\n\tthis.footprint = footprint;\n\tif (!signer.isAbsolute())\n\t\tthrow new RelativeNameException(signer);\n\tthis.signer = signer;\n\tthis.signature = signature;\n}", "ReleaseFile parseWithSignature( InputStream is, InputStream signStream, InputStream keyStream ) throws IOException;", "public void setSignature(String signature) {\n\t\tthis.signature = signature;\n\t}", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "ISModifySignature createISModifySignature();", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;", "boolean readSignature(Integer[] sig) {\n Scales.sendByte((byte) 's');\n\t /* Get actual signature */\n sig[2] = Scales.getByte();\n sig[1] = Scales.getByte();\n sig[0] = Scales.getByte();\n return true;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n if (signatureBuilder_ != null) {\n return signatureBuilder_.getMessageOrBuilder();\n } else {\n return signature_ == null ?\n org.apache.calcite.avatica.proto.Common.Signature.getDefaultInstance() : signature_;\n }\n }", "private void validateFermatPacketSignature(FermatPacket fermatPacketReceive){\n\n System.out.println(\" WsCommunicationVPNClient - validateFermatPacketSignature\");\n\n /*\n * Validate the signature\n */\n boolean isValid = AsymmectricCryptography.verifyMessageSignature(fermatPacketReceive.getSignature(), fermatPacketReceive.getMessageContent(), vpnServerIdentity);\n\n System.out.println(\" WsCommunicationVPNClient - isValid = \" + isValid);\n\n /*\n * if not valid signature\n */\n if (!isValid){\n throw new RuntimeException(\"Fermat Packet received has not a valid signature, go to close this connection maybe is compromise\");\n }\n\n }", "public String getSignature() {\n\t\treturn signature;\n\t}", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "public static byte[] SignWithPrivateKey(byte[] buf,PrivateKey pkey) throws Exception{\r\n\t\tSecureRandom secureRandom = new SecureRandom();\r\n\t\tSignature signature = Signature.getInstance(\"SHA1WithECDSA\");\r\n\t\tsignature.initSign(pkey,secureRandom);\r\n\t\tsignature.update(buf);\r\n\t\tbyte[] digitalSignature = signature.sign();\r\n\t\treturn digitalSignature;\r\n\t\t\r\n\t}", "public void setSignature(String Signature) {\n this.Signature = Signature;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n return getSignature();\n }", "public ISignature getSignature() {\n return _signature;\n }", "public String getSignature() {\n return this.Signature;\n }", "@SuppressWarnings(\"all\")\n public static void main(String...args) throws Exception {\n FileInputStream pubKFile = new FileInputStream(\"C:\\\\Demo\\\\publicKey\");\n byte[] encKey = new byte[pubKFile.available()];\n pubKFile.read(encKey);\n pubKFile.close();\n\n // 2. decode the public key\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encKey);\n PublicKey publicKey = KeyFactory.getInstance(\"DSA\").generatePublic(spec);\n\n // 3. read the signature\n FileInputStream signatureFile = new FileInputStream(\"C:\\\\Demo\\\\signature\");\n byte[] sigByte = new byte[signatureFile.available()];\n signatureFile.read(sigByte);\n signatureFile.close();\n\n // 4. generate the signature\n Signature signature = Signature.getInstance(\"SHA1withDSA\");\n signature.initVerify(publicKey);\n\n // 5. supply the data\n FileInputStream dataFile = new FileInputStream(\"C:\\\\Demo\\\\code\");\n BufferedInputStream dataStream = new BufferedInputStream(dataFile);\n byte[] tmpBuf = new byte[dataStream.available()];\n int len;\n while ((len = dataStream.read(tmpBuf)) >= 0) {\n signature.update(tmpBuf, 0, len);\n }\n dataStream.close();\n\n // 6. verify\n boolean result = signature.verify(sigByte);\n System.out.println(\"Result:\" + result);\n }", "public static void main(String[] args) {\n\n String pfx = \"E:\\\\PDFFileTest\\\\1.pfx\";\n String tmpPath = \"E:\\\\PDFFileTest\\\\1562570792439.pdf\";\n String expPath = \"E:\\\\PDFFileTest\\\\11.11\\\\h83.pdf\";\n String gif = \"E:\\\\PDFFileTest\\\\1.gif\";\n String password = \"111111\";\n try {\n sign(pfx, tmpPath, expPath, gif, password);\n System.out.println(\"success\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "private void generatePkcs1Md5Signature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 16) || (byteRead != 16))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// use the correct key\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t\r\n\t\tif (getSignatureType() == NON_REPUDIATION) {\t\t\r\n\t\t\tcipher.init((RSAPrivateCrtKey)nonRepKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\tif (getSignatureType() == AUTHENTICATION) {\r\n\t\t\tcipher.init((RSAPrivateCrtKey)authKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t\t\r\n\t\t////@ open valid(); // todo\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\t\t\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\t////@ open [1/2]valid();\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_MD5_PKCS1, lc);\r\n\t\t// copy the MD5 hash from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA), messageBuffer, (short) (128 - lc), lc);\r\n\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// generate signature\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as1);\r\n\t\t//@ foreachp_remove(messageBuffer, as1);\r\n\t\t//@ open transient_byte_array(messageBuffer);\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as1);\r\n\r\n\t\t////@ close [1/2]valid(); // auto\r\n\r\n\r\n\t}", "boolean hasSig();", "boolean checkSignature(long sig0, long sig1, long sig2) throws Exception {\n Integer[] sig = new Integer[3];\n\t /* Get signature */\n readSignature(sig);\n\t /* Compare signature */\n if (sig[0] != sig0 || sig[1] != sig1 || sig[2] != sig2) {\n throw new Exception(\"Signature does not match selected device! \");\n }\n return true; // Indicate supported command.\n }", "void setSignatureImage(byte[] signatureImage);", "public boolean signRequired() {\n\t\treturn false;\n\t}", "protected byte[] getSignature() {\n return signatureImpl.calculate(content, null);\n }", "dkk mo4509g();", "SignatureSink createSignatureSink();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public void testDoubleX509SignatureThumb() throws Exception {\n WSSecSignature builder = new WSSecSignature();\n builder.setUserInfo(\"16c73ab6-b892-458f-abf5-2f875f74882e\", \"security\");\n // builder.setUserInfo(\"john\", \"keypass\");\n builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER); \n Document doc = unsignedEnvelope.getAsDocument();\n \n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc);\n\n Document signedDoc = builder.build(doc, crypto, secHeader);\n Document signedDoc1 = builder.build(signedDoc, crypto, secHeader);\n verify(signedDoc1);\n }", "public static byte[] sign(String stringPrivateKey,String plaintext){\r\n\t\ttry {\r\n\t\t\tPKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(stringPrivateKey));\r\n\t\t\tKeyFactory kf = KeyFactory.getInstance(\"EC\");\r\n\t\t\tPrivateKey privateKey= kf.generatePrivate(privateKeySpec);\r\n\t\t\tSignature sig = Signature.getInstance(\"SHA256withECDSA\");\r\n\t\t\tsig.initSign(privateKey);\r\n\t\t\tsig.update(plaintext.getBytes(\"UTF-8\"));\r\n\t\t\tbyte[] signature = sig.sign();\r\n\t\t\tSystem.out.println(\"Bytes:\"+signature.length);\r\n\t\t\treturn signature;\r\n\t\t} catch (InvalidKeyException | SignatureException | UnsupportedEncodingException | NoSuchAlgorithmException | InvalidKeySpecException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static void main(String[] args)\n throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, UnsupportedEncodingException {\n final String text = \"We would like to provide data integrity.\";\n\n /**\n * STEP 1.\n * We create a public-private key pair.\n * Standard Algorithm Names\n * http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html\n */\n final KeyPair key = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n /**\n * Alice creates Signature object defining Signature algorithm.\n */\n final Signature signatureAlg = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We initialize the signature object with\n * - Operation modes (SIGN) and\n * - provides appropriate ***Private*** Key\n */\n signatureAlg.initSign(key.getPrivate());\n\n // Finally, we load the message into the signature object and sign it\n signatureAlg.update(text.getBytes(\"UTF-8\"));\n final byte[] signedText = signatureAlg.sign();\n System.out.println(\"Signature: \" + DatatypeConverter.printHexBinary(signedText));\n\n /**\n * To verify the signature, we create another signature object\n * and specify its algorithm\n */\n final Signature signatureAlg2 = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We have to initialize it with the mode. But to verify the algorithm,\n * we only need the public key of the original signee\n */\n signatureAlg2.initVerify(key.getPublic());\n\n //Finally, we can check whether the signature is valid\n signatureAlg2.update(text.getBytes(\"UTF-8\"));\n\n if (signatureAlg2.verify(signedText))\n System.out.println(\"Valid signature.\");\n else\n System.err.println(\"Invalid signature.\");\n }", "public void affiche3(BigInteger signe){\n System.out.println(\"La signature est :\"+signe);\n }", "com.microsoft.schemas.office.x2006.digsig.STSignatureText xgetSignatureText();" ]
[ "0.73976135", "0.704309", "0.70210266", "0.6921052", "0.6921052", "0.6921052", "0.6833218", "0.68208843", "0.66571474", "0.65837884", "0.6580073", "0.6580073", "0.6549985", "0.65176594", "0.6499652", "0.6490479", "0.64046055", "0.63172966", "0.6307634", "0.6307634", "0.62898576", "0.6273093", "0.6249798", "0.62436706", "0.62151176", "0.6214869", "0.6214243", "0.6184172", "0.6180248", "0.61655164", "0.6113408", "0.61041343", "0.6092459", "0.6082781", "0.6056683", "0.60500777", "0.5998656", "0.59978396", "0.5959772", "0.593669", "0.59344125", "0.5918469", "0.5916969", "0.5910817", "0.58813316", "0.5864352", "0.58635926", "0.58560973", "0.58560973", "0.58557546", "0.5852426", "0.58436865", "0.5841626", "0.58226836", "0.5803321", "0.5799519", "0.5798923", "0.57931036", "0.57903373", "0.57903373", "0.57903373", "0.5785939", "0.57843107", "0.5747793", "0.5738761", "0.57264227", "0.5724643", "0.5718272", "0.5717422", "0.57154185", "0.57154185", "0.5714451", "0.5714451", "0.5710953", "0.5694987", "0.56920105", "0.5681027", "0.56799185", "0.56781644", "0.5672383", "0.56646734", "0.56491727", "0.5647587", "0.5643544", "0.5643239", "0.5640683", "0.56399196", "0.5639839", "0.5630529", "0.5627866", "0.561977", "0.56098723", "0.56039405", "0.5592808", "0.5580254", "0.55797774", "0.5576713", "0.5566575", "0.5559037", "0.5537511", "0.55128556" ]
0.0
-1
pkidependent signature optional bytes signature = 5;
@java.lang.Override public com.google.protobuf.ByteString getSignature() { return instance.getSignature(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract byte[] getSignature();", "com.google.protobuf.ByteString getSignature();", "int getSignature ();", "String getSignature();", "String getSignature();", "String getSignature();", "BigInteger getDigitalSignature();", "public abstract String getSignature();", "SignatureIdentification createSignatureIdentification();", "org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder();", "com.google.protobuf.ByteString\n getSignatureBytes();", "com.google.protobuf.ByteString\n getSignatureBytes();", "Signature getSignature();", "org.apache.calcite.avatica.proto.Common.Signature getSignature();", "byte[] getSignatureImage();", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }", "public GpgSignature(@NonNull byte[] signature) {\n\t\tthis.signature = signature;\n\t}", "byte[] generateSignature(byte[] message, PrivateKey privateKey, SecureRandom secureRandom) throws IOException;", "boolean hasSignature();", "boolean hasSignature();", "public byte[] getSigAlgParams() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[]\");\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "native String nativeGetSignature(long nativeHandler) throws RuntimeException;", "com.google.protobuf.ByteString getSig();", "private void setSignature(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000010;\n signature_ = value;\n }", "String getUniqueSignature();", "SignatureSpi(com.android.org.bouncycastle.crypto.Digest r1, com.android.org.bouncycastle.crypto.DSA r2, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void\");\n }", "public void setSignature( String pSignature )\r\n {\r\n this.signature = pSignature;\r\n }", "public byte []\ngetSignature() {\n\treturn signature;\n}", "int getSignatureType();", "@Override\n public String buildSignature(RequestDataToSign requestDataToSign, String appKey) {\n // find private key for this app\n final String secretKey = keyStore.getPrivateKey(appKey);\n if (secretKey == null) {\n LOG.error(\"Unknown application key: {}\", appKey);\n throw new PrivateKeyNotFoundException();\n }\n\n // sign\n return super.buildSignature(requestDataToSign, secretKey);\n }", "java.lang.String getSignatureText();", "public boolean verifySignature() {\r\n\t\t\r\n\t\tString data;\r\n\t\t\r\n\t\tif(isTypeCreation){\r\n\t\t\t\r\n\t\t\tdata = StringUtil.getStringFromKey(creator) + name +\r\n\t\t\t\t\tdescription + begin + end+end_subscription+\r\n\t\t\t\t\tlocation+min_capacity+max_capacity;\r\n\t\t\treturn StringUtil.verifyECDSASig(creator, data, signature);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata = StringUtil.getStringFromKey(subscriber)+id_event;\r\n\t\t\treturn StringUtil.verifyECDSASig(subscriber, data, signature);\r\n\t\t}\r\n//\t\tSystem.out.println(\"signature \"+signature);\r\n\t\t\r\n\t}", "public static native String getSignature(long[] msgArgs);", "@Override\n public boolean verifySignature(byte[] signature) {\n try {\n Element[] sig = derDecode(signature);\n CL04SignPublicPairingKeySerParameter pk = (CL04SignPublicPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(pairingKeySerParameter.getParameters());\n Element a = sig[0];\n Element b = sig[1];\n Element c = sig[2];\n List<Element> A = IntStream.range(3, 3 + messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n List<Element> B = IntStream.range(3 + messages.size(), 3 + 2 * messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n return aFormedCorrectly(pairing, a, A, pk) && bFormedCorrectly(pairing, a, b, A, B, pk) && cFormedCorrectly(pairing, a, b, c, B, pk);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return false;\n\n }", "public String getSignature()\r\n {\r\n return signature;\r\n }", "public boolean isSignatureRequired() {\n\t\treturn false;\n\t}", "boolean verifySignature(byte[] message, byte[] signature, PublicKey publicKey) throws IOException;", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public interface SignatureObject {\n}", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "com.google.protobuf.ByteString getArtifactSignature();", "public Signer getPDFSigner();", "public abstract String getSigAlgOID();", "public static void main(String[] args) {\n\n\t\tif (args.length != 5) {\n\t\t System.out.println(\"Usage: GenSig nameOfFileToSign keystore password sign publicKey\");\n\n\t\t }\n\t\telse try{\n\n\t\t KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t ks.load(new FileInputStream(args[1]), args[2].toCharArray());\n\t\t \n\t\t String alias = (String)ks.aliases().nextElement();\n\t\t PrivateKey privateKey = (PrivateKey) ks.getKey(alias, args[2].toCharArray());\n\n\t\t Certificate cert = ks.getCertificate(alias);\n\n\t\t // Get public key\t\n\t\t PublicKey publicKey = cert.getPublicKey();\n\n\t\t /* Create a Signature object and initialize it with the private key */\n\n\t\t Signature rsa = Signature.getInstance(\"SHA256withRSA\");\t\n\t\n\n\t\t rsa.initSign(privateKey);\n\n\t\t /* Update and sign the data */\n\n \t String hexString = readFile(args[0]).trim();\n\t\t byte[] decodedBytes = DatatypeConverter.parseHexBinary(hexString);\t\n\t\t InputStream bufin = new ByteArrayInputStream(decodedBytes);\n\n\n\t\t byte[] buffer = new byte[1024];\n\t\t int len;\n\t\t while (bufin.available() != 0) {\n\t\t\tlen = bufin.read(buffer);\n\t\t\trsa.update(buffer, 0, len);\n\t\t };\n\n\t\t bufin.close();\n\n\t\t /* Now that all the data to be signed has been read in, \n\t\t\t generate a signature for it */\n\n\t\t byte[] realSig = rsa.sign();\n\n\t\t \n\t\t /* Save the signature in a file */\n\n\t\t File file = new File(args[3]);\n\t\t PrintWriter out = new PrintWriter(file);\n\n\t\t\t// if file doesn't exists, then create it\n\t\t\tif (!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\n\t\t out.println(DatatypeConverter.printBase64Binary(realSig));\n\t\t out.close();\n\n\n\t\t /* Save the public key in a file */\n\t\t byte[] key = publicKey.getEncoded();\n\t\t FileOutputStream keyfos = new FileOutputStream(args[4]);\n\t\t keyfos.write(key);\n\n\t\t keyfos.close();\n\n\t\t} catch (Exception e) {\n\t\t System.err.println(\"Caught exception \" + e.toString());\n\t\t}\n\n\t}", "com.microsoft.schemas.office.x2006.digsig.STSignatureType xgetSignatureType();", "int getSignatureProviderDetails();", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "SignatureSource createSignatureSource();", "public byte[] getSignature()\n {\n return Arrays.clone(signature);\n }", "public Signator.Signers getUsedPDFSignerLibrary();", "String componentSignature();", "void setSignature(String signature) {\n this.signature = signature;\n }", "org.apache.xmlbeans.XmlBase64Binary xgetSignatureImage();", "public io.lightcone.data.types.EdDSASignatureOrBuilder getSigOrBuilder() {\n return getSig();\n }", "BlsPoint sign(BigInteger privateKey, byte[] data);", "public interface SignatureFactory \n{\n /** \n * initializes the implementation class \n */\n public void init()\n throws SignedDocException;\n \n /**\n * Method returns an array of strings representing the \n * list of available token names.\n * @return an array of available token names.\n * @throws SignedDocException if reading the token information fails.\n */\n public String[] getAvailableTokenNames()\n throws SignedDocException;\n \n /**\n * Method returns a digital signature. It finds the RSA private \n * key object from the active token and\n * then signs the given data with this key and RSA mechanism.\n * @param digest digest of the data to be signed.\n * @param token token index\n * @param pin users pin code\n * @return an array of bytes containing digital signature.\n * @throws SignedDocException if signing the data fails.\n */\n public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;\n \n /**\n * Method returns a X.509 certificate object readed \n * from the active token and representing an\n * user public key certificate value.\n * @return X.509 certificate object.\n * @throws SignedDocException if getting X.509 public key certificate \n * fails or the requested certificate type X.509 is not available in \n * the default provider package\n */\n public X509Certificate getCertificate(int token, String pin)\n throws SignedDocException;\n \n /**\n * Resets the previous session\n * and other selected values\n */\n public void reset() \n throws SignedDocException;\n \n\t/**\n\t * Method decrypts the data with the RSA private key\n\t * corresponding to this certificate (which was used\n\t * to encrypt it). Decryption will be done on the card.\n\t * This operation closes the possibly opened previous\n\t * session with signature token and opens a new one with\n\t * authentication token if necessary\n\t * @param data data to be decrypted.\n\t * @param token index of authentication token\n\t * @param pin PIN code\n\t * @return decrypted data.\n\t * @throws SignedDocException for all decryption errors\n\t */\n\tpublic byte[] decrypt(byte[] data, int token, String pin) \n\t\tthrows SignedDocException;\n\t\t\t\t\n}", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "private byte getSignatureType() \r\n \t //@ requires [?f]signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures [f]signatureType |-> theSignatureType &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\treturn signatureType[0];\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public byte[] signData(String fitxer, PrivateKey priv) {\n byte[] signature = null;\n FileInputStream datafis;\n BufferedInputStream bufin = null;\n byte[] buffer = new byte[1024];\n int len;\n \n try {\n Signature signer = Signature.getInstance(\"SHA256withRSA\");\n signer.initSign(priv); //Inicialitzem la firma digital a partirde l’algorisme utilitzat\n \n datafis = new FileInputStream(fitxer);\n bufin = new BufferedInputStream(datafis);\n \n while (bufin.available() != 0) {\n len = bufin.read(buffer);\n signer.update(buffer, 0, len);//Li assignem a l’objecte firma les dades afirmar digitalment\n } \n\n bufin.close();\n signature = signer.sign();//Finalment generem la firma\n } catch (Exception ex) {\n System.err.println(\"Error signant les dades: \" + ex);\n }\n return signature;\n }", "public\nSIGRecord(Name name, int dclass, long ttl, int covered, int alg, int origttl,\n\t Date expire, Date timeSigned, int footprint, Name signer,\n\t byte [] signature)\n{\n\tthis(name, dclass, ttl);\n\tType.check(covered);\n\tcheckU8(\"alg\", alg);\n\tcheckU8(\"labels\", labels);\n\tTTL.check(origttl);\n\tcheckU16(\"footprint\", footprint);\n\tthis.covered = covered;\n\tthis.alg = alg;\n\tthis.labels = name.labels();\n\tthis.origttl = origttl;\n\tthis.expire = expire;\n\tthis.timeSigned = timeSigned;\n\tthis.footprint = footprint;\n\tif (!signer.isAbsolute())\n\t\tthrow new RelativeNameException(signer);\n\tthis.signer = signer;\n\tthis.signature = signature;\n}", "ReleaseFile parseWithSignature( InputStream is, InputStream signStream, InputStream keyStream ) throws IOException;", "public void setSignature(String signature) {\n\t\tthis.signature = signature;\n\t}", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "ISModifySignature createISModifySignature();", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;", "boolean readSignature(Integer[] sig) {\n Scales.sendByte((byte) 's');\n\t /* Get actual signature */\n sig[2] = Scales.getByte();\n sig[1] = Scales.getByte();\n sig[0] = Scales.getByte();\n return true;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n if (signatureBuilder_ != null) {\n return signatureBuilder_.getMessageOrBuilder();\n } else {\n return signature_ == null ?\n org.apache.calcite.avatica.proto.Common.Signature.getDefaultInstance() : signature_;\n }\n }", "public String getSignature() {\n\t\treturn signature;\n\t}", "private void validateFermatPacketSignature(FermatPacket fermatPacketReceive){\n\n System.out.println(\" WsCommunicationVPNClient - validateFermatPacketSignature\");\n\n /*\n * Validate the signature\n */\n boolean isValid = AsymmectricCryptography.verifyMessageSignature(fermatPacketReceive.getSignature(), fermatPacketReceive.getMessageContent(), vpnServerIdentity);\n\n System.out.println(\" WsCommunicationVPNClient - isValid = \" + isValid);\n\n /*\n * if not valid signature\n */\n if (!isValid){\n throw new RuntimeException(\"Fermat Packet received has not a valid signature, go to close this connection maybe is compromise\");\n }\n\n }", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "public static byte[] SignWithPrivateKey(byte[] buf,PrivateKey pkey) throws Exception{\r\n\t\tSecureRandom secureRandom = new SecureRandom();\r\n\t\tSignature signature = Signature.getInstance(\"SHA1WithECDSA\");\r\n\t\tsignature.initSign(pkey,secureRandom);\r\n\t\tsignature.update(buf);\r\n\t\tbyte[] digitalSignature = signature.sign();\r\n\t\treturn digitalSignature;\r\n\t\t\r\n\t}", "public void setSignature(String Signature) {\n this.Signature = Signature;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n return getSignature();\n }", "public ISignature getSignature() {\n return _signature;\n }", "public String getSignature() {\n return this.Signature;\n }", "@SuppressWarnings(\"all\")\n public static void main(String...args) throws Exception {\n FileInputStream pubKFile = new FileInputStream(\"C:\\\\Demo\\\\publicKey\");\n byte[] encKey = new byte[pubKFile.available()];\n pubKFile.read(encKey);\n pubKFile.close();\n\n // 2. decode the public key\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encKey);\n PublicKey publicKey = KeyFactory.getInstance(\"DSA\").generatePublic(spec);\n\n // 3. read the signature\n FileInputStream signatureFile = new FileInputStream(\"C:\\\\Demo\\\\signature\");\n byte[] sigByte = new byte[signatureFile.available()];\n signatureFile.read(sigByte);\n signatureFile.close();\n\n // 4. generate the signature\n Signature signature = Signature.getInstance(\"SHA1withDSA\");\n signature.initVerify(publicKey);\n\n // 5. supply the data\n FileInputStream dataFile = new FileInputStream(\"C:\\\\Demo\\\\code\");\n BufferedInputStream dataStream = new BufferedInputStream(dataFile);\n byte[] tmpBuf = new byte[dataStream.available()];\n int len;\n while ((len = dataStream.read(tmpBuf)) >= 0) {\n signature.update(tmpBuf, 0, len);\n }\n dataStream.close();\n\n // 6. verify\n boolean result = signature.verify(sigByte);\n System.out.println(\"Result:\" + result);\n }", "public static void main(String[] args) {\n\n String pfx = \"E:\\\\PDFFileTest\\\\1.pfx\";\n String tmpPath = \"E:\\\\PDFFileTest\\\\1562570792439.pdf\";\n String expPath = \"E:\\\\PDFFileTest\\\\11.11\\\\h83.pdf\";\n String gif = \"E:\\\\PDFFileTest\\\\1.gif\";\n String password = \"111111\";\n try {\n sign(pfx, tmpPath, expPath, gif, password);\n System.out.println(\"success\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void generatePkcs1Md5Signature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 16) || (byteRead != 16))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// use the correct key\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t\r\n\t\tif (getSignatureType() == NON_REPUDIATION) {\t\t\r\n\t\t\tcipher.init((RSAPrivateCrtKey)nonRepKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\tif (getSignatureType() == AUTHENTICATION) {\r\n\t\t\tcipher.init((RSAPrivateCrtKey)authKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t\t\r\n\t\t////@ open valid(); // todo\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\t\t\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\t////@ open [1/2]valid();\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_MD5_PKCS1, lc);\r\n\t\t// copy the MD5 hash from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA), messageBuffer, (short) (128 - lc), lc);\r\n\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// generate signature\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as1);\r\n\t\t//@ foreachp_remove(messageBuffer, as1);\r\n\t\t//@ open transient_byte_array(messageBuffer);\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as1);\r\n\r\n\t\t////@ close [1/2]valid(); // auto\r\n\r\n\r\n\t}", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "boolean hasSig();", "boolean checkSignature(long sig0, long sig1, long sig2) throws Exception {\n Integer[] sig = new Integer[3];\n\t /* Get signature */\n readSignature(sig);\n\t /* Compare signature */\n if (sig[0] != sig0 || sig[1] != sig1 || sig[2] != sig2) {\n throw new Exception(\"Signature does not match selected device! \");\n }\n return true; // Indicate supported command.\n }", "void setSignatureImage(byte[] signatureImage);", "public boolean signRequired() {\n\t\treturn false;\n\t}", "protected byte[] getSignature() {\n return signatureImpl.calculate(content, null);\n }", "dkk mo4509g();", "SignatureSink createSignatureSink();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public void testDoubleX509SignatureThumb() throws Exception {\n WSSecSignature builder = new WSSecSignature();\n builder.setUserInfo(\"16c73ab6-b892-458f-abf5-2f875f74882e\", \"security\");\n // builder.setUserInfo(\"john\", \"keypass\");\n builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER); \n Document doc = unsignedEnvelope.getAsDocument();\n \n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc);\n\n Document signedDoc = builder.build(doc, crypto, secHeader);\n Document signedDoc1 = builder.build(signedDoc, crypto, secHeader);\n verify(signedDoc1);\n }", "public static byte[] sign(String stringPrivateKey,String plaintext){\r\n\t\ttry {\r\n\t\t\tPKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(stringPrivateKey));\r\n\t\t\tKeyFactory kf = KeyFactory.getInstance(\"EC\");\r\n\t\t\tPrivateKey privateKey= kf.generatePrivate(privateKeySpec);\r\n\t\t\tSignature sig = Signature.getInstance(\"SHA256withECDSA\");\r\n\t\t\tsig.initSign(privateKey);\r\n\t\t\tsig.update(plaintext.getBytes(\"UTF-8\"));\r\n\t\t\tbyte[] signature = sig.sign();\r\n\t\t\tSystem.out.println(\"Bytes:\"+signature.length);\r\n\t\t\treturn signature;\r\n\t\t} catch (InvalidKeyException | SignatureException | UnsupportedEncodingException | NoSuchAlgorithmException | InvalidKeySpecException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static void main(String[] args)\n throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, UnsupportedEncodingException {\n final String text = \"We would like to provide data integrity.\";\n\n /**\n * STEP 1.\n * We create a public-private key pair.\n * Standard Algorithm Names\n * http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html\n */\n final KeyPair key = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n /**\n * Alice creates Signature object defining Signature algorithm.\n */\n final Signature signatureAlg = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We initialize the signature object with\n * - Operation modes (SIGN) and\n * - provides appropriate ***Private*** Key\n */\n signatureAlg.initSign(key.getPrivate());\n\n // Finally, we load the message into the signature object and sign it\n signatureAlg.update(text.getBytes(\"UTF-8\"));\n final byte[] signedText = signatureAlg.sign();\n System.out.println(\"Signature: \" + DatatypeConverter.printHexBinary(signedText));\n\n /**\n * To verify the signature, we create another signature object\n * and specify its algorithm\n */\n final Signature signatureAlg2 = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We have to initialize it with the mode. But to verify the algorithm,\n * we only need the public key of the original signee\n */\n signatureAlg2.initVerify(key.getPublic());\n\n //Finally, we can check whether the signature is valid\n signatureAlg2.update(text.getBytes(\"UTF-8\"));\n\n if (signatureAlg2.verify(signedText))\n System.out.println(\"Valid signature.\");\n else\n System.err.println(\"Invalid signature.\");\n }", "public void affiche3(BigInteger signe){\n System.out.println(\"La signature est :\"+signe);\n }", "com.microsoft.schemas.office.x2006.digsig.STSignatureText xgetSignatureText();" ]
[ "0.7398622", "0.70440924", "0.7022031", "0.69217896", "0.69217896", "0.69217896", "0.6832896", "0.6822018", "0.6656805", "0.6584727", "0.6581324", "0.6581324", "0.65508157", "0.65186554", "0.6500605", "0.64922667", "0.6405426", "0.63177353", "0.6309137", "0.6309137", "0.6291624", "0.62736934", "0.62497795", "0.62446547", "0.62165594", "0.62156177", "0.62154174", "0.6184839", "0.6182062", "0.6166634", "0.6114771", "0.61045414", "0.60940474", "0.6082703", "0.6057142", "0.60518956", "0.60011655", "0.5997219", "0.5960978", "0.59380794", "0.5934817", "0.59194785", "0.5916384", "0.5911303", "0.58812356", "0.5865573", "0.5863711", "0.5856585", "0.5856585", "0.5855826", "0.5853409", "0.58434474", "0.5842665", "0.5823415", "0.5804242", "0.579979", "0.57987016", "0.57940054", "0.5792097", "0.5792097", "0.5792097", "0.5786611", "0.5785841", "0.57484907", "0.5737833", "0.5727212", "0.5724433", "0.57179654", "0.57173324", "0.5716925", "0.5716925", "0.57159585", "0.57159585", "0.57102674", "0.5696881", "0.56934804", "0.56818354", "0.56809944", "0.5679553", "0.5671512", "0.5665498", "0.5650605", "0.5649356", "0.56453955", "0.5642767", "0.5640675", "0.5640649", "0.5640535", "0.5631937", "0.5628895", "0.5620545", "0.56121653", "0.560563", "0.559209", "0.55807406", "0.55806303", "0.5575903", "0.556633", "0.5558993", "0.55369806", "0.55133957" ]
0.0
-1
pkidependent signature optional bytes signature = 5;
public Builder setSignature(com.google.protobuf.ByteString value) { copyOnWrite(); instance.setSignature(value); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract byte[] getSignature();", "com.google.protobuf.ByteString getSignature();", "int getSignature ();", "String getSignature();", "String getSignature();", "String getSignature();", "BigInteger getDigitalSignature();", "public abstract String getSignature();", "SignatureIdentification createSignatureIdentification();", "org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder();", "com.google.protobuf.ByteString\n getSignatureBytes();", "com.google.protobuf.ByteString\n getSignatureBytes();", "Signature getSignature();", "org.apache.calcite.avatica.proto.Common.Signature getSignature();", "byte[] getSignatureImage();", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }", "public GpgSignature(@NonNull byte[] signature) {\n\t\tthis.signature = signature;\n\t}", "byte[] generateSignature(byte[] message, PrivateKey privateKey, SecureRandom secureRandom) throws IOException;", "boolean hasSignature();", "boolean hasSignature();", "public byte[] getSigAlgParams() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[]\");\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "native String nativeGetSignature(long nativeHandler) throws RuntimeException;", "com.google.protobuf.ByteString getSig();", "SignatureSpi(com.android.org.bouncycastle.crypto.Digest r1, com.android.org.bouncycastle.crypto.DSA r2, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void\");\n }", "private void setSignature(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000010;\n signature_ = value;\n }", "String getUniqueSignature();", "public void setSignature( String pSignature )\r\n {\r\n this.signature = pSignature;\r\n }", "public byte []\ngetSignature() {\n\treturn signature;\n}", "int getSignatureType();", "@Override\n public String buildSignature(RequestDataToSign requestDataToSign, String appKey) {\n // find private key for this app\n final String secretKey = keyStore.getPrivateKey(appKey);\n if (secretKey == null) {\n LOG.error(\"Unknown application key: {}\", appKey);\n throw new PrivateKeyNotFoundException();\n }\n\n // sign\n return super.buildSignature(requestDataToSign, secretKey);\n }", "java.lang.String getSignatureText();", "public boolean verifySignature() {\r\n\t\t\r\n\t\tString data;\r\n\t\t\r\n\t\tif(isTypeCreation){\r\n\t\t\t\r\n\t\t\tdata = StringUtil.getStringFromKey(creator) + name +\r\n\t\t\t\t\tdescription + begin + end+end_subscription+\r\n\t\t\t\t\tlocation+min_capacity+max_capacity;\r\n\t\t\treturn StringUtil.verifyECDSASig(creator, data, signature);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata = StringUtil.getStringFromKey(subscriber)+id_event;\r\n\t\t\treturn StringUtil.verifyECDSASig(subscriber, data, signature);\r\n\t\t}\r\n//\t\tSystem.out.println(\"signature \"+signature);\r\n\t\t\r\n\t}", "public static native String getSignature(long[] msgArgs);", "@Override\n public boolean verifySignature(byte[] signature) {\n try {\n Element[] sig = derDecode(signature);\n CL04SignPublicPairingKeySerParameter pk = (CL04SignPublicPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(pairingKeySerParameter.getParameters());\n Element a = sig[0];\n Element b = sig[1];\n Element c = sig[2];\n List<Element> A = IntStream.range(3, 3 + messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n List<Element> B = IntStream.range(3 + messages.size(), 3 + 2 * messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n return aFormedCorrectly(pairing, a, A, pk) && bFormedCorrectly(pairing, a, b, A, B, pk) && cFormedCorrectly(pairing, a, b, c, B, pk);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return false;\n\n }", "public String getSignature()\r\n {\r\n return signature;\r\n }", "public boolean isSignatureRequired() {\n\t\treturn false;\n\t}", "boolean verifySignature(byte[] message, byte[] signature, PublicKey publicKey) throws IOException;", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public interface SignatureObject {\n}", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "com.google.protobuf.ByteString getArtifactSignature();", "public Signer getPDFSigner();", "public abstract String getSigAlgOID();", "public static void main(String[] args) {\n\n\t\tif (args.length != 5) {\n\t\t System.out.println(\"Usage: GenSig nameOfFileToSign keystore password sign publicKey\");\n\n\t\t }\n\t\telse try{\n\n\t\t KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t ks.load(new FileInputStream(args[1]), args[2].toCharArray());\n\t\t \n\t\t String alias = (String)ks.aliases().nextElement();\n\t\t PrivateKey privateKey = (PrivateKey) ks.getKey(alias, args[2].toCharArray());\n\n\t\t Certificate cert = ks.getCertificate(alias);\n\n\t\t // Get public key\t\n\t\t PublicKey publicKey = cert.getPublicKey();\n\n\t\t /* Create a Signature object and initialize it with the private key */\n\n\t\t Signature rsa = Signature.getInstance(\"SHA256withRSA\");\t\n\t\n\n\t\t rsa.initSign(privateKey);\n\n\t\t /* Update and sign the data */\n\n \t String hexString = readFile(args[0]).trim();\n\t\t byte[] decodedBytes = DatatypeConverter.parseHexBinary(hexString);\t\n\t\t InputStream bufin = new ByteArrayInputStream(decodedBytes);\n\n\n\t\t byte[] buffer = new byte[1024];\n\t\t int len;\n\t\t while (bufin.available() != 0) {\n\t\t\tlen = bufin.read(buffer);\n\t\t\trsa.update(buffer, 0, len);\n\t\t };\n\n\t\t bufin.close();\n\n\t\t /* Now that all the data to be signed has been read in, \n\t\t\t generate a signature for it */\n\n\t\t byte[] realSig = rsa.sign();\n\n\t\t \n\t\t /* Save the signature in a file */\n\n\t\t File file = new File(args[3]);\n\t\t PrintWriter out = new PrintWriter(file);\n\n\t\t\t// if file doesn't exists, then create it\n\t\t\tif (!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\n\t\t out.println(DatatypeConverter.printBase64Binary(realSig));\n\t\t out.close();\n\n\n\t\t /* Save the public key in a file */\n\t\t byte[] key = publicKey.getEncoded();\n\t\t FileOutputStream keyfos = new FileOutputStream(args[4]);\n\t\t keyfos.write(key);\n\n\t\t keyfos.close();\n\n\t\t} catch (Exception e) {\n\t\t System.err.println(\"Caught exception \" + e.toString());\n\t\t}\n\n\t}", "com.microsoft.schemas.office.x2006.digsig.STSignatureType xgetSignatureType();", "int getSignatureProviderDetails();", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "SignatureSource createSignatureSource();", "public byte[] getSignature()\n {\n return Arrays.clone(signature);\n }", "public Signator.Signers getUsedPDFSignerLibrary();", "String componentSignature();", "void setSignature(String signature) {\n this.signature = signature;\n }", "org.apache.xmlbeans.XmlBase64Binary xgetSignatureImage();", "public io.lightcone.data.types.EdDSASignatureOrBuilder getSigOrBuilder() {\n return getSig();\n }", "BlsPoint sign(BigInteger privateKey, byte[] data);", "public interface SignatureFactory \n{\n /** \n * initializes the implementation class \n */\n public void init()\n throws SignedDocException;\n \n /**\n * Method returns an array of strings representing the \n * list of available token names.\n * @return an array of available token names.\n * @throws SignedDocException if reading the token information fails.\n */\n public String[] getAvailableTokenNames()\n throws SignedDocException;\n \n /**\n * Method returns a digital signature. It finds the RSA private \n * key object from the active token and\n * then signs the given data with this key and RSA mechanism.\n * @param digest digest of the data to be signed.\n * @param token token index\n * @param pin users pin code\n * @return an array of bytes containing digital signature.\n * @throws SignedDocException if signing the data fails.\n */\n public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;\n \n /**\n * Method returns a X.509 certificate object readed \n * from the active token and representing an\n * user public key certificate value.\n * @return X.509 certificate object.\n * @throws SignedDocException if getting X.509 public key certificate \n * fails or the requested certificate type X.509 is not available in \n * the default provider package\n */\n public X509Certificate getCertificate(int token, String pin)\n throws SignedDocException;\n \n /**\n * Resets the previous session\n * and other selected values\n */\n public void reset() \n throws SignedDocException;\n \n\t/**\n\t * Method decrypts the data with the RSA private key\n\t * corresponding to this certificate (which was used\n\t * to encrypt it). Decryption will be done on the card.\n\t * This operation closes the possibly opened previous\n\t * session with signature token and opens a new one with\n\t * authentication token if necessary\n\t * @param data data to be decrypted.\n\t * @param token index of authentication token\n\t * @param pin PIN code\n\t * @return decrypted data.\n\t * @throws SignedDocException for all decryption errors\n\t */\n\tpublic byte[] decrypt(byte[] data, int token, String pin) \n\t\tthrows SignedDocException;\n\t\t\t\t\n}", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public byte[] signData(String fitxer, PrivateKey priv) {\n byte[] signature = null;\n FileInputStream datafis;\n BufferedInputStream bufin = null;\n byte[] buffer = new byte[1024];\n int len;\n \n try {\n Signature signer = Signature.getInstance(\"SHA256withRSA\");\n signer.initSign(priv); //Inicialitzem la firma digital a partirde l’algorisme utilitzat\n \n datafis = new FileInputStream(fitxer);\n bufin = new BufferedInputStream(datafis);\n \n while (bufin.available() != 0) {\n len = bufin.read(buffer);\n signer.update(buffer, 0, len);//Li assignem a l’objecte firma les dades afirmar digitalment\n } \n\n bufin.close();\n signature = signer.sign();//Finalment generem la firma\n } catch (Exception ex) {\n System.err.println(\"Error signant les dades: \" + ex);\n }\n return signature;\n }", "private byte getSignatureType() \r\n \t //@ requires [?f]signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures [f]signatureType |-> theSignatureType &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\treturn signatureType[0];\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public\nSIGRecord(Name name, int dclass, long ttl, int covered, int alg, int origttl,\n\t Date expire, Date timeSigned, int footprint, Name signer,\n\t byte [] signature)\n{\n\tthis(name, dclass, ttl);\n\tType.check(covered);\n\tcheckU8(\"alg\", alg);\n\tcheckU8(\"labels\", labels);\n\tTTL.check(origttl);\n\tcheckU16(\"footprint\", footprint);\n\tthis.covered = covered;\n\tthis.alg = alg;\n\tthis.labels = name.labels();\n\tthis.origttl = origttl;\n\tthis.expire = expire;\n\tthis.timeSigned = timeSigned;\n\tthis.footprint = footprint;\n\tif (!signer.isAbsolute())\n\t\tthrow new RelativeNameException(signer);\n\tthis.signer = signer;\n\tthis.signature = signature;\n}", "ReleaseFile parseWithSignature( InputStream is, InputStream signStream, InputStream keyStream ) throws IOException;", "public void setSignature(String signature) {\n\t\tthis.signature = signature;\n\t}", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "ISModifySignature createISModifySignature();", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;", "boolean readSignature(Integer[] sig) {\n Scales.sendByte((byte) 's');\n\t /* Get actual signature */\n sig[2] = Scales.getByte();\n sig[1] = Scales.getByte();\n sig[0] = Scales.getByte();\n return true;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n if (signatureBuilder_ != null) {\n return signatureBuilder_.getMessageOrBuilder();\n } else {\n return signature_ == null ?\n org.apache.calcite.avatica.proto.Common.Signature.getDefaultInstance() : signature_;\n }\n }", "private void validateFermatPacketSignature(FermatPacket fermatPacketReceive){\n\n System.out.println(\" WsCommunicationVPNClient - validateFermatPacketSignature\");\n\n /*\n * Validate the signature\n */\n boolean isValid = AsymmectricCryptography.verifyMessageSignature(fermatPacketReceive.getSignature(), fermatPacketReceive.getMessageContent(), vpnServerIdentity);\n\n System.out.println(\" WsCommunicationVPNClient - isValid = \" + isValid);\n\n /*\n * if not valid signature\n */\n if (!isValid){\n throw new RuntimeException(\"Fermat Packet received has not a valid signature, go to close this connection maybe is compromise\");\n }\n\n }", "public String getSignature() {\n\t\treturn signature;\n\t}", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "public static byte[] SignWithPrivateKey(byte[] buf,PrivateKey pkey) throws Exception{\r\n\t\tSecureRandom secureRandom = new SecureRandom();\r\n\t\tSignature signature = Signature.getInstance(\"SHA1WithECDSA\");\r\n\t\tsignature.initSign(pkey,secureRandom);\r\n\t\tsignature.update(buf);\r\n\t\tbyte[] digitalSignature = signature.sign();\r\n\t\treturn digitalSignature;\r\n\t\t\r\n\t}", "public void setSignature(String Signature) {\n this.Signature = Signature;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n return getSignature();\n }", "public ISignature getSignature() {\n return _signature;\n }", "public String getSignature() {\n return this.Signature;\n }", "@SuppressWarnings(\"all\")\n public static void main(String...args) throws Exception {\n FileInputStream pubKFile = new FileInputStream(\"C:\\\\Demo\\\\publicKey\");\n byte[] encKey = new byte[pubKFile.available()];\n pubKFile.read(encKey);\n pubKFile.close();\n\n // 2. decode the public key\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encKey);\n PublicKey publicKey = KeyFactory.getInstance(\"DSA\").generatePublic(spec);\n\n // 3. read the signature\n FileInputStream signatureFile = new FileInputStream(\"C:\\\\Demo\\\\signature\");\n byte[] sigByte = new byte[signatureFile.available()];\n signatureFile.read(sigByte);\n signatureFile.close();\n\n // 4. generate the signature\n Signature signature = Signature.getInstance(\"SHA1withDSA\");\n signature.initVerify(publicKey);\n\n // 5. supply the data\n FileInputStream dataFile = new FileInputStream(\"C:\\\\Demo\\\\code\");\n BufferedInputStream dataStream = new BufferedInputStream(dataFile);\n byte[] tmpBuf = new byte[dataStream.available()];\n int len;\n while ((len = dataStream.read(tmpBuf)) >= 0) {\n signature.update(tmpBuf, 0, len);\n }\n dataStream.close();\n\n // 6. verify\n boolean result = signature.verify(sigByte);\n System.out.println(\"Result:\" + result);\n }", "public static void main(String[] args) {\n\n String pfx = \"E:\\\\PDFFileTest\\\\1.pfx\";\n String tmpPath = \"E:\\\\PDFFileTest\\\\1562570792439.pdf\";\n String expPath = \"E:\\\\PDFFileTest\\\\11.11\\\\h83.pdf\";\n String gif = \"E:\\\\PDFFileTest\\\\1.gif\";\n String password = \"111111\";\n try {\n sign(pfx, tmpPath, expPath, gif, password);\n System.out.println(\"success\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "private void generatePkcs1Md5Signature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 16) || (byteRead != 16))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// use the correct key\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t\r\n\t\tif (getSignatureType() == NON_REPUDIATION) {\t\t\r\n\t\t\tcipher.init((RSAPrivateCrtKey)nonRepKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\tif (getSignatureType() == AUTHENTICATION) {\r\n\t\t\tcipher.init((RSAPrivateCrtKey)authKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t\t\r\n\t\t////@ open valid(); // todo\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\t\t\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\t////@ open [1/2]valid();\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_MD5_PKCS1, lc);\r\n\t\t// copy the MD5 hash from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA), messageBuffer, (short) (128 - lc), lc);\r\n\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// generate signature\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as1);\r\n\t\t//@ foreachp_remove(messageBuffer, as1);\r\n\t\t//@ open transient_byte_array(messageBuffer);\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as1);\r\n\r\n\t\t////@ close [1/2]valid(); // auto\r\n\r\n\r\n\t}", "boolean hasSig();", "boolean checkSignature(long sig0, long sig1, long sig2) throws Exception {\n Integer[] sig = new Integer[3];\n\t /* Get signature */\n readSignature(sig);\n\t /* Compare signature */\n if (sig[0] != sig0 || sig[1] != sig1 || sig[2] != sig2) {\n throw new Exception(\"Signature does not match selected device! \");\n }\n return true; // Indicate supported command.\n }", "void setSignatureImage(byte[] signatureImage);", "public boolean signRequired() {\n\t\treturn false;\n\t}", "protected byte[] getSignature() {\n return signatureImpl.calculate(content, null);\n }", "dkk mo4509g();", "SignatureSink createSignatureSink();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public void testDoubleX509SignatureThumb() throws Exception {\n WSSecSignature builder = new WSSecSignature();\n builder.setUserInfo(\"16c73ab6-b892-458f-abf5-2f875f74882e\", \"security\");\n // builder.setUserInfo(\"john\", \"keypass\");\n builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER); \n Document doc = unsignedEnvelope.getAsDocument();\n \n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc);\n\n Document signedDoc = builder.build(doc, crypto, secHeader);\n Document signedDoc1 = builder.build(signedDoc, crypto, secHeader);\n verify(signedDoc1);\n }", "public static byte[] sign(String stringPrivateKey,String plaintext){\r\n\t\ttry {\r\n\t\t\tPKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(stringPrivateKey));\r\n\t\t\tKeyFactory kf = KeyFactory.getInstance(\"EC\");\r\n\t\t\tPrivateKey privateKey= kf.generatePrivate(privateKeySpec);\r\n\t\t\tSignature sig = Signature.getInstance(\"SHA256withECDSA\");\r\n\t\t\tsig.initSign(privateKey);\r\n\t\t\tsig.update(plaintext.getBytes(\"UTF-8\"));\r\n\t\t\tbyte[] signature = sig.sign();\r\n\t\t\tSystem.out.println(\"Bytes:\"+signature.length);\r\n\t\t\treturn signature;\r\n\t\t} catch (InvalidKeyException | SignatureException | UnsupportedEncodingException | NoSuchAlgorithmException | InvalidKeySpecException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static void main(String[] args)\n throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, UnsupportedEncodingException {\n final String text = \"We would like to provide data integrity.\";\n\n /**\n * STEP 1.\n * We create a public-private key pair.\n * Standard Algorithm Names\n * http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html\n */\n final KeyPair key = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n /**\n * Alice creates Signature object defining Signature algorithm.\n */\n final Signature signatureAlg = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We initialize the signature object with\n * - Operation modes (SIGN) and\n * - provides appropriate ***Private*** Key\n */\n signatureAlg.initSign(key.getPrivate());\n\n // Finally, we load the message into the signature object and sign it\n signatureAlg.update(text.getBytes(\"UTF-8\"));\n final byte[] signedText = signatureAlg.sign();\n System.out.println(\"Signature: \" + DatatypeConverter.printHexBinary(signedText));\n\n /**\n * To verify the signature, we create another signature object\n * and specify its algorithm\n */\n final Signature signatureAlg2 = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We have to initialize it with the mode. But to verify the algorithm,\n * we only need the public key of the original signee\n */\n signatureAlg2.initVerify(key.getPublic());\n\n //Finally, we can check whether the signature is valid\n signatureAlg2.update(text.getBytes(\"UTF-8\"));\n\n if (signatureAlg2.verify(signedText))\n System.out.println(\"Valid signature.\");\n else\n System.err.println(\"Invalid signature.\");\n }", "public void affiche3(BigInteger signe){\n System.out.println(\"La signature est :\"+signe);\n }", "com.microsoft.schemas.office.x2006.digsig.STSignatureText xgetSignatureText();" ]
[ "0.73976135", "0.704309", "0.70210266", "0.6921052", "0.6921052", "0.6921052", "0.6833218", "0.68208843", "0.66571474", "0.65837884", "0.6580073", "0.6580073", "0.6549985", "0.65176594", "0.6499652", "0.6490479", "0.64046055", "0.63172966", "0.6307634", "0.6307634", "0.62898576", "0.6273093", "0.6249798", "0.62436706", "0.62151176", "0.6214869", "0.6214243", "0.6184172", "0.6180248", "0.61655164", "0.6113408", "0.61041343", "0.6092459", "0.6082781", "0.6056683", "0.60500777", "0.5998656", "0.59978396", "0.5959772", "0.593669", "0.59344125", "0.5918469", "0.5916969", "0.5910817", "0.58813316", "0.5864352", "0.58635926", "0.58560973", "0.58560973", "0.58557546", "0.5852426", "0.58436865", "0.5841626", "0.58226836", "0.5803321", "0.5799519", "0.5798923", "0.57931036", "0.57903373", "0.57903373", "0.57903373", "0.5785939", "0.57843107", "0.5747793", "0.5738761", "0.57264227", "0.5724643", "0.5718272", "0.5717422", "0.57154185", "0.57154185", "0.5714451", "0.5714451", "0.5710953", "0.5694987", "0.56920105", "0.5681027", "0.56799185", "0.56781644", "0.5672383", "0.56646734", "0.56491727", "0.5647587", "0.5643544", "0.5643239", "0.5640683", "0.56399196", "0.5639839", "0.5630529", "0.5627866", "0.561977", "0.56098723", "0.56039405", "0.5592808", "0.5580254", "0.55797774", "0.5576713", "0.5566575", "0.5559037", "0.5537511", "0.55128556" ]
0.0
-1
pkidependent signature optional bytes signature = 5;
public Builder clearSignature() { copyOnWrite(); instance.clearSignature(); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract byte[] getSignature();", "com.google.protobuf.ByteString getSignature();", "int getSignature ();", "String getSignature();", "String getSignature();", "String getSignature();", "BigInteger getDigitalSignature();", "public abstract String getSignature();", "SignatureIdentification createSignatureIdentification();", "org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder();", "com.google.protobuf.ByteString\n getSignatureBytes();", "com.google.protobuf.ByteString\n getSignatureBytes();", "Signature getSignature();", "org.apache.calcite.avatica.proto.Common.Signature getSignature();", "byte[] getSignatureImage();", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }", "public GpgSignature(@NonNull byte[] signature) {\n\t\tthis.signature = signature;\n\t}", "byte[] generateSignature(byte[] message, PrivateKey privateKey, SecureRandom secureRandom) throws IOException;", "boolean hasSignature();", "boolean hasSignature();", "public byte[] getSigAlgParams() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSigAlgParams():byte[]\");\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "native String nativeGetSignature(long nativeHandler) throws RuntimeException;", "com.google.protobuf.ByteString getSig();", "SignatureSpi(com.android.org.bouncycastle.crypto.Digest r1, com.android.org.bouncycastle.crypto.DSA r2, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void\");\n }", "private void setSignature(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000010;\n signature_ = value;\n }", "String getUniqueSignature();", "public void setSignature( String pSignature )\r\n {\r\n this.signature = pSignature;\r\n }", "public byte []\ngetSignature() {\n\treturn signature;\n}", "int getSignatureType();", "@Override\n public String buildSignature(RequestDataToSign requestDataToSign, String appKey) {\n // find private key for this app\n final String secretKey = keyStore.getPrivateKey(appKey);\n if (secretKey == null) {\n LOG.error(\"Unknown application key: {}\", appKey);\n throw new PrivateKeyNotFoundException();\n }\n\n // sign\n return super.buildSignature(requestDataToSign, secretKey);\n }", "java.lang.String getSignatureText();", "public boolean verifySignature() {\r\n\t\t\r\n\t\tString data;\r\n\t\t\r\n\t\tif(isTypeCreation){\r\n\t\t\t\r\n\t\t\tdata = StringUtil.getStringFromKey(creator) + name +\r\n\t\t\t\t\tdescription + begin + end+end_subscription+\r\n\t\t\t\t\tlocation+min_capacity+max_capacity;\r\n\t\t\treturn StringUtil.verifyECDSASig(creator, data, signature);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata = StringUtil.getStringFromKey(subscriber)+id_event;\r\n\t\t\treturn StringUtil.verifyECDSASig(subscriber, data, signature);\r\n\t\t}\r\n//\t\tSystem.out.println(\"signature \"+signature);\r\n\t\t\r\n\t}", "public static native String getSignature(long[] msgArgs);", "@Override\n public boolean verifySignature(byte[] signature) {\n try {\n Element[] sig = derDecode(signature);\n CL04SignPublicPairingKeySerParameter pk = (CL04SignPublicPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(pairingKeySerParameter.getParameters());\n Element a = sig[0];\n Element b = sig[1];\n Element c = sig[2];\n List<Element> A = IntStream.range(3, 3 + messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n List<Element> B = IntStream.range(3 + messages.size(), 3 + 2 * messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n return aFormedCorrectly(pairing, a, A, pk) && bFormedCorrectly(pairing, a, b, A, B, pk) && cFormedCorrectly(pairing, a, b, c, B, pk);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return false;\n\n }", "public String getSignature()\r\n {\r\n return signature;\r\n }", "public boolean isSignatureRequired() {\n\t\treturn false;\n\t}", "boolean verifySignature(byte[] message, byte[] signature, PublicKey publicKey) throws IOException;", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public interface SignatureObject {\n}", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "com.google.protobuf.ByteString getArtifactSignature();", "public Signer getPDFSigner();", "public abstract String getSigAlgOID();", "public static void main(String[] args) {\n\n\t\tif (args.length != 5) {\n\t\t System.out.println(\"Usage: GenSig nameOfFileToSign keystore password sign publicKey\");\n\n\t\t }\n\t\telse try{\n\n\t\t KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t ks.load(new FileInputStream(args[1]), args[2].toCharArray());\n\t\t \n\t\t String alias = (String)ks.aliases().nextElement();\n\t\t PrivateKey privateKey = (PrivateKey) ks.getKey(alias, args[2].toCharArray());\n\n\t\t Certificate cert = ks.getCertificate(alias);\n\n\t\t // Get public key\t\n\t\t PublicKey publicKey = cert.getPublicKey();\n\n\t\t /* Create a Signature object and initialize it with the private key */\n\n\t\t Signature rsa = Signature.getInstance(\"SHA256withRSA\");\t\n\t\n\n\t\t rsa.initSign(privateKey);\n\n\t\t /* Update and sign the data */\n\n \t String hexString = readFile(args[0]).trim();\n\t\t byte[] decodedBytes = DatatypeConverter.parseHexBinary(hexString);\t\n\t\t InputStream bufin = new ByteArrayInputStream(decodedBytes);\n\n\n\t\t byte[] buffer = new byte[1024];\n\t\t int len;\n\t\t while (bufin.available() != 0) {\n\t\t\tlen = bufin.read(buffer);\n\t\t\trsa.update(buffer, 0, len);\n\t\t };\n\n\t\t bufin.close();\n\n\t\t /* Now that all the data to be signed has been read in, \n\t\t\t generate a signature for it */\n\n\t\t byte[] realSig = rsa.sign();\n\n\t\t \n\t\t /* Save the signature in a file */\n\n\t\t File file = new File(args[3]);\n\t\t PrintWriter out = new PrintWriter(file);\n\n\t\t\t// if file doesn't exists, then create it\n\t\t\tif (!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\n\t\t out.println(DatatypeConverter.printBase64Binary(realSig));\n\t\t out.close();\n\n\n\t\t /* Save the public key in a file */\n\t\t byte[] key = publicKey.getEncoded();\n\t\t FileOutputStream keyfos = new FileOutputStream(args[4]);\n\t\t keyfos.write(key);\n\n\t\t keyfos.close();\n\n\t\t} catch (Exception e) {\n\t\t System.err.println(\"Caught exception \" + e.toString());\n\t\t}\n\n\t}", "com.microsoft.schemas.office.x2006.digsig.STSignatureType xgetSignatureType();", "int getSignatureProviderDetails();", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "SignatureSource createSignatureSource();", "public byte[] getSignature()\n {\n return Arrays.clone(signature);\n }", "public Signator.Signers getUsedPDFSignerLibrary();", "String componentSignature();", "void setSignature(String signature) {\n this.signature = signature;\n }", "org.apache.xmlbeans.XmlBase64Binary xgetSignatureImage();", "public io.lightcone.data.types.EdDSASignatureOrBuilder getSigOrBuilder() {\n return getSig();\n }", "BlsPoint sign(BigInteger privateKey, byte[] data);", "public interface SignatureFactory \n{\n /** \n * initializes the implementation class \n */\n public void init()\n throws SignedDocException;\n \n /**\n * Method returns an array of strings representing the \n * list of available token names.\n * @return an array of available token names.\n * @throws SignedDocException if reading the token information fails.\n */\n public String[] getAvailableTokenNames()\n throws SignedDocException;\n \n /**\n * Method returns a digital signature. It finds the RSA private \n * key object from the active token and\n * then signs the given data with this key and RSA mechanism.\n * @param digest digest of the data to be signed.\n * @param token token index\n * @param pin users pin code\n * @return an array of bytes containing digital signature.\n * @throws SignedDocException if signing the data fails.\n */\n public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;\n \n /**\n * Method returns a X.509 certificate object readed \n * from the active token and representing an\n * user public key certificate value.\n * @return X.509 certificate object.\n * @throws SignedDocException if getting X.509 public key certificate \n * fails or the requested certificate type X.509 is not available in \n * the default provider package\n */\n public X509Certificate getCertificate(int token, String pin)\n throws SignedDocException;\n \n /**\n * Resets the previous session\n * and other selected values\n */\n public void reset() \n throws SignedDocException;\n \n\t/**\n\t * Method decrypts the data with the RSA private key\n\t * corresponding to this certificate (which was used\n\t * to encrypt it). Decryption will be done on the card.\n\t * This operation closes the possibly opened previous\n\t * session with signature token and opens a new one with\n\t * authentication token if necessary\n\t * @param data data to be decrypted.\n\t * @param token index of authentication token\n\t * @param pin PIN code\n\t * @return decrypted data.\n\t * @throws SignedDocException for all decryption errors\n\t */\n\tpublic byte[] decrypt(byte[] data, int token, String pin) \n\t\tthrows SignedDocException;\n\t\t\t\t\n}", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public byte[] signData(String fitxer, PrivateKey priv) {\n byte[] signature = null;\n FileInputStream datafis;\n BufferedInputStream bufin = null;\n byte[] buffer = new byte[1024];\n int len;\n \n try {\n Signature signer = Signature.getInstance(\"SHA256withRSA\");\n signer.initSign(priv); //Inicialitzem la firma digital a partirde l’algorisme utilitzat\n \n datafis = new FileInputStream(fitxer);\n bufin = new BufferedInputStream(datafis);\n \n while (bufin.available() != 0) {\n len = bufin.read(buffer);\n signer.update(buffer, 0, len);//Li assignem a l’objecte firma les dades afirmar digitalment\n } \n\n bufin.close();\n signature = signer.sign();//Finalment generem la firma\n } catch (Exception ex) {\n System.err.println(\"Error signant les dades: \" + ex);\n }\n return signature;\n }", "private byte getSignatureType() \r\n \t //@ requires [?f]signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures [f]signatureType |-> theSignatureType &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\treturn signatureType[0];\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public\nSIGRecord(Name name, int dclass, long ttl, int covered, int alg, int origttl,\n\t Date expire, Date timeSigned, int footprint, Name signer,\n\t byte [] signature)\n{\n\tthis(name, dclass, ttl);\n\tType.check(covered);\n\tcheckU8(\"alg\", alg);\n\tcheckU8(\"labels\", labels);\n\tTTL.check(origttl);\n\tcheckU16(\"footprint\", footprint);\n\tthis.covered = covered;\n\tthis.alg = alg;\n\tthis.labels = name.labels();\n\tthis.origttl = origttl;\n\tthis.expire = expire;\n\tthis.timeSigned = timeSigned;\n\tthis.footprint = footprint;\n\tif (!signer.isAbsolute())\n\t\tthrow new RelativeNameException(signer);\n\tthis.signer = signer;\n\tthis.signature = signature;\n}", "ReleaseFile parseWithSignature( InputStream is, InputStream signStream, InputStream keyStream ) throws IOException;", "public void setSignature(String signature) {\n\t\tthis.signature = signature;\n\t}", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "ISModifySignature createISModifySignature();", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;", "boolean readSignature(Integer[] sig) {\n Scales.sendByte((byte) 's');\n\t /* Get actual signature */\n sig[2] = Scales.getByte();\n sig[1] = Scales.getByte();\n sig[0] = Scales.getByte();\n return true;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n if (signatureBuilder_ != null) {\n return signatureBuilder_.getMessageOrBuilder();\n } else {\n return signature_ == null ?\n org.apache.calcite.avatica.proto.Common.Signature.getDefaultInstance() : signature_;\n }\n }", "private void validateFermatPacketSignature(FermatPacket fermatPacketReceive){\n\n System.out.println(\" WsCommunicationVPNClient - validateFermatPacketSignature\");\n\n /*\n * Validate the signature\n */\n boolean isValid = AsymmectricCryptography.verifyMessageSignature(fermatPacketReceive.getSignature(), fermatPacketReceive.getMessageContent(), vpnServerIdentity);\n\n System.out.println(\" WsCommunicationVPNClient - isValid = \" + isValid);\n\n /*\n * if not valid signature\n */\n if (!isValid){\n throw new RuntimeException(\"Fermat Packet received has not a valid signature, go to close this connection maybe is compromise\");\n }\n\n }", "public String getSignature() {\n\t\treturn signature;\n\t}", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "public static byte[] SignWithPrivateKey(byte[] buf,PrivateKey pkey) throws Exception{\r\n\t\tSecureRandom secureRandom = new SecureRandom();\r\n\t\tSignature signature = Signature.getInstance(\"SHA1WithECDSA\");\r\n\t\tsignature.initSign(pkey,secureRandom);\r\n\t\tsignature.update(buf);\r\n\t\tbyte[] digitalSignature = signature.sign();\r\n\t\treturn digitalSignature;\r\n\t\t\r\n\t}", "public void setSignature(String Signature) {\n this.Signature = Signature;\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n return getSignature();\n }", "public ISignature getSignature() {\n return _signature;\n }", "public String getSignature() {\n return this.Signature;\n }", "@SuppressWarnings(\"all\")\n public static void main(String...args) throws Exception {\n FileInputStream pubKFile = new FileInputStream(\"C:\\\\Demo\\\\publicKey\");\n byte[] encKey = new byte[pubKFile.available()];\n pubKFile.read(encKey);\n pubKFile.close();\n\n // 2. decode the public key\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encKey);\n PublicKey publicKey = KeyFactory.getInstance(\"DSA\").generatePublic(spec);\n\n // 3. read the signature\n FileInputStream signatureFile = new FileInputStream(\"C:\\\\Demo\\\\signature\");\n byte[] sigByte = new byte[signatureFile.available()];\n signatureFile.read(sigByte);\n signatureFile.close();\n\n // 4. generate the signature\n Signature signature = Signature.getInstance(\"SHA1withDSA\");\n signature.initVerify(publicKey);\n\n // 5. supply the data\n FileInputStream dataFile = new FileInputStream(\"C:\\\\Demo\\\\code\");\n BufferedInputStream dataStream = new BufferedInputStream(dataFile);\n byte[] tmpBuf = new byte[dataStream.available()];\n int len;\n while ((len = dataStream.read(tmpBuf)) >= 0) {\n signature.update(tmpBuf, 0, len);\n }\n dataStream.close();\n\n // 6. verify\n boolean result = signature.verify(sigByte);\n System.out.println(\"Result:\" + result);\n }", "public static void main(String[] args) {\n\n String pfx = \"E:\\\\PDFFileTest\\\\1.pfx\";\n String tmpPath = \"E:\\\\PDFFileTest\\\\1562570792439.pdf\";\n String expPath = \"E:\\\\PDFFileTest\\\\11.11\\\\h83.pdf\";\n String gif = \"E:\\\\PDFFileTest\\\\1.gif\";\n String password = \"111111\";\n try {\n sign(pfx, tmpPath, expPath, gif, password);\n System.out.println(\"success\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "private void generatePkcs1Md5Signature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 16) || (byteRead != 16))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// use the correct key\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t\r\n\t\tif (getSignatureType() == NON_REPUDIATION) {\t\t\r\n\t\t\tcipher.init((RSAPrivateCrtKey)nonRepKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\tif (getSignatureType() == AUTHENTICATION) {\r\n\t\t\tcipher.init((RSAPrivateCrtKey)authKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t\t\r\n\t\t////@ open valid(); // todo\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\t\t\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\t////@ open [1/2]valid();\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_MD5_PKCS1, lc);\r\n\t\t// copy the MD5 hash from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA), messageBuffer, (short) (128 - lc), lc);\r\n\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// generate signature\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as1);\r\n\t\t//@ foreachp_remove(messageBuffer, as1);\r\n\t\t//@ open transient_byte_array(messageBuffer);\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as1);\r\n\r\n\t\t////@ close [1/2]valid(); // auto\r\n\r\n\r\n\t}", "boolean hasSig();", "boolean checkSignature(long sig0, long sig1, long sig2) throws Exception {\n Integer[] sig = new Integer[3];\n\t /* Get signature */\n readSignature(sig);\n\t /* Compare signature */\n if (sig[0] != sig0 || sig[1] != sig1 || sig[2] != sig2) {\n throw new Exception(\"Signature does not match selected device! \");\n }\n return true; // Indicate supported command.\n }", "void setSignatureImage(byte[] signatureImage);", "public boolean signRequired() {\n\t\treturn false;\n\t}", "protected byte[] getSignature() {\n return signatureImpl.calculate(content, null);\n }", "dkk mo4509g();", "SignatureSink createSignatureSink();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public void testDoubleX509SignatureThumb() throws Exception {\n WSSecSignature builder = new WSSecSignature();\n builder.setUserInfo(\"16c73ab6-b892-458f-abf5-2f875f74882e\", \"security\");\n // builder.setUserInfo(\"john\", \"keypass\");\n builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER); \n Document doc = unsignedEnvelope.getAsDocument();\n \n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc);\n\n Document signedDoc = builder.build(doc, crypto, secHeader);\n Document signedDoc1 = builder.build(signedDoc, crypto, secHeader);\n verify(signedDoc1);\n }", "public static byte[] sign(String stringPrivateKey,String plaintext){\r\n\t\ttry {\r\n\t\t\tPKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(stringPrivateKey));\r\n\t\t\tKeyFactory kf = KeyFactory.getInstance(\"EC\");\r\n\t\t\tPrivateKey privateKey= kf.generatePrivate(privateKeySpec);\r\n\t\t\tSignature sig = Signature.getInstance(\"SHA256withECDSA\");\r\n\t\t\tsig.initSign(privateKey);\r\n\t\t\tsig.update(plaintext.getBytes(\"UTF-8\"));\r\n\t\t\tbyte[] signature = sig.sign();\r\n\t\t\tSystem.out.println(\"Bytes:\"+signature.length);\r\n\t\t\treturn signature;\r\n\t\t} catch (InvalidKeyException | SignatureException | UnsupportedEncodingException | NoSuchAlgorithmException | InvalidKeySpecException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static void main(String[] args)\n throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, UnsupportedEncodingException {\n final String text = \"We would like to provide data integrity.\";\n\n /**\n * STEP 1.\n * We create a public-private key pair.\n * Standard Algorithm Names\n * http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html\n */\n final KeyPair key = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n /**\n * Alice creates Signature object defining Signature algorithm.\n */\n final Signature signatureAlg = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We initialize the signature object with\n * - Operation modes (SIGN) and\n * - provides appropriate ***Private*** Key\n */\n signatureAlg.initSign(key.getPrivate());\n\n // Finally, we load the message into the signature object and sign it\n signatureAlg.update(text.getBytes(\"UTF-8\"));\n final byte[] signedText = signatureAlg.sign();\n System.out.println(\"Signature: \" + DatatypeConverter.printHexBinary(signedText));\n\n /**\n * To verify the signature, we create another signature object\n * and specify its algorithm\n */\n final Signature signatureAlg2 = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We have to initialize it with the mode. But to verify the algorithm,\n * we only need the public key of the original signee\n */\n signatureAlg2.initVerify(key.getPublic());\n\n //Finally, we can check whether the signature is valid\n signatureAlg2.update(text.getBytes(\"UTF-8\"));\n\n if (signatureAlg2.verify(signedText))\n System.out.println(\"Valid signature.\");\n else\n System.err.println(\"Invalid signature.\");\n }", "public void affiche3(BigInteger signe){\n System.out.println(\"La signature est :\"+signe);\n }", "com.microsoft.schemas.office.x2006.digsig.STSignatureText xgetSignatureText();" ]
[ "0.73976135", "0.704309", "0.70210266", "0.6921052", "0.6921052", "0.6921052", "0.6833218", "0.68208843", "0.66571474", "0.65837884", "0.6580073", "0.6580073", "0.6549985", "0.65176594", "0.6499652", "0.6490479", "0.64046055", "0.63172966", "0.6307634", "0.6307634", "0.62898576", "0.6273093", "0.6249798", "0.62436706", "0.62151176", "0.6214869", "0.6214243", "0.6184172", "0.6180248", "0.61655164", "0.6113408", "0.61041343", "0.6092459", "0.6082781", "0.6056683", "0.60500777", "0.5998656", "0.59978396", "0.5959772", "0.593669", "0.59344125", "0.5918469", "0.5916969", "0.5910817", "0.58813316", "0.5864352", "0.58635926", "0.58560973", "0.58560973", "0.58557546", "0.5852426", "0.58436865", "0.5841626", "0.58226836", "0.5803321", "0.5799519", "0.5798923", "0.57931036", "0.57903373", "0.57903373", "0.57903373", "0.5785939", "0.57843107", "0.5747793", "0.5738761", "0.57264227", "0.5724643", "0.5718272", "0.5717422", "0.57154185", "0.57154185", "0.5714451", "0.5714451", "0.5710953", "0.5694987", "0.56920105", "0.5681027", "0.56799185", "0.56781644", "0.5672383", "0.56646734", "0.56491727", "0.5647587", "0.5643544", "0.5643239", "0.5640683", "0.56399196", "0.5639839", "0.5630529", "0.5627866", "0.561977", "0.56098723", "0.56039405", "0.5592808", "0.5580254", "0.55797774", "0.5576713", "0.5566575", "0.5559037", "0.5537511", "0.55128556" ]
0.0
-1
DERencoded X.509 certificate chain repeated bytes certificate = 1;
java.util.List<com.google.protobuf.ByteString> getCertificateList();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6394192", "0.61330765", "0.61006594", "0.60482687", "0.602352", "0.6006773", "0.5965928", "0.58786696", "0.5791951", "0.57439876", "0.57363886", "0.57346094", "0.57299364", "0.57224", "0.57224", "0.5619409", "0.558984", "0.55617076", "0.55617076", "0.55569893", "0.55530185", "0.5547045", "0.5518622", "0.5511868", "0.55108696", "0.55108696", "0.5485581", "0.5463167", "0.544292", "0.54160935", "0.5413839", "0.5406575", "0.540317", "0.53949416", "0.5339265", "0.5333285", "0.5325161", "0.53196114", "0.5315588", "0.5311513", "0.53066754", "0.53033113", "0.5289029", "0.52745855", "0.5264804", "0.5264804", "0.5260825", "0.5249203", "0.5244855", "0.5244754", "0.523448", "0.5218867", "0.5218258", "0.5204517", "0.5194733", "0.51866835", "0.5178598", "0.5163447", "0.5143541", "0.5132101", "0.5127687", "0.51237017", "0.5109286", "0.5078722", "0.5071932", "0.5069754", "0.50655746", "0.5061466", "0.50556165", "0.5055193", "0.50545955", "0.50522506", "0.5043691", "0.5038166", "0.5029388", "0.5022404", "0.50123733", "0.50072986", "0.5006049", "0.50052065", "0.49996534", "0.49953255", "0.49761605", "0.49707028", "0.49616292", "0.49591652", "0.49554187", "0.4952366", "0.49480525", "0.49473253", "0.4944978", "0.493571", "0.49247384", "0.49124497", "0.4910755", "0.49064356", "0.48939002", "0.48905846", "0.48885608", "0.48816416" ]
0.5626907
15
DERencoded X.509 certificate chain repeated bytes certificate = 1;
int getCertificateCount();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6393691", "0.6132981", "0.610133", "0.60493743", "0.60226244", "0.60062546", "0.5965777", "0.58786803", "0.5792661", "0.57446504", "0.57361895", "0.5734376", "0.57294655", "0.57224315", "0.57224315", "0.5627075", "0.5619113", "0.5589357", "0.5561189", "0.5561189", "0.55562174", "0.5552454", "0.55465317", "0.55187744", "0.55113304", "0.5510848", "0.5510848", "0.5486289", "0.54632354", "0.54419345", "0.5414766", "0.5413758", "0.54069126", "0.5403797", "0.53956133", "0.5339408", "0.53336936", "0.53254783", "0.5319129", "0.53157705", "0.5311538", "0.5306761", "0.53027284", "0.528877", "0.5274992", "0.52644", "0.52644", "0.5260611", "0.5248674", "0.5245094", "0.5244277", "0.52361006", "0.52190125", "0.52184993", "0.52039486", "0.51941496", "0.518727", "0.5179285", "0.5163885", "0.51430416", "0.5131618", "0.5127767", "0.5122257", "0.51092076", "0.5078354", "0.50710535", "0.5070632", "0.5066335", "0.50609124", "0.50565493", "0.505563", "0.5054315", "0.5051865", "0.5043288", "0.5038498", "0.502956", "0.50232697", "0.5013959", "0.5006349", "0.50061744", "0.5004363", "0.5000391", "0.49950904", "0.49760792", "0.4971123", "0.4961426", "0.49599686", "0.49553004", "0.49525094", "0.49475256", "0.49472058", "0.4945735", "0.49363053", "0.49241063", "0.4913188", "0.49096376", "0.49059084", "0.4894333", "0.48917437", "0.48894823", "0.48809448" ]
0.0
-1
DERencoded X.509 certificate chain repeated bytes certificate = 1;
com.google.protobuf.ByteString getCertificate(int index);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6394264", "0.6133", "0.6048322", "0.602348", "0.6006828", "0.5965939", "0.5878645", "0.57918864", "0.57440233", "0.5736294", "0.57346123", "0.5729974", "0.57223564", "0.57223564", "0.56269145", "0.5619426", "0.5589989", "0.5561688", "0.5561688", "0.55568737", "0.5552956", "0.55470085", "0.55187273", "0.5511795", "0.5510891", "0.5510891", "0.5485625", "0.5463288", "0.54430336", "0.54161096", "0.54138064", "0.54065895", "0.5403303", "0.5394938", "0.5339361", "0.5333479", "0.5325224", "0.5319512", "0.53156906", "0.5311456", "0.5306741", "0.5303345", "0.52891165", "0.5274534", "0.5264846", "0.5264846", "0.526077", "0.52492887", "0.5244901", "0.52447456", "0.5234571", "0.5218953", "0.52181095", "0.5204579", "0.5194795", "0.5186814", "0.5178515", "0.516352", "0.5143562", "0.5132147", "0.512766", "0.51236075", "0.51093286", "0.5078684", "0.5071915", "0.5069776", "0.5065688", "0.5061457", "0.5055575", "0.50551426", "0.5054419", "0.5052279", "0.504373", "0.5038082", "0.5029488", "0.50224143", "0.50123596", "0.50072867", "0.50061095", "0.5005222", "0.49996942", "0.4995226", "0.49762338", "0.4970684", "0.4961693", "0.4959164", "0.49555925", "0.49524254", "0.49481726", "0.49473765", "0.49449876", "0.49357104", "0.49247393", "0.4912303", "0.49107757", "0.49064335", "0.48940066", "0.48905843", "0.48884922", "0.48816553" ]
0.6100678
2
DERencoded X.509 certificate chain repeated bytes certificate = 1;
@java.lang.Override public java.util.List<com.google.protobuf.ByteString> getCertificateList() { return certificate_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6394264", "0.6133", "0.6100678", "0.6048322", "0.602348", "0.6006828", "0.5965939", "0.5878645", "0.57918864", "0.57440233", "0.5736294", "0.57346123", "0.5729974", "0.57223564", "0.57223564", "0.56269145", "0.5619426", "0.5589989", "0.5561688", "0.5561688", "0.55568737", "0.5552956", "0.55470085", "0.55187273", "0.5511795", "0.5510891", "0.5510891", "0.5485625", "0.5463288", "0.54430336", "0.54161096", "0.54138064", "0.54065895", "0.5403303", "0.5394938", "0.5339361", "0.5333479", "0.5319512", "0.53156906", "0.5311456", "0.5306741", "0.5303345", "0.52891165", "0.5274534", "0.5264846", "0.5264846", "0.526077", "0.52492887", "0.5244901", "0.52447456", "0.5234571", "0.5218953", "0.52181095", "0.5204579", "0.5194795", "0.5186814", "0.5178515", "0.516352", "0.5143562", "0.5132147", "0.512766", "0.51236075", "0.51093286", "0.5078684", "0.5071915", "0.5069776", "0.5065688", "0.5061457", "0.5055575", "0.50551426", "0.5054419", "0.5052279", "0.504373", "0.5038082", "0.5029488", "0.50224143", "0.50123596", "0.50072867", "0.50061095", "0.5005222", "0.49996942", "0.4995226", "0.49762338", "0.4970684", "0.4961693", "0.4959164", "0.49555925", "0.49524254", "0.49481726", "0.49473765", "0.49449876", "0.49357104", "0.49247393", "0.4912303", "0.49107757", "0.49064335", "0.48940066", "0.48905843", "0.48884922", "0.48816553" ]
0.5325224
37
DERencoded X.509 certificate chain repeated bytes certificate = 1;
@java.lang.Override public int getCertificateCount() { return certificate_.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6394192", "0.61330765", "0.61006594", "0.60482687", "0.602352", "0.6006773", "0.5965928", "0.58786696", "0.5791951", "0.57439876", "0.57363886", "0.57346094", "0.57299364", "0.57224", "0.57224", "0.5626907", "0.5619409", "0.558984", "0.55617076", "0.55617076", "0.55569893", "0.55530185", "0.5547045", "0.5518622", "0.5511868", "0.55108696", "0.55108696", "0.5485581", "0.5463167", "0.544292", "0.54160935", "0.5413839", "0.5406575", "0.540317", "0.53949416", "0.5339265", "0.5333285", "0.5325161", "0.53196114", "0.5315588", "0.5311513", "0.53066754", "0.53033113", "0.5289029", "0.52745855", "0.5264804", "0.5264804", "0.5260825", "0.5249203", "0.5244855", "0.5244754", "0.523448", "0.5218867", "0.5218258", "0.5204517", "0.5194733", "0.51866835", "0.5178598", "0.5163447", "0.5143541", "0.5132101", "0.5127687", "0.51237017", "0.5109286", "0.5078722", "0.5071932", "0.5069754", "0.50655746", "0.5061466", "0.50556165", "0.5055193", "0.50545955", "0.50522506", "0.5043691", "0.5038166", "0.5029388", "0.5022404", "0.50123733", "0.50072986", "0.5006049", "0.50052065", "0.49996534", "0.49953255", "0.49761605", "0.49707028", "0.49616292", "0.49591652", "0.4952366", "0.49480525", "0.49473253", "0.4944978", "0.493571", "0.49247384", "0.49124497", "0.4910755", "0.49064356", "0.48939002", "0.48905846", "0.48885608", "0.48816416" ]
0.49554187
87
DERencoded X.509 certificate chain repeated bytes certificate = 1;
@java.lang.Override public com.google.protobuf.ByteString getCertificate(int index) { return certificate_.get(index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6393691", "0.6132981", "0.610133", "0.60493743", "0.60226244", "0.60062546", "0.5965777", "0.58786803", "0.5792661", "0.57446504", "0.57361895", "0.5734376", "0.57294655", "0.57224315", "0.57224315", "0.5627075", "0.5619113", "0.5589357", "0.5561189", "0.5561189", "0.55562174", "0.5552454", "0.55465317", "0.55187744", "0.55113304", "0.5510848", "0.5510848", "0.5486289", "0.54632354", "0.54419345", "0.5414766", "0.5413758", "0.54069126", "0.5403797", "0.5339408", "0.53336936", "0.53254783", "0.5319129", "0.53157705", "0.5311538", "0.5306761", "0.53027284", "0.528877", "0.5274992", "0.52644", "0.52644", "0.5260611", "0.5248674", "0.5245094", "0.5244277", "0.52361006", "0.52190125", "0.52184993", "0.52039486", "0.51941496", "0.518727", "0.5179285", "0.5163885", "0.51430416", "0.5131618", "0.5127767", "0.5122257", "0.51092076", "0.5078354", "0.50710535", "0.5070632", "0.5066335", "0.50609124", "0.50565493", "0.505563", "0.5054315", "0.5051865", "0.5043288", "0.5038498", "0.502956", "0.50232697", "0.5013959", "0.5006349", "0.50061744", "0.5004363", "0.5000391", "0.49950904", "0.49760792", "0.4971123", "0.4961426", "0.49599686", "0.49553004", "0.49525094", "0.49475256", "0.49472058", "0.4945735", "0.49363053", "0.49241063", "0.4913188", "0.49096376", "0.49059084", "0.4894333", "0.48917437", "0.48894823", "0.48809448" ]
0.53956133
34
DERencoded X.509 certificate chain repeated bytes certificate = 1;
private void setCertificate( int index, com.google.protobuf.ByteString value) { java.lang.Class<?> valueClass = value.getClass(); ensureCertificateIsMutable(); certificate_.set(index, value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6394264", "0.6133", "0.6100678", "0.6048322", "0.602348", "0.6006828", "0.5965939", "0.5878645", "0.57918864", "0.57440233", "0.5736294", "0.57346123", "0.5729974", "0.57223564", "0.57223564", "0.56269145", "0.5619426", "0.5589989", "0.5561688", "0.5561688", "0.55568737", "0.5552956", "0.55470085", "0.55187273", "0.5511795", "0.5510891", "0.5510891", "0.5485625", "0.5463288", "0.54430336", "0.54161096", "0.54138064", "0.54065895", "0.5403303", "0.5394938", "0.5339361", "0.5333479", "0.5325224", "0.5319512", "0.53156906", "0.5311456", "0.5306741", "0.5303345", "0.52891165", "0.5274534", "0.5264846", "0.5264846", "0.526077", "0.52492887", "0.5244901", "0.52447456", "0.5234571", "0.5218953", "0.52181095", "0.5204579", "0.5194795", "0.5186814", "0.5178515", "0.516352", "0.5143562", "0.5132147", "0.512766", "0.51236075", "0.51093286", "0.5078684", "0.5071915", "0.5069776", "0.5065688", "0.5061457", "0.5055575", "0.50551426", "0.5054419", "0.5052279", "0.504373", "0.5038082", "0.5029488", "0.50224143", "0.50123596", "0.50072867", "0.50061095", "0.5005222", "0.49996942", "0.4995226", "0.49762338", "0.4970684", "0.4961693", "0.4959164", "0.49555925", "0.49524254", "0.49481726", "0.49473765", "0.49449876", "0.49357104", "0.49247393", "0.4912303", "0.49107757", "0.49064335", "0.48940066", "0.48905843", "0.48884922", "0.48816553" ]
0.0
-1
DERencoded X.509 certificate chain repeated bytes certificate = 1;
private void addCertificate(com.google.protobuf.ByteString value) { java.lang.Class<?> valueClass = value.getClass(); ensureCertificateIsMutable(); certificate_.add(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6394264", "0.6133", "0.6100678", "0.6048322", "0.602348", "0.6006828", "0.5965939", "0.5878645", "0.57918864", "0.57440233", "0.5736294", "0.57346123", "0.5729974", "0.57223564", "0.57223564", "0.56269145", "0.5619426", "0.5589989", "0.5561688", "0.5561688", "0.55568737", "0.5552956", "0.55470085", "0.55187273", "0.5511795", "0.5510891", "0.5510891", "0.5485625", "0.5463288", "0.54430336", "0.54161096", "0.54138064", "0.54065895", "0.5403303", "0.5394938", "0.5339361", "0.5333479", "0.5325224", "0.5319512", "0.53156906", "0.5311456", "0.5306741", "0.5303345", "0.52891165", "0.5274534", "0.5264846", "0.5264846", "0.526077", "0.52492887", "0.5244901", "0.52447456", "0.5234571", "0.5218953", "0.52181095", "0.5204579", "0.5194795", "0.5186814", "0.5178515", "0.516352", "0.5143562", "0.5132147", "0.512766", "0.51236075", "0.51093286", "0.5078684", "0.5071915", "0.5069776", "0.5065688", "0.5061457", "0.5055575", "0.50551426", "0.5054419", "0.5052279", "0.504373", "0.5038082", "0.5029488", "0.50224143", "0.50123596", "0.50072867", "0.50061095", "0.5005222", "0.49996942", "0.4995226", "0.49762338", "0.4970684", "0.4961693", "0.4959164", "0.49555925", "0.49524254", "0.49481726", "0.49473765", "0.49449876", "0.49247393", "0.4912303", "0.49107757", "0.49064335", "0.48940066", "0.48905843", "0.48884922", "0.48816553" ]
0.49357104
92
DERencoded X.509 certificate chain repeated bytes certificate = 1;
private void addAllCertificate( java.lang.Iterable<? extends com.google.protobuf.ByteString> values) { ensureCertificateIsMutable(); com.google.protobuf.AbstractMessageLite.addAll( values, certificate_); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6394192", "0.61330765", "0.61006594", "0.60482687", "0.602352", "0.6006773", "0.5965928", "0.58786696", "0.5791951", "0.57439876", "0.57363886", "0.57346094", "0.57299364", "0.57224", "0.57224", "0.5626907", "0.5619409", "0.558984", "0.55617076", "0.55617076", "0.55569893", "0.55530185", "0.5547045", "0.5518622", "0.5511868", "0.55108696", "0.55108696", "0.5485581", "0.5463167", "0.544292", "0.54160935", "0.5413839", "0.5406575", "0.540317", "0.53949416", "0.5339265", "0.5333285", "0.5325161", "0.53196114", "0.5315588", "0.5311513", "0.53066754", "0.53033113", "0.5289029", "0.52745855", "0.5264804", "0.5264804", "0.5260825", "0.5249203", "0.5244855", "0.5244754", "0.523448", "0.5218867", "0.5218258", "0.5204517", "0.5194733", "0.51866835", "0.5178598", "0.5163447", "0.5143541", "0.5132101", "0.5127687", "0.51237017", "0.5109286", "0.5078722", "0.5071932", "0.5069754", "0.50655746", "0.5061466", "0.50556165", "0.5055193", "0.50545955", "0.50522506", "0.5043691", "0.5038166", "0.5029388", "0.5022404", "0.50123733", "0.50072986", "0.5006049", "0.50052065", "0.49996534", "0.49953255", "0.49761605", "0.49707028", "0.49616292", "0.49591652", "0.49554187", "0.4952366", "0.49480525", "0.49473253", "0.4944978", "0.493571", "0.49247384", "0.49124497", "0.4910755", "0.49064356", "0.48939002", "0.48905846", "0.48885608", "0.48816416" ]
0.0
-1
DERencoded X.509 certificate chain repeated bytes certificate = 1;
private void clearCertificate() { certificate_ = emptyProtobufList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6393691", "0.6132981", "0.610133", "0.60493743", "0.60226244", "0.60062546", "0.5965777", "0.58786803", "0.5792661", "0.57446504", "0.57361895", "0.5734376", "0.57294655", "0.57224315", "0.57224315", "0.5627075", "0.5619113", "0.5589357", "0.5561189", "0.5561189", "0.55562174", "0.5552454", "0.55465317", "0.55187744", "0.55113304", "0.5510848", "0.5510848", "0.5486289", "0.54632354", "0.54419345", "0.5414766", "0.5413758", "0.54069126", "0.5403797", "0.53956133", "0.5339408", "0.53336936", "0.53254783", "0.5319129", "0.53157705", "0.5311538", "0.5306761", "0.53027284", "0.528877", "0.5274992", "0.52644", "0.52644", "0.5260611", "0.5248674", "0.5245094", "0.5244277", "0.52361006", "0.52190125", "0.52184993", "0.52039486", "0.51941496", "0.518727", "0.5179285", "0.5163885", "0.51430416", "0.5131618", "0.5127767", "0.5122257", "0.51092076", "0.5078354", "0.50710535", "0.5070632", "0.5066335", "0.50609124", "0.50565493", "0.505563", "0.5054315", "0.5051865", "0.5043288", "0.5038498", "0.502956", "0.50232697", "0.5013959", "0.5006349", "0.50061744", "0.5004363", "0.5000391", "0.49950904", "0.49760792", "0.4971123", "0.4961426", "0.49599686", "0.49553004", "0.49525094", "0.49475256", "0.49472058", "0.4945735", "0.49363053", "0.49241063", "0.4913188", "0.49096376", "0.49059084", "0.4894333", "0.48917437", "0.48894823", "0.48809448" ]
0.0
-1
DERencoded X.509 certificate chain repeated bytes certificate = 1;
@java.lang.Override public java.util.List<com.google.protobuf.ByteString> getCertificateList() { return java.util.Collections.unmodifiableList( instance.getCertificateList()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6394264", "0.6133", "0.6100678", "0.6048322", "0.602348", "0.6006828", "0.5965939", "0.5878645", "0.57918864", "0.57440233", "0.5736294", "0.57346123", "0.5729974", "0.57223564", "0.57223564", "0.56269145", "0.5619426", "0.5589989", "0.5561688", "0.5561688", "0.55568737", "0.5552956", "0.55470085", "0.55187273", "0.5511795", "0.5510891", "0.5510891", "0.5485625", "0.5463288", "0.54430336", "0.54161096", "0.54138064", "0.54065895", "0.5403303", "0.5394938", "0.5339361", "0.5333479", "0.5325224", "0.5319512", "0.53156906", "0.5311456", "0.5306741", "0.5303345", "0.52891165", "0.5274534", "0.5264846", "0.5264846", "0.526077", "0.52492887", "0.5244901", "0.52447456", "0.5234571", "0.5218953", "0.52181095", "0.5204579", "0.5194795", "0.5186814", "0.5178515", "0.516352", "0.5143562", "0.5132147", "0.512766", "0.51236075", "0.51093286", "0.5078684", "0.5071915", "0.5069776", "0.5065688", "0.5061457", "0.5055575", "0.50551426", "0.5054419", "0.5052279", "0.504373", "0.5038082", "0.5029488", "0.50224143", "0.50123596", "0.50072867", "0.50061095", "0.5005222", "0.49996942", "0.4995226", "0.49762338", "0.4970684", "0.4961693", "0.4959164", "0.49555925", "0.49524254", "0.49481726", "0.49449876", "0.49357104", "0.49247393", "0.4912303", "0.49107757", "0.49064335", "0.48940066", "0.48905843", "0.48884922", "0.48816553" ]
0.49473765
90
DERencoded X.509 certificate chain repeated bytes certificate = 1;
@java.lang.Override public int getCertificateCount() { return instance.getCertificateCount(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6394264", "0.6133", "0.6100678", "0.6048322", "0.602348", "0.6006828", "0.5965939", "0.5878645", "0.57918864", "0.57440233", "0.5736294", "0.57346123", "0.5729974", "0.57223564", "0.57223564", "0.56269145", "0.5619426", "0.5589989", "0.5561688", "0.5561688", "0.55568737", "0.5552956", "0.55470085", "0.55187273", "0.5511795", "0.5510891", "0.5510891", "0.5485625", "0.5463288", "0.54430336", "0.54161096", "0.54138064", "0.54065895", "0.5403303", "0.5394938", "0.5339361", "0.5333479", "0.5325224", "0.5319512", "0.53156906", "0.5311456", "0.5306741", "0.5303345", "0.52891165", "0.5274534", "0.5264846", "0.5264846", "0.526077", "0.52492887", "0.5244901", "0.52447456", "0.5234571", "0.5218953", "0.52181095", "0.5204579", "0.5194795", "0.5186814", "0.5178515", "0.516352", "0.5143562", "0.5132147", "0.512766", "0.51236075", "0.51093286", "0.5078684", "0.5071915", "0.5069776", "0.5065688", "0.5061457", "0.5055575", "0.50551426", "0.5054419", "0.5052279", "0.504373", "0.5038082", "0.5029488", "0.50224143", "0.50123596", "0.50072867", "0.50061095", "0.5005222", "0.49996942", "0.4995226", "0.49762338", "0.4970684", "0.4961693", "0.4959164", "0.49555925", "0.49524254", "0.49481726", "0.49473765", "0.49449876", "0.49357104", "0.49247393", "0.4912303", "0.49107757", "0.49064335", "0.48940066", "0.48905843", "0.48884922", "0.48816553" ]
0.0
-1
DERencoded X.509 certificate chain repeated bytes certificate = 1;
@java.lang.Override public com.google.protobuf.ByteString getCertificate(int index) { return instance.getCertificate(index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6394192", "0.61330765", "0.61006594", "0.60482687", "0.602352", "0.6006773", "0.5965928", "0.58786696", "0.5791951", "0.57439876", "0.57363886", "0.57346094", "0.57299364", "0.57224", "0.57224", "0.5626907", "0.5619409", "0.558984", "0.55617076", "0.55617076", "0.55569893", "0.55530185", "0.5547045", "0.5518622", "0.5511868", "0.55108696", "0.55108696", "0.5485581", "0.5463167", "0.544292", "0.54160935", "0.5413839", "0.540317", "0.53949416", "0.5339265", "0.5333285", "0.5325161", "0.53196114", "0.5315588", "0.5311513", "0.53066754", "0.53033113", "0.5289029", "0.52745855", "0.5264804", "0.5264804", "0.5260825", "0.5249203", "0.5244855", "0.5244754", "0.523448", "0.5218867", "0.5218258", "0.5204517", "0.5194733", "0.51866835", "0.5178598", "0.5163447", "0.5143541", "0.5132101", "0.5127687", "0.51237017", "0.5109286", "0.5078722", "0.5071932", "0.5069754", "0.50655746", "0.5061466", "0.50556165", "0.5055193", "0.50545955", "0.50522506", "0.5043691", "0.5038166", "0.5029388", "0.5022404", "0.50123733", "0.50072986", "0.5006049", "0.50052065", "0.49996534", "0.49953255", "0.49761605", "0.49707028", "0.49616292", "0.49591652", "0.49554187", "0.4952366", "0.49480525", "0.49473253", "0.4944978", "0.493571", "0.49247384", "0.49124497", "0.4910755", "0.49064356", "0.48939002", "0.48905846", "0.48885608", "0.48816416" ]
0.5406575
32
DERencoded X.509 certificate chain repeated bytes certificate = 1;
public Builder setCertificate( int index, com.google.protobuf.ByteString value) { copyOnWrite(); instance.setCertificate(index, value); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6393691", "0.6132981", "0.610133", "0.60493743", "0.60226244", "0.60062546", "0.5965777", "0.58786803", "0.5792661", "0.57446504", "0.57361895", "0.5734376", "0.57294655", "0.57224315", "0.57224315", "0.5627075", "0.5619113", "0.5589357", "0.5561189", "0.5561189", "0.55562174", "0.5552454", "0.55465317", "0.55187744", "0.55113304", "0.5510848", "0.5510848", "0.5486289", "0.54632354", "0.54419345", "0.5414766", "0.5413758", "0.54069126", "0.5403797", "0.53956133", "0.5339408", "0.53336936", "0.53254783", "0.5319129", "0.53157705", "0.5311538", "0.5306761", "0.53027284", "0.528877", "0.5274992", "0.52644", "0.52644", "0.5260611", "0.5248674", "0.5245094", "0.5244277", "0.52361006", "0.52190125", "0.52184993", "0.52039486", "0.51941496", "0.518727", "0.5179285", "0.5163885", "0.51430416", "0.5131618", "0.5127767", "0.5122257", "0.51092076", "0.5078354", "0.50710535", "0.5070632", "0.5066335", "0.50609124", "0.50565493", "0.505563", "0.5054315", "0.5051865", "0.5043288", "0.5038498", "0.502956", "0.50232697", "0.5013959", "0.5006349", "0.50061744", "0.5004363", "0.5000391", "0.49950904", "0.49760792", "0.4971123", "0.4961426", "0.49599686", "0.49553004", "0.49525094", "0.49475256", "0.49472058", "0.4945735", "0.49363053", "0.49241063", "0.4913188", "0.49096376", "0.49059084", "0.4894333", "0.48917437", "0.48894823", "0.48809448" ]
0.0
-1
DERencoded X.509 certificate chain repeated bytes certificate = 1;
public Builder addCertificate(com.google.protobuf.ByteString value) { copyOnWrite(); instance.addCertificate(value); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6394264", "0.6133", "0.6100678", "0.6048322", "0.602348", "0.6006828", "0.5965939", "0.5878645", "0.57918864", "0.57440233", "0.5736294", "0.57346123", "0.5729974", "0.57223564", "0.57223564", "0.56269145", "0.5619426", "0.5589989", "0.5561688", "0.5561688", "0.55568737", "0.5552956", "0.55470085", "0.55187273", "0.5511795", "0.5510891", "0.5510891", "0.5485625", "0.5463288", "0.54430336", "0.54161096", "0.54138064", "0.54065895", "0.5403303", "0.5394938", "0.5339361", "0.5333479", "0.5325224", "0.5319512", "0.53156906", "0.5311456", "0.5306741", "0.5303345", "0.52891165", "0.5274534", "0.5264846", "0.5264846", "0.526077", "0.52492887", "0.5244901", "0.52447456", "0.5234571", "0.5218953", "0.52181095", "0.5204579", "0.5194795", "0.5186814", "0.5178515", "0.516352", "0.5143562", "0.5132147", "0.512766", "0.51236075", "0.51093286", "0.5078684", "0.5071915", "0.5069776", "0.5065688", "0.5061457", "0.5055575", "0.50551426", "0.5054419", "0.5052279", "0.504373", "0.5038082", "0.5029488", "0.50224143", "0.50123596", "0.50072867", "0.50061095", "0.5005222", "0.49996942", "0.4995226", "0.49762338", "0.4970684", "0.4961693", "0.4959164", "0.49555925", "0.49524254", "0.49481726", "0.49473765", "0.49449876", "0.49357104", "0.49247393", "0.4912303", "0.49107757", "0.49064335", "0.48940066", "0.48905843", "0.48884922", "0.48816553" ]
0.0
-1
DERencoded X.509 certificate chain repeated bytes certificate = 1;
public Builder addAllCertificate( java.lang.Iterable<? extends com.google.protobuf.ByteString> values) { copyOnWrite(); instance.addAllCertificate(values); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6394264", "0.6133", "0.6100678", "0.6048322", "0.602348", "0.6006828", "0.5965939", "0.5878645", "0.57918864", "0.57440233", "0.5736294", "0.57346123", "0.5729974", "0.57223564", "0.57223564", "0.56269145", "0.5619426", "0.5589989", "0.5561688", "0.5561688", "0.55568737", "0.5552956", "0.55470085", "0.55187273", "0.5511795", "0.5510891", "0.5510891", "0.5485625", "0.5463288", "0.54430336", "0.54161096", "0.54138064", "0.54065895", "0.5403303", "0.5394938", "0.5339361", "0.5333479", "0.5325224", "0.5319512", "0.53156906", "0.5311456", "0.5306741", "0.5303345", "0.52891165", "0.5274534", "0.5264846", "0.5264846", "0.526077", "0.52492887", "0.5244901", "0.52447456", "0.5234571", "0.5218953", "0.52181095", "0.5204579", "0.5194795", "0.5186814", "0.5178515", "0.516352", "0.5143562", "0.5132147", "0.512766", "0.51236075", "0.51093286", "0.5078684", "0.5071915", "0.5069776", "0.5065688", "0.5061457", "0.5055575", "0.50551426", "0.5054419", "0.5052279", "0.504373", "0.5038082", "0.5029488", "0.50224143", "0.50123596", "0.50072867", "0.50061095", "0.5005222", "0.49996942", "0.4995226", "0.49762338", "0.4970684", "0.4961693", "0.4959164", "0.49555925", "0.49524254", "0.49481726", "0.49473765", "0.49449876", "0.49357104", "0.49247393", "0.4912303", "0.49107757", "0.49064335", "0.48940066", "0.48905843", "0.48884922", "0.48816553" ]
0.0
-1
DERencoded X.509 certificate chain repeated bytes certificate = 1;
public Builder clearCertificate() { copyOnWrite(); instance.clearCertificate(); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate[] getCertificateChain();", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "com.google.protobuf.ByteString getCertificate(int index);", "String getCertificate();", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "private byte[][] getUserCertificate() throws KeyChainException, InterruptedException, CertificateEncodingException {\n ArrayList<byte[]> encodings = new ArrayList<byte[]>();\n X509Certificate[] chain = KeyChain.getCertificateChain(getApplicationContext(), mCurrentProfile.getUserCertificateAlias());\n if (chain == null || chain.length == 0) {\n return null;\n }\n for (X509Certificate cert : chain) {\n encodings.add(cert.getEncoded());\n }\n return encodings.toArray(new byte[encodings.size()][]);\n }", "private @NonNull WpcCrtChn getChn() throws IOException, GeneralSecurityException {\n int siz = MAX_CRT; // Initialize the requested length for the GET_CERTIFICATE Request\n int ofs = 0; // Initialize the offset for the GET_CERTIFICATE Request\n int len = 0; // Initialize length of Certificate Chain\n ByteArrayOutputStream bas = new ByteArrayOutputStream(MAX_CRT); // Create stream for Certificate Chain\n do {\n ByteBuffer req = getMsg(REQ_CRT, 4); // Create GET_CERTIFICATE request message\n req.position(1); // Set buffer pointer to offset\n req.put((byte) (((ofs & 0x0300) >> 2) | SLOT_0)); // Add slot byte\n req.put((byte) ofs); // Add offset\n req.put((byte) siz); // Add Length\n ByteBuffer res = sndMsg(req, WpcAthRsp.RES_CRT); // Send GET_CERTIFICATE Request\n if (ofs == 0) { // First GET_CERTIFICATE Request?\n len = res.getShort(); // Get the total length of the Certificate Chain\n if (len < siz) { // Certificate Chain too small?\n WpcLog.logErr(\"Wrong WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n }\n byte[] buf = res.array(); // Get CERTIFICATE Response\n if ((siz != (buf.length - 1))) { // Incorrect Certificate Chain fragment size?\n WpcLog.logErr(\"Invalid WPC Certificate Chain length\"); // Log error\n throw new IOException(); // Abort authentication\n }\n bas.write(buf, 1, siz); // Add Certificate fragment to the Certificate Chain\n len = len - siz; // Calculate remaining bytes in the Certificate Chain\n ofs = ofs + siz; // Calculate offset for the next GET_CERTIFICATE Request\n if (len > MAX_CRT) { // Remaining Certificate Chain does not fit into one GET_CERTIFICATE Request?\n siz = MAX_CRT; // Request the maximum fragment for the next GET_CERTIFICATE Request\n } else { // Remaining Certificate Chain fits into one GET_CERTIFICATE Request\n siz = len; // Request the remaining bytes of the Certificate Chain\n }\n } while (len > 0); // Repeat until whole Certificate Chain is received\n byte[] ba = bas.toByteArray(); // Convert WPC Certificate Chain into a byte array\n WpcCrtChn chn = new WpcCrtChn(ba); // Create the Certificate Chain\n chn.verify(); // Verify the Certificate Chain\n mCom.setChn(chn); // Announce used WPC Certificate Chain\n WpcLog.log(WpcLog.EvtTyp.CHN, ba); // Log the received WPC Certificate Chain\n return chn; // Return the Certificate Chain\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index);", "public static byte[] parseDERfromPEM(byte[] pem) {\n String begin = \"-----BEGIN.*?-----\";\n String end = \"-----END.*-----\";\n\n String data = new String(pem, StandardCharsets.UTF_8)\n .replaceFirst(begin, \"\")\n .replaceFirst(end, \"\")\n .replaceAll(\"\\\\s\", \"\");\n\n return Base64.getDecoder().decode(data);\n }", "public X509Certificate getCertificate();", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public byte[] getEncoded() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getEncoded():byte[]\");\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates();", "java.util.List<com.google.protobuf.ByteString> getCertificateList();", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public final int\n getDepth() { return certificateChain_.size(); }", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "liubaninc.m0.pki.CertificatesOuterClass.CertificatesOrBuilder getCertificatesOrBuilder();", "private byte[] getEncoded0() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: in method: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded0():byte[]\");\n }", "public abstract byte[] getEncoded() throws CRLException;", "public final ArrayList<CertificateV2>\n getCertificateChain_() { return certificateChain_; }", "public byte[] certificate() {\n return this.certificate;\n }", "public byte[] getEncoded() throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.getEncoded():byte[]\");\n }", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);", "public X509Certificate[] getServerCertificateChain() {\n/* */ try {\n/* 208 */ return this.delegate.getServerCertificateChain();\n/* 209 */ } catch (SSLPeerUnverifiedException sSLPeerUnverifiedException) {\n/* */ \n/* */ \n/* */ \n/* 213 */ return null;\n/* */ } \n/* */ }", "public X509Certificate getRootCertificate() throws CertException;", "public final X509Certificate[] getCertificateChain() {\n return this.certChain;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public byte[] getTBSCertificate() throws java.security.cert.CertificateEncodingException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getTBSCertificate():byte[]\");\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return instance.getCertificate(index);\n }", "void exportCertificate(X509Certificate cert, PrintStream ps)\n {\n\tBASE64Encoder encoder = new BASE64Encoder();\n\tps.println(X509Factory.BEGIN_CERT);\n\ttry\n\t{\n\t encoder.encodeBuffer(cert.getEncoded(), ps);\n\t}\n\tcatch (Throwable e)\n\t{\n\t Trace.printException(this, e);\n\t}\n\tps.println(X509Factory.END_CERT);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCertificate(int index) {\n return certificate_.get(index);\n }", "public void setCertificateChain(java.nio.ByteBuffer certificateChain) {\n this.certificateChain = certificateChain;\n }", "public ValidationResult validate(X509Certificate[] certChain);", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return certificate_;\n }", "private X509Certificate generateSelfSignedCertificateWithFakeSignature(PublicKey publicKey) throws IOException, CertificateParsingException {\n byte[] signature;\n AlgorithmIdentifier sigAlgId;\n V3TBSCertificateGenerator tbsGenerator = new V3TBSCertificateGenerator();\n int i = this.mKeymasterAlgorithm;\n if (i == 1) {\n signature = new byte[1];\n sigAlgId = new AlgorithmIdentifier(PKCSObjectIdentifiers.sha256WithRSAEncryption, DERNull.INSTANCE);\n } else if (i == 3) {\n sigAlgId = new AlgorithmIdentifier(X9ObjectIdentifiers.ecdsa_with_SHA256);\n ASN1EncodableVector v = new ASN1EncodableVector();\n v.add(new DERInteger(0));\n v.add(new DERInteger(0));\n signature = new DERSequence().getEncoded();\n } else {\n throw new ProviderException(\"Unsupported key algorithm: \" + this.mKeymasterAlgorithm);\n }\n byte[] signature2 = signature;\n ASN1InputStream publicKeyInfoIn = new ASN1InputStream(publicKey.getEncoded());\n tbsGenerator.setSubjectPublicKeyInfo(SubjectPublicKeyInfo.getInstance(publicKeyInfoIn.readObject()));\n publicKeyInfoIn.close();\n tbsGenerator.setSerialNumber(new ASN1Integer(this.mSpec.getCertificateSerialNumber()));\n X509Principal subject = new X509Principal(this.mSpec.getCertificateSubject().getEncoded());\n tbsGenerator.setSubject(subject);\n tbsGenerator.setIssuer(subject);\n tbsGenerator.setStartDate(new Time(this.mSpec.getCertificateNotBefore()));\n tbsGenerator.setEndDate(new Time(this.mSpec.getCertificateNotAfter()));\n tbsGenerator.setSignature(sigAlgId);\n TBSCertificate tbsCertificate = tbsGenerator.generateTBSCertificate();\n ASN1EncodableVector result = new ASN1EncodableVector();\n result.add(tbsCertificate);\n result.add(sigAlgId);\n result.add(new DERBitString(signature2));\n return new X509CertificateObject(Certificate.getInstance(new DERSequence(result)));\n throw result;\n }", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public CertificateData() {\n \t\t// TODO Auto-generated constructor stub\n \t\taCertStrings = new HashMap<TreeNodeDescriptor.TreeNodeType, String[]>(15);\n \t\t// now init the certificate with dummy data\n \t\t// for every string meant for the multi fixed text display\n \t\t// devise a method to change the character font strike\n \t\t// the first character in the string marks the stroke type\n \t\t// (see function: it.plio.ext.oxsit.ooo.ui.TreeNodeDescriptor.EnableDisplay(boolean) for\n \t\t// for information on how they are interpreted):\n \t\t// b\tthe string will be in bold\n \t\t// B\n \t\t// r\n \t\t// s the string will striken out regular\n \t\t// S the string will striken out bold\n \t\t//\t\n \t\t{\n \t\t\tString[] saDummy = new String[m_nMAXIMUM_FIELDS];\t\t\t\n \n \t\t\tsaDummy[m_nTITLE] = \"bInformazioni sul certificato\";\n \t\t\tsaDummy[m_nEMPTY_FIELD_01] = \"\";\n \t\t\tsaDummy[m_nINFO_LINE1] = \"rIl certificato è adatto per la firma digitale.\";\n \t\t\tsaDummy[m_nINFO_LINE2] = \"r(non ripudio attivato)\";\n \t\t\tsaDummy[m_nTITLE_SCOPE] = \"bIl certificato è stato rilasciato per i seguenti scopi:\";\n \t\t\tsaDummy[m_nSCOPE_LINE1] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE2] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE3] = \"...\";\n \t\t\tsaDummy[m_nSCOPE_LINE4] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_STATE] = \"bCertificato verificato con CRL\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_ERROR] = \"\";\n \t\t\tsaDummy[m_nCERT_VALIDITY_VERIFICATION_CONDITIONS] = \"\";\n \t\t\tsaDummy[m_nDATE_VALID_FROM] = \"bValido dal 10/04/2006 16:06:04\";\n \t\t\tsaDummy[m_nDATE_VALID_TO] = \"bal 10/04/2009 16:06:04\";\n \t\t\tsetCertString(TreeNodeType.CERTIFICATE, saDummy);\n \t\t}\n \t\t//subject TreeNodeType.SUBJECT inserted by the derived classes\n \t\t{\n \t\t\tString[] saDummy = {\"V3\"};\n \t\t\tsetCertString(TreeNodeType.VERSION, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\"15 BA 35\"};\n \t\t\tsetCertString(TreeNodeType.SERIAL_NUMBER, saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"CN=The Certification Authority\\nOU=The Certification Authority\\nserialNumber=02313821007\\nO=The Certification Wizards\\nC=IT\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.ISSUER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2006 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_FROM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"10/04/2009 16:06:04\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.VALID_TO,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"dnQualifier=2006111605A1528\\nSN=GIACOMO\\ngivenName=VERDI\\[email protected]\\nserialNumber=GCMVRD01D12210Y\\nCN=\\\"GCMVRD01D12210Y/7420091000049623.fmIW78mgkUVdmdQuXCrZbDsW9oQ=\\\"\\nOU=C.C.I.A.A. DI TORINO\\nO=Non Dichiarato\\nC=IT\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 RSA Encryption (rsaEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SUBJECT_ALGORITHM,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"30 82 01 0A 02 82 01 01 00 C4 1C 77 1D AD 89 18\\nB1 6E 88 20 49 61 E9 AD 1E 3F 7B 9B 2B 39 A3 D8\\nBF F1 42 E0 81 F0 03 E8 16 26 33 1A B1 DC 99 97\\n4C 5D E2 A6 9A B8 D4 9A 68 DF 87 79 0A 98 75 F8\\n33 54 61 71 40 9E 49 00 00 06 51 42 13 33 5C 6C\\n34 AA FD 6C FA C2 7C 93 43 DD 8D 6F 75 0D 51 99\\n83 F2 8F 4E 86 3A 42 22 05 36 3F 3C B6 D5 4A 8E\\nDE A5 DC 2E CA 7B 90 F0 2B E9 3B 1E 02 94 7C 00\\n8C 11 A9 B6 92 21 99 B6 3A 0B E6 82 71 E1 7E C2\\nF5 1C BD D9 06 65 0E 69 42 C5 00 5E 3F 34 3D 33\\n2F 20 DD FF 3C 51 48 6B F6 74 F3 A5 62 48 C9 A8\\nC9 73 1C 8D 40 85 D4 78 AF 5F 87 49 4B CD 42 08\\n5B C7 A4 D1 80 03 83 01 A9 AD C2 E3 63 87 62 09\\nFE 98 CC D9 82 1A CB AD 41 72 48 02 D5 8A 76 C0\\nD5 59 A9 FF CA 3C B5 0C 1E 04 F9 16 DB AB DE 01\\nF7 A0 BE CF 94 2A 53 A4 DD C8 67 0C A9 AF 60 5F\\n53 3A E1 F0 71 7C D7 36 AB 02 03 01 00 01\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.PUBLIC_KEY,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\"PKCS #1 SHA-1 With RSA Encryption (sha1WithRSAEncryption)\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeDescriptor.TreeNodeType.SIGNATURE_ALGORITHM,saDummy);\n \t\t}\t\t\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F 59 05 59 E6 FB 45 8F D4 C3 2D CB 8C 4C 55 02\\nDB 5A 42 39 \",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_SHA1,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\t\"6F B2 8C 96 83 3C 65 26 6F 7D CF 74 3F E7 E4 AD\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.THUMBPRINT_MD5,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\t\"Non Repudiation\",\n \t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_KEY_USAGE,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Certificato qualificato (O.I.D. 0.4.0.1862.1.1)\\nPeriodo conservazione informazioni relative alla emissione del cerificato qualificato: 20 anni (O.I.D. 0.4.0.1862.1.3)\\nDispositivo sicuro (O.I.D. 0.4.0.1862.1.4)\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.QC_STATEMENTS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"OCSP - URI:http://ocsp.infocert.it/OCSPServer_ICE/OCSPServlet\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.AUTHORITY_INFORMATION_ACCESS,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"Policy: 1.3.76.14.1.1.1\\nCPS: http://www.card.infocamere.it/firma/cps/cps.htm\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CERTIFICATE_POLICIES,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"19560415000000Z\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_DIRECTORY_ATTRIBUTES,saDummy);\n \t\t}\n \n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?cacertificate, email:firma\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_ISSUER_ALTERNATIVE_NAME,saDummy);\n \t\t}\n \t\t\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"keyid:9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_AUTHORITY_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"URI:ldap://ldap.infocamere.it/cn%3DInfoCamere%20Firma%20Digitale%2Cou%3DCertificati%20di%20Firma%2Co%3DInfoCamere%20SCpA%2Cc%3DIT?certificaterevocationlist\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_CRL_DISTRIBUTION_POINTS,saDummy);\n \t\t}\n \t\t{\n \t\t\tString[] saDummy = {\n \t\t\t\t\t\"9C:6F:E1:76:68:27:42:9C:C0:80:40:70:A0:0F:08:E9:D1:12:FF:A4\"\n \t\t\t\t\t};\n \t\t\tsetCertString(TreeNodeType.X509V3_SUBJECT_KEY_IDENTIFIER,saDummy);\n \t\t}\n \t}", "X509CertificateInfo()\n {\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index);", "@Override\r\n\tpublic Integer[] getCertificate() {\n\t\treturn null;\r\n\t}", "public void encode(sun.security.util.DerOutputStream r1) throws java.security.cert.CRLException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.encode(sun.security.util.DerOutputStream):void\");\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "@Test\n @Override\n public void testPrepare() throws IOException {\n context.getConfig()\n .setDefaultExplicitCertificateKeyPair(\n new CertificateKeyPair(\n certificate,\n new CustomRSAPrivateKey(\n context.getConfig().getDefaultClientRSAModulus(),\n context.getConfig().getDefaultClientRSAPrivateKey())));\n context.getConfig().setAutoSelectCertificate(false);\n preparator.prepare();\n assertArrayEquals(\n ArrayConverter.hexStringToByteArray(\n \"0003943082039030820278A003020102020900A650C00794049FCD300D06092A864886F70D01010B0500305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B65723020170D3137303731333132353331385A180F32313137303631393132353331385A305C310B30090603550406130241553113301106035504080C0A536F6D652D53746174653121301F060355040A0C18496E7465726E6574205769646769747320507479204C74643115301306035504030C0C544C532D41747461636B657230820122300D06092A864886F70D01010105000382010F003082010A0282010100C8820D6C3CE84C8430F6835ABFC7D7A912E1664F44578751F376501A8C68476C3072D919C5D39BD0DBE080E71DB83BD4AB2F2F9BDE3DFFB0080F510A5F6929C196551F2B3C369BE051054C877573195558FD282035934DC86EDAB8D4B1B7F555E5B2FEE7275384A756EF86CB86793B5D1333F0973203CB96966766E655CD2CCCAE1940E4494B8E9FB5279593B75AFD0B378243E51A88F6EB88DEF522A8CD5C6C082286A04269A2879760FCBA45005D7F2672DD228809D47274F0FE0EA5531C2BD95366C05BF69EDC0F3C3189866EDCA0C57ADCCA93250AE78D9EACA0393A95FF9952FC47FB7679DD3803E6A7A6FA771861E3D99E4B551A4084668B111B7EEF7D0203010001A3533051301D0603551D0E04160414E7A92FE5543AEE2FF7592F800AC6E66541E3268B301F0603551D23041830168014E7A92FE5543AEE2FF7592F800AC6E66541E3268B300F0603551D130101FF040530030101FF300D06092A864886F70D01010B050003820101000D5C11E28CF19D1BC17E4FF543695168570AA7DB85B3ECB85405392A0EDAFE4F097EE4685B7285E3D9B869D23257161CA65E20B5E6A585D33DA5CD653AF81243318132C9F64A476EC08BA80486B3E439F765635A7EA8A969B3ABD8650036D74C5FC4A04589E9AC8DC3BE2708743A6CFE3B451E3740F735F156D6DC7FFC8A2C852CD4E397B942461C2FCA884C7AFB7EBEF7918D6AAEF1F0D257E959754C4665779FA0E3253EF2BEDBBD5BE5DA600A0A68E51D2D1C125C4E198669A6BC715E8F3884E9C3EFF39D40838ADA4B1F38313F6286AA395DC6DEA9DAF49396CF12EC47EFA7A0D3882F8B84D9AEEFFB252C6B81A566609605FBFD3F0D17E5B12401492A1A\"),\n message.getCertificatesListBytes().getValue());\n assertEquals(0x000397, (int) message.getCertificatesListLength().getValue());\n assertEquals(\n HandshakeMessageType.CERTIFICATE.getValue(), (byte) message.getType().getValue());\n assertEquals(0x00039A, (int) message.getLength().getValue());\n }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n return certificate_;\n }", "private byte[] convertPemToDer(String pem) {\n BufferedReader bufferedReader = new BufferedReader(new StringReader(pem));\n String encoded =\n bufferedReader\n .lines()\n .filter(line -> !line.startsWith(\"-----BEGIN\") && !line.startsWith(\"-----END\"))\n .collect(Collectors.joining());\n return Base64.getDecoder().decode(encoded);\n }", "public X509CRLImpl(byte[] encoding) throws IOException {\n this((CertificateList) CertificateList.ASN1.decode(encoding));\n }", "private static List<String> extractBase64EncodedCerts(String pemCerts) throws GeneralSecurityException\n {\n List<String> certificateList = new ArrayList<>();\n Matcher matcher = CERT_PATTERN.matcher(pemCerts);\n if (!matcher.find())\n {\n throw new GeneralSecurityException(\"Invalid certificate format\");\n }\n\n for (int start = 0; matcher.find(start); start = matcher.end())\n {\n String certificate = matcher.group(1).replaceAll(\"\\\\s\", \"\");\n certificateList.add(certificate);\n }\n return certificateList;\n }", "public Certificate[] getCertificateChainAsArray(String signatureAlias) throws CryptoException {\n\t\tList<Certificate> chain = getCertificateChain(signatureAlias);\n\t\tif(chain != null && chain.size() > 0) {\n\t\t\tCertificate [] certificates = new Certificate[chain.size()];\n\t\t\tchain.toArray(certificates);\n\t\t\treturn certificates;\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader Flujo = new InputStreamReader(System.in);\r\n\r\n\t\t\tBufferedReader teclado = new BufferedReader(Flujo);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado: \" );\r\n\t\t\tString NameFile=teclado.readLine();\r\n\t\t\tSystem.out.println(\"Nombre fichero:\"+NameFile );\r\n\t\t\tFileInputStream fr = new FileInputStream(NameFile);\r\n\r\n\r\n\r\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c = (X509Certificate) cf.generateCertificate(fr);\r\n\r\n\t\t\tSystem.out.println(\"Certificado Leido \\n\");\r\n\r\n\r\n\r\n\t\t\t//lectura certificado CA\r\n\t\t\tInputStreamReader Flujo3 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado3 = new BufferedReader(Flujo3);\r\n\t\t\tSystem.out.print(\"Introducir Nombre Certificado CA(*.pem): \" );\r\n\t\t\tString NameFile3=teclado3.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero CA:\"+NameFile3 );\r\n\r\n\r\n\t\t\tFileInputStream fr3 = new FileInputStream(NameFile3);\r\n\r\n\t\t\tCertificateFactory cf3 = CertificateFactory.getInstance(\"X509\");\r\n\t\t\tX509Certificate c3 = (X509Certificate) cf3.generateCertificate(fr3);\r\n\r\n\t\t\tPublicKey publicKeyCA=c3.getPublicKey();\r\n\t\t\tfr3.close();\r\n\t\t\tc.verify(publicKeyCA);\r\n\r\n\t\t\t//lectura del fichero crl.pem\r\n\r\n\t\t\tInputStreamReader Flujo2 = new InputStreamReader(System.in);\r\n\t\t\tBufferedReader teclado2 = new BufferedReader(Flujo2);\r\n\t\t\tSystem.out.print(\"Introducir Nombre fichero certificados revocados(*.pem): \" );\r\n\t\t\tString NameFile2=teclado2.readLine();\r\n\t\t\tSystem.out.println(\"Leido nombre fichero crl:\"+NameFile2);\r\n\r\n\t\t\tFileInputStream inStream = new FileInputStream(NameFile2);\r\n\r\n\t\t\tCertificateFactory cf1 = CertificateFactory.getInstance(\"X.509\");\r\n\r\n\t\t\tX509CRL crl = (X509CRL) cf1.generateCRL(inStream);\r\n\r\n\t\t\t//Imprime los campos del certificado en forma de string\r\n\r\n\t\t\tinStream.close();\r\n\r\n\t\t\tFileWriter fichSalida = new FileWriter(\"log.txt\");\r\n\t\t\tBufferedWriter fs= new BufferedWriter(fichSalida);\r\n\r\n\t\t\tif(crl.isRevoked(c)){\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" Revocado\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t\tfs.write(\"\\n Certificado \"+NameFile+\" NO revocado\");\r\n\t\t\t}\t\r\n\t\t\tcrl.verify(publicKeyCA);\t\t\t\t\t\t\r\n\r\n\t\t\tSystem.out.println(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\tfs.write(\"\\n Fichero CRL \"+NameFile2+\" HA SIDO FIRMADO POR LA CA\");\r\n\t\t\t\r\n\t\t\tSet setEntries=crl.getRevokedCertificates();\r\n\t\t\tif(setEntries!=null && setEntries.isEmpty()==false){\r\n\t\t\t\tfor(Iterator iterator = setEntries.iterator(); iterator.hasNext();){\r\n\t\t\t\t\tX509CRLEntry x509crlentry = (X509CRLEntry) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"serial number=\"+x509crlentry.getSerialNumber());\r\n\t\t\t\t\tSystem.out.println(\"revocacion date=\"+x509crlentry.getRevocationDate());\r\n\t\t\t\t\tSystem.out.println(\"extensions=\"+x509crlentry.hasExtensions());\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\tfs.close();\r\n\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace( );\r\n\t\t}\r\n\t}", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n return certificate_;\n }", "public String getCertDescription() {\n return certDescription;\n }", "public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }", "abstract X509Certificate mo6705a(X509Certificate x509Certificate);", "java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList();", "public List<Certificate> getCertificateChain(String signatureAlias) throws CryptoException {\n\t\ttry {\n\t\t\tArrayList<Certificate> list = new ArrayList<Certificate>();\n\t\t\tCertificate[] certificates = keystore.getCertificateChain(signatureAlias);\n\t\t\tfor (int i = 0, length = certificates == null ? 0 : certificates.length; i < length; i++) {\n\t\t\t\tlist.add(certificates[i]);\n\t\t\t}\n\t\t\treturn list;\n\t\t} catch(GeneralSecurityException e) {\n\t\t\tlogger.error(\"error retrieving certificate chain for alias '{}'\", signatureAlias);\n\t\t\tthrow new CryptoException(\"error retrieving certificate chain for alias '\" + signatureAlias + \"'\", e);\n\t\t}\n\t}", "public int getDERLength() throws TLVEncodingException {\r\n\t\tint length;\r\n\t\tint i = 1;\r\n\r\n\t\tif ((buffer[cursor] & 0x80) == 0x80) {\r\n\t\t\ti = buffer[cursor] & 0x07;\r\n\t\t\tcursor++;\r\n\t\t}\r\n\r\n\t\tif (cursor + i > limit)\r\n\t\t\tthrow new TLVEncodingException(\"Invalid DER length field\");\r\n\r\n\t\tlength = 0;\r\n\t\tfor (; i > 0; i--) {\r\n\t\t\tlength = (length << 8) | (buffer[cursor++] & 0xFF);\r\n\t\t}\r\n\r\n\t\treturn length;\r\n\t}", "public static X509Certificate buildChain(Key key, Certificate[] chain)\n throws CertificateException, KeyStoreException,\n NoSuchAlgorithmException, InvalidKeyException,\n NoSuchProviderException {\n X509Certificate theOne = null;\n if (key instanceof RSAPrivateCrtKey) {\n final RSAPrivateCrtKey rsa = (RSAPrivateCrtKey) key;\n BigInteger publicExponent = rsa.getPublicExponent();\n BigInteger modulus = rsa.getModulus();\n for (int i = 0; i < chain.length; i++) {\n X509Certificate c = (X509Certificate) chain[i];\n PublicKey pub = c.getPublicKey();\n if (pub instanceof RSAPublicKey) {\n RSAPublicKey certKey = (RSAPublicKey) pub;\n BigInteger pe = certKey.getPublicExponent();\n BigInteger mod = certKey.getModulus();\n if (publicExponent.equals(pe) && modulus.equals(mod)) {\n theOne = c;\n }\n }\n }\n if (theOne == null) {\n throw new KeyStoreException(\"Can't build keystore: [No certificates belong to the private-key]\");\n }\n X509Certificate[] newChain;\n newChain = X509CertificateChainBuilder.buildPath(theOne, chain);\n Arrays.fill(chain, null);\n System.arraycopy(newChain, 0, chain, 0, newChain.length);\n }\n return theOne;\n }", "private static byte[] getCertificateInBytes(int n) {\n byte[] certificate_bytes = null;\n try {\n PTEID_Certif[] certs = pteid.GetCertificates();\n// System.out.println(\"Number of certs found: \" + certs.length);\n// int i = 0;\n// for (PTEID_Certif cert : certs) {\n// System.out.println(\"-------------------------------\\nCertificate #\" + (i++));\n// System.out.println(cert.certifLabel);\n// }\n certificate_bytes = certs[n].certif; //gets the byte[] with the n-th certif\n\n } catch (PteidException e) {\n e.printStackTrace();\n }\n return certificate_bytes;\n }", "private static byte[] createDEROctet(int usage)\n\t{\n\t\treturn new KeyUsage(usage).getDEREncoded();\n\t}", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilder();\n } else {\n return certificate_ == null ?\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }\n }", "private synchronized String getEncodedCertToString(String certSignReq,\n NodeType nodeType) throws IOException {\n Future<CertPath> future;\n if (nodeType == NodeType.SCM && rootCertificateServer != null) {\n future = rootCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n } else {\n future = scmCertificateServer.requestCertificate(certSignReq,\n KERBEROS_TRUSTED, nodeType);\n }\n try {\n return getPEMEncodedString(future.get());\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw generateException(e, nodeType);\n } catch (ExecutionException e) {\n if (e.getCause() != null) {\n if (e.getCause() instanceof SCMSecurityException) {\n throw (SCMSecurityException) e.getCause();\n } else {\n throw generateException(e, nodeType);\n }\n } else {\n throw generateException(e, nodeType);\n }\n }\n }", "@Override\n public String getDataNodeCertificate(\n DatanodeDetailsProto dnDetails,\n String certSignReq) throws IOException {\n LOGGER.info(\"Processing CSR for dn {}, UUID: {}\", dnDetails.getHostName(),\n dnDetails.getUuid());\n Objects.requireNonNull(dnDetails);\n checkIfCertSignRequestAllowed(\n storageContainerManager.getRootCARotationManager(), false, config,\n \"getDataNodeCertificate\");\n return getEncodedCertToString(certSignReq, NodeType.DATANODE);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public java.security.cert.X509Certificate generateX509Certificate(java.security.PrivateKey r1) throws java.lang.SecurityException, java.security.SignatureException, java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.generateX509Certificate(java.security.PrivateKey):java.security.cert.X509Certificate\");\n }", "public void checkServerTrusted ( X509Certificate[] chain, String authType ) throws CertificateException { \n //String to hold the issuer of first member in the chain\n String issuer = \"\";\n //String to hold the subject of the first member in the chain\n String subject = \"\";\n //Calendar to get the valid on and expires on date\n Calendar cal=Calendar.getInstance();\n //Date and String to hold the date the certificate was issued on\n Date issuedOn = null;\n String issuedOnString = new String(\"\");\n //Date and String to hold the date the certificate is valid until\n Date expiresOn = null;\n String expiresOnString = new String(\"\");\n //BigInteger to hold the serial number of the certificate\n BigInteger serial = null;\n //the highest certificate in the chain (the root)\n X509Certificate highestCert = null;\n \n try {\n highestCert = chain[0];\n issuer = highestCert.getIssuerX500Principal().toString();\n subject = highestCert.getSubjectX500Principal().toString();\n serial = highestCert.getSerialNumber();\n \n issuedOn = highestCert.getNotBefore();\n cal.setTime(issuedOn);\n issuedOnString = new String((cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n expiresOn = highestCert.getNotAfter();\n cal.setTime(expiresOn);\n expiresOnString = new String( (cal.get(Calendar.MONTH)+1) + \"/\"+cal.get(Calendar.DAY_OF_MONTH)+\"/\"+cal.get(Calendar.YEAR));\n \n mTrustManager.checkServerTrusted(chain, authType);\n } catch (CertificateException cx) { \n \t if ( !mAllowUntrusted )\n \t {\n \t\t ERTrustManagerCertificateException erce = new ERTrustManagerCertificateException(\"\\nUntrusted Certificate Found: \"+\n \"\\nIssued by: \"+ issuer + \n \"\\nIssued to: \" + subject + \n \"\\nIssued on: \" + issuedOnString + \n \"\\nExpires on: \" + expiresOnString + \n \"\\nSerial: \" + serial); \n \t\t erce.setCertificate(highestCert);\n \n \t throw erce;\n \t }\n }\n\n }", "@Override\r\n\tpublic byte[] sign(final byte[] data,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties xParams) throws AOException {\r\n\r\n final Properties extraParams = xParams != null ? xParams : new Properties();\r\n\r\n final String digestMethodAlgorithm = extraParams.getProperty(\"referencesDigestMethod\", DIGEST_METHOD); //$NON-NLS-1$\r\n final boolean useOpenOffice31Mode = \"true\".equalsIgnoreCase(extraParams.getProperty(\"useOpenOffice31Mode\")); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n if (!isValidDataFile(data)) {\r\n throw new AOFormatFileException(\"Los datos introducidos no se corresponden con un documento ODF\"); //$NON-NLS-1$\r\n }\r\n\r\n String fullPath = MANIFEST_PATH;\r\n boolean isCofirm = false;\r\n\r\n try {\r\n // genera el archivo zip temporal a partir del InputStream de\r\n // entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n // carga el fichero zip\r\n final ZipFile zf = new ZipFile(zipFile);\r\n\r\n // obtiene el archivo manifest.xml, que indica los ficheros que\r\n // contiene el ODF\r\n final InputStream manifest = zf.getInputStream(zf.getEntry(fullPath));\r\n final byte[] manifestData = AOUtil.getDataFromInputStream(manifest);\r\n\r\n if (manifest != null) {\r\n manifest.close();\r\n }\r\n\r\n // obtiene el documento manifest.xml y su raiz\r\n final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n dbf.setNamespaceAware(true);\r\n final Document docManifest = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(manifestData));\r\n final Element rootManifest = docManifest.getDocumentElement();\r\n\r\n // recupera todos los nodos de manifest.xml\r\n final NodeList listFileEntry = rootManifest.getElementsByTagName(\"manifest:file-entry\"); //$NON-NLS-1$\r\n\r\n //\r\n // Datos necesarios para la firma\r\n //\r\n\r\n // MessageDigest\r\n final MessageDigest md;\r\n try {\r\n\t md = MessageDigest.getInstance(DIGEST_METHOD_ALGORITHM_NAME);\r\n }\r\n catch (final Exception e) {\r\n \tzf.close();\r\n \tthrow new AOException(\r\n \t\t\t\"No se ha podido obtener un generador de huellas digitales con el algoritmo \" + DIGEST_METHOD_ALGORITHM_NAME + \": \" + e, e //$NON-NLS-1$ //$NON-NLS-2$\r\n \t\t\t);\r\n }\r\n\r\n // XMLSignatureFactory\r\n final XMLSignatureFactory fac = XMLSignatureFactory.getInstance(\"DOM\"); //$NON-NLS-1$\r\n\r\n // DigestMethod\r\n final DigestMethod dm;\r\n try {\r\n dm = fac.newDigestMethod(digestMethodAlgorithm, null);\r\n }\r\n catch (final Exception e) {\r\n zf.close();\r\n throw new AOException(\r\n \"No se ha podido obtener un generador de huellas digitales con el algoritmo: \" + digestMethodAlgorithm, e //$NON-NLS-1$\r\n );\r\n }\r\n\r\n // Configuramos mediante reflexion las transformaciones y referencias\r\n\r\n final Class<?> canonicalizerClass = Class.forName(\"com.sun.org.apache.xml.internal.security.c14n.Canonicalizer\"); //$NON-NLS-1$\r\n final String algoIdC14nOmitComments =\r\n \t\t(String) canonicalizerClass.getField(\"ALGO_ID_C14N_OMIT_COMMENTS\").get(null); //$NON-NLS-1$\r\n\r\n // Transforms\r\n final List<Transform> transformList = new ArrayList<Transform>(1);\r\n transformList.add(\r\n \t\tfac.newTransform(\r\n \t\t\t\talgoIdC14nOmitComments,\r\n \t\t\t\t(TransformParameterSpec) null\r\n\t\t\t\t)\r\n \t\t);\r\n\r\n // References\r\n final List<Reference> referenceList = new ArrayList<Reference>();\r\n\r\n Class.forName(\"com.sun.org.apache.xml.internal.security.Init\").getMethod(\"init\").invoke(null); //$NON-NLS-1$ //$NON-NLS-2$\r\n\r\n final Object canonicalizer = canonicalizerClass.\r\n \t\tgetMethod(\"getInstance\", String.class).invoke(null, algoIdC14nOmitComments); //$NON-NLS-1$\r\n\r\n final Method canonicalizeSubtreeMethod =\r\n \t\tcanonicalizerClass.getMethod(\"canonicalizeSubtree\", org.w3c.dom.Node.class); //$NON-NLS-1$\r\n\r\n //\r\n // Anadimos tambien referencias manualmente al propio manifest.xml y\r\n // al mimetype\r\n //\r\n\r\n // manifest tiene una canonicalizacion. Solo en OOo 3.2 y superiores\r\n if (!useOpenOffice31Mode) {\r\n\r\n // mimetype es una referencia simple, porque no es XML\r\n referenceList.add(fac.newReference(\"mimetype\", dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(\"mimetype\")))))); //$NON-NLS-1$\r\n\r\n referenceList.add(\r\n \t\tfac.newReference(\r\n \t\t\t\tMANIFEST_PATH,\r\n \t\t\t\tdm,\r\n \t\t\t\ttransformList,\r\n \t\t\t\tnull,\r\n \t\t\t\tnull,\r\n \t\t\t\tmd.digest(\r\n \t\t\t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\t\t\tdbf.newDocumentBuilder().parse(\r\n \t\t\t\t\t\t\t\t\t\tnew ByteArrayInputStream(manifestData)\r\n \t\t\t\t\t\t\t\t\t).getDocumentElement()\r\n \t\t\t\t\t\t\t)\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // para cada nodo de manifest.xml\r\n Reference reference;\r\n for (int i = 0; i < listFileEntry.getLength(); i++) {\r\n fullPath = ((Element) listFileEntry.item(i)).getAttribute(\"manifest:full-path\"); //$NON-NLS-1$\r\n\r\n // si es un archivo\r\n if (!fullPath.endsWith(\"/\")) { //$NON-NLS-1$\r\n\r\n // y es uno de los siguientes archivos xml\r\n if (fullPath.equals(\"content.xml\") || fullPath.equals(\"meta.xml\") //$NON-NLS-1$ //$NON-NLS-2$\r\n || fullPath.equals(\"styles.xml\") //$NON-NLS-1$\r\n || fullPath.equals(\"settings.xml\")) { //$NON-NLS-1$\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, transformList, null, null, //$NON-NLS-1$ //$NON-NLS-2$\r\n // Obtiene su forma canonica y su DigestValue\r\n \t\tmd.digest(\r\n \t\t\t\t(byte[]) canonicalizeSubtreeMethod.invoke(\r\n \t\t\t\t\t\tcanonicalizer,\r\n \t\t\t\t\t\t// Recupera el fichero y su raiz\r\n \t\t\t\t\t\tdbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(fullPath))).getDocumentElement()\r\n \t\t\t\t\t\t)\r\n \t\t\t\t)\r\n \t\t);\r\n }\r\n\r\n // si no es uno de los archivos xml\r\n else {\r\n\r\n // crea la referencia\r\n reference = fac.newReference(fullPath.replaceAll(\" \", \"%20\"), dm, null, null, null, md.digest(AOUtil.getDataFromInputStream( //$NON-NLS-1$ //$NON-NLS-2$\r\n // Recupera el fichero\r\n zf.getInputStream(zf.getEntry(fullPath)))));\r\n\r\n }\r\n\r\n if (!fullPath.equals(SIGNATURES_PATH)) {\r\n \treferenceList.add(reference);\r\n }\r\n else {\r\n // Para mantener la compatibilidad con OpenOffice 3.1?\r\n \tisCofirm = true;\r\n }\r\n }\r\n }\r\n\r\n // Si se encuentra el fichero de firmas en el documento, la nueva firma\r\n // se debe agregar a el\r\n if (!isCofirm && zf.getEntry(SIGNATURES_PATH) != null) {\r\n \tisCofirm = true;\r\n }\r\n\r\n final Document docSignatures;\r\n final Element rootSignatures;\r\n // si es cofirma\r\n if (isCofirm) {\r\n // recupera el documento de firmas y su raiz\r\n docSignatures = dbf.newDocumentBuilder().parse(zf.getInputStream(zf.getEntry(SIGNATURES_PATH)));\r\n rootSignatures = docSignatures.getDocumentElement();\r\n }\r\n else {\r\n // crea un nuevo documento de firmas\r\n docSignatures = dbf.newDocumentBuilder().newDocument();\r\n rootSignatures = docSignatures.createElement(\"document-signatures\"); //$NON-NLS-1$\r\n rootSignatures.setAttribute(\"xmlns\", OPENOFFICE); //$NON-NLS-1$\r\n docSignatures.appendChild(rootSignatures);\r\n\r\n // En OpenOffice 3.2 y superiores no anadimos la propia firma al\r\n // manifest para evitar referencias circulares\r\n if (useOpenOffice31Mode) {\r\n final Element nodeDocumentSignatures = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeDocumentSignatures.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeDocumentSignatures.setAttribute(\"manifest:full-path\", SIGNATURES_PATH); //$NON-NLS-1$\r\n rootManifest.appendChild(nodeDocumentSignatures);\r\n\r\n // nuevo elemento de META-INF\r\n final Element nodeMetaInf = docManifest.createElement(\"manifest:file-entry\"); //$NON-NLS-1$\r\n nodeMetaInf.setAttribute(\"manifest:media-type\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n nodeMetaInf.setAttribute(\"manifest:full-path\", \"META-INF/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n rootManifest.appendChild(nodeMetaInf);\r\n }\r\n }\r\n\r\n // Ids de Signature y SignatureProperty\r\n final String signatureId = UUID.randomUUID().toString();\r\n final String signaturePropertyId = UUID.randomUUID().toString();\r\n\r\n // referencia a SignatureProperty\r\n referenceList.add(fac.newReference(\"#\" + signaturePropertyId, dm)); //$NON-NLS-1$\r\n\r\n // contenido de SignatureProperty\r\n final Element content = docSignatures.createElement(\"dc:date\"); //$NON-NLS-1$\r\n content.setAttribute(\"xmlns:dc\", \"http://purl.org/dc/elements/1.1/\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n content.setTextContent(new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss,SS\").format(new Date())); //$NON-NLS-1$\r\n final List<XMLStructure> contentList = new ArrayList<XMLStructure>();\r\n contentList.add(new DOMStructure(content));\r\n\r\n // SignatureProperty\r\n final List<SignatureProperty> spList = new ArrayList<SignatureProperty>();\r\n spList.add(fac.newSignatureProperty(contentList, \"#\" + signatureId, signaturePropertyId)); //$NON-NLS-1$\r\n\r\n // SignatureProperties\r\n final List<SignatureProperties> spsList = new ArrayList<SignatureProperties>();\r\n spsList.add(fac.newSignatureProperties(spList, null));\r\n\r\n // Object\r\n final List<XMLObject> objectList = new ArrayList<XMLObject>();\r\n objectList.add(fac.newXMLObject(spsList, null, null, null));\r\n\r\n // Preparamos el KeyInfo\r\n final KeyInfoFactory kif = fac.getKeyInfoFactory();\r\n final List<Object> x509Content = new ArrayList<Object>();\r\n final X509Certificate cert = (X509Certificate) certChain[0];\r\n x509Content.add(cert.getSubjectX500Principal().getName());\r\n x509Content.add(cert);\r\n\r\n // genera la firma\r\n fac.newXMLSignature(\r\n // SignedInfo\r\n fac.newSignedInfo(\r\n // CanonicalizationMethod\r\n fac.newCanonicalizationMethod(\r\n CanonicalizationMethod.INCLUSIVE,\r\n (C14NMethodParameterSpec) null),\r\n fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),\r\n referenceList\r\n ),\r\n // KeyInfo\r\n kif.newKeyInfo(\r\n Collections.singletonList(kif.newX509Data(x509Content)),\r\n null\r\n ),\r\n objectList,\r\n signatureId,\r\n null\r\n ).sign(\r\n new DOMSignContext(key, rootSignatures)\r\n );\r\n\r\n // crea un nuevo fichero zip\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n final ZipOutputStream zos = new ZipOutputStream(baos);\r\n\r\n // copia el contenido del zip original en el nuevo excepto el\r\n // documento de firmas y manifest.xml\r\n final Enumeration<? extends ZipEntry> e = zf.entries();\r\n ZipEntry ze;\r\n ZipEntry zeOut;\r\n while (e.hasMoreElements()) {\r\n ze = e.nextElement();\r\n zeOut = new ZipEntry(ze.getName());\r\n if (!ze.getName().equals(SIGNATURES_PATH) && !ze.getName().equals(MANIFEST_PATH)) {\r\n zos.putNextEntry(zeOut);\r\n zos.write(AOUtil.getDataFromInputStream(zf.getInputStream(ze)));\r\n }\r\n }\r\n\r\n // anade el documento de firmas\r\n zos.putNextEntry(new ZipEntry(SIGNATURES_PATH));\r\n final ByteArrayOutputStream baosXML = new ByteArrayOutputStream();\r\n writeXML(baosXML, rootSignatures, false);\r\n zos.write(baosXML.toByteArray());\r\n zos.closeEntry();\r\n\r\n // anade manifest.xml\r\n zos.putNextEntry(new ZipEntry(MANIFEST_PATH));\r\n final ByteArrayOutputStream baosManifest = new ByteArrayOutputStream();\r\n writeXML(baosManifest, rootManifest, false);\r\n zos.write(baosManifest.toByteArray());\r\n zos.closeEntry();\r\n\r\n try {\r\n zos.close();\r\n }\r\n catch (final Exception t) {\r\n // Ignoramos los errores en el cierre\r\n }\r\n zf.close();\r\n return baos.toByteArray();\r\n\r\n }\r\n catch (final SAXException saxex) {\r\n throw new AOFormatFileException(\"Estructura de archivo no valida: \" + fullPath + \": \" + saxex); //$NON-NLS-1$ //$NON-NLS-2$\r\n }\r\n catch (final Exception e) {\r\n throw new AOException(\"No ha sido posible generar la firma ODF: \" + e, e); //$NON-NLS-1$\r\n }\r\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public java.util.List<? extends liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder> \n getCertificateOrBuilderList() {\n if (certificateBuilder_ != null) {\n return certificateBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(certificate_);\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic static X509Certificate GenerateASelfSignedCerteficate(X500Principal dnName1,\n\t \t\tX500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey,\n\t \t\tPrivateKey myprivateKey, KeyUsage Keyus ) \n\t throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, \n\t NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t\n //Add the serial number\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t\t \n\t\t\t //Issuer Id extension \n\t\t certGen.setIssuerDN(dnName1); \n\t\t \n\t\t //Subject DN extension\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t \n\t\t\t //Not before \n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t // Not After\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t \n\t\t\t //Set the public Key\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t \n\t\t\t //Sign the certificate\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\t \t\n\t\t\t\n\t\t\t \n\t\t\t // finally, sign the certificate with the private key of the same KeyPair\n\t\t\t Security.addProvider(new BouncyCastleProvider());\n\t\t\t \n\t\t\t X509Certificate certroot = certGen.generate(myprivateKey,\"BC\");\n\t\t\t \n\t\t\t \n\t \treturn certroot;\n\t }", "public InternalIterator(X509Certificate param1X509Certificate) {\n/* 70 */ this.certificate = param1X509Certificate;\n/* */ }", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeyStore getKeyStore();\n\t\n\t/**\n\t * Returns a KeyManager which accompanies the KeyStore. \n\t * @return the KeyManager\n\t */\n\tpublic X509ExtendedKeyManager getKeyManager();\n\t\n\t/**\n\t * Returns a password which can be used to obtain PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method, \n\t * with the alias returned by the {@link #getKeyAlias()} method.\n\t * @return key password\n\t */\n\tpublic char[] getKeyPassword();\n\t\n\t/**\n\t * Returns an alias which can be used to obtain the PrivateKey entry\n\t * from the KeyStore returned by the {@link #getKeyStore()} method.\n\t * @return key alias\n\t */\n\tpublic String getKeyAlias();\n\t\n\t/**\n\t * Helper method to get private key from the underlying keystore\n\t * @return private key\n\t */\n\tpublic PrivateKey getKey();\n\n\t/**\n\t * Helper method to get certificate from the underlying keystore\n\t * @return certificate\n\t */\n\tpublic X509Certificate getCertificate();\n\n\t/**\n \t * Helper method to get certificate chain from the underlying keystore\n\t * @return certificate chain\n\t */\n\tpublic X509Certificate[] getCertificateChain();\n\t\n\t/**\n\t * @return RFC 2253 distinguished name of the certificate subject\n\t * @since 1.1.0\n\t */\n\tpublic String getSubjectName();\n}", "public String call_google_certificate() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, KeyManagementException {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n // From https://www.washington.edu/itconnect/security/ca/load-der.crt\n InputStream caInput = getResources().openRawResource(R.raw.loadder);\n Certificate ca;\n try {\n ca = cf.generateCertificate(caInput);\n System.out.println(\"ca=\" + ((X509Certificate) ca).getSubjectDN());\n } finally {\n caInput.close();\n }\n // Create a KeyStore containing our trusted CAs\n String keyStoreType = KeyStore.getDefaultType();\n KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n keyStore.load(null, null);\n keyStore.setCertificateEntry(\"ca\", ca);\n // Create a TrustManager that trusts the CAs in our KeyStore\n String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);\n tmf.init(keyStore);\n // Create an SSLContext that uses our TrustManager\n SSLContext context = SSLContext.getInstance(\"TLS\");\n context.init(null, tmf.getTrustManagers(), null);\n // Tell the URLConnection to use a SocketFactory from our SSLContext\n URL url = new URL(\"https://certs.cac.washington.edu/CAtest/\");\n HttpsURLConnection urlConnection =\n (HttpsURLConnection) url.openConnection();\n urlConnection.setSSLSocketFactory(context.getSocketFactory());\n InputStream in = urlConnection.getInputStream();\n return getStringFromInputStream(in);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() {\n return getCertificateFieldBuilder().addBuilder(\n liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance());\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public byte[] getEncoded() throws CRLException {\n if (encoding == null) {\n encoding = crl.getEncoded();\n }\n byte[] result = new byte[encoding.length];\n System.arraycopy(encoding, 0, result, 0, encoding.length);\n return result;\n }", "public void validate(KeyStore keyStore, Certificate cert) throws CertificateException\n {\n if (cert != null && cert instanceof X509Certificate)\n {\n ((X509Certificate)cert).checkValidity();\n \n String certAlias = \"[none]\";\n try\n {\n certAlias = keyStore.getCertificateAlias((X509Certificate)cert);\n Certificate[] certChain = keyStore.getCertificateChain(certAlias);\n \n ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();\n for (Certificate item : certChain)\n {\n if (!(item instanceof X509Certificate))\n {\n throw new CertificateException(\"Invalid certificate type in chain\");\n }\n certList.add((X509Certificate)item);\n }\n \n if (certList.isEmpty())\n {\n throw new CertificateException(\"Invalid certificate chain\");\n \n }\n \n X509CertSelector certSelect = new X509CertSelector();\n certSelect.setCertificate(certList.get(0));\n \n // Configure certification path builder parameters\n PKIXBuilderParameters pbParams = new PKIXBuilderParameters(_trustStore, certSelect);\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(certList)));\n \n // Set static Certificate Revocation List\n if (_crls != null && !_crls.isEmpty())\n {\n pbParams.addCertStore(CertStore.getInstance(\"Collection\", new CollectionCertStoreParameters(_crls)));\n }\n \n // Enable revocation checking\n pbParams.setRevocationEnabled(true);\n \n // Set maximum certification path length\n pbParams.setMaxPathLength(_maxCertPathLength);\n \n // Build certification path\n CertPathBuilderResult buildResult = CertPathBuilder.getInstance(\"PKIX\").build(pbParams); \n \n // Validate certification path\n CertPathValidator.getInstance(\"PKIX\").validate(buildResult.getCertPath(),pbParams);\n }\n catch (Exception ex)\n {\n Log.debug(ex);\n throw new CertificateException(\"Unable to validate certificate for alias [\" +\n certAlias + \"]: \" + ex.getMessage());\n }\n } \n }", "@Override\n\tprotected void initChain() {\n\t\tChainItem<XmlISC> item = firstItem = signingCertificateRecognition();\n\n\t\tif (Context.SIGNATURE.equals(context) || Context.COUNTER_SIGNATURE.equals(context)) {\n\t\t\titem = item.setNextItem(signingCertificateSigned());\n\t\t\titem = item.setNextItem(signingCertificateAttributePresent());\n\n\t\t\t/*\n\t\t\t * 2) The building block shall take the first reference and shall check that the digest of the certificate\n\t\t\t * referenced matches the result of digesting the signing certificate with the algorithm indicated. If they\n\t\t\t * do not match, the building block shall take the next element and shall repeat this step until a matching\n\t\t\t * element has been found or all elements have been checked. If they do match, the building block shall\n\t\t\t * continue with step 3. If the last element is reached without finding any match, the validation of this\n\t\t\t * property shall be taken as failed and the building block shall return the indication INDETERMINATE with\n\t\t\t * the sub-indication NO_SIGNING_CERTIFICATE_FOUND.\n\t\t\t */\n\t\t\titem = item.setNextItem(digestValuePresent());\n\t\t\titem = item.setNextItem(digestValueMatch());\n\n\t\t\t/*\n\t\t\t * 3) If the issuer and the serial number are additionally present in that reference, the details of the\n\t\t\t * issuer's name and the serial number of the IssuerSerial element may be compared with those indicated in\n\t\t\t * the\n\t\t\t * signing certificate: if they do not match, an additional warning shall be returned with the output.\n\t\t\t */\n\t\t\titem = item.setNextItem(issuerSerialMatch());\n\t\t}\n\t}", "public X509Certificate getCACertificate() throws DorianInternalException;", "X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm)\r\n throws GeneralSecurityException, IOException {\r\n PrivateKey privkey = pair.getPrivate();\r\n X509CertInfo info = new X509CertInfo();//creating an X509CertInfo object\r\n Date from = new Date();\r\n Date to = new Date(from.getTime() + days * 86400000l);\r\n CertificateValidity interval = new CertificateValidity(from, to);\r\n BigInteger sn = new BigInteger(64, new SecureRandom());\r\n X500Name owner = new X500Name(dn);\r\n \r\n //now set all the information of X509CertInfo class \r\n \r\n info.set(X509CertInfo.VALIDITY, interval);\r\n info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn));\r\n info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));\r\n info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));\r\n info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));\r\n info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\r\n AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);\r\n info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));\r\n CertificateExtensions extensions = new CertificateExtensions();\r\n BasicConstraintsExtension bce = new BasicConstraintsExtension(true, -1);\r\n extensions.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension(false, bce.getExtensionValue()));\r\n info.set(X509CertInfo.EXTENSIONS, extensions);\r\n // Sign the cert to identify the algorithm that's used.\r\n X509CertImpl cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n \r\n // Update the algorith, and resign.\r\n algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG);\r\n info.set(CertificateAlgorithmId.NAME + \".\" + CertificateAlgorithmId.ALGORITHM, algo);\r\n cert = new X509CertImpl(info);\r\n cert.sign(privkey, algorithm);\r\n return cert;\r\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder(\n int index) {\n return certificate_.get(index);\n }", "public static byte[] convertECDSAASN1toXMLDSIG(byte asn1Bytes[]) throws IOException {\n\n if (asn1Bytes.length < 8 || asn1Bytes[0] != 48) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n int offset;\n if (asn1Bytes[1] > 0) {\n offset = 2;\n } else if (asn1Bytes[1] == (byte) 0x81) {\n offset = 3;\n } else {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n\n byte rLength = asn1Bytes[offset + 1];\n int i;\n\n for (i = rLength; (i > 0) && (asn1Bytes[(offset + 2 + rLength) - i] == 0); i--)\n ;\n\n byte sLength = asn1Bytes[offset + 2 + rLength + 1];\n int j;\n\n for (j = sLength; (j > 0) && (asn1Bytes[(offset + 2 + rLength + 2 + sLength) - j] == 0); j--)\n ;\n\n int rawLen = Math.max(i, j);\n\n if ((asn1Bytes[offset - 1] & 0xff) != asn1Bytes.length - offset || (asn1Bytes[offset - 1] & 0xff) != 2 + rLength + 2 + sLength || asn1Bytes[offset] != 2 || asn1Bytes[offset + 2 + rLength] != 2) {\n throw new IOException(\"Invalid ASN.1 format of ECDSA signature\");\n }\n byte xmldsigBytes[] = new byte[2 * rawLen];\n\n System.arraycopy(asn1Bytes, (offset + 2 + rLength) - i, xmldsigBytes, rawLen - i, i);\n System.arraycopy(asn1Bytes, (offset + 2 + rLength + 2 + sLength) - j, xmldsigBytes, 2 * rawLen - j, j);\n\n return xmldsigBytes;\n }", "@java.lang.Override\n public int getCertificateCount() {\n return certificate_.size();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate(int index) {\n if (certificateBuilder_ == null) {\n return certificate_.get(index);\n } else {\n return certificateBuilder_.getMessage(index);\n }\n }", "public Collection<X509Certificate> getCertificates() {\n return certificateChain;\n }", "@java.lang.Override\n public java.util.List<com.google.protobuf.ByteString>\n getCertificateList() {\n return java.util.Collections.unmodifiableList(\n instance.getCertificateList());\n }", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "private void addCertificate(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureCertificateIsMutable();\n certificate_.add(value);\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private static String internalEncodeObjectToPEM(Object o) throws CertificateEncodingException, IOException {\n StringWriter sw = new StringWriter();\n final String LINE64 = \"(.{64})\";\n\n if (o instanceof X509Certificate) {\n X509Certificate crt = (X509Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n crt.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END + \"\\n\");\n } else if (o instanceof Certificate) {\n Certificate cert = (Certificate) o;\n sw.write(Constants.CRT_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cert.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CRT_END);\n } else if (o instanceof CMSEnvelopedData) {\n CMSEnvelopedData cms = (CMSEnvelopedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof CMSSignedData) {\n CMSSignedData cms = (CMSSignedData) o;\n sw.write(Constants.CMS_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n cms.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CMS_END);\n } else if (o instanceof PKCS10CertificationRequest) {\n PKCS10CertificationRequest csr = (PKCS10CertificationRequest) o;\n sw.write(Constants.CSR_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n csr.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.CSR_END);\n } else if (o instanceof PrivateKey) {\n PrivateKey key = (PrivateKey) o;\n sw.write(Constants.PRIVATE_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PRIVATE_KEY_END);\n } else if (o instanceof PublicKey) {\n PublicKey key = (PublicKey) o;\n sw.write(Constants.PUBLIC_KEY_BEGIN + \"\\n\");\n sw.write(Base64.getEncoder().encodeToString(\n key.getEncoded()).replaceAll(LINE64, \"$1\\n\")\n );\n sw.write(\"\\n\" + Constants.PUBLIC_KEY_END);\n } else {\n throw new CertificateEncodingException(\n \"unknown Object type \" +\n o.getClass().getName() +\n \". Supported types are: \\n\" +\n \" * X509Certificate\\n\" +\n \" * Certificate\\n\" +\n \" * CMSEnvelopedData\\n\" +\n \" * CMSSignedData\\n\" +\n \" * PKCS10CertificationRequest\\n\" +\n \" * PrivateKey\\n\" +\n \" * PublicKey\"\n );\n }\n\n String res = sw.toString();\n return res.replaceAll(\"(?m)^\\r?\\n\", \"\");\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder getCertificateBuilder() {\n \n onChanged();\n return getCertificateFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic byte[] cosign(final byte[] data,\r\n final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }", "public CertificateDescription certificate() {\n return this.certificate;\n }", "protected X509Certificate getCertificate(String certString,\n String format)\n {\n X509Certificate cert = null;\n \n try {\n \n if (SAMLUtilsCommon.debug.messageEnabled()) {\n SAMLUtilsCommon.debug.message(\"getCertificate(Assertion) : \" +\n certString);\n }\n \n StringBuffer xml = new StringBuffer(100);\n xml.append(SAMLConstants.BEGIN_CERT);\n xml.append(certString);\n xml.append(SAMLConstants.END_CERT);\n \n byte[] barr = null;\n barr = (xml.toString()).getBytes();\n \n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n ByteArrayInputStream bais = new ByteArrayInputStream(barr);\n \n if ((format !=null) &&\n format.equals(SAMLConstants.TAG_PKCS7)) { // PKCS7 format\n Collection c = cf.generateCertificates(bais);\n Iterator i = c.iterator();\n while (i.hasNext()) {\n cert = (java.security.cert.X509Certificate) i.next();\n }\n } else { //X509:v3 format\n while (bais.available() > 0) {\n cert = (java.security.cert.X509Certificate)\n cf.generateCertificate(bais);\n }\n }\n } catch (Exception e) {\n SAMLUtilsCommon.debug.error(\"getCertificate Exception: \", e);\n }\n \n return cert;\n }", "Result_SignDecodeErrorZ read_chan_signer(byte[] reader);", "public liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates() {\n if (certificatesBuilder_ == null) {\n return certificates_ == null ? liubaninc.m0.pki.CertificatesOuterClass.Certificates.getDefaultInstance() : certificates_;\n } else {\n return certificatesBuilder_.getMessage();\n }\n }" ]
[ "0.6394192", "0.61330765", "0.61006594", "0.60482687", "0.602352", "0.6006773", "0.5965928", "0.58786696", "0.5791951", "0.57439876", "0.57363886", "0.57346094", "0.57299364", "0.57224", "0.57224", "0.5626907", "0.5619409", "0.558984", "0.55617076", "0.55617076", "0.55569893", "0.55530185", "0.5547045", "0.5518622", "0.5511868", "0.55108696", "0.55108696", "0.5485581", "0.5463167", "0.544292", "0.54160935", "0.5413839", "0.5406575", "0.540317", "0.53949416", "0.5339265", "0.5333285", "0.5325161", "0.53196114", "0.5315588", "0.5311513", "0.53066754", "0.53033113", "0.5289029", "0.52745855", "0.5264804", "0.5264804", "0.5260825", "0.5249203", "0.5244855", "0.5244754", "0.523448", "0.5218867", "0.5218258", "0.5204517", "0.5194733", "0.51866835", "0.5178598", "0.5163447", "0.5143541", "0.5132101", "0.5127687", "0.51237017", "0.5109286", "0.5078722", "0.5071932", "0.5069754", "0.50655746", "0.5061466", "0.50556165", "0.5055193", "0.50545955", "0.50522506", "0.5043691", "0.5038166", "0.5029388", "0.5022404", "0.50123733", "0.50072986", "0.5006049", "0.50052065", "0.49996534", "0.49953255", "0.49761605", "0.49707028", "0.49616292", "0.49591652", "0.49554187", "0.4952366", "0.49480525", "0.49473253", "0.4944978", "0.493571", "0.49247384", "0.49124497", "0.4910755", "0.49064356", "0.48939002", "0.48905846", "0.48885608", "0.48816416" ]
0.0
-1
From PaymentDetails.merchant_data optional bytes merchant_data = 1;
boolean hasMerchantData();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setMerchantData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000020;\n merchantData_ = value;\n }", "private void setMerchantData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000001;\n merchantData_ = value;\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return merchantData_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return merchantData_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return instance.getMerchantData();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return instance.getMerchantData();\n }", "public Builder setMerchantData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setMerchantData(value);\n return this;\n }", "public Builder setMerchantData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setMerchantData(value);\n return this;\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000020) != 0);\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "private void clearMerchantData() {\n bitField0_ = (bitField0_ & ~0x00000020);\n merchantData_ = getDefaultInstance().getMerchantData();\n }", "private void clearMerchantData() {\n bitField0_ = (bitField0_ & ~0x00000001);\n merchantData_ = getDefaultInstance().getMerchantData();\n }", "public String getPaymentData() {\n return paymentData;\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "public void setMerchantCode (java.lang.String merchantCode) {\r\n\t\tthis.merchantCode = merchantCode;\r\n\t}", "public String getMerchant() {\n return _merchant;\n }", "public Long getMerchantId()\n {\n return merchantId;\n }", "public void setMerchantNum(String merchantNum) {\n this.merchantNum = FileUtils.hexStringFromatByF(10, \"\");\n }", "public void setMerchantId(Long merchantId) {\n this.merchantId = merchantId;\n }", "public String getMerchantTag() {\n return this.merchantTag;\n }", "public String getMerchantNo();", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public Long getMerchantId() {\n return merchantId;\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId;\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId;\n }", "public java.lang.String getMerchantCode () {\r\n\t\treturn merchantCode;\r\n\t}", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "public void setMerchantName(String merchantName) {\n this.merchantName = merchantName;\n }", "public void setMerchantId (java.lang.Long merchantId) {\r\n\t\tthis.merchantId = merchantId;\r\n\t}", "public String getMerchantAccountCode() {\n return merchantAccountCode;\n }", "private JsonObjectBuilder merchantToJsonBuilder(Merchant merchant) {\n\n // Any way to avoid converting to a String?\n String jsonMerchant = jsonb.toJson(merchant);\n try (JsonReader jsonReader = Json.createReader(new StringReader(jsonMerchant))) {\n JsonObject merchantJson = jsonReader.readObject();\n JsonObjectBuilder merchantBuilder = Json.createObjectBuilder();\n merchantJson.forEach((k, v) -> {\n merchantBuilder.add(k, v);\n });\n return merchantBuilder;\n }\n }", "boolean verifyDeveloperPayload(Purchase p) {\n\t String payload = p.getDeveloperPayload();\n\n\t return true;\n\t }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId == null ? null : merchantId.trim();\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId == null ? null : merchantId.trim();\n }", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "public String getMerchantReference() {\n return this.merchantReference;\n }", "public String getMerchantAccount() {\n return merchantAccount;\n }", "@Override\n\tpublic String pay(ZFTMerchantConfig merchant, ZFTOrderConfig order) throws Exception {\n\t\treturn null;\n\t}", "public void setMerchantTransNo (java.lang.String merchantTransNo) {\r\n\t\tthis.merchantTransNo = merchantTransNo;\r\n\t}", "public void setAdditionalBillingData(com.ipcommerce.schemas.CWS.v2_0.Transactions.PersonalInfo additionalBillingData) {\n this.additionalBillingData = additionalBillingData;\n }", "public String getMerchantReference() {\n return merchantReference;\n }", "void setPaymentInformation(String information);", "public void sendPaymentToMerchant() {\n // Check for successful send and a BIP70 Payment requirement\n if (lastBitcoinSentEvent != null && lastBitcoinSentEvent.isSendWasSuccessful()) {\n Preconditions.checkNotNull(getPaymentRequestData());\n Preconditions.checkState(getPaymentRequestData().isPresent());\n Preconditions.checkNotNull(getPaymentRequestData().get().getPaymentSessionSummary());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().isPresent());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().get().hasPaymentSession());\n\n PaymentSessionSummary paymentSessionSummary = getPaymentRequestData().get().getPaymentSessionSummary().get();\n\n // Send the Payment message to the merchant\n try {\n final List<Transaction> transactionsSent = Lists.newArrayList(lastBitcoinSentEvent.getTransaction().get());\n final PaymentRequestData finalPaymentRequestData = getPaymentRequestData().get();\n\n final Optional<PaymentSessionSummary.PaymentProtocolResponseDto> dto = paymentSessionSummary.sendPaymentSessionPayment(\n transactionsSent,\n lastBitcoinSentEvent.getChangeAddress(),\n getSendBitcoinEnterPaymentMemoPanelModel().getPaymentMemo());\n\n final Protos.Payment finalPayment = dto.get().getFinalPayment();\n final ListenableFuture<PaymentProtocol.Ack> future = dto.get().getFuture();\n\n if (future != null) {\n Futures.addCallback(\n future, new FutureCallback<PaymentProtocol.Ack>() {\n @Override\n public void onSuccess(PaymentProtocol.Ack result) {\n\n // Have successfully received a PaymentAck from the merchant\n log.info(\"Received PaymentAck from merchant. Memo: {}\", result.getMemo());\n getSendBitcoinShowPaymentACKMemoPanelModel().setPaymentACKMemo(result.getMemo());\n\n PaymentProtocolService paymentProtocolService = CoreServices.getPaymentProtocolService();\n\n if (finalPayment != null) {\n Optional<Protos.PaymentACK> paymentACK = paymentProtocolService.newPaymentACK(finalPayment, result.getMemo());\n\n finalPaymentRequestData.setPayment(Optional.of(finalPayment));\n finalPaymentRequestData.setPaymentACK(paymentACK);\n log.debug(\"Saving PaymentMemo of {} and PaymentACKMemo of {}\", finalPayment.getMemo(), paymentACK.isPresent() ? paymentACK.get().getMemo() : \"n/a\");\n WalletService walletService = CoreServices.getOrCreateWalletService(WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletId());\n walletService.addPaymentRequestData(finalPaymentRequestData);\n\n // Write payments\n CharSequence password = WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletPassword().getPassword();\n if (password != null) {\n walletService.writePayments(password);\n }\n\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(true, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_OK, null));\n } else {\n log.error(\"No payment and hence cannot save payment or paymentACK\");\n }\n }\n\n @Override\n public void onFailure(Throwable t) {\n // Failed to communicate with the merchant\n log.error(\"Unexpected failure\", t);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{t.getClass().getCanonicalName() + \" \" + t.getMessage()}));\n }\n });\n } else {\n throw new PaymentProtocolException(\"Failed to create future from Ack\");\n }\n } catch (IOException | PaymentProtocolException e) {\n log.error(\"Unexpected failure\", e);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{e.getClass().getCanonicalName() + \" \" + e.getMessage()}));\n }\n } else {\n String message = \"Bitcoin not sent successfully so no payment sent to requestor\";\n log.debug(message);\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(false, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED, new String[]{message}));\n }\n }", "public String getMerchantName() {\n return merchantName;\n }", "boolean verifyDeveloperPayload(Purchase p) {\n return DEVELOPER_PAYLOAD.equals(p.getDeveloperPayload());\n }", "public java.lang.Long getMerchantId () {\r\n\t\treturn merchantId;\r\n\t}", "@ApiModelProperty(required = true, value = \"merchant resource for the store\")\n @JsonProperty(\"merchant\")\n public EntityInfo getMerchant() {\n return merchant;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == PayUmoneyFlowManager.REQUEST_CODE_PAYMENT && resultCode == RESULT_OK && data !=\n null) {\n TransactionResponse transactionResponse = data.getParcelableExtra(PayUmoneyFlowManager\n .INTENT_EXTRA_TRANSACTION_RESPONSE);\n\n ResultModel resultModel = data.getParcelableExtra(PayUmoneyFlowManager.ARG_RESULT);\n\n // Check which object is non-null\n if (transactionResponse != null && transactionResponse.getPayuResponse() != null) {\n if (transactionResponse.getTransactionStatus().equals(TransactionResponse.TransactionStatus.SUCCESSFUL)) {\n //Success Transaction\n AddPayment(name, ridequantity, Amount);\n } else {\n Intent intent = new Intent();\n setResult(RESULT_OK, intent);\n finish();\n\n }\n\n // Response from Payumoney\n// String payuResponse = transactionResponse.getPayuResponse();\n//\n//// Response from SURl and FURL\n// String merchantResponse = transactionResponse.getTransactionDetails();\n//\n// new AlertDialog.Builder(this)\n// .setCancelable(false)\n// .setMessage(\"Payu's Data : \" + payuResponse + \"\\n\\n\\n Merchant's Data: \" + merchantResponse)\n// .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {\n// public void onClick(DialogInterface dialog, int whichButton) {\n// dialog.dismiss();\n// }\n// }).show();\n\n } else if (resultModel != null && resultModel.getError() != null) {\n Log.d(TAG, \"Error response : \" + resultModel.getError().getTransactionResponse());\n } else {\n Log.d(TAG, \"Both objects are null!\");\n }\n }\n }", "public String getMerchantAccount() {\n return merchantAccount;\n }", "@JsonProperty(\"MerchantId\")\n public String getMerchantId() {\n return merchantId;\n }", "public Builder setPaymentHashBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n paymentHash_ = value;\n onChanged();\n return this;\n }", "public void setPaymentinformation (java.lang.String paymentinformation) {\r\n\t\tthis.paymentinformation = paymentinformation;\r\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public void setMerchantName(String merchantName) {\n\t\tthis.merchantName = merchantName;\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n String payload = p.getDeveloperPayload();\n\n /*\n * TODO: verify that the developer payload of the purchase is correct. It will be\n * the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase and\n * verifying it here might seem like a good approach, but this will fail in the\n * case where the user purchases an item on one device and then uses your app on\n * a different device, because on the other device you will not have access to the\n * random string you originally generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different between them,\n * so that one user's purchase can't be replayed to another user.\n *\n * 2. The payload must be such that you can verify it even when the app wasn't the\n * one who initiated the purchase flow (so that items purchased by the user on\n * one device work on other devices owned by the user).\n *\n * Using your own server to store and verify developer payloads across app\n * installations is recommended.\n */\n\n return true;\n }", "boolean verifyDeveloperPayload(Purchase p) {\n\t\t/*String payload = */p.getDeveloperPayload();\n\n\t\t/*\n\t\t * TODO: verify that the developer payload of the purchase is correct.\n\t\t * It will be the same one that you sent when initiating the purchase.\n\t\t * \n\t\t * WARNING: Locally generating a random string when starting a purchase\n\t\t * and verifying it here might seem like a good approach, but this will\n\t\t * fail in the case where the user purchases an item on one device and\n\t\t * then uses your app on a different device, because on the other device\n\t\t * you will not have access to the random string you originally\n\t\t * generated.\n\t\t * \n\t\t * So a good developer payload has these characteristics:\n\t\t * \n\t\t * 1. If two different users purchase an item, the payload is different\n\t\t * between them, so that one user's purchase can't be replayed to\n\t\t * another user.\n\t\t * \n\t\t * 2. The payload must be such that you can verify it even when the app\n\t\t * wasn't the one who initiated the purchase flow (so that items\n\t\t * purchased by the user on one device work on other devices owned by\n\t\t * the user).\n\t\t * \n\t\t * Using your own server to store and verify developer payloads across\n\t\t * app installations is recommended.\n\t\t */\n\n\t\treturn true;\n\t}", "@Override\r\n\tpublic JSONObject init(Merchant merchant, PayeeVo v) {\n\t\tJSONObject valid = this.valid(merchant,v.getTotal_amount());\r\n\t\tif (valid.getBooleanValue(\"state\")){\r\n\t\t\tPayee payee = this.getPayee();\r\n\t\t\tif (payee != null){\r\n\t\t\t\tv.setCost(String.valueOf(merchant.getFee()));\r\n\t\t\t\tv.setmId(String.valueOf(merchant.getId()));\r\n\t\t\t\tJSONObject result = this.execute(payee, v);\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t\treturn Result.error.toJson(\"代付服务关闭\");\r\n\t\t}\r\n\t\treturn valid;\r\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n\t\tString payload = p.getDeveloperPayload();\n\n\t\t/*\n\t\t * TODO: verify that the developer payload of the purchase is correct.\n\t\t * It will be the same one that you sent when initiating the purchase.\n\t\t * \n\t\t * WARNING: Locally generating a random string when starting a purchase\n\t\t * and verifying it here might seem like a good approach, but this will\n\t\t * fail in the case where the user purchases an item on one device and\n\t\t * then uses your app on a different device, because on the other device\n\t\t * you will not have access to the random string you originally\n\t\t * generated.\n\t\t * \n\t\t * So a good developer payload has these characteristics:\n\t\t * \n\t\t * 1. If two different users purchase an item, the payload is different\n\t\t * between them, so that one user's purchase can't be replayed to\n\t\t * another user.\n\t\t * \n\t\t * 2. The payload must be such that you can verify it even when the app\n\t\t * wasn't the one who initiated the purchase flow (so that items\n\t\t * purchased by the user on one device work on other devices owned by\n\t\t * the user).\n\t\t * \n\t\t * Using your own server to store and verify developer payloads across\n\t\t * app installations is recommended.\n\t\t */\n\n\t\treturn true;\n\t}", "public void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@Override\n public void onChanged(@Nullable Merchant merchant) {\n }", "private void m50363B() {\n try {\n TokenPaymentParams tokenPaymentParams = new TokenPaymentParams(this.f30711G0, this.f30708D0, this.f30709E0.getBrand(), this.f30737h0.getText().toString());\n StringBuilder sb = new StringBuilder();\n sb.append(this.f30720S.getString(C10232R.string.checkout_ui_callback_scheme));\n sb.append(\"://callback\");\n tokenPaymentParams.mo40895e(sb.toString());\n this.f30754y0.mo41066a(new Transaction((PaymentParams) tokenPaymentParams));\n this.f30728a.mo23628i(C11645a.f33474f, \"credit_card\");\n } catch (PaymentException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tprotected byte[] prepare_data() {\n\t\tbyte[] ret_byte = null;\n\t\tJSONObject json_object = new JSONObject();\n\t\ttry {\n\t\t\tjson_object.put(Jsonkey.string_transitionid_key, \"\");\n\t\t\tjson_object.put(Jsonkey.string_magicid_key, \"\");\n\t\t\tJSONObject json_content = new JSONObject();\n\t\t\tjson_object.put(Jsonkey.string_content_key, json_content);\n\t\t\tjson_content.put(Jsonkey.string_ctype_key, \"verify_login_request\");\n\t\t\tJSONObject json_cvalue = new JSONObject();\n\t\t\tjson_content.put(Jsonkey.string_cvalue_key, json_cvalue);\n\t\t\tjson_cvalue.put(Jsonkey.string_user_name_key, user_name);\n\t\t\tjson_cvalue.put(Jsonkey.string_user_password_key, user_password);\n\t\t\t\n\t\t\tString json_string = json_object.toString();\n\t\t\tret_byte = json_string.getBytes();\n\t\t} catch (JSONException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn ret_byte;\n\t}", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public CreditCard getDefaultPaymentInfo();", "public Builder clearMerchantData() {\n copyOnWrite();\n instance.clearMerchantData();\n return this;\n }", "public Builder clearMerchantData() {\n copyOnWrite();\n instance.clearMerchantData();\n return this;\n }", "public void setPaymentInfoInCart(CreditCard cc);", "@Test\n\tpublic void testInvalidMerchantTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\t//database.addCustomer(merchant); Merchant not in database\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This merchant is not a DTUPay user\",verifyParticipants);\n\t}", "public String getDeveloperPayload(){\n return developerPayload;\n }", "public Merchant() {}", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private void returnDeposit(String paymentInfo) {\n }", "boolean hasSerializedPaymentDetails();", "private GetMerchantByParkingResponse(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "public Object adjustBankSysexForEmit(byte[] data, Model model)\n {\n return data;\n }", "public IBankTransfert payment();", "public void parsingAdditionalData() {\n\t\tString AdditionalData = billPayBean.getAdditionalData();\n\t\tswitch (Integer.parseInt(billPayBean.getBillerId())) {\n\t\tcase 91901:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(95,120));\n\t\t\tbillPayBean.setMeterNumber(AdditionalData.substring(7,18));\n\t\t\tbillPayBean.setBillNumber(AdditionalData.substring(18,30));\n\t\t\tbreak;\n\t\tcase 91951:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(47,72));\n\t\t\tbillPayBean.setBillNumber(AdditionalData.substring(0,12));\n\t\t\tbreak;\n\t\tcase 91999:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(66,91));\n\t\t\tbillPayBean.setRegNumber(AdditionalData.substring(0,13));\n\t\t\tbreak;\n\t\tdefault:\n\t\t}\n\t\treturn ;\n\t}", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public void parseParameter(byte[] data)\n {\n return; \n }", "public String getMerchantOrderReference() {\n return merchantOrderReference;\n }", "public void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "public String getMerchantName() {\n\t\treturn merchantName;\n\t}", "public String getJP_BankDataCustomerCode2();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "String getPaymentInformation();", "@ApiModelProperty(value = \"If provided, then the value overrides the one present in onboarding data. If the merchantCategoryCode value is not populated in onboarding data then this field is mandatory.<br><br><b>Note:</b> required if not provided during onboarding\")\n public Integer getMerchantCategoryCode() {\n return merchantCategoryCode;\n }", "private void setPaymentUrlBytes(\n com.google.protobuf.ByteString value) {\n paymentUrl_ = value.toStringUtf8();\n bitField0_ |= 0x00000010;\n }", "public void navigateToBaseActivity() throws JSONException {\n\n String merchantKey = jsonObject.getString(\"merchantKey\");\n String amount = jsonObject.getString(\"amount\");\n String email = jsonObject.getString(\"email\");\n String value = jsonObject.getString(\"value\");\n String firstName = jsonObject.getString(\"firstName\");\n String phone = jsonObject.getString(\"phone\");\n String txnId = jsonObject.getString(\"txnId\");\n String sUrl = jsonObject.getString(\"sUrl\");\n String fUrl = jsonObject.getString(\"fUrl\");\n String udf1 = jsonObject.getString(\"udf1\");\n String udf2 = jsonObject.getString(\"udf2\");\n String udf3 = jsonObject.getString(\"udf3\");\n String udf4 = jsonObject.getString(\"udf4\");\n String udf5 = jsonObject.getString(\"udf5\");\n salt = jsonObject.getString(\"salt\");\n int environment;\n if (value.equals(\"test\"))\n environment = PayuConstants.STAGING_ENV;\n else\n environment = PayuConstants.PRODUCTION_ENV;\n String userCredentials = merchantKey + \":\" + email;\n mPaymentParams = new PaymentParams();\n mPaymentParams.setKey(merchantKey);\n mPaymentParams.setAmount(amount);\n mPaymentParams.setProductInfo(\"GoCharge power bank charges\");\n mPaymentParams.setFirstName(firstName);\n mPaymentParams.setEmail(email);\n mPaymentParams.setPhone(phone);\n mPaymentParams.setTxnId(txnId);\n mPaymentParams.setSurl(sUrl);\n mPaymentParams.setFurl(fUrl);\n mPaymentParams.setNotifyURL(mPaymentParams.getSurl()); //for lazy pay\n mPaymentParams.setUdf1(udf1);\n mPaymentParams.setUdf2(udf2);\n mPaymentParams.setUdf3(udf3);\n mPaymentParams.setUdf4(udf4);\n mPaymentParams.setUdf5(udf5);\n mPaymentParams.setUserCredentials(userCredentials);\n payuConfig = new PayuConfig();\n payuConfig.setEnvironment(environment);\n generateHashFromSDK(mPaymentParams, salt);\n\n }" ]
[ "0.7797422", "0.77918124", "0.75766045", "0.75766045", "0.72464305", "0.72464305", "0.6597311", "0.6597311", "0.6441166", "0.6441166", "0.63655734", "0.6324887", "0.62667197", "0.62563246", "0.6005362", "0.5960295", "0.5960295", "0.5873643", "0.58162814", "0.5814753", "0.57891667", "0.5772042", "0.57114214", "0.5705532", "0.5704619", "0.5662944", "0.5662944", "0.5662944", "0.5662944", "0.5653525", "0.5625046", "0.5625046", "0.562438", "0.5577743", "0.55719674", "0.5565961", "0.55476195", "0.5503755", "0.5482933", "0.5420203", "0.5420203", "0.54144263", "0.5414363", "0.541154", "0.54030347", "0.5383753", "0.5372269", "0.5363541", "0.5348345", "0.5332825", "0.5331783", "0.5319071", "0.5314819", "0.53104293", "0.53003657", "0.5285834", "0.5282473", "0.5224128", "0.52218544", "0.52146405", "0.52129304", "0.52108216", "0.52069247", "0.5201274", "0.51969695", "0.515134", "0.513523", "0.5125502", "0.51180404", "0.5112707", "0.5112191", "0.5102199", "0.50883555", "0.5081001", "0.5081001", "0.5068579", "0.50668013", "0.50616", "0.50615776", "0.50562394", "0.5046173", "0.5034452", "0.50321424", "0.5015906", "0.5000806", "0.49917835", "0.4990597", "0.49896547", "0.49815026", "0.49793768", "0.49725616", "0.49724683", "0.49575555", "0.49566895", "0.49451298", "0.49393365", "0.493865", "0.49326822", "0.49184534" ]
0.59463644
18
From PaymentDetails.merchant_data optional bytes merchant_data = 1;
com.google.protobuf.ByteString getMerchantData();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setMerchantData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000020;\n merchantData_ = value;\n }", "private void setMerchantData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000001;\n merchantData_ = value;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return merchantData_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return merchantData_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return instance.getMerchantData();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return instance.getMerchantData();\n }", "public Builder setMerchantData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setMerchantData(value);\n return this;\n }", "public Builder setMerchantData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setMerchantData(value);\n return this;\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000020) != 0);\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "private void clearMerchantData() {\n bitField0_ = (bitField0_ & ~0x00000020);\n merchantData_ = getDefaultInstance().getMerchantData();\n }", "private void clearMerchantData() {\n bitField0_ = (bitField0_ & ~0x00000001);\n merchantData_ = getDefaultInstance().getMerchantData();\n }", "public String getPaymentData() {\n return paymentData;\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "boolean hasMerchantData();", "boolean hasMerchantData();", "public void setMerchantCode (java.lang.String merchantCode) {\r\n\t\tthis.merchantCode = merchantCode;\r\n\t}", "public String getMerchant() {\n return _merchant;\n }", "public Long getMerchantId()\n {\n return merchantId;\n }", "public void setMerchantNum(String merchantNum) {\n this.merchantNum = FileUtils.hexStringFromatByF(10, \"\");\n }", "public void setMerchantId(Long merchantId) {\n this.merchantId = merchantId;\n }", "public String getMerchantTag() {\n return this.merchantTag;\n }", "public String getMerchantNo();", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public Long getMerchantId() {\n return merchantId;\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId;\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId;\n }", "public java.lang.String getMerchantCode () {\r\n\t\treturn merchantCode;\r\n\t}", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "public void setMerchantName(String merchantName) {\n this.merchantName = merchantName;\n }", "public void setMerchantId (java.lang.Long merchantId) {\r\n\t\tthis.merchantId = merchantId;\r\n\t}", "public String getMerchantAccountCode() {\n return merchantAccountCode;\n }", "private JsonObjectBuilder merchantToJsonBuilder(Merchant merchant) {\n\n // Any way to avoid converting to a String?\n String jsonMerchant = jsonb.toJson(merchant);\n try (JsonReader jsonReader = Json.createReader(new StringReader(jsonMerchant))) {\n JsonObject merchantJson = jsonReader.readObject();\n JsonObjectBuilder merchantBuilder = Json.createObjectBuilder();\n merchantJson.forEach((k, v) -> {\n merchantBuilder.add(k, v);\n });\n return merchantBuilder;\n }\n }", "boolean verifyDeveloperPayload(Purchase p) {\n\t String payload = p.getDeveloperPayload();\n\n\t return true;\n\t }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId == null ? null : merchantId.trim();\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId == null ? null : merchantId.trim();\n }", "public String getMerchantReference() {\n return this.merchantReference;\n }", "public String getMerchantAccount() {\n return merchantAccount;\n }", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "@Override\n\tpublic String pay(ZFTMerchantConfig merchant, ZFTOrderConfig order) throws Exception {\n\t\treturn null;\n\t}", "public void setMerchantTransNo (java.lang.String merchantTransNo) {\r\n\t\tthis.merchantTransNo = merchantTransNo;\r\n\t}", "public void setAdditionalBillingData(com.ipcommerce.schemas.CWS.v2_0.Transactions.PersonalInfo additionalBillingData) {\n this.additionalBillingData = additionalBillingData;\n }", "public String getMerchantReference() {\n return merchantReference;\n }", "void setPaymentInformation(String information);", "public void sendPaymentToMerchant() {\n // Check for successful send and a BIP70 Payment requirement\n if (lastBitcoinSentEvent != null && lastBitcoinSentEvent.isSendWasSuccessful()) {\n Preconditions.checkNotNull(getPaymentRequestData());\n Preconditions.checkState(getPaymentRequestData().isPresent());\n Preconditions.checkNotNull(getPaymentRequestData().get().getPaymentSessionSummary());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().isPresent());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().get().hasPaymentSession());\n\n PaymentSessionSummary paymentSessionSummary = getPaymentRequestData().get().getPaymentSessionSummary().get();\n\n // Send the Payment message to the merchant\n try {\n final List<Transaction> transactionsSent = Lists.newArrayList(lastBitcoinSentEvent.getTransaction().get());\n final PaymentRequestData finalPaymentRequestData = getPaymentRequestData().get();\n\n final Optional<PaymentSessionSummary.PaymentProtocolResponseDto> dto = paymentSessionSummary.sendPaymentSessionPayment(\n transactionsSent,\n lastBitcoinSentEvent.getChangeAddress(),\n getSendBitcoinEnterPaymentMemoPanelModel().getPaymentMemo());\n\n final Protos.Payment finalPayment = dto.get().getFinalPayment();\n final ListenableFuture<PaymentProtocol.Ack> future = dto.get().getFuture();\n\n if (future != null) {\n Futures.addCallback(\n future, new FutureCallback<PaymentProtocol.Ack>() {\n @Override\n public void onSuccess(PaymentProtocol.Ack result) {\n\n // Have successfully received a PaymentAck from the merchant\n log.info(\"Received PaymentAck from merchant. Memo: {}\", result.getMemo());\n getSendBitcoinShowPaymentACKMemoPanelModel().setPaymentACKMemo(result.getMemo());\n\n PaymentProtocolService paymentProtocolService = CoreServices.getPaymentProtocolService();\n\n if (finalPayment != null) {\n Optional<Protos.PaymentACK> paymentACK = paymentProtocolService.newPaymentACK(finalPayment, result.getMemo());\n\n finalPaymentRequestData.setPayment(Optional.of(finalPayment));\n finalPaymentRequestData.setPaymentACK(paymentACK);\n log.debug(\"Saving PaymentMemo of {} and PaymentACKMemo of {}\", finalPayment.getMemo(), paymentACK.isPresent() ? paymentACK.get().getMemo() : \"n/a\");\n WalletService walletService = CoreServices.getOrCreateWalletService(WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletId());\n walletService.addPaymentRequestData(finalPaymentRequestData);\n\n // Write payments\n CharSequence password = WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletPassword().getPassword();\n if (password != null) {\n walletService.writePayments(password);\n }\n\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(true, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_OK, null));\n } else {\n log.error(\"No payment and hence cannot save payment or paymentACK\");\n }\n }\n\n @Override\n public void onFailure(Throwable t) {\n // Failed to communicate with the merchant\n log.error(\"Unexpected failure\", t);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{t.getClass().getCanonicalName() + \" \" + t.getMessage()}));\n }\n });\n } else {\n throw new PaymentProtocolException(\"Failed to create future from Ack\");\n }\n } catch (IOException | PaymentProtocolException e) {\n log.error(\"Unexpected failure\", e);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{e.getClass().getCanonicalName() + \" \" + e.getMessage()}));\n }\n } else {\n String message = \"Bitcoin not sent successfully so no payment sent to requestor\";\n log.debug(message);\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(false, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED, new String[]{message}));\n }\n }", "public String getMerchantName() {\n return merchantName;\n }", "boolean verifyDeveloperPayload(Purchase p) {\n return DEVELOPER_PAYLOAD.equals(p.getDeveloperPayload());\n }", "public java.lang.Long getMerchantId () {\r\n\t\treturn merchantId;\r\n\t}", "@ApiModelProperty(required = true, value = \"merchant resource for the store\")\n @JsonProperty(\"merchant\")\n public EntityInfo getMerchant() {\n return merchant;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == PayUmoneyFlowManager.REQUEST_CODE_PAYMENT && resultCode == RESULT_OK && data !=\n null) {\n TransactionResponse transactionResponse = data.getParcelableExtra(PayUmoneyFlowManager\n .INTENT_EXTRA_TRANSACTION_RESPONSE);\n\n ResultModel resultModel = data.getParcelableExtra(PayUmoneyFlowManager.ARG_RESULT);\n\n // Check which object is non-null\n if (transactionResponse != null && transactionResponse.getPayuResponse() != null) {\n if (transactionResponse.getTransactionStatus().equals(TransactionResponse.TransactionStatus.SUCCESSFUL)) {\n //Success Transaction\n AddPayment(name, ridequantity, Amount);\n } else {\n Intent intent = new Intent();\n setResult(RESULT_OK, intent);\n finish();\n\n }\n\n // Response from Payumoney\n// String payuResponse = transactionResponse.getPayuResponse();\n//\n//// Response from SURl and FURL\n// String merchantResponse = transactionResponse.getTransactionDetails();\n//\n// new AlertDialog.Builder(this)\n// .setCancelable(false)\n// .setMessage(\"Payu's Data : \" + payuResponse + \"\\n\\n\\n Merchant's Data: \" + merchantResponse)\n// .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {\n// public void onClick(DialogInterface dialog, int whichButton) {\n// dialog.dismiss();\n// }\n// }).show();\n\n } else if (resultModel != null && resultModel.getError() != null) {\n Log.d(TAG, \"Error response : \" + resultModel.getError().getTransactionResponse());\n } else {\n Log.d(TAG, \"Both objects are null!\");\n }\n }\n }", "public String getMerchantAccount() {\n return merchantAccount;\n }", "@JsonProperty(\"MerchantId\")\n public String getMerchantId() {\n return merchantId;\n }", "public Builder setPaymentHashBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n paymentHash_ = value;\n onChanged();\n return this;\n }", "public void setPaymentinformation (java.lang.String paymentinformation) {\r\n\t\tthis.paymentinformation = paymentinformation;\r\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public void setMerchantName(String merchantName) {\n\t\tthis.merchantName = merchantName;\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n String payload = p.getDeveloperPayload();\n\n /*\n * TODO: verify that the developer payload of the purchase is correct. It will be\n * the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase and\n * verifying it here might seem like a good approach, but this will fail in the\n * case where the user purchases an item on one device and then uses your app on\n * a different device, because on the other device you will not have access to the\n * random string you originally generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different between them,\n * so that one user's purchase can't be replayed to another user.\n *\n * 2. The payload must be such that you can verify it even when the app wasn't the\n * one who initiated the purchase flow (so that items purchased by the user on\n * one device work on other devices owned by the user).\n *\n * Using your own server to store and verify developer payloads across app\n * installations is recommended.\n */\n\n return true;\n }", "boolean verifyDeveloperPayload(Purchase p) {\n\t\t/*String payload = */p.getDeveloperPayload();\n\n\t\t/*\n\t\t * TODO: verify that the developer payload of the purchase is correct.\n\t\t * It will be the same one that you sent when initiating the purchase.\n\t\t * \n\t\t * WARNING: Locally generating a random string when starting a purchase\n\t\t * and verifying it here might seem like a good approach, but this will\n\t\t * fail in the case where the user purchases an item on one device and\n\t\t * then uses your app on a different device, because on the other device\n\t\t * you will not have access to the random string you originally\n\t\t * generated.\n\t\t * \n\t\t * So a good developer payload has these characteristics:\n\t\t * \n\t\t * 1. If two different users purchase an item, the payload is different\n\t\t * between them, so that one user's purchase can't be replayed to\n\t\t * another user.\n\t\t * \n\t\t * 2. The payload must be such that you can verify it even when the app\n\t\t * wasn't the one who initiated the purchase flow (so that items\n\t\t * purchased by the user on one device work on other devices owned by\n\t\t * the user).\n\t\t * \n\t\t * Using your own server to store and verify developer payloads across\n\t\t * app installations is recommended.\n\t\t */\n\n\t\treturn true;\n\t}", "@Override\r\n\tpublic JSONObject init(Merchant merchant, PayeeVo v) {\n\t\tJSONObject valid = this.valid(merchant,v.getTotal_amount());\r\n\t\tif (valid.getBooleanValue(\"state\")){\r\n\t\t\tPayee payee = this.getPayee();\r\n\t\t\tif (payee != null){\r\n\t\t\t\tv.setCost(String.valueOf(merchant.getFee()));\r\n\t\t\t\tv.setmId(String.valueOf(merchant.getId()));\r\n\t\t\t\tJSONObject result = this.execute(payee, v);\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t\treturn Result.error.toJson(\"代付服务关闭\");\r\n\t\t}\r\n\t\treturn valid;\r\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n\t\tString payload = p.getDeveloperPayload();\n\n\t\t/*\n\t\t * TODO: verify that the developer payload of the purchase is correct.\n\t\t * It will be the same one that you sent when initiating the purchase.\n\t\t * \n\t\t * WARNING: Locally generating a random string when starting a purchase\n\t\t * and verifying it here might seem like a good approach, but this will\n\t\t * fail in the case where the user purchases an item on one device and\n\t\t * then uses your app on a different device, because on the other device\n\t\t * you will not have access to the random string you originally\n\t\t * generated.\n\t\t * \n\t\t * So a good developer payload has these characteristics:\n\t\t * \n\t\t * 1. If two different users purchase an item, the payload is different\n\t\t * between them, so that one user's purchase can't be replayed to\n\t\t * another user.\n\t\t * \n\t\t * 2. The payload must be such that you can verify it even when the app\n\t\t * wasn't the one who initiated the purchase flow (so that items\n\t\t * purchased by the user on one device work on other devices owned by\n\t\t * the user).\n\t\t * \n\t\t * Using your own server to store and verify developer payloads across\n\t\t * app installations is recommended.\n\t\t */\n\n\t\treturn true;\n\t}", "public void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@Override\n public void onChanged(@Nullable Merchant merchant) {\n }", "private void m50363B() {\n try {\n TokenPaymentParams tokenPaymentParams = new TokenPaymentParams(this.f30711G0, this.f30708D0, this.f30709E0.getBrand(), this.f30737h0.getText().toString());\n StringBuilder sb = new StringBuilder();\n sb.append(this.f30720S.getString(C10232R.string.checkout_ui_callback_scheme));\n sb.append(\"://callback\");\n tokenPaymentParams.mo40895e(sb.toString());\n this.f30754y0.mo41066a(new Transaction((PaymentParams) tokenPaymentParams));\n this.f30728a.mo23628i(C11645a.f33474f, \"credit_card\");\n } catch (PaymentException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tprotected byte[] prepare_data() {\n\t\tbyte[] ret_byte = null;\n\t\tJSONObject json_object = new JSONObject();\n\t\ttry {\n\t\t\tjson_object.put(Jsonkey.string_transitionid_key, \"\");\n\t\t\tjson_object.put(Jsonkey.string_magicid_key, \"\");\n\t\t\tJSONObject json_content = new JSONObject();\n\t\t\tjson_object.put(Jsonkey.string_content_key, json_content);\n\t\t\tjson_content.put(Jsonkey.string_ctype_key, \"verify_login_request\");\n\t\t\tJSONObject json_cvalue = new JSONObject();\n\t\t\tjson_content.put(Jsonkey.string_cvalue_key, json_cvalue);\n\t\t\tjson_cvalue.put(Jsonkey.string_user_name_key, user_name);\n\t\t\tjson_cvalue.put(Jsonkey.string_user_password_key, user_password);\n\t\t\t\n\t\t\tString json_string = json_object.toString();\n\t\t\tret_byte = json_string.getBytes();\n\t\t} catch (JSONException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn ret_byte;\n\t}", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public CreditCard getDefaultPaymentInfo();", "public Builder clearMerchantData() {\n copyOnWrite();\n instance.clearMerchantData();\n return this;\n }", "public Builder clearMerchantData() {\n copyOnWrite();\n instance.clearMerchantData();\n return this;\n }", "public void setPaymentInfoInCart(CreditCard cc);", "@Test\n\tpublic void testInvalidMerchantTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\t//database.addCustomer(merchant); Merchant not in database\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This merchant is not a DTUPay user\",verifyParticipants);\n\t}", "public Merchant() {}", "public String getDeveloperPayload(){\n return developerPayload;\n }", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private void returnDeposit(String paymentInfo) {\n }", "private GetMerchantByParkingResponse(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "boolean hasSerializedPaymentDetails();", "public Object adjustBankSysexForEmit(byte[] data, Model model)\n {\n return data;\n }", "public IBankTransfert payment();", "public void parsingAdditionalData() {\n\t\tString AdditionalData = billPayBean.getAdditionalData();\n\t\tswitch (Integer.parseInt(billPayBean.getBillerId())) {\n\t\tcase 91901:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(95,120));\n\t\t\tbillPayBean.setMeterNumber(AdditionalData.substring(7,18));\n\t\t\tbillPayBean.setBillNumber(AdditionalData.substring(18,30));\n\t\t\tbreak;\n\t\tcase 91951:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(47,72));\n\t\t\tbillPayBean.setBillNumber(AdditionalData.substring(0,12));\n\t\t\tbreak;\n\t\tcase 91999:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(66,91));\n\t\t\tbillPayBean.setRegNumber(AdditionalData.substring(0,13));\n\t\t\tbreak;\n\t\tdefault:\n\t\t}\n\t\treturn ;\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "public void parseParameter(byte[] data)\n {\n return; \n }", "public String getMerchantOrderReference() {\n return merchantOrderReference;\n }", "public void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "public String getJP_BankDataCustomerCode2();", "public String getMerchantName() {\n\t\treturn merchantName;\n\t}", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "String getPaymentInformation();", "@ApiModelProperty(value = \"If provided, then the value overrides the one present in onboarding data. If the merchantCategoryCode value is not populated in onboarding data then this field is mandatory.<br><br><b>Note:</b> required if not provided during onboarding\")\n public Integer getMerchantCategoryCode() {\n return merchantCategoryCode;\n }", "private void setPaymentUrlBytes(\n com.google.protobuf.ByteString value) {\n paymentUrl_ = value.toStringUtf8();\n bitField0_ |= 0x00000010;\n }", "public void navigateToBaseActivity() throws JSONException {\n\n String merchantKey = jsonObject.getString(\"merchantKey\");\n String amount = jsonObject.getString(\"amount\");\n String email = jsonObject.getString(\"email\");\n String value = jsonObject.getString(\"value\");\n String firstName = jsonObject.getString(\"firstName\");\n String phone = jsonObject.getString(\"phone\");\n String txnId = jsonObject.getString(\"txnId\");\n String sUrl = jsonObject.getString(\"sUrl\");\n String fUrl = jsonObject.getString(\"fUrl\");\n String udf1 = jsonObject.getString(\"udf1\");\n String udf2 = jsonObject.getString(\"udf2\");\n String udf3 = jsonObject.getString(\"udf3\");\n String udf4 = jsonObject.getString(\"udf4\");\n String udf5 = jsonObject.getString(\"udf5\");\n salt = jsonObject.getString(\"salt\");\n int environment;\n if (value.equals(\"test\"))\n environment = PayuConstants.STAGING_ENV;\n else\n environment = PayuConstants.PRODUCTION_ENV;\n String userCredentials = merchantKey + \":\" + email;\n mPaymentParams = new PaymentParams();\n mPaymentParams.setKey(merchantKey);\n mPaymentParams.setAmount(amount);\n mPaymentParams.setProductInfo(\"GoCharge power bank charges\");\n mPaymentParams.setFirstName(firstName);\n mPaymentParams.setEmail(email);\n mPaymentParams.setPhone(phone);\n mPaymentParams.setTxnId(txnId);\n mPaymentParams.setSurl(sUrl);\n mPaymentParams.setFurl(fUrl);\n mPaymentParams.setNotifyURL(mPaymentParams.getSurl()); //for lazy pay\n mPaymentParams.setUdf1(udf1);\n mPaymentParams.setUdf2(udf2);\n mPaymentParams.setUdf3(udf3);\n mPaymentParams.setUdf4(udf4);\n mPaymentParams.setUdf5(udf5);\n mPaymentParams.setUserCredentials(userCredentials);\n payuConfig = new PayuConfig();\n payuConfig.setEnvironment(environment);\n generateHashFromSDK(mPaymentParams, salt);\n\n }" ]
[ "0.7797542", "0.7791984", "0.72457767", "0.72457767", "0.6597282", "0.6597282", "0.64411324", "0.64411324", "0.63645166", "0.63239515", "0.6267365", "0.62569773", "0.6004758", "0.59594744", "0.59594744", "0.5946166", "0.5946166", "0.58732635", "0.58180135", "0.5815311", "0.57901794", "0.57724446", "0.5712245", "0.5707533", "0.5704003", "0.56633335", "0.56633335", "0.56633335", "0.56633335", "0.56539625", "0.5625574", "0.5625574", "0.562408", "0.55771023", "0.5571984", "0.55662656", "0.5547567", "0.5505207", "0.54818773", "0.5420988", "0.5420988", "0.5415817", "0.54126877", "0.5412118", "0.5403655", "0.5384956", "0.5371296", "0.5364792", "0.5349802", "0.5333934", "0.53318715", "0.5318022", "0.53150094", "0.5311886", "0.53004605", "0.52869076", "0.52826893", "0.52229816", "0.52220863", "0.5215288", "0.5212707", "0.520925", "0.52054906", "0.5201921", "0.5195478", "0.51524246", "0.5134985", "0.51245314", "0.51188505", "0.5113095", "0.5111281", "0.51038957", "0.5090348", "0.50824", "0.50824", "0.5070004", "0.50679225", "0.5064237", "0.50615", "0.5058139", "0.50473297", "0.5033698", "0.50334597", "0.5015592", "0.50028926", "0.49933758", "0.49906015", "0.49895284", "0.49803907", "0.4980213", "0.4973967", "0.49706343", "0.49578786", "0.4957266", "0.49444962", "0.494076", "0.49392447", "0.49329844", "0.4918309" ]
0.7576785
3
Signed transactions that satisfy PaymentDetails.outputs repeated bytes transactions = 2;
java.util.List<com.google.protobuf.ByteString> getTransactionsList();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testValidOutputValues() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, -20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(-20, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testNoDoubleSpending() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Alice wants double spending: transfers 10 coins to Bob, 20 to Cal again\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1: input 0\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n\n // Sign for tx1: input 1\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(1).addSignature(sig2);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testHandleTxs() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // Cal transfers 5 coins to Bob, Bob transfers 2 coins to Alice\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0); // index 0 refers to output 1 of tx1\n tx2.addInput(tx1.getHash(), 1); // index 1 refers to output 1 of tx1\n tx2.addOutput(2, kpAlice.getPublic());\n tx2.addOutput(5, kpBob.getPublic());\n\n // Sign for tx2\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx2.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(0).addSignature(sig2);\n\n byte[] sig3 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpCal.getPrivate());\n sig.update(tx2.getRawDataToSign(1));\n sig3 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(1).addSignature(sig3);\n tx2.finalize();\n\n // Alice transfers 3 coins to Cal\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(), 0);\n tx3.addOutput(3, kpCal.getPublic());\n\n // Sign for tx3\n byte[] sig4 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx3.getRawDataToSign(0));\n sig4 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx3.getInput(0).addSignature(sig4);\n tx3.finalize();\n\n Transaction[] acceptedTx = txHandler.handleTxs(new Transaction[] {tx1, tx2, tx3});\n // tx1, tx2 supposed to be valid, tx3 supposed to be invalid\n assertEquals(acceptedTx.length, 2);\n // assertFalse(txHandler.isValidTx(tx3));\n }", "public boolean processTransaction() {\n\n // Checks to see if the signature can be verified.\n if (verifySignature() == false) {\n System.out.println(\"# Transaction signature could not be verified.\");\n return false;\n }\n\n // Gathers all transaction inputs, making sure they are unspent.\n for (TransactionInput i : inputs) {\n i.UTXO = BasicBlockchain.UTXOs.get(i.transactionOutputId);\n }\n\n // Checks if transaction amount is valid.\n if (getInputsValue() < BasicBlockchain.minimumTransaction) {\n System.out.println(\"# Transaction inputs are too small.\");\n return false;\n }\n\n // Generates transaction outputs.\n // Get value of the inputs then the leftover change.\n float leftOver = getInputsValue() - value;\n transactionId = calculateHash();\n // Send value to recipient.\n outputs.add(new TransactionOutput(this.recipient, value, transactionId));\n // Send the leftover \"change\" back to sender.\n outputs.add(new TransactionOutput(this.sender, leftOver, transactionId));\n\n\n // Adds outputs to the unspent list.\n for (TransactionOutput o : outputs) {\n BasicBlockchain.UTXOs.put(o.id, o);\n }\n\n // Removes the transaction inputs from the blockchain's UTXO list as spent.\n for (TransactionInput i : inputs) {\n if (i.UTXO == null) continue;\n BasicBlockchain.UTXOs.remove(i.UTXO.id);\n }\n\n return true;\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutput();", "public static void main(String[] args) throws AddressFormatException {\n\n// generateMultisig();\n String getSignedTransaction = signFirstTime();\n String rawtx = signSecondTime(getSignedTransaction);\n\n System.out.println(\"rawtx ->\"+ rawtx);\n }", "private static String signFirstTime() throws AddressFormatException\n {\n ECKey key1 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n\n\n // Use the redeem script we have saved somewhere to start building the transaction\n Script redeemScript = new Script(hexStringToByteArray(\"5221021ae8964b8529dc3e52955f2cabd967e08c52008dbcca8e054143b668f3998f4a210306be609ef37366ab0f3dd4096ac23a6ee4d561fc469fa60003f799b0121ad1072102199f3d89fa00e6f55dd6ecdd911457d7264415914957db124d53bf0064963f3853ae\"));\n\n // Start building the transaction by adding the unspent inputs we want to use\n // The data is taken from blockchain.info, and can be found here: https://blockchain.info/rawtx/ca1884b8f2e0ba88249a86ec5ddca04f937f12d4fac299af41a9b51643302077\n Transaction spendTx = new Transaction(params);\n ScriptBuilder scriptBuilder = new ScriptBuilder();\n scriptBuilder.data(new String(\"a9145204ad7c5fa5a2491cd91c332e28c87221194ca087\").getBytes()); // Script of this output\n TransactionInput input = spendTx.addInput(new Sha256Hash(\"fed695bf5e2c15286956a7bd3464c5beb97ef064e1f9406eba189ea844733e7c\"), 1, scriptBuilder.build());\n\n // Add outputs to the person receiving bitcoins\n Address receiverAddress = new Address(params, \"n2cWhs5sbWFCwzuuWWsVM9ubPwykGtX75T\");\n Coin charge = Coin.valueOf(1000000); // 0.1 mBTC\n Script outputScript = ScriptBuilder.createOutputScript(receiverAddress);\n spendTx.addOutput(charge, outputScript);\n\n /*8888888888888888888888888888888888888888888888888888888888888*/\n\n // Sign the first part of the transaction using private key #1\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature ecdsaSignature = key1.sign(sighash);\n TransactionSignature transactionSignarture = new TransactionSignature(ecdsaSignature, Transaction.SigHash.ALL, false);\n\n // Create p2sh multisig input script\n Script inputScript = ScriptBuilder.createP2SHMultiSigInputScript(Arrays.asList(transactionSignarture), redeemScript);\n\n // Add the script signature to the input\n input.setScriptSig(inputScript);\n System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "private ArrayList<Long> storeTransactionInputs(long transactionId, ArrayList<TransactionInput> inputs, int isCoinbase){\n \t\tint inputindex = 0;\n \t\tlong previousOutputId;\n \t\tString prevOutputHash;\n \t\tResultSet findOutputResults;\n \t\tResultSet generatedKey;\n \t\tLong addressId;\n \t\tArrayList<Long> addressIdz=new ArrayList<Long>();\n \t\ttry {\n \t\tfor (TransactionInput i : inputs) {\n\t\t\t\n \t\t\tprevOutputHash = HexBin.encode(i.outpoint.hash);\n \t\t\tfindTransactionOutputStatement.setString(1, prevOutputHash);\n \t\t\tfindTransactionOutputStatement.setLong(2, i.outpoint.index);\n \t\t\tfindOutputResults = findTransactionOutputStatement\n \t\t\t\t\t.executeQuery();\n \t\t\tif (findOutputResults.next()) {\n \t\t\t\tpreviousOutputId = findOutputResults.getLong(1);\n\t\t\t\taddressId=findOutputResults.getLong(2);\n \t\t\t} else {\n \t\t\t\tpreviousOutputId = 0;\n\t\t\t\taddressId=null;\n \t\t\t}\n \t\t\tfindOutputResults.close();\n \t\t\tinsertTransactionInputStatement.setLong(1, transactionId);\n \t\t\tinsertTransactionInputStatement.setInt(2, inputindex);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(3, previousOutputId);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setString(4, prevOutputHash);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(5, i.outpoint.index);\n \t\t\tinsertTransactionInputStatement.setLong(6,\n \t\t\t\t\ti.scriptBytes.length);\n \t\t\tinsertTransactionInputStatement.setString(7,\n \t\t\t\t\tHexBin.encode(i.scriptBytes));\n \t\t\tinsertTransactionInputStatement.setLong(8, i.sequence);\n \t\t\tinsertTransactionInputStatement.setBoolean(9,\n \t\t\t\t\ti.isCoinBase());\n\t\t\tif(addressId!=null){\n \t\t\t\tinsertTransactionInputStatement.setLong(10,addressId);\n \t\t\t\taddressIdz.add(addressId);\n\t\t\t} else {\n \t\t\t\t// TODO Auto-generated catch block\n \t\t\t\tinsertTransactionInputStatement.setNull(10,\n \t\t\t\t\t\tjava.sql.Types.INTEGER);\n \t\t\t}\n \t\t\tinsertTransactionInputStatement.execute();\n \t\t\t\n \t\t}\n \t\t\n \t\t\n \t} catch (SQLException e1) {\n \t\t// TODO Auto-generated catch block\n \t\te1.printStackTrace();\n \t}\n \t\treturn addressIdz;\n \t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputOrBuilder();", "List<TransactionVO> addPendingTransactions(List<SignedTransaction> transactions);", "@Test\n public void TxHandlerTestThird() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid output number(wrong number of coins to transfer)\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1 scrooge to alice 20coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: Alice --> Bob -5coins [*Invalid output number*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(-5, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n // tx3: Alice --> Bob 90coins [*Invalid output number*]\n Transaction tx3 = new Transaction();\n tx3.addInput(tx1.getHash(), 0);\n tx3.addOutput(90, pkBob.getPublic());\n tx3.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n }", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "private static String signSecondTime(String transactionString)\n {\n Transaction spendTx = new Transaction(params, hexStringToByteArray(transactionString));\n\n // Get the input chunks\n Script inputScript = spendTx.getInput(0).getScriptSig();\n List<ScriptChunk> scriptChunks = inputScript.getChunks();\n\n // Create a list of all signatures. Start by extracting the existing ones from the list of script schunks.\n // The last signature in the script chunk list is the redeemScript\n List<TransactionSignature> signatureList = new ArrayList<TransactionSignature>();\n Iterator<ScriptChunk> iterator = scriptChunks.iterator();\n Script redeemScript = null;\n\n while (iterator.hasNext())\n {\n ScriptChunk chunk = iterator.next();\n\n if (iterator.hasNext() && chunk.opcode != 0)\n {\n TransactionSignature transactionSignarture = TransactionSignature.decodeFromBitcoin(chunk.data, false);\n signatureList.add(transactionSignarture);\n } else\n {\n redeemScript = new Script(chunk.data);\n }\n }\n\n // Create the sighash using the redeem script\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature secondSignature;\n\n // Take out the key and sign the signhash\n //ECKey key2 = createKeyFromSha256Passphrase(\"Super secret key 2\");\n ECKey key2 = ECKey.fromPrivate(new BigInteger(\"68123968917867656952640885027449260190826636504009580537802764798766700329220\"));\n// ECKey key2 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n secondSignature = key2.sign(sighash);\n\n // Add the second signature to the signature list\n TransactionSignature transactionSignarture = new TransactionSignature(secondSignature, Transaction.SigHash.ALL, false);\n signatureList.add(transactionSignarture);\n\n // Rebuild p2sh multisig input script\n inputScript = ScriptBuilder.createP2SHMultiSigInputScript(signatureList, redeemScript);\n spendTx.getInput(0).setScriptSig(inputScript);\n\n //System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "@Test\n public void testOutputsInUTXOPool() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is NOT put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // UTXO pool does not contains the UTXO\n assertFalse(txHandler.isValidTx(tx1));\n\n // Put output of createCoinTx to the pool\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler1 = new TxHandler(utxoPool);\n\n // UTXO pool now contains the UTXO\n assertTrue(txHandler1.isValidTx(tx1));\n }", "@Test\n public void testValidBalance() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 100 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(100, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "RequestResult postSignRequests(TriphaseRequest[] requests) throws IOException,\n CertificateEncodingException, SAXException;", "public IBankTransfert payment();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static boolean isSigned_entries_receiveEst() {\n return false;\n }", "com.google.protobuf.ByteString getTransactions(int index);", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "@Suspendable\n @Override\n public SignedTransaction call() throws FlowException {\n\n Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);\n//\n\n // Source\n AccountInfo issuerOwner = subFlow(new AccountInfoByName(acctNameSource)).get(0).getState().getData();\n PublicKey issuerOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty issuerOwnerAnonParty = new AnonymousParty(issuerOwnerKey);\n\n AccountInfo targetOwner = subFlow(new AccountInfoByName(acctNameTarget)).get(0).getState().getData();\n PublicKey targetOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty targetOwnerAnonParty = new AnonymousParty(targetOwnerKey);\n\n\n AssetForAccountState outputAsset = new AssetForAccountState(issuerOwnerAnonParty, targetOwnerAnonParty,\n asset.getState().getData().getName(), asset.getState().getData().getValue());\n\n\n TransactionBuilder txBuilder = new TransactionBuilder(notary)\n .addInputState(asset)\n .addOutputState(outputAsset, AssetForAccountContract.ID)\n .addCommand(new AssetForAccountContract.Commands.Transfer(), issuerOwnerKey);\n\n txBuilder.verify(getServiceHub());\n\n SignedTransaction fullySignedTransaction = getServiceHub().signInitialTransaction(txBuilder, issuerOwnerKey);\n\n //return fullySignedTransaction;\n return subFlow(new FinalityFlow(fullySignedTransaction, Collections.emptyList()));\n }", "private boolean areOutputsSpent(Transaction tx){\n // Need to see if tx inputs are contained in the blockchain UTXOs\n for(TransactionInput i : tx.inputs){\n if(!currentBlockchain.UTXOs.containsKey(i.previousOutId)){\n return true;\n }\n }\n return false;\n }", "BigInteger getDigitalSignature();", "public static long deepTransactionCheck(Transaction tx, UtxoUpdateBuffer utxo_buffer, BlockHeader block_header, NetworkParams params)\n throws ValidationException\n {\n try(TimeRecordAuto tra_blk = TimeRecord.openAuto(\"Validation.deepTransactionCheck\"))\n {\n TransactionInner inner = null;\n\n try\n {\n inner = TransactionInner.parseFrom(tx.getInnerData());\n }\n catch(java.io.IOException e)\n {\n throw new ValidationException(\"error parsing tx on second pass somehow\", e);\n }\n\n long sum_of_inputs = 0L;\n // Make sure all inputs exist\n for(TransactionInput in : inner.getInputsList())\n {\n TransactionOutput matching_out = utxo_buffer.getOutputMatching(in);\n if (matching_out == null)\n {\n throw new ValidationException(String.format(\"No matching output for input %s\", new ChainHash(in.getSrcTxId())));\n }\n validateSpendable(matching_out, block_header, params);\n sum_of_inputs += matching_out.getValue();\n\n // SIP-4 check\n if (block_header.getBlockHeight() >= params.getActivationHeightTxInValue())\n {\n if (in.getValue() != 0L)\n {\n if (in.getValue() != matching_out.getValue())\n {\n throw new ValidationException(String.format(\"Input value does not match: %d %d\", matching_out.getValue(), in.getValue()));\n }\n }\n }\n utxo_buffer.useOutput(matching_out, new ChainHash(in.getSrcTxId()), in.getSrcTxOutIdx());\n }\n\n long spent = 0L;\n // Sum up all outputs\n int out_idx =0;\n ArrayList<ByteString> raw_output_list = TransactionUtil.extractWireFormatTxOut(tx);\n\n for(TransactionOutput out : inner.getOutputsList())\n {\n validateTransactionOutput(out, block_header, params);\n spent+=out.getValue();\n utxo_buffer.addOutput(raw_output_list, out, new ChainHash(tx.getTxHash()), out_idx);\n out_idx++;\n\n }\n\n spent+=inner.getFee();\n\n if (!inner.getIsCoinbase())\n {\n if (sum_of_inputs != spent)\n {\n throw new ValidationException(String.format(\"Transaction took in %d and spent %d\", sum_of_inputs, spent));\n }\n }\n \n return inner.getFee();\n }\n }", "@Test\n public void TxHandlerTestSecond() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the double spending\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(25, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1: one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx 2:Scrooge --> Bob 20coins [*Double-spending*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx0.getHash(), 0);\n tx2.addOutput(25, pkBob.getPublic());\n tx2.signTx(pkScrooge.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n\n }", "String signITRByAssesse(String PAN,String xml, DigitalSignatureWrapper digitalSignatureWrapper) throws MissingPrivateKeyException,InvalidDigitalSignatureException,Exception;", "public boolean processTransaction() {\r\n\t\t\r\n\t\t\tif(verifySignature() == false) {\r\n\t\t\t\tSystem.out.println(\"#Transaction Signature failed to verify\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\ttransactionId = calulateHash();\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "public static boolean isSigned_receivets() {\n return true;\n }", "@Override\n public boolean isValid() {\n final BlockChainInt outputHash = getOutputHash();\n\n return inputs.stream().map(input -> input.verifySignature(outputHash)).reduce(true, (a, b) -> a && b)\n && outputs.stream().map(output -> output.getAmount() >= 0).reduce(true, (a, b) -> a && b)\n && getTransactionFee() >= 0;\n }", "@Override\n public void run() {\n byte[] deviceTxPayload = CoreServices.getOrCreateHardwareWalletService().get().getContext().getSerializedTx().toByteArray();\n\n log.info(\"DeviceTx payload:\\n{}\", Utils.HEX.encode(deviceTxPayload));\n\n // Load deviceTx\n Transaction deviceTx = new Transaction(MainNetParams.get(), deviceTxPayload);\n\n log.info(\"deviceTx:\\n{}\", deviceTx.toString());\n\n // Check the signatures are canonical\n for (TransactionInput txInput : deviceTx.getInputs()) {\n byte[] signature = txInput.getScriptSig().getChunks().get(0).data;\n if (signature != null) {\n log.debug(\n \"Is signature canonical test result '{}' for txInput '{}', signature '{}'\",\n TransactionSignature.isEncodingCanonical(signature),\n txInput.toString(),\n Utils.HEX.encode(signature));\n } else {\n log.warn(\"No signature data\");\n }\n }\n\n log.debug(\"Committing and broadcasting the last tx\");\n\n BitcoinNetworkService bitcoinNetworkService = CoreServices.getOrCreateBitcoinNetworkService();\n\n if (bitcoinNetworkService.getLastSendRequestSummaryOptional().isPresent()\n && bitcoinNetworkService.getLastWalletOptional().isPresent()) {\n\n SendRequestSummary sendRequestSummary = bitcoinNetworkService.getLastSendRequestSummaryOptional().get();\n\n // Check the unsigned and signed tx are essentially the same as a check against malware attacks on the Trezor\n if (TransactionUtils.checkEssentiallyEqual(sendRequestSummary.getSendRequest().get().tx, deviceTx)) {\n // Substitute the signed tx from the trezor\n log.debug(\n \"Substituting the Trezor signed tx '{}' for the unsigned version {}\",\n deviceTx.toString(),\n sendRequestSummary.getSendRequest().get().tx.toString()\n );\n sendRequestSummary.getSendRequest().get().tx = deviceTx;\n log.debug(\"The transaction fee was {}\", sendRequestSummary.getSendRequest().get().fee);\n\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_TRANSACTION_CREATED_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n\n // Get the last wallet\n Wallet wallet = bitcoinNetworkService.getLastWalletOptional().get();\n\n // Commit and broadcast\n bitcoinNetworkService.commitAndBroadcast(sendRequestSummary, wallet, paymentRequestData);\n\n // Ensure the header is switched off whilst the send is in progress\n ViewEvents.fireViewChangedEvent(ViewKey.HEADER, false);\n } else {\n // The signed transaction is essentially different from what was sent to it - abort send\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_FAILURE_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n }\n } else {\n log.debug(\"Cannot commit and broadcast the last send as it is not present in bitcoinNetworkService\");\n }\n // Clear the previous remembered tx\n bitcoinNetworkService.setLastSendRequestSummaryOptional(Optional.<SendRequestSummary>absent());\n bitcoinNetworkService.setLastWalletOptional(Optional.<Wallet>absent());\n }", "@Test\n public void TxHandlerTestForth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid signature\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx1: scrooge to alice 20 coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: alice to bob 20coins[signed by bob]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(20, pkBob.getPublic());\n tx2.signTx(pkBob.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n }", "@Override\n public byte[] createDataToSignInput(\n Transaction transaction,\n int inputIndex,\n long amountInSat,\n PublicKeyTriple publicKeyTriple) {\n\n final byte[] redeemScript = createRedeemScript(publicKeyTriple);\n\n return TransactionHelpers.getDataToSign(\n transaction,\n inputIndex,\n new Script(redeemScript)\n );\n }", "public TransactionResponse processAllTransaction() throws ParseException {\n TransactionResponse response = new TransactionResponse();\n\n //User0\n response.setTransaction(new Transaction(\"user0\",\"0001\", \"type0\",\"user0_Billing\",\"user0_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-00\")));\n\n //User1\n response.setTransaction(new Transaction(\"user1\", \"0101\",\"type0\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user1\", \"0102\", \"type1\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-00\")));\n\n //User2\n response.setTransaction(new Transaction(\"user2\", \"0201\", \"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-01-00\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0202\", \"type2\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0203\",\"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n //User3\n response.setTransaction(new Transaction(\"user3\", \"0301\",\"type0\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user3\", \"0302\",\"type1\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n return response;\n }", "com.dogecoin.protocols.payments.Protos.Output getOutputs(int index);", "@Test\n public void TxHandlerTestFifth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the input not in the UtxoPool\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n //tx1: Scrooge --> Alice 20coins [Pay Coins *NOT added to UTXO pool* due to accidents]\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n utxo = new UTXO(tx1.getHash(),0);\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n utxoPool.removeUTXO(utxo);\n assertTrue(\"tx1:UTXO has been removed.\", utxoPool.getAllUTXO().size() == 0);\n\n\n // tx2: Alice --> Bob 15coins [Pay Coins *Previous Tx NOT in UTXO pool*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(15, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 0);\n\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "private static void createDummyTransactions() {\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 10L, new Transaction(10000d, \"cars\", 0L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 11L, new Transaction(15000d, \"shopping\", 10L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 12L, new Transaction(20000d, \"keys\", 11L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 13L, new Transaction(25000d, \"furniture\", 12L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 14L, new Transaction(30000d, \"keys\", 13L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 15L, new Transaction(40000d, \"cars\", 14L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 16L, new Transaction(50000d, \"cars\", 15L)));\n }", "@Test\n public void TxHandlerTestFirst() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test some basic functions of TxHandler\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n // tx0: Scrooge --> Scrooge 25coins [Create Coins]\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx( pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n\n // tx1: Scrooge --> Scrooge 4coins [Divide Coins]\n //\t Scrooge --> Scrooge 5coins\n //\t Scrooge --> Scrooge 6coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(),0);\n\n tx1.addOutput(4,pkScrooge.getPublic());\n tx1.addOutput(5,pkScrooge.getPublic());\n tx1.addOutput(6,pkScrooge.getPublic());\n\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx2: Scrooge --> Alice 4coins [Pay separately]\n //\t Scrooge --> Alice 5coins\n // Scrooge --> Bob 6coins\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addInput(tx1.getHash(), 1);\n tx2.addInput(tx1.getHash(), 2);\n\n tx2.addOutput(4, pkAlice.getPublic());\n tx2.addOutput(5, pkAlice.getPublic());\n tx2.addOutput(6, pkBob.getPublic());\n\n tx2.signTx(pkScrooge.getPrivate(), 0);\n tx2.signTx(pkScrooge.getPrivate(), 1);\n tx2.signTx(pkScrooge.getPrivate(), 2);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx3:Alice --> Alice 2coins [Divide Coins]\n // Alice --> Alice 2coins\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(),0);\n\n tx3.addOutput(2, pkAlice.getPublic());\n tx3.addOutput(2, pkAlice.getPublic());\n\n tx3.signTx(pkAlice.getPrivate(),0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 4);\n\n // tx4: Alice --> Bob 2coins [Pay jointly]\n // Alice --> Bob 5coins\n Transaction tx4 = new Transaction();\n tx4.addInput(tx3.getHash(),0);\n tx4.addInput(tx2.getHash(),1);\n\n tx4.addOutput(7, pkBob.getPublic());\n\n tx4.signTx(pkAlice.getPrivate(), 0);\n tx4.signTx(pkAlice.getPrivate(),1);\n\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx4) returns: \" + txHandler.isValidTx(tx4));\n assertTrue(\"tx4:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx4}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx4:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n// System.out.println(\"tx4.hashCode returns: \" + tx4.hashCode());\n }", "public ParametricStatement[] createForPaymentTransaction(PaymentTransaction paymentTransaction)\n throws SQLException {\n int multiplier = 1;\n Date date = paymentTransaction.getProcessDate();\n if (paymentTransaction instanceof VoidTransaction) {\n VoidTransaction trans = (VoidTransaction)paymentTransaction;\n ITransaction originalTrans = trans.getOriginalTransaction();\n if (originalTrans instanceof PaymentTransaction) {\n multiplier = -1;\n paymentTransaction = (PaymentTransaction)originalTrans;\n } else {\n // Do nothing if original was not a payment transaction.\n return new ParametricStatement[0];\n }\n }\n ArrayList parametricStatements = new ArrayList();\n String storeId = paymentTransaction.getStore().getId();\n String operatorId = paymentTransaction.getTheOperator().getId();\n // String registerId = paymentTransaction.getId();\n // int registerIdIndex = registerId.indexOf('*') + 1;\n // registerId = registerId.substring(registerIdIndex, registerId.indexOf('*', registerIdIndex));\n String registerId = paymentTransaction.getRegisterId();\n PaymentSummary[] currentPaymentSummaries = this.selectByDateStoreId(date, storeId);\n List newPaymentSummaries = new ArrayList();\n Payment[] payments = paymentTransaction.getPaymentsArray();\n for (int paymentIndex = 0; paymentIndex < payments.length; paymentIndex++) {\n ArmCurrency paymentAmount = payments[paymentIndex].getAmount().multiply(multiplier);\n String paymentType = payments[paymentIndex].getTransactionPaymentName();\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n boolean found = false;\n //to find if this payment type is already in the database\n for (int summaryIndex = 0; summaryIndex < currentPaymentSummaries.length; summaryIndex++) {\n if (currentPaymentSummaries[summaryIndex].getEmployeeId().equals(operatorId)\n && currentPaymentSummaries[summaryIndex].getRegisterId().equals(registerId)\n && currentPaymentSummaries[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n currentPaymentSummaries[summaryIndex].doSetPaymentTotal(paymentAmount.add(\n currentPaymentSummaries[summaryIndex].getPaymentTotal()));\n int mediaCount = ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).\n getMediaCount();\n ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n // work-around for cloudscape date truncation problem.\n currentPaymentSummaries[summaryIndex].doSetDate(date);\n List list = fromObjectToBean(currentPaymentSummaries[summaryIndex]).toList();\n list.add(currentPaymentSummaries[summaryIndex].getId());\n parametricStatements.add(new ParametricStatement(updateSql, list));\n break;\n }\n }\n //to find if it is already in the newPaymentSummaries List\n if (!found) {\n PaymentSummary[] newPaymentSummaryArray = (PaymentSummary[])newPaymentSummaries.toArray(new\n PaymentSummary[0]);\n for (int summaryIndex = 0; summaryIndex < newPaymentSummaryArray.length; summaryIndex++) {\n if (newPaymentSummaryArray[summaryIndex].getEmployeeId().equals(operatorId)\n && newPaymentSummaryArray[summaryIndex].getRegisterId().equals(registerId)\n && newPaymentSummaryArray[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n ArmCurrency newTotal = paymentAmount.add(newPaymentSummaryArray[summaryIndex].\n getPaymentTotal());\n int mediaCount = ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).\n getMediaCount();\n newPaymentSummaryArray[summaryIndex].doSetPaymentTotal(newTotal);\n ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n }\n }\n }\n if (!found) {\n CMSPaymentSummary paymentSummary = new CMSPaymentSummary();\n paymentSummary.doSetDate(date);\n paymentSummary.doSetEmployeeId(operatorId);\n paymentSummary.doSetStoreId(storeId);\n paymentSummary.doSetRegisterId(registerId);\n paymentSummary.doSetPaymentTotal(paymentAmount);\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n paymentSummary.doSetPaymentType(paymentType);\n paymentSummary.doSetId(this.getNextChelseaId());\n paymentSummary.doSetMediaCount(paymentSummary.getMediaCount() + 1);\n newPaymentSummaries.add(paymentSummary);\n }\n }\n for (int i = 0; i < newPaymentSummaries.size(); i++) {\n PaymentSummary paymentSummary = (PaymentSummary)newPaymentSummaries.get(i);\n parametricStatements.add(new ParametricStatement(insertSql\n , fromObjectToBean(paymentSummary).toList()));\n }\n return (ParametricStatement[])parametricStatements.toArray(new ParametricStatement[\n parametricStatements.size()]);\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "@Test\n public void transactionSum() {\n final Transaction transaction1 = new Transaction(\"774cedda\", State.CANCELED, 1000L, new Date());\n final Account account1 = new Account(\"1001\", 0L, Collections.singletonList(transaction1));\n final Transaction transaction2 = new Transaction(\"337868a7\", State.FINISHED, 8000L, new Date());\n final Transaction transaction3 = new Transaction(\"f8047f86\", State.CANCELED, 10000L, new Date());\n final Account account2 = new Account(\"1002\", 8000L, Arrays.asList(transaction2, transaction3));\n\n final long actual = calcSumOfCancelledTransOnNonEmptyAccounts(Arrays.asList(account1, account2));\n\n Assert.assertEquals(actual, 10_000L);\n }", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutputs(int index);", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public abstract void generateReceipt(Transaction trans);", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "public Transaction getDummyTransaction(String action) {\n\n\t\t// Long payerAccountNum = 111l;\n\t\tLong payerRealmNum = 0l;\n\t\tLong payerShardNum = 0l;\n\t\t// Long nodeAccountNum=123l;\n\t\tLong nodeRealmNum = 0l;\n\t\tLong nodeShardNum = 0l;\n\t\tlong transactionFee = 0l;\n\t\tTimestamp startTime =\n\t\t\t\tRequestBuilder.getTimestamp(Instant.now(Clock.systemUTC()).minusSeconds(13));\n\t\tDuration transactionDuration = RequestBuilder.getDuration(100);\n\t\tboolean generateRecord = false;\n\t\tString memo = \"UnitTesting\";\n\t\tint thresholdValue = 10;\n\t\tList<Key> keyList = new ArrayList<>();\n\t\tKeyPair pair = new KeyPairGenerator().generateKeyPair();\n\t\tbyte[] pubKey = ((EdDSAPublicKey) pair.getPublic()).getAbyte();\n\t\tKey akey =\n\t\t\t\tKey.newBuilder().setEd25519(ByteString.copyFromUtf8((MiscUtils.commonsBytesToHex(pubKey)))).build();\n\t\tPrivateKey priv = pair.getPrivate();\n\t\tkeyList.add(akey);\n\t\tlong initBal = 100;\n\t\tlong sendRecordThreshold = 5;\n\t\tlong receiveRecordThreshold = 5;\n\t\tboolean receiverSign = false;\n\t\tDuration autoRenew = RequestBuilder.getDuration(100);\n\t\t;\n\t\tlong proxyAccountNum = 12345l;\n\t\tlong proxyRealmNum = 0l;\n\t\tlong proxyShardNum = 0l;\n\t\tint proxyFraction = 10;\n\t\tint maxReceiveProxyFraction = 10;\n\t\tlong shardID = 0l;\n\t\tlong realmID = 0l;\n\n\t\tTransaction trx = null;\n\t\tSignatureList sigList = SignatureList.getDefaultInstance();\n\t\tTimestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\n\t\t/**\n\t\t * SignatureList sigList = SignatureList.getDefaultInstance(); Transaction transferTx =\n\t\t * RequestBuilder.getCryptoTransferRequest( payer.getAccountNum(), payer.getRealmNum(),\n\t\t * payer.getShardNum(), nodeAccount.getAccountNum(), nodeAccount.getRealmNum(),\n\t\t * nodeAccount.getShardNum(), 800, timestamp, transactionDuration, false, \"test\", sigList,\n\t\t * payer.getAccountNum(), -100l, nodeAccount.getAccountNum(), 100l); transferTx =\n\t\t * TransactionSigner.signTransaction(transferTx, accountKeys.get(payer));\n\t\t */\n\n\t\tif (\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t\ttrx = RequestBuilder.getCryptoTransferRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 800, timestamp,\n\t\t\t\t\ttransactionDuration, false, \"test\", sigList, payerAccountId.getAccountNum(), -100l,\n\t\t\t\t\tnodeAccountId.getAccountNum(), 100l);\n\t\t\t// trx = TransactionSigner.signTransaction(trx, account2keyMap.get(payerAccountId));\n\t\t}\n\n\t\tif (\"createContract\".equalsIgnoreCase(action)) {\n\t\t\tFileID fileID = FileID.newBuilder().setFileNum(9999l).setRealmNum(1l).setShardNum(2l).build();\n\n\t\t\ttrx = RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 50000000000l, timestamp,\n\t\t\t\t\ttransactionDuration, true, \"createContract\", DEFAULT_CONTRACT_OP_GAS, fileID,\n\t\t\t\t\tByteString.EMPTY, 0, transactionDuration,\n\t\t\t\t\tSignatureList.newBuilder().addSigs(\n\t\t\t\t\t\t\tSignature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t\t\t\t\t\t.build(),\n\t\t\t\t\t\"\");\n\t\t}\n\n\t\t// if(\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t// long durationInSeconds = DAY_SEC * 30;\n\t\t// * Duration contractAutoRenew = Duration.newBuilder().setSeconds(durationInSeconds).build();\n\t\t// * Timestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\t\t// * Duration transactionDuration = RequestBuilder.getDuration(30, 0);\n\t\t// * Transaction createContractRequest =\n\t\t// RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t// * payerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t// * nodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 100l, timestamp,\n\t\t// transactionDuration, true, \"createContract\",\n\t\t// * DEFAULT_CONTRACT_OP_GAS, contractFile, ByteString.EMPTY, 0, contractAutoRenew,\n\t\t// * SignatureList.newBuilder()\n\t\t// *\n\t\t// .addSigs(Signature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t// * .build());\n\t\t// }\n\n\t\treturn trx;\n\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public static byte[] secondOutputStep(byte[] S){\n\t\tStringBuffer string = new StringBuffer();\n\t\tfor (int i = 1; i < S.length; i+=2) {\n\t\t\tstring.append(getBit(S[i],7));\n\t\t}\n\t\tbyte[] bval = new BigInteger(string.toString(), 2).toByteArray();\n\t\tif(bval.length > 16){\n\t\t\treturn Arrays.copyOfRange(bval,1,bval.length);\n\t\t}else{\n\t\t\treturn bval;\n\t\t}\n\t\t\n\t}", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "public double printOutput() {\r\n return calculateNetPay();\r\n }", "public boolean doTransaction() {\r\n int nonce = -1;\r\n TransactionOperation transactionOperation = null;\r\n try {\r\n double balance;\r\n \r\n //read the stream for requests from client\r\n byte[] cipherText = (byte [])is.readObject();\r\n \r\n // decrypt the ciphertext to obtain the signed message\r\n ATMSessionMessage atmSessionMessage = (ATMSessionMessage) crypto.decryptRijndael(cipherText, kSession);\r\n if(!(currTimeStamp < atmSessionMessage.getTimeStamp())) error (\"Time stamp does not match\");\r\n \r\n //interpret the transaction operation in the request\r\n SignedMessage signedMessage = atmSessionMessage.getSignedMessage();\r\n \r\n \r\n \t\t//verify signature\r\n \t\ttry {\r\n \t\t\tif(!crypto.verify(signedMessage.msg, signedMessage.signature, currAcct.kPub))\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"Digital signature failed...\");\r\n \t\t\t}\r\n \t\t\tSystem.out.println(\"Message signature valid...\");\r\n \t\t} catch (SignatureException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t} catch (KeyException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\t\r\n TransactionMessage transactionMessage = (TransactionMessage)signedMessage.getObject();\r\n transactionOperation = transactionMessage.getOperation();\r\n \r\n //print the signed message\r\n System.out.println(\"\\n\" + (new Date()).toString());\r\n System.out.println(signedMessage.toString());\r\n \r\n //strip out the parameters embedded \r\n nonce = atmSessionMessage.getNonce();\r\n double value = transactionMessage.getValue();\r\n \r\n //print the timestamp when the transaction takes place\r\n Date now = new Date();\r\n System.out.println(\"\\n\" + now.toString());\r\n \r\n //re-route the request to the appropriate handling function\r\n if(transactionOperation == TransactionOperation.Deposit) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" DEPOSIT: \" + value);\r\n currAcct.deposit(value);\r\n \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Deposit Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.Withdraw) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" WITHDRAW: \" + value);\r\n \t currAcct.withdraw(value);\r\n \t \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Withdrawal Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.EndSession) \r\n \t {\r\n \t \tSystem.out.println(\"\\nTerminating session with ACCT#: \" + currAcct.getNumber());\r\n \t \treturn false;\r\n \t \t\r\n \t }\r\n \r\n accts.save();\r\n //create a successful reply Success and set the balance\r\n balance = currAcct.getBalance(); \r\n transactionMessage = new TransactionMessage(MessageType.ResponseSuccess,transactionOperation,balance);\r\n atmSessionMessage = new ATMSessionMessage(transactionMessage);\r\n \r\n //set the nonce \r\n atmSessionMessage.setNonce(nonce);\r\n currTimeStamp = atmSessionMessage.getTimeStamp();\r\n //encrypt the response and send it\r\n cipherText = crypto.encryptRijndael(atmSessionMessage, kSession);\r\n os.writeObject((Serializable)cipherText);\r\n \r\n //Logging.....\r\n //get the signed message and encrypt it\r\n \r\n signedMessage.encryptMessage(this.kLog);\r\n \r\n //encrypt the action\r\n //archive the signed message for logging and non-repudiation purposes \r\n SignedAction signedAction = new SignedAction(currAcct.getNumber(), atmSessionMessage.getTimeStamp(), signedMessage);\r\n \r\n //flush out transaction record to the audit file\r\n BankServer.log.write(signedAction);\r\n \r\n\t return true;\r\n }\r\n catch(Exception e){\r\n if(e instanceof TransException) replyFailure(transactionOperation,nonce);\r\n System.out.println(\"Terminating session with ACCT#: \" + currAcct.getNumber());\r\n \t//e.printStackTrace();\r\n \r\n return true;\r\n }\r\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return transactions_.get(index);\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutput();", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_3() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Test\n\tpublic void testTransfer() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"acc2\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(02, \"acc1\", 00000, 200.00, \"\"));\n\t\ttransactions.add(2, new Transaction(02, \"acc2\", 00001, 200.00, \"\"));\n\t\ttransactions.add(3, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\t// ArrayList<Account> expected = new ArrayList();\n\t\t// expected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\t\t// expected.add(1, new Account(00001, \"acc2\", true, 1050.00, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Money Transfered\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"money not transfered\", testResult);\n\t}", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "protected void pktsOut(int n) {}", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputOrBuilder();", "public void calculatePayment() {}", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_4_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString ticketId = roc.createTickets(1, true)[0].get(\"ticketId\").getAsString();\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tuserData, ticketId);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true, ticketId);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void fixedPayerAndReceiverTest() {\n double fixedRate = 0.015;\n GeneratorAttributeIR attribute = new GeneratorAttributeIR(Period.ofYears(7));\n double notional = 1.0e8;\n ZonedDateTime date = DateUtils.getUTCDate(2013, 9, 10);\n SwapFixedIborDefinition def1 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute);\n SwapFixedIborDefinition def2 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, true);\n assertEquals(def1, def2);\n SwapFixedIborDefinition def3 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, false);\n assertFalse(def1.equals(def3));\n int nIbor = def1.getIborLeg().getNumberOfPayments();\n int nFixed = def1.getFixedLeg().getNumberOfPayments();\n assertEquals(nIbor, def3.getIborLeg().getNumberOfPayments());\n assertEquals(nFixed, def3.getFixedLeg().getNumberOfPayments());\n assertEquals(def1.getIborLeg().getIborIndex(), def3.getIborLeg().getIborIndex());\n assertEquals(def1.getIborLeg().getCalendar(), def3.getIborLeg().getCalendar());\n assertEquals(def1.getCurrency(), def3.getIborLeg().getCurrency());\n for (int i = 0; i < nIbor; ++i) {\n CouponIborDefinition ibor1 = def1.getIborLeg().getNthPayment(i);\n CouponIborDefinition ibor3 = def3.getIborLeg().getNthPayment(i);\n assertEquals(ibor1.getNotional(), -ibor3.getNotional());\n assertEquals(ibor1.getAccrualStartDate(), ibor3.getAccrualStartDate());\n assertEquals(ibor1.getAccrualEndDate(), ibor3.getAccrualEndDate());\n assertEquals(ibor1.getFixingDate(), ibor3.getFixingDate());\n assertEquals(ibor1.getPaymentDate(), ibor3.getPaymentDate());\n assertEquals(ibor1.getPaymentYearFraction(), ibor3.getPaymentYearFraction());\n }\n for (int i = 0; i < nFixed; ++i) {\n CouponFixedDefinition fixed1 = def1.getFixedLeg().getNthPayment(i);\n CouponFixedDefinition fixed3 = def3.getFixedLeg().getNthPayment(i);\n assertEquals(fixed1.getNotional(), -fixed3.getNotional());\n assertEquals(fixed1.getAccrualStartDate(), fixed3.getAccrualStartDate());\n assertEquals(fixed1.getAccrualEndDate(), fixed3.getAccrualEndDate());\n assertEquals(fixed1.getPaymentDate(), fixed3.getPaymentDate());\n assertEquals(fixed1.getPaymentYearFraction(), fixed3.getPaymentYearFraction());\n }\n }", "public static Transaction generateSendTransaction(String strPrivateKey, String creatorAddress, String receiverAddress,\n TransactionHistory transactionHistory) {\n List<Creation> creations = new ArrayList<Creation>();\n List<Input> inputs = new ArrayList<Input>();\n List<Output> outputs = new ArrayList<Output>();\n\n // Get sender address from private key\n BigInteger privateKey = Bitcoin.decodePrivateKey(strPrivateKey);\n byte[] publicKey = Bitcoin.generatePublicKey(privateKey);\n String senderAddress = Bitcoin.publicKeyToAddress(publicKey);\n\n // Variable for counting number of coupons in referred transaction outputs\n int couponsInInputs = 0;\n\n // Find previous transaction outputs to refer to\n Iterator<Transaction> transactionIterator = transactionHistory.iterator();\n while (transactionIterator.hasNext() && couponsInInputs < 1) {\n Transaction transaction = transactionIterator.next();\n Iterator<Output> outputIterator = transaction.getOutputs().iterator();\n while (outputIterator.hasNext() && couponsInInputs < 1) {\n Output output = outputIterator.next();\n if (output.getCreatorAddress().equals(creatorAddress) && output.getAddress().equals(senderAddress)\n && output.getInputId() == 0) {\n Input input = new Input(output.getOutputId());\n inputs.add(input);\n couponsInInputs += output.getAmount();\n }\n }\n }\n\n // Check if enough coupons are available\n if (couponsInInputs <= 0) {\n throw new IllegalArgumentException();\n }\n\n // Set that 1 coupon should be sent to receiver address\n Output output = new Output(creatorAddress, 1, receiverAddress);\n outputs.add(output);\n\n // Send remaining coupons in referred transaction outputs back to the user as change\n if (couponsInInputs > 1) {\n Output changeOutput = new Output(creatorAddress, couponsInInputs - 1, senderAddress);\n outputs.add(changeOutput);\n }\n\n // Create transaction, sign it and return it\n Transaction transaction = new Transaction(creations, inputs, outputs);\n transaction.signTransaction(privateKey);\n return transaction;\n\n }", "public int[] getTsumoPayment(boolean isDealer) {\r\n int[] output = new int[2];\r\n if (isDealer) {\r\n output[0] = basicPoints * 2;\r\n output[1] = 0;\r\n } else {\r\n output[0] = basicPoints * 1;\r\n output[1] = basicPoints * 2;\r\n }\r\n output[0] = (int)(100*Math.ceil(output[0]/100.0));\r\n output[1] = (int)(100*Math.ceil(output[1]/100.0));\r\n \r\n return output;\r\n }", "@Test\n\tpublic void validateSignatureBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock newBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE VALID\n\t\tassertEquals(true, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\ttransactionsSignature = new byte[64];\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID GENERATOR SIGNATURE\n\t\tnewBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), newBlock.getTimestamp(), newBlock.getGeneratingBalance(), generator, new byte[32]);\n\t\ttransactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t///CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//VALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = newBlock.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID TRANSACTION SIGNATURE\n\t\tassertEquals(true, newBlock.isSignatureValid());\t\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tpayment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(200).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK INVALID TRANSACTION SIGNATURE\n\t\tassertEquals(false, newBlock.isSignatureValid());\t\n\t}", "public double sumTransactions() {\n\t\treturn checkIfTransactionsExist(true);\n\t}", "public void printTransactions() {\n for (int i = 0; i < transactions.size(); i++) {\n\t\t\tint indeks = i+1;\n\t\t\tSystem.out.println(\"Transactions \" + indeks + \": \" + transactions.get(i).getType() + \" \" + transactions.get(i).getAmount());\n\t\t}\n }", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "@Override\r\n\tpublic byte[] countersign(final byte[] sign,\r\n final String algorithm,\r\n final CounterSignTarget targetType,\r\n final Object[] targets,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException {\r\n throw new UnsupportedOperationException(\"No es posible realizar contrafirmas de ficheros ODF\"); //$NON-NLS-1$\r\n }", "public int updatePayment2(int requestId, int amount);", "private void convertTransactionToBitStream(){\n bitTransactionList = new ArrayList<>();\n itemListMap2 = new HashMap<>();\n \n for(int i=0; i<transactions_set.size(); i++){\n ArrayList curr_tr = transactions_set.get(i);\n \n if(curr_tr.size() >= min_itemset_size_K){ \n int freqItem = 0;\n BitSet bitset = new BitSet(bitsetLen);\n \n for(int j=0; j<curr_tr.size(); j++){\n try{\n int item = (int)curr_tr.get(j);\n bitset.set(itemIndex.get(item), true);\n freqItem++;\n }\n catch(Exception e){}\n }\n if(freqItem >= min_itemset_size_K){\n bitTransactionList.add(bitset);\n// System.out.println(bitset);\n HashSet<BitSet> subset_2 = createSubsetsOfLen2(bitset);\n for(BitSet sub_b : subset_2){\n itemListMap2.put(sub_b, itemListMap2.getOrDefault(sub_b, 0)+1);\n }\n }\n }\n }\n \n itemListMap2.values().removeIf(val -> val<min_sup);\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_5_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t\t\r\n\t\t\t\tHashMap<String,Object> o2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t\t\r\n\t\t\t\to = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\to2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return instance.getTransactions(index);\n }", "protected int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws IOException {\n return serializator.write(output, mostSigBits) +\n serializator.write(output, leastSigBits);\n }", "public static void main(String[] args)\n\t{\n \n\t\tSystem.out.println(\"Enter the size of transaction array\");\n int trSize = sc.nextInt();\n\n // creating an array of provided size\n int[] transactions = new int[trSize];\n \n // get the elements of the array (in a loop)\n System.out.println(\"Enter the values of array\");\n for (int i = 0; i < transactions.length; i++) {\n transactions[i] = sc.nextInt();\n }\n // get the number of targets\n System.out.println(\"Enter the total no of targets that needs to be achieved\");\n int numTargets = sc.nextInt();\n \n // get in target one-by-one (loop)\n for (int i = 0; i < numTargets; i++) {\n \n \t// Get TargetValue\n System.out.println(\"Enter the value of target\");\n int target = sc.nextInt();\n \n int sum =0;\n for ( int j=0; j < transactions.length; j++) {\n \tsum = sum + transactions[j];\n \t\n \tif ( sum >= target) {\n \tSystem.out.println(\"Target achieved after \" + (j+1) + \" transactions\" );\n \tbreak; // break out of the innermost for loop\n \t}\n \t\n \t//we come to the last transactions, yet target is not achieved\n \tif (j == transactions.length - 1) {\n \t\tSystem.out.println( \"Given target is not achieved\");\n \t}\n \t\n }\n \n \n\t}\n\n}", "public void onOutputSpent(MoneroOutputWallet output);", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public double calculatePay() {\n\t\treturn 0;\r\n\t}", "public byte[] signNativeByTransDataDefault(UInt256 uInt256) {\n return new byte[0];\n }", "@Suspendable\n @Override\n protected void checkTransaction(SignedTransaction stx) throws FlowException {\n }", "com.google.protobuf.ByteString\n getTranCodeBytes();", "com.google.protobuf.ByteString\n getOutputBytes();", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_1() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public float getInputsValue() {\n\t\tfloat total = 0;\n\t\tfor (TransactionInput i : inputs) {\n\t\t\tif (i.getUTXO() == null)\n\t\t\t\tcontinue; // if Transaction can't be found skip it\n\t\t\ttotal += i.getUTXO().getValue();\n\t\t}\n\t\treturn total;\n\t}", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }" ]
[ "0.6157669", "0.5968836", "0.5894512", "0.575845", "0.57379013", "0.56862354", "0.5671643", "0.5638562", "0.55891097", "0.55805844", "0.5491049", "0.547115", "0.5430694", "0.535867", "0.535867", "0.535867", "0.5344417", "0.5307626", "0.5253172", "0.524015", "0.5189739", "0.51506877", "0.5134411", "0.51289254", "0.5127413", "0.50831395", "0.50639427", "0.5035688", "0.50094956", "0.49972042", "0.4990747", "0.4967469", "0.4967469", "0.4967469", "0.49642414", "0.4948274", "0.49423918", "0.49403173", "0.49305025", "0.49055907", "0.48962563", "0.48919266", "0.48815575", "0.48727128", "0.48690858", "0.48671517", "0.4864887", "0.48293087", "0.4796929", "0.47936854", "0.4792538", "0.47683463", "0.47675353", "0.47675353", "0.47675353", "0.47565505", "0.47514316", "0.47473222", "0.47313264", "0.47313264", "0.4730076", "0.47218332", "0.47160283", "0.47159252", "0.47158366", "0.4699172", "0.46933794", "0.46929714", "0.4690595", "0.4686018", "0.4673744", "0.4672201", "0.46678242", "0.46676886", "0.4667487", "0.46660423", "0.46638095", "0.46557528", "0.46553993", "0.46553993", "0.46553993", "0.46531892", "0.46475676", "0.46449953", "0.4624059", "0.46231604", "0.46201655", "0.46124235", "0.46085235", "0.46082187", "0.46068537", "0.46033576", "0.4602587", "0.45972705", "0.45952573", "0.4587196", "0.4582048", "0.4580939", "0.45772147", "0.45763913", "0.4568933" ]
0.0
-1
Signed transactions that satisfy PaymentDetails.outputs repeated bytes transactions = 2;
int getTransactionsCount();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testValidOutputValues() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, -20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(-20, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testNoDoubleSpending() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Alice wants double spending: transfers 10 coins to Bob, 20 to Cal again\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1: input 0\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n\n // Sign for tx1: input 1\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(1).addSignature(sig2);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testHandleTxs() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // Cal transfers 5 coins to Bob, Bob transfers 2 coins to Alice\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0); // index 0 refers to output 1 of tx1\n tx2.addInput(tx1.getHash(), 1); // index 1 refers to output 1 of tx1\n tx2.addOutput(2, kpAlice.getPublic());\n tx2.addOutput(5, kpBob.getPublic());\n\n // Sign for tx2\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx2.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(0).addSignature(sig2);\n\n byte[] sig3 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpCal.getPrivate());\n sig.update(tx2.getRawDataToSign(1));\n sig3 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(1).addSignature(sig3);\n tx2.finalize();\n\n // Alice transfers 3 coins to Cal\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(), 0);\n tx3.addOutput(3, kpCal.getPublic());\n\n // Sign for tx3\n byte[] sig4 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx3.getRawDataToSign(0));\n sig4 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx3.getInput(0).addSignature(sig4);\n tx3.finalize();\n\n Transaction[] acceptedTx = txHandler.handleTxs(new Transaction[] {tx1, tx2, tx3});\n // tx1, tx2 supposed to be valid, tx3 supposed to be invalid\n assertEquals(acceptedTx.length, 2);\n // assertFalse(txHandler.isValidTx(tx3));\n }", "public boolean processTransaction() {\n\n // Checks to see if the signature can be verified.\n if (verifySignature() == false) {\n System.out.println(\"# Transaction signature could not be verified.\");\n return false;\n }\n\n // Gathers all transaction inputs, making sure they are unspent.\n for (TransactionInput i : inputs) {\n i.UTXO = BasicBlockchain.UTXOs.get(i.transactionOutputId);\n }\n\n // Checks if transaction amount is valid.\n if (getInputsValue() < BasicBlockchain.minimumTransaction) {\n System.out.println(\"# Transaction inputs are too small.\");\n return false;\n }\n\n // Generates transaction outputs.\n // Get value of the inputs then the leftover change.\n float leftOver = getInputsValue() - value;\n transactionId = calculateHash();\n // Send value to recipient.\n outputs.add(new TransactionOutput(this.recipient, value, transactionId));\n // Send the leftover \"change\" back to sender.\n outputs.add(new TransactionOutput(this.sender, leftOver, transactionId));\n\n\n // Adds outputs to the unspent list.\n for (TransactionOutput o : outputs) {\n BasicBlockchain.UTXOs.put(o.id, o);\n }\n\n // Removes the transaction inputs from the blockchain's UTXO list as spent.\n for (TransactionInput i : inputs) {\n if (i.UTXO == null) continue;\n BasicBlockchain.UTXOs.remove(i.UTXO.id);\n }\n\n return true;\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutput();", "public static void main(String[] args) throws AddressFormatException {\n\n// generateMultisig();\n String getSignedTransaction = signFirstTime();\n String rawtx = signSecondTime(getSignedTransaction);\n\n System.out.println(\"rawtx ->\"+ rawtx);\n }", "private static String signFirstTime() throws AddressFormatException\n {\n ECKey key1 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n\n\n // Use the redeem script we have saved somewhere to start building the transaction\n Script redeemScript = new Script(hexStringToByteArray(\"5221021ae8964b8529dc3e52955f2cabd967e08c52008dbcca8e054143b668f3998f4a210306be609ef37366ab0f3dd4096ac23a6ee4d561fc469fa60003f799b0121ad1072102199f3d89fa00e6f55dd6ecdd911457d7264415914957db124d53bf0064963f3853ae\"));\n\n // Start building the transaction by adding the unspent inputs we want to use\n // The data is taken from blockchain.info, and can be found here: https://blockchain.info/rawtx/ca1884b8f2e0ba88249a86ec5ddca04f937f12d4fac299af41a9b51643302077\n Transaction spendTx = new Transaction(params);\n ScriptBuilder scriptBuilder = new ScriptBuilder();\n scriptBuilder.data(new String(\"a9145204ad7c5fa5a2491cd91c332e28c87221194ca087\").getBytes()); // Script of this output\n TransactionInput input = spendTx.addInput(new Sha256Hash(\"fed695bf5e2c15286956a7bd3464c5beb97ef064e1f9406eba189ea844733e7c\"), 1, scriptBuilder.build());\n\n // Add outputs to the person receiving bitcoins\n Address receiverAddress = new Address(params, \"n2cWhs5sbWFCwzuuWWsVM9ubPwykGtX75T\");\n Coin charge = Coin.valueOf(1000000); // 0.1 mBTC\n Script outputScript = ScriptBuilder.createOutputScript(receiverAddress);\n spendTx.addOutput(charge, outputScript);\n\n /*8888888888888888888888888888888888888888888888888888888888888*/\n\n // Sign the first part of the transaction using private key #1\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature ecdsaSignature = key1.sign(sighash);\n TransactionSignature transactionSignarture = new TransactionSignature(ecdsaSignature, Transaction.SigHash.ALL, false);\n\n // Create p2sh multisig input script\n Script inputScript = ScriptBuilder.createP2SHMultiSigInputScript(Arrays.asList(transactionSignarture), redeemScript);\n\n // Add the script signature to the input\n input.setScriptSig(inputScript);\n System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "private ArrayList<Long> storeTransactionInputs(long transactionId, ArrayList<TransactionInput> inputs, int isCoinbase){\n \t\tint inputindex = 0;\n \t\tlong previousOutputId;\n \t\tString prevOutputHash;\n \t\tResultSet findOutputResults;\n \t\tResultSet generatedKey;\n \t\tLong addressId;\n \t\tArrayList<Long> addressIdz=new ArrayList<Long>();\n \t\ttry {\n \t\tfor (TransactionInput i : inputs) {\n\t\t\t\n \t\t\tprevOutputHash = HexBin.encode(i.outpoint.hash);\n \t\t\tfindTransactionOutputStatement.setString(1, prevOutputHash);\n \t\t\tfindTransactionOutputStatement.setLong(2, i.outpoint.index);\n \t\t\tfindOutputResults = findTransactionOutputStatement\n \t\t\t\t\t.executeQuery();\n \t\t\tif (findOutputResults.next()) {\n \t\t\t\tpreviousOutputId = findOutputResults.getLong(1);\n\t\t\t\taddressId=findOutputResults.getLong(2);\n \t\t\t} else {\n \t\t\t\tpreviousOutputId = 0;\n\t\t\t\taddressId=null;\n \t\t\t}\n \t\t\tfindOutputResults.close();\n \t\t\tinsertTransactionInputStatement.setLong(1, transactionId);\n \t\t\tinsertTransactionInputStatement.setInt(2, inputindex);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(3, previousOutputId);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setString(4, prevOutputHash);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(5, i.outpoint.index);\n \t\t\tinsertTransactionInputStatement.setLong(6,\n \t\t\t\t\ti.scriptBytes.length);\n \t\t\tinsertTransactionInputStatement.setString(7,\n \t\t\t\t\tHexBin.encode(i.scriptBytes));\n \t\t\tinsertTransactionInputStatement.setLong(8, i.sequence);\n \t\t\tinsertTransactionInputStatement.setBoolean(9,\n \t\t\t\t\ti.isCoinBase());\n\t\t\tif(addressId!=null){\n \t\t\t\tinsertTransactionInputStatement.setLong(10,addressId);\n \t\t\t\taddressIdz.add(addressId);\n\t\t\t} else {\n \t\t\t\t// TODO Auto-generated catch block\n \t\t\t\tinsertTransactionInputStatement.setNull(10,\n \t\t\t\t\t\tjava.sql.Types.INTEGER);\n \t\t\t}\n \t\t\tinsertTransactionInputStatement.execute();\n \t\t\t\n \t\t}\n \t\t\n \t\t\n \t} catch (SQLException e1) {\n \t\t// TODO Auto-generated catch block\n \t\te1.printStackTrace();\n \t}\n \t\treturn addressIdz;\n \t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputOrBuilder();", "List<TransactionVO> addPendingTransactions(List<SignedTransaction> transactions);", "@Test\n public void TxHandlerTestThird() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid output number(wrong number of coins to transfer)\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1 scrooge to alice 20coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: Alice --> Bob -5coins [*Invalid output number*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(-5, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n // tx3: Alice --> Bob 90coins [*Invalid output number*]\n Transaction tx3 = new Transaction();\n tx3.addInput(tx1.getHash(), 0);\n tx3.addOutput(90, pkBob.getPublic());\n tx3.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n }", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "private static String signSecondTime(String transactionString)\n {\n Transaction spendTx = new Transaction(params, hexStringToByteArray(transactionString));\n\n // Get the input chunks\n Script inputScript = spendTx.getInput(0).getScriptSig();\n List<ScriptChunk> scriptChunks = inputScript.getChunks();\n\n // Create a list of all signatures. Start by extracting the existing ones from the list of script schunks.\n // The last signature in the script chunk list is the redeemScript\n List<TransactionSignature> signatureList = new ArrayList<TransactionSignature>();\n Iterator<ScriptChunk> iterator = scriptChunks.iterator();\n Script redeemScript = null;\n\n while (iterator.hasNext())\n {\n ScriptChunk chunk = iterator.next();\n\n if (iterator.hasNext() && chunk.opcode != 0)\n {\n TransactionSignature transactionSignarture = TransactionSignature.decodeFromBitcoin(chunk.data, false);\n signatureList.add(transactionSignarture);\n } else\n {\n redeemScript = new Script(chunk.data);\n }\n }\n\n // Create the sighash using the redeem script\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature secondSignature;\n\n // Take out the key and sign the signhash\n //ECKey key2 = createKeyFromSha256Passphrase(\"Super secret key 2\");\n ECKey key2 = ECKey.fromPrivate(new BigInteger(\"68123968917867656952640885027449260190826636504009580537802764798766700329220\"));\n// ECKey key2 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n secondSignature = key2.sign(sighash);\n\n // Add the second signature to the signature list\n TransactionSignature transactionSignarture = new TransactionSignature(secondSignature, Transaction.SigHash.ALL, false);\n signatureList.add(transactionSignarture);\n\n // Rebuild p2sh multisig input script\n inputScript = ScriptBuilder.createP2SHMultiSigInputScript(signatureList, redeemScript);\n spendTx.getInput(0).setScriptSig(inputScript);\n\n //System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "@Test\n public void testOutputsInUTXOPool() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is NOT put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // UTXO pool does not contains the UTXO\n assertFalse(txHandler.isValidTx(tx1));\n\n // Put output of createCoinTx to the pool\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler1 = new TxHandler(utxoPool);\n\n // UTXO pool now contains the UTXO\n assertTrue(txHandler1.isValidTx(tx1));\n }", "@Test\n public void testValidBalance() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 100 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(100, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "RequestResult postSignRequests(TriphaseRequest[] requests) throws IOException,\n CertificateEncodingException, SAXException;", "public IBankTransfert payment();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static boolean isSigned_entries_receiveEst() {\n return false;\n }", "com.google.protobuf.ByteString getTransactions(int index);", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "@Suspendable\n @Override\n public SignedTransaction call() throws FlowException {\n\n Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);\n//\n\n // Source\n AccountInfo issuerOwner = subFlow(new AccountInfoByName(acctNameSource)).get(0).getState().getData();\n PublicKey issuerOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty issuerOwnerAnonParty = new AnonymousParty(issuerOwnerKey);\n\n AccountInfo targetOwner = subFlow(new AccountInfoByName(acctNameTarget)).get(0).getState().getData();\n PublicKey targetOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty targetOwnerAnonParty = new AnonymousParty(targetOwnerKey);\n\n\n AssetForAccountState outputAsset = new AssetForAccountState(issuerOwnerAnonParty, targetOwnerAnonParty,\n asset.getState().getData().getName(), asset.getState().getData().getValue());\n\n\n TransactionBuilder txBuilder = new TransactionBuilder(notary)\n .addInputState(asset)\n .addOutputState(outputAsset, AssetForAccountContract.ID)\n .addCommand(new AssetForAccountContract.Commands.Transfer(), issuerOwnerKey);\n\n txBuilder.verify(getServiceHub());\n\n SignedTransaction fullySignedTransaction = getServiceHub().signInitialTransaction(txBuilder, issuerOwnerKey);\n\n //return fullySignedTransaction;\n return subFlow(new FinalityFlow(fullySignedTransaction, Collections.emptyList()));\n }", "private boolean areOutputsSpent(Transaction tx){\n // Need to see if tx inputs are contained in the blockchain UTXOs\n for(TransactionInput i : tx.inputs){\n if(!currentBlockchain.UTXOs.containsKey(i.previousOutId)){\n return true;\n }\n }\n return false;\n }", "BigInteger getDigitalSignature();", "public static long deepTransactionCheck(Transaction tx, UtxoUpdateBuffer utxo_buffer, BlockHeader block_header, NetworkParams params)\n throws ValidationException\n {\n try(TimeRecordAuto tra_blk = TimeRecord.openAuto(\"Validation.deepTransactionCheck\"))\n {\n TransactionInner inner = null;\n\n try\n {\n inner = TransactionInner.parseFrom(tx.getInnerData());\n }\n catch(java.io.IOException e)\n {\n throw new ValidationException(\"error parsing tx on second pass somehow\", e);\n }\n\n long sum_of_inputs = 0L;\n // Make sure all inputs exist\n for(TransactionInput in : inner.getInputsList())\n {\n TransactionOutput matching_out = utxo_buffer.getOutputMatching(in);\n if (matching_out == null)\n {\n throw new ValidationException(String.format(\"No matching output for input %s\", new ChainHash(in.getSrcTxId())));\n }\n validateSpendable(matching_out, block_header, params);\n sum_of_inputs += matching_out.getValue();\n\n // SIP-4 check\n if (block_header.getBlockHeight() >= params.getActivationHeightTxInValue())\n {\n if (in.getValue() != 0L)\n {\n if (in.getValue() != matching_out.getValue())\n {\n throw new ValidationException(String.format(\"Input value does not match: %d %d\", matching_out.getValue(), in.getValue()));\n }\n }\n }\n utxo_buffer.useOutput(matching_out, new ChainHash(in.getSrcTxId()), in.getSrcTxOutIdx());\n }\n\n long spent = 0L;\n // Sum up all outputs\n int out_idx =0;\n ArrayList<ByteString> raw_output_list = TransactionUtil.extractWireFormatTxOut(tx);\n\n for(TransactionOutput out : inner.getOutputsList())\n {\n validateTransactionOutput(out, block_header, params);\n spent+=out.getValue();\n utxo_buffer.addOutput(raw_output_list, out, new ChainHash(tx.getTxHash()), out_idx);\n out_idx++;\n\n }\n\n spent+=inner.getFee();\n\n if (!inner.getIsCoinbase())\n {\n if (sum_of_inputs != spent)\n {\n throw new ValidationException(String.format(\"Transaction took in %d and spent %d\", sum_of_inputs, spent));\n }\n }\n \n return inner.getFee();\n }\n }", "@Test\n public void TxHandlerTestSecond() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the double spending\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(25, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1: one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx 2:Scrooge --> Bob 20coins [*Double-spending*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx0.getHash(), 0);\n tx2.addOutput(25, pkBob.getPublic());\n tx2.signTx(pkScrooge.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n\n }", "String signITRByAssesse(String PAN,String xml, DigitalSignatureWrapper digitalSignatureWrapper) throws MissingPrivateKeyException,InvalidDigitalSignatureException,Exception;", "public boolean processTransaction() {\r\n\t\t\r\n\t\t\tif(verifySignature() == false) {\r\n\t\t\t\tSystem.out.println(\"#Transaction Signature failed to verify\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\ttransactionId = calulateHash();\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "public static boolean isSigned_receivets() {\n return true;\n }", "@Override\n public boolean isValid() {\n final BlockChainInt outputHash = getOutputHash();\n\n return inputs.stream().map(input -> input.verifySignature(outputHash)).reduce(true, (a, b) -> a && b)\n && outputs.stream().map(output -> output.getAmount() >= 0).reduce(true, (a, b) -> a && b)\n && getTransactionFee() >= 0;\n }", "@Override\n public void run() {\n byte[] deviceTxPayload = CoreServices.getOrCreateHardwareWalletService().get().getContext().getSerializedTx().toByteArray();\n\n log.info(\"DeviceTx payload:\\n{}\", Utils.HEX.encode(deviceTxPayload));\n\n // Load deviceTx\n Transaction deviceTx = new Transaction(MainNetParams.get(), deviceTxPayload);\n\n log.info(\"deviceTx:\\n{}\", deviceTx.toString());\n\n // Check the signatures are canonical\n for (TransactionInput txInput : deviceTx.getInputs()) {\n byte[] signature = txInput.getScriptSig().getChunks().get(0).data;\n if (signature != null) {\n log.debug(\n \"Is signature canonical test result '{}' for txInput '{}', signature '{}'\",\n TransactionSignature.isEncodingCanonical(signature),\n txInput.toString(),\n Utils.HEX.encode(signature));\n } else {\n log.warn(\"No signature data\");\n }\n }\n\n log.debug(\"Committing and broadcasting the last tx\");\n\n BitcoinNetworkService bitcoinNetworkService = CoreServices.getOrCreateBitcoinNetworkService();\n\n if (bitcoinNetworkService.getLastSendRequestSummaryOptional().isPresent()\n && bitcoinNetworkService.getLastWalletOptional().isPresent()) {\n\n SendRequestSummary sendRequestSummary = bitcoinNetworkService.getLastSendRequestSummaryOptional().get();\n\n // Check the unsigned and signed tx are essentially the same as a check against malware attacks on the Trezor\n if (TransactionUtils.checkEssentiallyEqual(sendRequestSummary.getSendRequest().get().tx, deviceTx)) {\n // Substitute the signed tx from the trezor\n log.debug(\n \"Substituting the Trezor signed tx '{}' for the unsigned version {}\",\n deviceTx.toString(),\n sendRequestSummary.getSendRequest().get().tx.toString()\n );\n sendRequestSummary.getSendRequest().get().tx = deviceTx;\n log.debug(\"The transaction fee was {}\", sendRequestSummary.getSendRequest().get().fee);\n\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_TRANSACTION_CREATED_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n\n // Get the last wallet\n Wallet wallet = bitcoinNetworkService.getLastWalletOptional().get();\n\n // Commit and broadcast\n bitcoinNetworkService.commitAndBroadcast(sendRequestSummary, wallet, paymentRequestData);\n\n // Ensure the header is switched off whilst the send is in progress\n ViewEvents.fireViewChangedEvent(ViewKey.HEADER, false);\n } else {\n // The signed transaction is essentially different from what was sent to it - abort send\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_FAILURE_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n }\n } else {\n log.debug(\"Cannot commit and broadcast the last send as it is not present in bitcoinNetworkService\");\n }\n // Clear the previous remembered tx\n bitcoinNetworkService.setLastSendRequestSummaryOptional(Optional.<SendRequestSummary>absent());\n bitcoinNetworkService.setLastWalletOptional(Optional.<Wallet>absent());\n }", "@Test\n public void TxHandlerTestForth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid signature\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx1: scrooge to alice 20 coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: alice to bob 20coins[signed by bob]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(20, pkBob.getPublic());\n tx2.signTx(pkBob.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n }", "@Override\n public byte[] createDataToSignInput(\n Transaction transaction,\n int inputIndex,\n long amountInSat,\n PublicKeyTriple publicKeyTriple) {\n\n final byte[] redeemScript = createRedeemScript(publicKeyTriple);\n\n return TransactionHelpers.getDataToSign(\n transaction,\n inputIndex,\n new Script(redeemScript)\n );\n }", "public TransactionResponse processAllTransaction() throws ParseException {\n TransactionResponse response = new TransactionResponse();\n\n //User0\n response.setTransaction(new Transaction(\"user0\",\"0001\", \"type0\",\"user0_Billing\",\"user0_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-00\")));\n\n //User1\n response.setTransaction(new Transaction(\"user1\", \"0101\",\"type0\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user1\", \"0102\", \"type1\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-00\")));\n\n //User2\n response.setTransaction(new Transaction(\"user2\", \"0201\", \"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-01-00\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0202\", \"type2\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0203\",\"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n //User3\n response.setTransaction(new Transaction(\"user3\", \"0301\",\"type0\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user3\", \"0302\",\"type1\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n return response;\n }", "com.dogecoin.protocols.payments.Protos.Output getOutputs(int index);", "@Test\n public void TxHandlerTestFifth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the input not in the UtxoPool\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n //tx1: Scrooge --> Alice 20coins [Pay Coins *NOT added to UTXO pool* due to accidents]\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n utxo = new UTXO(tx1.getHash(),0);\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n utxoPool.removeUTXO(utxo);\n assertTrue(\"tx1:UTXO has been removed.\", utxoPool.getAllUTXO().size() == 0);\n\n\n // tx2: Alice --> Bob 15coins [Pay Coins *Previous Tx NOT in UTXO pool*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(15, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 0);\n\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "private static void createDummyTransactions() {\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 10L, new Transaction(10000d, \"cars\", 0L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 11L, new Transaction(15000d, \"shopping\", 10L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 12L, new Transaction(20000d, \"keys\", 11L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 13L, new Transaction(25000d, \"furniture\", 12L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 14L, new Transaction(30000d, \"keys\", 13L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 15L, new Transaction(40000d, \"cars\", 14L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 16L, new Transaction(50000d, \"cars\", 15L)));\n }", "@Test\n public void TxHandlerTestFirst() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test some basic functions of TxHandler\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n // tx0: Scrooge --> Scrooge 25coins [Create Coins]\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx( pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n\n // tx1: Scrooge --> Scrooge 4coins [Divide Coins]\n //\t Scrooge --> Scrooge 5coins\n //\t Scrooge --> Scrooge 6coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(),0);\n\n tx1.addOutput(4,pkScrooge.getPublic());\n tx1.addOutput(5,pkScrooge.getPublic());\n tx1.addOutput(6,pkScrooge.getPublic());\n\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx2: Scrooge --> Alice 4coins [Pay separately]\n //\t Scrooge --> Alice 5coins\n // Scrooge --> Bob 6coins\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addInput(tx1.getHash(), 1);\n tx2.addInput(tx1.getHash(), 2);\n\n tx2.addOutput(4, pkAlice.getPublic());\n tx2.addOutput(5, pkAlice.getPublic());\n tx2.addOutput(6, pkBob.getPublic());\n\n tx2.signTx(pkScrooge.getPrivate(), 0);\n tx2.signTx(pkScrooge.getPrivate(), 1);\n tx2.signTx(pkScrooge.getPrivate(), 2);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx3:Alice --> Alice 2coins [Divide Coins]\n // Alice --> Alice 2coins\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(),0);\n\n tx3.addOutput(2, pkAlice.getPublic());\n tx3.addOutput(2, pkAlice.getPublic());\n\n tx3.signTx(pkAlice.getPrivate(),0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 4);\n\n // tx4: Alice --> Bob 2coins [Pay jointly]\n // Alice --> Bob 5coins\n Transaction tx4 = new Transaction();\n tx4.addInput(tx3.getHash(),0);\n tx4.addInput(tx2.getHash(),1);\n\n tx4.addOutput(7, pkBob.getPublic());\n\n tx4.signTx(pkAlice.getPrivate(), 0);\n tx4.signTx(pkAlice.getPrivate(),1);\n\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx4) returns: \" + txHandler.isValidTx(tx4));\n assertTrue(\"tx4:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx4}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx4:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n// System.out.println(\"tx4.hashCode returns: \" + tx4.hashCode());\n }", "public ParametricStatement[] createForPaymentTransaction(PaymentTransaction paymentTransaction)\n throws SQLException {\n int multiplier = 1;\n Date date = paymentTransaction.getProcessDate();\n if (paymentTransaction instanceof VoidTransaction) {\n VoidTransaction trans = (VoidTransaction)paymentTransaction;\n ITransaction originalTrans = trans.getOriginalTransaction();\n if (originalTrans instanceof PaymentTransaction) {\n multiplier = -1;\n paymentTransaction = (PaymentTransaction)originalTrans;\n } else {\n // Do nothing if original was not a payment transaction.\n return new ParametricStatement[0];\n }\n }\n ArrayList parametricStatements = new ArrayList();\n String storeId = paymentTransaction.getStore().getId();\n String operatorId = paymentTransaction.getTheOperator().getId();\n // String registerId = paymentTransaction.getId();\n // int registerIdIndex = registerId.indexOf('*') + 1;\n // registerId = registerId.substring(registerIdIndex, registerId.indexOf('*', registerIdIndex));\n String registerId = paymentTransaction.getRegisterId();\n PaymentSummary[] currentPaymentSummaries = this.selectByDateStoreId(date, storeId);\n List newPaymentSummaries = new ArrayList();\n Payment[] payments = paymentTransaction.getPaymentsArray();\n for (int paymentIndex = 0; paymentIndex < payments.length; paymentIndex++) {\n ArmCurrency paymentAmount = payments[paymentIndex].getAmount().multiply(multiplier);\n String paymentType = payments[paymentIndex].getTransactionPaymentName();\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n boolean found = false;\n //to find if this payment type is already in the database\n for (int summaryIndex = 0; summaryIndex < currentPaymentSummaries.length; summaryIndex++) {\n if (currentPaymentSummaries[summaryIndex].getEmployeeId().equals(operatorId)\n && currentPaymentSummaries[summaryIndex].getRegisterId().equals(registerId)\n && currentPaymentSummaries[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n currentPaymentSummaries[summaryIndex].doSetPaymentTotal(paymentAmount.add(\n currentPaymentSummaries[summaryIndex].getPaymentTotal()));\n int mediaCount = ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).\n getMediaCount();\n ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n // work-around for cloudscape date truncation problem.\n currentPaymentSummaries[summaryIndex].doSetDate(date);\n List list = fromObjectToBean(currentPaymentSummaries[summaryIndex]).toList();\n list.add(currentPaymentSummaries[summaryIndex].getId());\n parametricStatements.add(new ParametricStatement(updateSql, list));\n break;\n }\n }\n //to find if it is already in the newPaymentSummaries List\n if (!found) {\n PaymentSummary[] newPaymentSummaryArray = (PaymentSummary[])newPaymentSummaries.toArray(new\n PaymentSummary[0]);\n for (int summaryIndex = 0; summaryIndex < newPaymentSummaryArray.length; summaryIndex++) {\n if (newPaymentSummaryArray[summaryIndex].getEmployeeId().equals(operatorId)\n && newPaymentSummaryArray[summaryIndex].getRegisterId().equals(registerId)\n && newPaymentSummaryArray[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n ArmCurrency newTotal = paymentAmount.add(newPaymentSummaryArray[summaryIndex].\n getPaymentTotal());\n int mediaCount = ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).\n getMediaCount();\n newPaymentSummaryArray[summaryIndex].doSetPaymentTotal(newTotal);\n ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n }\n }\n }\n if (!found) {\n CMSPaymentSummary paymentSummary = new CMSPaymentSummary();\n paymentSummary.doSetDate(date);\n paymentSummary.doSetEmployeeId(operatorId);\n paymentSummary.doSetStoreId(storeId);\n paymentSummary.doSetRegisterId(registerId);\n paymentSummary.doSetPaymentTotal(paymentAmount);\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n paymentSummary.doSetPaymentType(paymentType);\n paymentSummary.doSetId(this.getNextChelseaId());\n paymentSummary.doSetMediaCount(paymentSummary.getMediaCount() + 1);\n newPaymentSummaries.add(paymentSummary);\n }\n }\n for (int i = 0; i < newPaymentSummaries.size(); i++) {\n PaymentSummary paymentSummary = (PaymentSummary)newPaymentSummaries.get(i);\n parametricStatements.add(new ParametricStatement(insertSql\n , fromObjectToBean(paymentSummary).toList()));\n }\n return (ParametricStatement[])parametricStatements.toArray(new ParametricStatement[\n parametricStatements.size()]);\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "@Test\n public void transactionSum() {\n final Transaction transaction1 = new Transaction(\"774cedda\", State.CANCELED, 1000L, new Date());\n final Account account1 = new Account(\"1001\", 0L, Collections.singletonList(transaction1));\n final Transaction transaction2 = new Transaction(\"337868a7\", State.FINISHED, 8000L, new Date());\n final Transaction transaction3 = new Transaction(\"f8047f86\", State.CANCELED, 10000L, new Date());\n final Account account2 = new Account(\"1002\", 8000L, Arrays.asList(transaction2, transaction3));\n\n final long actual = calcSumOfCancelledTransOnNonEmptyAccounts(Arrays.asList(account1, account2));\n\n Assert.assertEquals(actual, 10_000L);\n }", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutputs(int index);", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "public abstract void generateReceipt(Transaction trans);", "public Transaction getDummyTransaction(String action) {\n\n\t\t// Long payerAccountNum = 111l;\n\t\tLong payerRealmNum = 0l;\n\t\tLong payerShardNum = 0l;\n\t\t// Long nodeAccountNum=123l;\n\t\tLong nodeRealmNum = 0l;\n\t\tLong nodeShardNum = 0l;\n\t\tlong transactionFee = 0l;\n\t\tTimestamp startTime =\n\t\t\t\tRequestBuilder.getTimestamp(Instant.now(Clock.systemUTC()).minusSeconds(13));\n\t\tDuration transactionDuration = RequestBuilder.getDuration(100);\n\t\tboolean generateRecord = false;\n\t\tString memo = \"UnitTesting\";\n\t\tint thresholdValue = 10;\n\t\tList<Key> keyList = new ArrayList<>();\n\t\tKeyPair pair = new KeyPairGenerator().generateKeyPair();\n\t\tbyte[] pubKey = ((EdDSAPublicKey) pair.getPublic()).getAbyte();\n\t\tKey akey =\n\t\t\t\tKey.newBuilder().setEd25519(ByteString.copyFromUtf8((MiscUtils.commonsBytesToHex(pubKey)))).build();\n\t\tPrivateKey priv = pair.getPrivate();\n\t\tkeyList.add(akey);\n\t\tlong initBal = 100;\n\t\tlong sendRecordThreshold = 5;\n\t\tlong receiveRecordThreshold = 5;\n\t\tboolean receiverSign = false;\n\t\tDuration autoRenew = RequestBuilder.getDuration(100);\n\t\t;\n\t\tlong proxyAccountNum = 12345l;\n\t\tlong proxyRealmNum = 0l;\n\t\tlong proxyShardNum = 0l;\n\t\tint proxyFraction = 10;\n\t\tint maxReceiveProxyFraction = 10;\n\t\tlong shardID = 0l;\n\t\tlong realmID = 0l;\n\n\t\tTransaction trx = null;\n\t\tSignatureList sigList = SignatureList.getDefaultInstance();\n\t\tTimestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\n\t\t/**\n\t\t * SignatureList sigList = SignatureList.getDefaultInstance(); Transaction transferTx =\n\t\t * RequestBuilder.getCryptoTransferRequest( payer.getAccountNum(), payer.getRealmNum(),\n\t\t * payer.getShardNum(), nodeAccount.getAccountNum(), nodeAccount.getRealmNum(),\n\t\t * nodeAccount.getShardNum(), 800, timestamp, transactionDuration, false, \"test\", sigList,\n\t\t * payer.getAccountNum(), -100l, nodeAccount.getAccountNum(), 100l); transferTx =\n\t\t * TransactionSigner.signTransaction(transferTx, accountKeys.get(payer));\n\t\t */\n\n\t\tif (\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t\ttrx = RequestBuilder.getCryptoTransferRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 800, timestamp,\n\t\t\t\t\ttransactionDuration, false, \"test\", sigList, payerAccountId.getAccountNum(), -100l,\n\t\t\t\t\tnodeAccountId.getAccountNum(), 100l);\n\t\t\t// trx = TransactionSigner.signTransaction(trx, account2keyMap.get(payerAccountId));\n\t\t}\n\n\t\tif (\"createContract\".equalsIgnoreCase(action)) {\n\t\t\tFileID fileID = FileID.newBuilder().setFileNum(9999l).setRealmNum(1l).setShardNum(2l).build();\n\n\t\t\ttrx = RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 50000000000l, timestamp,\n\t\t\t\t\ttransactionDuration, true, \"createContract\", DEFAULT_CONTRACT_OP_GAS, fileID,\n\t\t\t\t\tByteString.EMPTY, 0, transactionDuration,\n\t\t\t\t\tSignatureList.newBuilder().addSigs(\n\t\t\t\t\t\t\tSignature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t\t\t\t\t\t.build(),\n\t\t\t\t\t\"\");\n\t\t}\n\n\t\t// if(\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t// long durationInSeconds = DAY_SEC * 30;\n\t\t// * Duration contractAutoRenew = Duration.newBuilder().setSeconds(durationInSeconds).build();\n\t\t// * Timestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\t\t// * Duration transactionDuration = RequestBuilder.getDuration(30, 0);\n\t\t// * Transaction createContractRequest =\n\t\t// RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t// * payerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t// * nodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 100l, timestamp,\n\t\t// transactionDuration, true, \"createContract\",\n\t\t// * DEFAULT_CONTRACT_OP_GAS, contractFile, ByteString.EMPTY, 0, contractAutoRenew,\n\t\t// * SignatureList.newBuilder()\n\t\t// *\n\t\t// .addSigs(Signature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t// * .build());\n\t\t// }\n\n\t\treturn trx;\n\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public static byte[] secondOutputStep(byte[] S){\n\t\tStringBuffer string = new StringBuffer();\n\t\tfor (int i = 1; i < S.length; i+=2) {\n\t\t\tstring.append(getBit(S[i],7));\n\t\t}\n\t\tbyte[] bval = new BigInteger(string.toString(), 2).toByteArray();\n\t\tif(bval.length > 16){\n\t\t\treturn Arrays.copyOfRange(bval,1,bval.length);\n\t\t}else{\n\t\t\treturn bval;\n\t\t}\n\t\t\n\t}", "public double printOutput() {\r\n return calculateNetPay();\r\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "public boolean doTransaction() {\r\n int nonce = -1;\r\n TransactionOperation transactionOperation = null;\r\n try {\r\n double balance;\r\n \r\n //read the stream for requests from client\r\n byte[] cipherText = (byte [])is.readObject();\r\n \r\n // decrypt the ciphertext to obtain the signed message\r\n ATMSessionMessage atmSessionMessage = (ATMSessionMessage) crypto.decryptRijndael(cipherText, kSession);\r\n if(!(currTimeStamp < atmSessionMessage.getTimeStamp())) error (\"Time stamp does not match\");\r\n \r\n //interpret the transaction operation in the request\r\n SignedMessage signedMessage = atmSessionMessage.getSignedMessage();\r\n \r\n \r\n \t\t//verify signature\r\n \t\ttry {\r\n \t\t\tif(!crypto.verify(signedMessage.msg, signedMessage.signature, currAcct.kPub))\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"Digital signature failed...\");\r\n \t\t\t}\r\n \t\t\tSystem.out.println(\"Message signature valid...\");\r\n \t\t} catch (SignatureException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t} catch (KeyException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\t\r\n TransactionMessage transactionMessage = (TransactionMessage)signedMessage.getObject();\r\n transactionOperation = transactionMessage.getOperation();\r\n \r\n //print the signed message\r\n System.out.println(\"\\n\" + (new Date()).toString());\r\n System.out.println(signedMessage.toString());\r\n \r\n //strip out the parameters embedded \r\n nonce = atmSessionMessage.getNonce();\r\n double value = transactionMessage.getValue();\r\n \r\n //print the timestamp when the transaction takes place\r\n Date now = new Date();\r\n System.out.println(\"\\n\" + now.toString());\r\n \r\n //re-route the request to the appropriate handling function\r\n if(transactionOperation == TransactionOperation.Deposit) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" DEPOSIT: \" + value);\r\n currAcct.deposit(value);\r\n \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Deposit Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.Withdraw) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" WITHDRAW: \" + value);\r\n \t currAcct.withdraw(value);\r\n \t \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Withdrawal Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.EndSession) \r\n \t {\r\n \t \tSystem.out.println(\"\\nTerminating session with ACCT#: \" + currAcct.getNumber());\r\n \t \treturn false;\r\n \t \t\r\n \t }\r\n \r\n accts.save();\r\n //create a successful reply Success and set the balance\r\n balance = currAcct.getBalance(); \r\n transactionMessage = new TransactionMessage(MessageType.ResponseSuccess,transactionOperation,balance);\r\n atmSessionMessage = new ATMSessionMessage(transactionMessage);\r\n \r\n //set the nonce \r\n atmSessionMessage.setNonce(nonce);\r\n currTimeStamp = atmSessionMessage.getTimeStamp();\r\n //encrypt the response and send it\r\n cipherText = crypto.encryptRijndael(atmSessionMessage, kSession);\r\n os.writeObject((Serializable)cipherText);\r\n \r\n //Logging.....\r\n //get the signed message and encrypt it\r\n \r\n signedMessage.encryptMessage(this.kLog);\r\n \r\n //encrypt the action\r\n //archive the signed message for logging and non-repudiation purposes \r\n SignedAction signedAction = new SignedAction(currAcct.getNumber(), atmSessionMessage.getTimeStamp(), signedMessage);\r\n \r\n //flush out transaction record to the audit file\r\n BankServer.log.write(signedAction);\r\n \r\n\t return true;\r\n }\r\n catch(Exception e){\r\n if(e instanceof TransException) replyFailure(transactionOperation,nonce);\r\n System.out.println(\"Terminating session with ACCT#: \" + currAcct.getNumber());\r\n \t//e.printStackTrace();\r\n \r\n return true;\r\n }\r\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutput();", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_3() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return transactions_.get(index);\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "protected void pktsOut(int n) {}", "@Test\n\tpublic void testTransfer() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"acc2\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(02, \"acc1\", 00000, 200.00, \"\"));\n\t\ttransactions.add(2, new Transaction(02, \"acc2\", 00001, 200.00, \"\"));\n\t\ttransactions.add(3, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\t// ArrayList<Account> expected = new ArrayList();\n\t\t// expected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\t\t// expected.add(1, new Account(00001, \"acc2\", true, 1050.00, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Money Transfered\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"money not transfered\", testResult);\n\t}", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputOrBuilder();", "public void calculatePayment() {}", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_4_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString ticketId = roc.createTickets(1, true)[0].get(\"ticketId\").getAsString();\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tuserData, ticketId);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true, ticketId);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void fixedPayerAndReceiverTest() {\n double fixedRate = 0.015;\n GeneratorAttributeIR attribute = new GeneratorAttributeIR(Period.ofYears(7));\n double notional = 1.0e8;\n ZonedDateTime date = DateUtils.getUTCDate(2013, 9, 10);\n SwapFixedIborDefinition def1 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute);\n SwapFixedIborDefinition def2 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, true);\n assertEquals(def1, def2);\n SwapFixedIborDefinition def3 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, false);\n assertFalse(def1.equals(def3));\n int nIbor = def1.getIborLeg().getNumberOfPayments();\n int nFixed = def1.getFixedLeg().getNumberOfPayments();\n assertEquals(nIbor, def3.getIborLeg().getNumberOfPayments());\n assertEquals(nFixed, def3.getFixedLeg().getNumberOfPayments());\n assertEquals(def1.getIborLeg().getIborIndex(), def3.getIborLeg().getIborIndex());\n assertEquals(def1.getIborLeg().getCalendar(), def3.getIborLeg().getCalendar());\n assertEquals(def1.getCurrency(), def3.getIborLeg().getCurrency());\n for (int i = 0; i < nIbor; ++i) {\n CouponIborDefinition ibor1 = def1.getIborLeg().getNthPayment(i);\n CouponIborDefinition ibor3 = def3.getIborLeg().getNthPayment(i);\n assertEquals(ibor1.getNotional(), -ibor3.getNotional());\n assertEquals(ibor1.getAccrualStartDate(), ibor3.getAccrualStartDate());\n assertEquals(ibor1.getAccrualEndDate(), ibor3.getAccrualEndDate());\n assertEquals(ibor1.getFixingDate(), ibor3.getFixingDate());\n assertEquals(ibor1.getPaymentDate(), ibor3.getPaymentDate());\n assertEquals(ibor1.getPaymentYearFraction(), ibor3.getPaymentYearFraction());\n }\n for (int i = 0; i < nFixed; ++i) {\n CouponFixedDefinition fixed1 = def1.getFixedLeg().getNthPayment(i);\n CouponFixedDefinition fixed3 = def3.getFixedLeg().getNthPayment(i);\n assertEquals(fixed1.getNotional(), -fixed3.getNotional());\n assertEquals(fixed1.getAccrualStartDate(), fixed3.getAccrualStartDate());\n assertEquals(fixed1.getAccrualEndDate(), fixed3.getAccrualEndDate());\n assertEquals(fixed1.getPaymentDate(), fixed3.getPaymentDate());\n assertEquals(fixed1.getPaymentYearFraction(), fixed3.getPaymentYearFraction());\n }\n }", "public static Transaction generateSendTransaction(String strPrivateKey, String creatorAddress, String receiverAddress,\n TransactionHistory transactionHistory) {\n List<Creation> creations = new ArrayList<Creation>();\n List<Input> inputs = new ArrayList<Input>();\n List<Output> outputs = new ArrayList<Output>();\n\n // Get sender address from private key\n BigInteger privateKey = Bitcoin.decodePrivateKey(strPrivateKey);\n byte[] publicKey = Bitcoin.generatePublicKey(privateKey);\n String senderAddress = Bitcoin.publicKeyToAddress(publicKey);\n\n // Variable for counting number of coupons in referred transaction outputs\n int couponsInInputs = 0;\n\n // Find previous transaction outputs to refer to\n Iterator<Transaction> transactionIterator = transactionHistory.iterator();\n while (transactionIterator.hasNext() && couponsInInputs < 1) {\n Transaction transaction = transactionIterator.next();\n Iterator<Output> outputIterator = transaction.getOutputs().iterator();\n while (outputIterator.hasNext() && couponsInInputs < 1) {\n Output output = outputIterator.next();\n if (output.getCreatorAddress().equals(creatorAddress) && output.getAddress().equals(senderAddress)\n && output.getInputId() == 0) {\n Input input = new Input(output.getOutputId());\n inputs.add(input);\n couponsInInputs += output.getAmount();\n }\n }\n }\n\n // Check if enough coupons are available\n if (couponsInInputs <= 0) {\n throw new IllegalArgumentException();\n }\n\n // Set that 1 coupon should be sent to receiver address\n Output output = new Output(creatorAddress, 1, receiverAddress);\n outputs.add(output);\n\n // Send remaining coupons in referred transaction outputs back to the user as change\n if (couponsInInputs > 1) {\n Output changeOutput = new Output(creatorAddress, couponsInInputs - 1, senderAddress);\n outputs.add(changeOutput);\n }\n\n // Create transaction, sign it and return it\n Transaction transaction = new Transaction(creations, inputs, outputs);\n transaction.signTransaction(privateKey);\n return transaction;\n\n }", "public int[] getTsumoPayment(boolean isDealer) {\r\n int[] output = new int[2];\r\n if (isDealer) {\r\n output[0] = basicPoints * 2;\r\n output[1] = 0;\r\n } else {\r\n output[0] = basicPoints * 1;\r\n output[1] = basicPoints * 2;\r\n }\r\n output[0] = (int)(100*Math.ceil(output[0]/100.0));\r\n output[1] = (int)(100*Math.ceil(output[1]/100.0));\r\n \r\n return output;\r\n }", "@Test\n\tpublic void validateSignatureBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock newBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE VALID\n\t\tassertEquals(true, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\ttransactionsSignature = new byte[64];\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID GENERATOR SIGNATURE\n\t\tnewBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), newBlock.getTimestamp(), newBlock.getGeneratingBalance(), generator, new byte[32]);\n\t\ttransactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t///CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//VALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = newBlock.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID TRANSACTION SIGNATURE\n\t\tassertEquals(true, newBlock.isSignatureValid());\t\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tpayment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(200).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK INVALID TRANSACTION SIGNATURE\n\t\tassertEquals(false, newBlock.isSignatureValid());\t\n\t}", "public double sumTransactions() {\n\t\treturn checkIfTransactionsExist(true);\n\t}", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "public void printTransactions() {\n for (int i = 0; i < transactions.size(); i++) {\n\t\t\tint indeks = i+1;\n\t\t\tSystem.out.println(\"Transactions \" + indeks + \": \" + transactions.get(i).getType() + \" \" + transactions.get(i).getAmount());\n\t\t}\n }", "@Override\r\n\tpublic byte[] countersign(final byte[] sign,\r\n final String algorithm,\r\n final CounterSignTarget targetType,\r\n final Object[] targets,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException {\r\n throw new UnsupportedOperationException(\"No es posible realizar contrafirmas de ficheros ODF\"); //$NON-NLS-1$\r\n }", "public int updatePayment2(int requestId, int amount);", "private void convertTransactionToBitStream(){\n bitTransactionList = new ArrayList<>();\n itemListMap2 = new HashMap<>();\n \n for(int i=0; i<transactions_set.size(); i++){\n ArrayList curr_tr = transactions_set.get(i);\n \n if(curr_tr.size() >= min_itemset_size_K){ \n int freqItem = 0;\n BitSet bitset = new BitSet(bitsetLen);\n \n for(int j=0; j<curr_tr.size(); j++){\n try{\n int item = (int)curr_tr.get(j);\n bitset.set(itemIndex.get(item), true);\n freqItem++;\n }\n catch(Exception e){}\n }\n if(freqItem >= min_itemset_size_K){\n bitTransactionList.add(bitset);\n// System.out.println(bitset);\n HashSet<BitSet> subset_2 = createSubsetsOfLen2(bitset);\n for(BitSet sub_b : subset_2){\n itemListMap2.put(sub_b, itemListMap2.getOrDefault(sub_b, 0)+1);\n }\n }\n }\n }\n \n itemListMap2.values().removeIf(val -> val<min_sup);\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_5_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t\t\r\n\t\t\t\tHashMap<String,Object> o2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t\t\r\n\t\t\t\to = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\to2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return instance.getTransactions(index);\n }", "protected int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws IOException {\n return serializator.write(output, mostSigBits) +\n serializator.write(output, leastSigBits);\n }", "public void onOutputSpent(MoneroOutputWallet output);", "public static void main(String[] args)\n\t{\n \n\t\tSystem.out.println(\"Enter the size of transaction array\");\n int trSize = sc.nextInt();\n\n // creating an array of provided size\n int[] transactions = new int[trSize];\n \n // get the elements of the array (in a loop)\n System.out.println(\"Enter the values of array\");\n for (int i = 0; i < transactions.length; i++) {\n transactions[i] = sc.nextInt();\n }\n // get the number of targets\n System.out.println(\"Enter the total no of targets that needs to be achieved\");\n int numTargets = sc.nextInt();\n \n // get in target one-by-one (loop)\n for (int i = 0; i < numTargets; i++) {\n \n \t// Get TargetValue\n System.out.println(\"Enter the value of target\");\n int target = sc.nextInt();\n \n int sum =0;\n for ( int j=0; j < transactions.length; j++) {\n \tsum = sum + transactions[j];\n \t\n \tif ( sum >= target) {\n \tSystem.out.println(\"Target achieved after \" + (j+1) + \" transactions\" );\n \tbreak; // break out of the innermost for loop\n \t}\n \t\n \t//we come to the last transactions, yet target is not achieved\n \tif (j == transactions.length - 1) {\n \t\tSystem.out.println( \"Given target is not achieved\");\n \t}\n \t\n }\n \n \n\t}\n\n}", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public double calculatePay() {\n\t\treturn 0;\r\n\t}", "public byte[] signNativeByTransDataDefault(UInt256 uInt256) {\n return new byte[0];\n }", "@Suspendable\n @Override\n protected void checkTransaction(SignedTransaction stx) throws FlowException {\n }", "com.google.protobuf.ByteString\n getOutputBytes();", "com.google.protobuf.ByteString\n getTranCodeBytes();", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "public float getInputsValue() {\n\t\tfloat total = 0;\n\t\tfor (TransactionInput i : inputs) {\n\t\t\tif (i.getUTXO() == null)\n\t\t\t\tcontinue; // if Transaction can't be found skip it\n\t\t\ttotal += i.getUTXO().getValue();\n\t\t}\n\t\treturn total;\n\t}", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_1() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }" ]
[ "0.61595416", "0.5966926", "0.5893284", "0.57574815", "0.57380486", "0.56829846", "0.5668829", "0.5640629", "0.55908084", "0.5576276", "0.549149", "0.5468646", "0.5428697", "0.5360827", "0.5360827", "0.5360827", "0.5346331", "0.5305661", "0.525313", "0.52381736", "0.51885766", "0.5148147", "0.51314443", "0.5125945", "0.51255107", "0.50846374", "0.5060251", "0.50338894", "0.50077987", "0.4994864", "0.49875298", "0.49698073", "0.49698073", "0.49698073", "0.49596593", "0.4949018", "0.49411756", "0.49386016", "0.4928867", "0.49035704", "0.49003276", "0.48912862", "0.48795715", "0.48694947", "0.48674142", "0.48642266", "0.48613507", "0.48246202", "0.47959137", "0.47953072", "0.47908524", "0.47715572", "0.47715572", "0.47715572", "0.4765489", "0.4753552", "0.47508267", "0.47471234", "0.47317925", "0.47285673", "0.47285673", "0.4719286", "0.47174066", "0.4714295", "0.47125024", "0.46985352", "0.46933845", "0.46927908", "0.46907243", "0.46877164", "0.46726155", "0.46705523", "0.46680796", "0.46678", "0.46671906", "0.4663788", "0.46598783", "0.4658921", "0.4658921", "0.4658921", "0.46515226", "0.4651428", "0.46477026", "0.4641957", "0.46230626", "0.4621864", "0.46166465", "0.46140277", "0.46129876", "0.46080026", "0.46053308", "0.4601807", "0.4601678", "0.45944613", "0.45911747", "0.4586006", "0.45831758", "0.4578833", "0.4576443", "0.45755768", "0.4566767" ]
0.0
-1
Signed transactions that satisfy PaymentDetails.outputs repeated bytes transactions = 2;
com.google.protobuf.ByteString getTransactions(int index);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testValidOutputValues() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, -20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(-20, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testNoDoubleSpending() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Alice wants double spending: transfers 10 coins to Bob, 20 to Cal again\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1: input 0\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n\n // Sign for tx1: input 1\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(1).addSignature(sig2);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testHandleTxs() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // Cal transfers 5 coins to Bob, Bob transfers 2 coins to Alice\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0); // index 0 refers to output 1 of tx1\n tx2.addInput(tx1.getHash(), 1); // index 1 refers to output 1 of tx1\n tx2.addOutput(2, kpAlice.getPublic());\n tx2.addOutput(5, kpBob.getPublic());\n\n // Sign for tx2\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx2.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(0).addSignature(sig2);\n\n byte[] sig3 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpCal.getPrivate());\n sig.update(tx2.getRawDataToSign(1));\n sig3 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(1).addSignature(sig3);\n tx2.finalize();\n\n // Alice transfers 3 coins to Cal\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(), 0);\n tx3.addOutput(3, kpCal.getPublic());\n\n // Sign for tx3\n byte[] sig4 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx3.getRawDataToSign(0));\n sig4 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx3.getInput(0).addSignature(sig4);\n tx3.finalize();\n\n Transaction[] acceptedTx = txHandler.handleTxs(new Transaction[] {tx1, tx2, tx3});\n // tx1, tx2 supposed to be valid, tx3 supposed to be invalid\n assertEquals(acceptedTx.length, 2);\n // assertFalse(txHandler.isValidTx(tx3));\n }", "public boolean processTransaction() {\n\n // Checks to see if the signature can be verified.\n if (verifySignature() == false) {\n System.out.println(\"# Transaction signature could not be verified.\");\n return false;\n }\n\n // Gathers all transaction inputs, making sure they are unspent.\n for (TransactionInput i : inputs) {\n i.UTXO = BasicBlockchain.UTXOs.get(i.transactionOutputId);\n }\n\n // Checks if transaction amount is valid.\n if (getInputsValue() < BasicBlockchain.minimumTransaction) {\n System.out.println(\"# Transaction inputs are too small.\");\n return false;\n }\n\n // Generates transaction outputs.\n // Get value of the inputs then the leftover change.\n float leftOver = getInputsValue() - value;\n transactionId = calculateHash();\n // Send value to recipient.\n outputs.add(new TransactionOutput(this.recipient, value, transactionId));\n // Send the leftover \"change\" back to sender.\n outputs.add(new TransactionOutput(this.sender, leftOver, transactionId));\n\n\n // Adds outputs to the unspent list.\n for (TransactionOutput o : outputs) {\n BasicBlockchain.UTXOs.put(o.id, o);\n }\n\n // Removes the transaction inputs from the blockchain's UTXO list as spent.\n for (TransactionInput i : inputs) {\n if (i.UTXO == null) continue;\n BasicBlockchain.UTXOs.remove(i.UTXO.id);\n }\n\n return true;\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutput();", "public static void main(String[] args) throws AddressFormatException {\n\n// generateMultisig();\n String getSignedTransaction = signFirstTime();\n String rawtx = signSecondTime(getSignedTransaction);\n\n System.out.println(\"rawtx ->\"+ rawtx);\n }", "private static String signFirstTime() throws AddressFormatException\n {\n ECKey key1 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n\n\n // Use the redeem script we have saved somewhere to start building the transaction\n Script redeemScript = new Script(hexStringToByteArray(\"5221021ae8964b8529dc3e52955f2cabd967e08c52008dbcca8e054143b668f3998f4a210306be609ef37366ab0f3dd4096ac23a6ee4d561fc469fa60003f799b0121ad1072102199f3d89fa00e6f55dd6ecdd911457d7264415914957db124d53bf0064963f3853ae\"));\n\n // Start building the transaction by adding the unspent inputs we want to use\n // The data is taken from blockchain.info, and can be found here: https://blockchain.info/rawtx/ca1884b8f2e0ba88249a86ec5ddca04f937f12d4fac299af41a9b51643302077\n Transaction spendTx = new Transaction(params);\n ScriptBuilder scriptBuilder = new ScriptBuilder();\n scriptBuilder.data(new String(\"a9145204ad7c5fa5a2491cd91c332e28c87221194ca087\").getBytes()); // Script of this output\n TransactionInput input = spendTx.addInput(new Sha256Hash(\"fed695bf5e2c15286956a7bd3464c5beb97ef064e1f9406eba189ea844733e7c\"), 1, scriptBuilder.build());\n\n // Add outputs to the person receiving bitcoins\n Address receiverAddress = new Address(params, \"n2cWhs5sbWFCwzuuWWsVM9ubPwykGtX75T\");\n Coin charge = Coin.valueOf(1000000); // 0.1 mBTC\n Script outputScript = ScriptBuilder.createOutputScript(receiverAddress);\n spendTx.addOutput(charge, outputScript);\n\n /*8888888888888888888888888888888888888888888888888888888888888*/\n\n // Sign the first part of the transaction using private key #1\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature ecdsaSignature = key1.sign(sighash);\n TransactionSignature transactionSignarture = new TransactionSignature(ecdsaSignature, Transaction.SigHash.ALL, false);\n\n // Create p2sh multisig input script\n Script inputScript = ScriptBuilder.createP2SHMultiSigInputScript(Arrays.asList(transactionSignarture), redeemScript);\n\n // Add the script signature to the input\n input.setScriptSig(inputScript);\n System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "private ArrayList<Long> storeTransactionInputs(long transactionId, ArrayList<TransactionInput> inputs, int isCoinbase){\n \t\tint inputindex = 0;\n \t\tlong previousOutputId;\n \t\tString prevOutputHash;\n \t\tResultSet findOutputResults;\n \t\tResultSet generatedKey;\n \t\tLong addressId;\n \t\tArrayList<Long> addressIdz=new ArrayList<Long>();\n \t\ttry {\n \t\tfor (TransactionInput i : inputs) {\n\t\t\t\n \t\t\tprevOutputHash = HexBin.encode(i.outpoint.hash);\n \t\t\tfindTransactionOutputStatement.setString(1, prevOutputHash);\n \t\t\tfindTransactionOutputStatement.setLong(2, i.outpoint.index);\n \t\t\tfindOutputResults = findTransactionOutputStatement\n \t\t\t\t\t.executeQuery();\n \t\t\tif (findOutputResults.next()) {\n \t\t\t\tpreviousOutputId = findOutputResults.getLong(1);\n\t\t\t\taddressId=findOutputResults.getLong(2);\n \t\t\t} else {\n \t\t\t\tpreviousOutputId = 0;\n\t\t\t\taddressId=null;\n \t\t\t}\n \t\t\tfindOutputResults.close();\n \t\t\tinsertTransactionInputStatement.setLong(1, transactionId);\n \t\t\tinsertTransactionInputStatement.setInt(2, inputindex);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(3, previousOutputId);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setString(4, prevOutputHash);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(5, i.outpoint.index);\n \t\t\tinsertTransactionInputStatement.setLong(6,\n \t\t\t\t\ti.scriptBytes.length);\n \t\t\tinsertTransactionInputStatement.setString(7,\n \t\t\t\t\tHexBin.encode(i.scriptBytes));\n \t\t\tinsertTransactionInputStatement.setLong(8, i.sequence);\n \t\t\tinsertTransactionInputStatement.setBoolean(9,\n \t\t\t\t\ti.isCoinBase());\n\t\t\tif(addressId!=null){\n \t\t\t\tinsertTransactionInputStatement.setLong(10,addressId);\n \t\t\t\taddressIdz.add(addressId);\n\t\t\t} else {\n \t\t\t\t// TODO Auto-generated catch block\n \t\t\t\tinsertTransactionInputStatement.setNull(10,\n \t\t\t\t\t\tjava.sql.Types.INTEGER);\n \t\t\t}\n \t\t\tinsertTransactionInputStatement.execute();\n \t\t\t\n \t\t}\n \t\t\n \t\t\n \t} catch (SQLException e1) {\n \t\t// TODO Auto-generated catch block\n \t\te1.printStackTrace();\n \t}\n \t\treturn addressIdz;\n \t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputOrBuilder();", "List<TransactionVO> addPendingTransactions(List<SignedTransaction> transactions);", "@Test\n public void TxHandlerTestThird() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid output number(wrong number of coins to transfer)\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1 scrooge to alice 20coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: Alice --> Bob -5coins [*Invalid output number*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(-5, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n // tx3: Alice --> Bob 90coins [*Invalid output number*]\n Transaction tx3 = new Transaction();\n tx3.addInput(tx1.getHash(), 0);\n tx3.addOutput(90, pkBob.getPublic());\n tx3.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n }", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "private static String signSecondTime(String transactionString)\n {\n Transaction spendTx = new Transaction(params, hexStringToByteArray(transactionString));\n\n // Get the input chunks\n Script inputScript = spendTx.getInput(0).getScriptSig();\n List<ScriptChunk> scriptChunks = inputScript.getChunks();\n\n // Create a list of all signatures. Start by extracting the existing ones from the list of script schunks.\n // The last signature in the script chunk list is the redeemScript\n List<TransactionSignature> signatureList = new ArrayList<TransactionSignature>();\n Iterator<ScriptChunk> iterator = scriptChunks.iterator();\n Script redeemScript = null;\n\n while (iterator.hasNext())\n {\n ScriptChunk chunk = iterator.next();\n\n if (iterator.hasNext() && chunk.opcode != 0)\n {\n TransactionSignature transactionSignarture = TransactionSignature.decodeFromBitcoin(chunk.data, false);\n signatureList.add(transactionSignarture);\n } else\n {\n redeemScript = new Script(chunk.data);\n }\n }\n\n // Create the sighash using the redeem script\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature secondSignature;\n\n // Take out the key and sign the signhash\n //ECKey key2 = createKeyFromSha256Passphrase(\"Super secret key 2\");\n ECKey key2 = ECKey.fromPrivate(new BigInteger(\"68123968917867656952640885027449260190826636504009580537802764798766700329220\"));\n// ECKey key2 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n secondSignature = key2.sign(sighash);\n\n // Add the second signature to the signature list\n TransactionSignature transactionSignarture = new TransactionSignature(secondSignature, Transaction.SigHash.ALL, false);\n signatureList.add(transactionSignarture);\n\n // Rebuild p2sh multisig input script\n inputScript = ScriptBuilder.createP2SHMultiSigInputScript(signatureList, redeemScript);\n spendTx.getInput(0).setScriptSig(inputScript);\n\n //System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "@Test\n public void testOutputsInUTXOPool() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is NOT put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // UTXO pool does not contains the UTXO\n assertFalse(txHandler.isValidTx(tx1));\n\n // Put output of createCoinTx to the pool\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler1 = new TxHandler(utxoPool);\n\n // UTXO pool now contains the UTXO\n assertTrue(txHandler1.isValidTx(tx1));\n }", "@Test\n public void testValidBalance() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 100 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(100, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "RequestResult postSignRequests(TriphaseRequest[] requests) throws IOException,\n CertificateEncodingException, SAXException;", "public IBankTransfert payment();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static boolean isSigned_entries_receiveEst() {\n return false;\n }", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "@Suspendable\n @Override\n public SignedTransaction call() throws FlowException {\n\n Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);\n//\n\n // Source\n AccountInfo issuerOwner = subFlow(new AccountInfoByName(acctNameSource)).get(0).getState().getData();\n PublicKey issuerOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty issuerOwnerAnonParty = new AnonymousParty(issuerOwnerKey);\n\n AccountInfo targetOwner = subFlow(new AccountInfoByName(acctNameTarget)).get(0).getState().getData();\n PublicKey targetOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty targetOwnerAnonParty = new AnonymousParty(targetOwnerKey);\n\n\n AssetForAccountState outputAsset = new AssetForAccountState(issuerOwnerAnonParty, targetOwnerAnonParty,\n asset.getState().getData().getName(), asset.getState().getData().getValue());\n\n\n TransactionBuilder txBuilder = new TransactionBuilder(notary)\n .addInputState(asset)\n .addOutputState(outputAsset, AssetForAccountContract.ID)\n .addCommand(new AssetForAccountContract.Commands.Transfer(), issuerOwnerKey);\n\n txBuilder.verify(getServiceHub());\n\n SignedTransaction fullySignedTransaction = getServiceHub().signInitialTransaction(txBuilder, issuerOwnerKey);\n\n //return fullySignedTransaction;\n return subFlow(new FinalityFlow(fullySignedTransaction, Collections.emptyList()));\n }", "private boolean areOutputsSpent(Transaction tx){\n // Need to see if tx inputs are contained in the blockchain UTXOs\n for(TransactionInput i : tx.inputs){\n if(!currentBlockchain.UTXOs.containsKey(i.previousOutId)){\n return true;\n }\n }\n return false;\n }", "BigInteger getDigitalSignature();", "public static long deepTransactionCheck(Transaction tx, UtxoUpdateBuffer utxo_buffer, BlockHeader block_header, NetworkParams params)\n throws ValidationException\n {\n try(TimeRecordAuto tra_blk = TimeRecord.openAuto(\"Validation.deepTransactionCheck\"))\n {\n TransactionInner inner = null;\n\n try\n {\n inner = TransactionInner.parseFrom(tx.getInnerData());\n }\n catch(java.io.IOException e)\n {\n throw new ValidationException(\"error parsing tx on second pass somehow\", e);\n }\n\n long sum_of_inputs = 0L;\n // Make sure all inputs exist\n for(TransactionInput in : inner.getInputsList())\n {\n TransactionOutput matching_out = utxo_buffer.getOutputMatching(in);\n if (matching_out == null)\n {\n throw new ValidationException(String.format(\"No matching output for input %s\", new ChainHash(in.getSrcTxId())));\n }\n validateSpendable(matching_out, block_header, params);\n sum_of_inputs += matching_out.getValue();\n\n // SIP-4 check\n if (block_header.getBlockHeight() >= params.getActivationHeightTxInValue())\n {\n if (in.getValue() != 0L)\n {\n if (in.getValue() != matching_out.getValue())\n {\n throw new ValidationException(String.format(\"Input value does not match: %d %d\", matching_out.getValue(), in.getValue()));\n }\n }\n }\n utxo_buffer.useOutput(matching_out, new ChainHash(in.getSrcTxId()), in.getSrcTxOutIdx());\n }\n\n long spent = 0L;\n // Sum up all outputs\n int out_idx =0;\n ArrayList<ByteString> raw_output_list = TransactionUtil.extractWireFormatTxOut(tx);\n\n for(TransactionOutput out : inner.getOutputsList())\n {\n validateTransactionOutput(out, block_header, params);\n spent+=out.getValue();\n utxo_buffer.addOutput(raw_output_list, out, new ChainHash(tx.getTxHash()), out_idx);\n out_idx++;\n\n }\n\n spent+=inner.getFee();\n\n if (!inner.getIsCoinbase())\n {\n if (sum_of_inputs != spent)\n {\n throw new ValidationException(String.format(\"Transaction took in %d and spent %d\", sum_of_inputs, spent));\n }\n }\n \n return inner.getFee();\n }\n }", "@Test\n public void TxHandlerTestSecond() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the double spending\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(25, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1: one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx 2:Scrooge --> Bob 20coins [*Double-spending*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx0.getHash(), 0);\n tx2.addOutput(25, pkBob.getPublic());\n tx2.signTx(pkScrooge.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n\n }", "String signITRByAssesse(String PAN,String xml, DigitalSignatureWrapper digitalSignatureWrapper) throws MissingPrivateKeyException,InvalidDigitalSignatureException,Exception;", "public boolean processTransaction() {\r\n\t\t\r\n\t\t\tif(verifySignature() == false) {\r\n\t\t\t\tSystem.out.println(\"#Transaction Signature failed to verify\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\ttransactionId = calulateHash();\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "public static boolean isSigned_receivets() {\n return true;\n }", "@Override\n public boolean isValid() {\n final BlockChainInt outputHash = getOutputHash();\n\n return inputs.stream().map(input -> input.verifySignature(outputHash)).reduce(true, (a, b) -> a && b)\n && outputs.stream().map(output -> output.getAmount() >= 0).reduce(true, (a, b) -> a && b)\n && getTransactionFee() >= 0;\n }", "@Override\n public void run() {\n byte[] deviceTxPayload = CoreServices.getOrCreateHardwareWalletService().get().getContext().getSerializedTx().toByteArray();\n\n log.info(\"DeviceTx payload:\\n{}\", Utils.HEX.encode(deviceTxPayload));\n\n // Load deviceTx\n Transaction deviceTx = new Transaction(MainNetParams.get(), deviceTxPayload);\n\n log.info(\"deviceTx:\\n{}\", deviceTx.toString());\n\n // Check the signatures are canonical\n for (TransactionInput txInput : deviceTx.getInputs()) {\n byte[] signature = txInput.getScriptSig().getChunks().get(0).data;\n if (signature != null) {\n log.debug(\n \"Is signature canonical test result '{}' for txInput '{}', signature '{}'\",\n TransactionSignature.isEncodingCanonical(signature),\n txInput.toString(),\n Utils.HEX.encode(signature));\n } else {\n log.warn(\"No signature data\");\n }\n }\n\n log.debug(\"Committing and broadcasting the last tx\");\n\n BitcoinNetworkService bitcoinNetworkService = CoreServices.getOrCreateBitcoinNetworkService();\n\n if (bitcoinNetworkService.getLastSendRequestSummaryOptional().isPresent()\n && bitcoinNetworkService.getLastWalletOptional().isPresent()) {\n\n SendRequestSummary sendRequestSummary = bitcoinNetworkService.getLastSendRequestSummaryOptional().get();\n\n // Check the unsigned and signed tx are essentially the same as a check against malware attacks on the Trezor\n if (TransactionUtils.checkEssentiallyEqual(sendRequestSummary.getSendRequest().get().tx, deviceTx)) {\n // Substitute the signed tx from the trezor\n log.debug(\n \"Substituting the Trezor signed tx '{}' for the unsigned version {}\",\n deviceTx.toString(),\n sendRequestSummary.getSendRequest().get().tx.toString()\n );\n sendRequestSummary.getSendRequest().get().tx = deviceTx;\n log.debug(\"The transaction fee was {}\", sendRequestSummary.getSendRequest().get().fee);\n\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_TRANSACTION_CREATED_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n\n // Get the last wallet\n Wallet wallet = bitcoinNetworkService.getLastWalletOptional().get();\n\n // Commit and broadcast\n bitcoinNetworkService.commitAndBroadcast(sendRequestSummary, wallet, paymentRequestData);\n\n // Ensure the header is switched off whilst the send is in progress\n ViewEvents.fireViewChangedEvent(ViewKey.HEADER, false);\n } else {\n // The signed transaction is essentially different from what was sent to it - abort send\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_FAILURE_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n }\n } else {\n log.debug(\"Cannot commit and broadcast the last send as it is not present in bitcoinNetworkService\");\n }\n // Clear the previous remembered tx\n bitcoinNetworkService.setLastSendRequestSummaryOptional(Optional.<SendRequestSummary>absent());\n bitcoinNetworkService.setLastWalletOptional(Optional.<Wallet>absent());\n }", "@Test\n public void TxHandlerTestForth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid signature\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx1: scrooge to alice 20 coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: alice to bob 20coins[signed by bob]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(20, pkBob.getPublic());\n tx2.signTx(pkBob.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n }", "@Override\n public byte[] createDataToSignInput(\n Transaction transaction,\n int inputIndex,\n long amountInSat,\n PublicKeyTriple publicKeyTriple) {\n\n final byte[] redeemScript = createRedeemScript(publicKeyTriple);\n\n return TransactionHelpers.getDataToSign(\n transaction,\n inputIndex,\n new Script(redeemScript)\n );\n }", "public TransactionResponse processAllTransaction() throws ParseException {\n TransactionResponse response = new TransactionResponse();\n\n //User0\n response.setTransaction(new Transaction(\"user0\",\"0001\", \"type0\",\"user0_Billing\",\"user0_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-00\")));\n\n //User1\n response.setTransaction(new Transaction(\"user1\", \"0101\",\"type0\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user1\", \"0102\", \"type1\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-00\")));\n\n //User2\n response.setTransaction(new Transaction(\"user2\", \"0201\", \"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-01-00\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0202\", \"type2\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0203\",\"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n //User3\n response.setTransaction(new Transaction(\"user3\", \"0301\",\"type0\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user3\", \"0302\",\"type1\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n return response;\n }", "com.dogecoin.protocols.payments.Protos.Output getOutputs(int index);", "@Test\n public void TxHandlerTestFifth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the input not in the UtxoPool\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n //tx1: Scrooge --> Alice 20coins [Pay Coins *NOT added to UTXO pool* due to accidents]\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n utxo = new UTXO(tx1.getHash(),0);\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n utxoPool.removeUTXO(utxo);\n assertTrue(\"tx1:UTXO has been removed.\", utxoPool.getAllUTXO().size() == 0);\n\n\n // tx2: Alice --> Bob 15coins [Pay Coins *Previous Tx NOT in UTXO pool*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(15, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 0);\n\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "private static void createDummyTransactions() {\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 10L, new Transaction(10000d, \"cars\", 0L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 11L, new Transaction(15000d, \"shopping\", 10L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 12L, new Transaction(20000d, \"keys\", 11L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 13L, new Transaction(25000d, \"furniture\", 12L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 14L, new Transaction(30000d, \"keys\", 13L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 15L, new Transaction(40000d, \"cars\", 14L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 16L, new Transaction(50000d, \"cars\", 15L)));\n }", "@Test\n public void TxHandlerTestFirst() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test some basic functions of TxHandler\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n // tx0: Scrooge --> Scrooge 25coins [Create Coins]\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx( pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n\n // tx1: Scrooge --> Scrooge 4coins [Divide Coins]\n //\t Scrooge --> Scrooge 5coins\n //\t Scrooge --> Scrooge 6coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(),0);\n\n tx1.addOutput(4,pkScrooge.getPublic());\n tx1.addOutput(5,pkScrooge.getPublic());\n tx1.addOutput(6,pkScrooge.getPublic());\n\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx2: Scrooge --> Alice 4coins [Pay separately]\n //\t Scrooge --> Alice 5coins\n // Scrooge --> Bob 6coins\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addInput(tx1.getHash(), 1);\n tx2.addInput(tx1.getHash(), 2);\n\n tx2.addOutput(4, pkAlice.getPublic());\n tx2.addOutput(5, pkAlice.getPublic());\n tx2.addOutput(6, pkBob.getPublic());\n\n tx2.signTx(pkScrooge.getPrivate(), 0);\n tx2.signTx(pkScrooge.getPrivate(), 1);\n tx2.signTx(pkScrooge.getPrivate(), 2);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx3:Alice --> Alice 2coins [Divide Coins]\n // Alice --> Alice 2coins\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(),0);\n\n tx3.addOutput(2, pkAlice.getPublic());\n tx3.addOutput(2, pkAlice.getPublic());\n\n tx3.signTx(pkAlice.getPrivate(),0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 4);\n\n // tx4: Alice --> Bob 2coins [Pay jointly]\n // Alice --> Bob 5coins\n Transaction tx4 = new Transaction();\n tx4.addInput(tx3.getHash(),0);\n tx4.addInput(tx2.getHash(),1);\n\n tx4.addOutput(7, pkBob.getPublic());\n\n tx4.signTx(pkAlice.getPrivate(), 0);\n tx4.signTx(pkAlice.getPrivate(),1);\n\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx4) returns: \" + txHandler.isValidTx(tx4));\n assertTrue(\"tx4:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx4}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx4:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n// System.out.println(\"tx4.hashCode returns: \" + tx4.hashCode());\n }", "public ParametricStatement[] createForPaymentTransaction(PaymentTransaction paymentTransaction)\n throws SQLException {\n int multiplier = 1;\n Date date = paymentTransaction.getProcessDate();\n if (paymentTransaction instanceof VoidTransaction) {\n VoidTransaction trans = (VoidTransaction)paymentTransaction;\n ITransaction originalTrans = trans.getOriginalTransaction();\n if (originalTrans instanceof PaymentTransaction) {\n multiplier = -1;\n paymentTransaction = (PaymentTransaction)originalTrans;\n } else {\n // Do nothing if original was not a payment transaction.\n return new ParametricStatement[0];\n }\n }\n ArrayList parametricStatements = new ArrayList();\n String storeId = paymentTransaction.getStore().getId();\n String operatorId = paymentTransaction.getTheOperator().getId();\n // String registerId = paymentTransaction.getId();\n // int registerIdIndex = registerId.indexOf('*') + 1;\n // registerId = registerId.substring(registerIdIndex, registerId.indexOf('*', registerIdIndex));\n String registerId = paymentTransaction.getRegisterId();\n PaymentSummary[] currentPaymentSummaries = this.selectByDateStoreId(date, storeId);\n List newPaymentSummaries = new ArrayList();\n Payment[] payments = paymentTransaction.getPaymentsArray();\n for (int paymentIndex = 0; paymentIndex < payments.length; paymentIndex++) {\n ArmCurrency paymentAmount = payments[paymentIndex].getAmount().multiply(multiplier);\n String paymentType = payments[paymentIndex].getTransactionPaymentName();\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n boolean found = false;\n //to find if this payment type is already in the database\n for (int summaryIndex = 0; summaryIndex < currentPaymentSummaries.length; summaryIndex++) {\n if (currentPaymentSummaries[summaryIndex].getEmployeeId().equals(operatorId)\n && currentPaymentSummaries[summaryIndex].getRegisterId().equals(registerId)\n && currentPaymentSummaries[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n currentPaymentSummaries[summaryIndex].doSetPaymentTotal(paymentAmount.add(\n currentPaymentSummaries[summaryIndex].getPaymentTotal()));\n int mediaCount = ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).\n getMediaCount();\n ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n // work-around for cloudscape date truncation problem.\n currentPaymentSummaries[summaryIndex].doSetDate(date);\n List list = fromObjectToBean(currentPaymentSummaries[summaryIndex]).toList();\n list.add(currentPaymentSummaries[summaryIndex].getId());\n parametricStatements.add(new ParametricStatement(updateSql, list));\n break;\n }\n }\n //to find if it is already in the newPaymentSummaries List\n if (!found) {\n PaymentSummary[] newPaymentSummaryArray = (PaymentSummary[])newPaymentSummaries.toArray(new\n PaymentSummary[0]);\n for (int summaryIndex = 0; summaryIndex < newPaymentSummaryArray.length; summaryIndex++) {\n if (newPaymentSummaryArray[summaryIndex].getEmployeeId().equals(operatorId)\n && newPaymentSummaryArray[summaryIndex].getRegisterId().equals(registerId)\n && newPaymentSummaryArray[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n ArmCurrency newTotal = paymentAmount.add(newPaymentSummaryArray[summaryIndex].\n getPaymentTotal());\n int mediaCount = ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).\n getMediaCount();\n newPaymentSummaryArray[summaryIndex].doSetPaymentTotal(newTotal);\n ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n }\n }\n }\n if (!found) {\n CMSPaymentSummary paymentSummary = new CMSPaymentSummary();\n paymentSummary.doSetDate(date);\n paymentSummary.doSetEmployeeId(operatorId);\n paymentSummary.doSetStoreId(storeId);\n paymentSummary.doSetRegisterId(registerId);\n paymentSummary.doSetPaymentTotal(paymentAmount);\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n paymentSummary.doSetPaymentType(paymentType);\n paymentSummary.doSetId(this.getNextChelseaId());\n paymentSummary.doSetMediaCount(paymentSummary.getMediaCount() + 1);\n newPaymentSummaries.add(paymentSummary);\n }\n }\n for (int i = 0; i < newPaymentSummaries.size(); i++) {\n PaymentSummary paymentSummary = (PaymentSummary)newPaymentSummaries.get(i);\n parametricStatements.add(new ParametricStatement(insertSql\n , fromObjectToBean(paymentSummary).toList()));\n }\n return (ParametricStatement[])parametricStatements.toArray(new ParametricStatement[\n parametricStatements.size()]);\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "@Test\n public void transactionSum() {\n final Transaction transaction1 = new Transaction(\"774cedda\", State.CANCELED, 1000L, new Date());\n final Account account1 = new Account(\"1001\", 0L, Collections.singletonList(transaction1));\n final Transaction transaction2 = new Transaction(\"337868a7\", State.FINISHED, 8000L, new Date());\n final Transaction transaction3 = new Transaction(\"f8047f86\", State.CANCELED, 10000L, new Date());\n final Account account2 = new Account(\"1002\", 8000L, Arrays.asList(transaction2, transaction3));\n\n final long actual = calcSumOfCancelledTransOnNonEmptyAccounts(Arrays.asList(account1, account2));\n\n Assert.assertEquals(actual, 10_000L);\n }", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutputs(int index);", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "public abstract void generateReceipt(Transaction trans);", "public Transaction getDummyTransaction(String action) {\n\n\t\t// Long payerAccountNum = 111l;\n\t\tLong payerRealmNum = 0l;\n\t\tLong payerShardNum = 0l;\n\t\t// Long nodeAccountNum=123l;\n\t\tLong nodeRealmNum = 0l;\n\t\tLong nodeShardNum = 0l;\n\t\tlong transactionFee = 0l;\n\t\tTimestamp startTime =\n\t\t\t\tRequestBuilder.getTimestamp(Instant.now(Clock.systemUTC()).minusSeconds(13));\n\t\tDuration transactionDuration = RequestBuilder.getDuration(100);\n\t\tboolean generateRecord = false;\n\t\tString memo = \"UnitTesting\";\n\t\tint thresholdValue = 10;\n\t\tList<Key> keyList = new ArrayList<>();\n\t\tKeyPair pair = new KeyPairGenerator().generateKeyPair();\n\t\tbyte[] pubKey = ((EdDSAPublicKey) pair.getPublic()).getAbyte();\n\t\tKey akey =\n\t\t\t\tKey.newBuilder().setEd25519(ByteString.copyFromUtf8((MiscUtils.commonsBytesToHex(pubKey)))).build();\n\t\tPrivateKey priv = pair.getPrivate();\n\t\tkeyList.add(akey);\n\t\tlong initBal = 100;\n\t\tlong sendRecordThreshold = 5;\n\t\tlong receiveRecordThreshold = 5;\n\t\tboolean receiverSign = false;\n\t\tDuration autoRenew = RequestBuilder.getDuration(100);\n\t\t;\n\t\tlong proxyAccountNum = 12345l;\n\t\tlong proxyRealmNum = 0l;\n\t\tlong proxyShardNum = 0l;\n\t\tint proxyFraction = 10;\n\t\tint maxReceiveProxyFraction = 10;\n\t\tlong shardID = 0l;\n\t\tlong realmID = 0l;\n\n\t\tTransaction trx = null;\n\t\tSignatureList sigList = SignatureList.getDefaultInstance();\n\t\tTimestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\n\t\t/**\n\t\t * SignatureList sigList = SignatureList.getDefaultInstance(); Transaction transferTx =\n\t\t * RequestBuilder.getCryptoTransferRequest( payer.getAccountNum(), payer.getRealmNum(),\n\t\t * payer.getShardNum(), nodeAccount.getAccountNum(), nodeAccount.getRealmNum(),\n\t\t * nodeAccount.getShardNum(), 800, timestamp, transactionDuration, false, \"test\", sigList,\n\t\t * payer.getAccountNum(), -100l, nodeAccount.getAccountNum(), 100l); transferTx =\n\t\t * TransactionSigner.signTransaction(transferTx, accountKeys.get(payer));\n\t\t */\n\n\t\tif (\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t\ttrx = RequestBuilder.getCryptoTransferRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 800, timestamp,\n\t\t\t\t\ttransactionDuration, false, \"test\", sigList, payerAccountId.getAccountNum(), -100l,\n\t\t\t\t\tnodeAccountId.getAccountNum(), 100l);\n\t\t\t// trx = TransactionSigner.signTransaction(trx, account2keyMap.get(payerAccountId));\n\t\t}\n\n\t\tif (\"createContract\".equalsIgnoreCase(action)) {\n\t\t\tFileID fileID = FileID.newBuilder().setFileNum(9999l).setRealmNum(1l).setShardNum(2l).build();\n\n\t\t\ttrx = RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 50000000000l, timestamp,\n\t\t\t\t\ttransactionDuration, true, \"createContract\", DEFAULT_CONTRACT_OP_GAS, fileID,\n\t\t\t\t\tByteString.EMPTY, 0, transactionDuration,\n\t\t\t\t\tSignatureList.newBuilder().addSigs(\n\t\t\t\t\t\t\tSignature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t\t\t\t\t\t.build(),\n\t\t\t\t\t\"\");\n\t\t}\n\n\t\t// if(\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t// long durationInSeconds = DAY_SEC * 30;\n\t\t// * Duration contractAutoRenew = Duration.newBuilder().setSeconds(durationInSeconds).build();\n\t\t// * Timestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\t\t// * Duration transactionDuration = RequestBuilder.getDuration(30, 0);\n\t\t// * Transaction createContractRequest =\n\t\t// RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t// * payerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t// * nodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 100l, timestamp,\n\t\t// transactionDuration, true, \"createContract\",\n\t\t// * DEFAULT_CONTRACT_OP_GAS, contractFile, ByteString.EMPTY, 0, contractAutoRenew,\n\t\t// * SignatureList.newBuilder()\n\t\t// *\n\t\t// .addSigs(Signature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t// * .build());\n\t\t// }\n\n\t\treturn trx;\n\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public static byte[] secondOutputStep(byte[] S){\n\t\tStringBuffer string = new StringBuffer();\n\t\tfor (int i = 1; i < S.length; i+=2) {\n\t\t\tstring.append(getBit(S[i],7));\n\t\t}\n\t\tbyte[] bval = new BigInteger(string.toString(), 2).toByteArray();\n\t\tif(bval.length > 16){\n\t\t\treturn Arrays.copyOfRange(bval,1,bval.length);\n\t\t}else{\n\t\t\treturn bval;\n\t\t}\n\t\t\n\t}", "public double printOutput() {\r\n return calculateNetPay();\r\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "public boolean doTransaction() {\r\n int nonce = -1;\r\n TransactionOperation transactionOperation = null;\r\n try {\r\n double balance;\r\n \r\n //read the stream for requests from client\r\n byte[] cipherText = (byte [])is.readObject();\r\n \r\n // decrypt the ciphertext to obtain the signed message\r\n ATMSessionMessage atmSessionMessage = (ATMSessionMessage) crypto.decryptRijndael(cipherText, kSession);\r\n if(!(currTimeStamp < atmSessionMessage.getTimeStamp())) error (\"Time stamp does not match\");\r\n \r\n //interpret the transaction operation in the request\r\n SignedMessage signedMessage = atmSessionMessage.getSignedMessage();\r\n \r\n \r\n \t\t//verify signature\r\n \t\ttry {\r\n \t\t\tif(!crypto.verify(signedMessage.msg, signedMessage.signature, currAcct.kPub))\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"Digital signature failed...\");\r\n \t\t\t}\r\n \t\t\tSystem.out.println(\"Message signature valid...\");\r\n \t\t} catch (SignatureException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t} catch (KeyException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\t\r\n TransactionMessage transactionMessage = (TransactionMessage)signedMessage.getObject();\r\n transactionOperation = transactionMessage.getOperation();\r\n \r\n //print the signed message\r\n System.out.println(\"\\n\" + (new Date()).toString());\r\n System.out.println(signedMessage.toString());\r\n \r\n //strip out the parameters embedded \r\n nonce = atmSessionMessage.getNonce();\r\n double value = transactionMessage.getValue();\r\n \r\n //print the timestamp when the transaction takes place\r\n Date now = new Date();\r\n System.out.println(\"\\n\" + now.toString());\r\n \r\n //re-route the request to the appropriate handling function\r\n if(transactionOperation == TransactionOperation.Deposit) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" DEPOSIT: \" + value);\r\n currAcct.deposit(value);\r\n \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Deposit Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.Withdraw) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" WITHDRAW: \" + value);\r\n \t currAcct.withdraw(value);\r\n \t \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Withdrawal Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.EndSession) \r\n \t {\r\n \t \tSystem.out.println(\"\\nTerminating session with ACCT#: \" + currAcct.getNumber());\r\n \t \treturn false;\r\n \t \t\r\n \t }\r\n \r\n accts.save();\r\n //create a successful reply Success and set the balance\r\n balance = currAcct.getBalance(); \r\n transactionMessage = new TransactionMessage(MessageType.ResponseSuccess,transactionOperation,balance);\r\n atmSessionMessage = new ATMSessionMessage(transactionMessage);\r\n \r\n //set the nonce \r\n atmSessionMessage.setNonce(nonce);\r\n currTimeStamp = atmSessionMessage.getTimeStamp();\r\n //encrypt the response and send it\r\n cipherText = crypto.encryptRijndael(atmSessionMessage, kSession);\r\n os.writeObject((Serializable)cipherText);\r\n \r\n //Logging.....\r\n //get the signed message and encrypt it\r\n \r\n signedMessage.encryptMessage(this.kLog);\r\n \r\n //encrypt the action\r\n //archive the signed message for logging and non-repudiation purposes \r\n SignedAction signedAction = new SignedAction(currAcct.getNumber(), atmSessionMessage.getTimeStamp(), signedMessage);\r\n \r\n //flush out transaction record to the audit file\r\n BankServer.log.write(signedAction);\r\n \r\n\t return true;\r\n }\r\n catch(Exception e){\r\n if(e instanceof TransException) replyFailure(transactionOperation,nonce);\r\n System.out.println(\"Terminating session with ACCT#: \" + currAcct.getNumber());\r\n \t//e.printStackTrace();\r\n \r\n return true;\r\n }\r\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutput();", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_3() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return transactions_.get(index);\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "protected void pktsOut(int n) {}", "@Test\n\tpublic void testTransfer() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"acc2\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(02, \"acc1\", 00000, 200.00, \"\"));\n\t\ttransactions.add(2, new Transaction(02, \"acc2\", 00001, 200.00, \"\"));\n\t\ttransactions.add(3, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\t// ArrayList<Account> expected = new ArrayList();\n\t\t// expected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\t\t// expected.add(1, new Account(00001, \"acc2\", true, 1050.00, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Money Transfered\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"money not transfered\", testResult);\n\t}", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputOrBuilder();", "public void calculatePayment() {}", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_4_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString ticketId = roc.createTickets(1, true)[0].get(\"ticketId\").getAsString();\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tuserData, ticketId);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true, ticketId);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void fixedPayerAndReceiverTest() {\n double fixedRate = 0.015;\n GeneratorAttributeIR attribute = new GeneratorAttributeIR(Period.ofYears(7));\n double notional = 1.0e8;\n ZonedDateTime date = DateUtils.getUTCDate(2013, 9, 10);\n SwapFixedIborDefinition def1 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute);\n SwapFixedIborDefinition def2 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, true);\n assertEquals(def1, def2);\n SwapFixedIborDefinition def3 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, false);\n assertFalse(def1.equals(def3));\n int nIbor = def1.getIborLeg().getNumberOfPayments();\n int nFixed = def1.getFixedLeg().getNumberOfPayments();\n assertEquals(nIbor, def3.getIborLeg().getNumberOfPayments());\n assertEquals(nFixed, def3.getFixedLeg().getNumberOfPayments());\n assertEquals(def1.getIborLeg().getIborIndex(), def3.getIborLeg().getIborIndex());\n assertEquals(def1.getIborLeg().getCalendar(), def3.getIborLeg().getCalendar());\n assertEquals(def1.getCurrency(), def3.getIborLeg().getCurrency());\n for (int i = 0; i < nIbor; ++i) {\n CouponIborDefinition ibor1 = def1.getIborLeg().getNthPayment(i);\n CouponIborDefinition ibor3 = def3.getIborLeg().getNthPayment(i);\n assertEquals(ibor1.getNotional(), -ibor3.getNotional());\n assertEquals(ibor1.getAccrualStartDate(), ibor3.getAccrualStartDate());\n assertEquals(ibor1.getAccrualEndDate(), ibor3.getAccrualEndDate());\n assertEquals(ibor1.getFixingDate(), ibor3.getFixingDate());\n assertEquals(ibor1.getPaymentDate(), ibor3.getPaymentDate());\n assertEquals(ibor1.getPaymentYearFraction(), ibor3.getPaymentYearFraction());\n }\n for (int i = 0; i < nFixed; ++i) {\n CouponFixedDefinition fixed1 = def1.getFixedLeg().getNthPayment(i);\n CouponFixedDefinition fixed3 = def3.getFixedLeg().getNthPayment(i);\n assertEquals(fixed1.getNotional(), -fixed3.getNotional());\n assertEquals(fixed1.getAccrualStartDate(), fixed3.getAccrualStartDate());\n assertEquals(fixed1.getAccrualEndDate(), fixed3.getAccrualEndDate());\n assertEquals(fixed1.getPaymentDate(), fixed3.getPaymentDate());\n assertEquals(fixed1.getPaymentYearFraction(), fixed3.getPaymentYearFraction());\n }\n }", "public static Transaction generateSendTransaction(String strPrivateKey, String creatorAddress, String receiverAddress,\n TransactionHistory transactionHistory) {\n List<Creation> creations = new ArrayList<Creation>();\n List<Input> inputs = new ArrayList<Input>();\n List<Output> outputs = new ArrayList<Output>();\n\n // Get sender address from private key\n BigInteger privateKey = Bitcoin.decodePrivateKey(strPrivateKey);\n byte[] publicKey = Bitcoin.generatePublicKey(privateKey);\n String senderAddress = Bitcoin.publicKeyToAddress(publicKey);\n\n // Variable for counting number of coupons in referred transaction outputs\n int couponsInInputs = 0;\n\n // Find previous transaction outputs to refer to\n Iterator<Transaction> transactionIterator = transactionHistory.iterator();\n while (transactionIterator.hasNext() && couponsInInputs < 1) {\n Transaction transaction = transactionIterator.next();\n Iterator<Output> outputIterator = transaction.getOutputs().iterator();\n while (outputIterator.hasNext() && couponsInInputs < 1) {\n Output output = outputIterator.next();\n if (output.getCreatorAddress().equals(creatorAddress) && output.getAddress().equals(senderAddress)\n && output.getInputId() == 0) {\n Input input = new Input(output.getOutputId());\n inputs.add(input);\n couponsInInputs += output.getAmount();\n }\n }\n }\n\n // Check if enough coupons are available\n if (couponsInInputs <= 0) {\n throw new IllegalArgumentException();\n }\n\n // Set that 1 coupon should be sent to receiver address\n Output output = new Output(creatorAddress, 1, receiverAddress);\n outputs.add(output);\n\n // Send remaining coupons in referred transaction outputs back to the user as change\n if (couponsInInputs > 1) {\n Output changeOutput = new Output(creatorAddress, couponsInInputs - 1, senderAddress);\n outputs.add(changeOutput);\n }\n\n // Create transaction, sign it and return it\n Transaction transaction = new Transaction(creations, inputs, outputs);\n transaction.signTransaction(privateKey);\n return transaction;\n\n }", "public int[] getTsumoPayment(boolean isDealer) {\r\n int[] output = new int[2];\r\n if (isDealer) {\r\n output[0] = basicPoints * 2;\r\n output[1] = 0;\r\n } else {\r\n output[0] = basicPoints * 1;\r\n output[1] = basicPoints * 2;\r\n }\r\n output[0] = (int)(100*Math.ceil(output[0]/100.0));\r\n output[1] = (int)(100*Math.ceil(output[1]/100.0));\r\n \r\n return output;\r\n }", "@Test\n\tpublic void validateSignatureBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock newBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE VALID\n\t\tassertEquals(true, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\ttransactionsSignature = new byte[64];\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID GENERATOR SIGNATURE\n\t\tnewBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), newBlock.getTimestamp(), newBlock.getGeneratingBalance(), generator, new byte[32]);\n\t\ttransactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t///CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//VALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = newBlock.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID TRANSACTION SIGNATURE\n\t\tassertEquals(true, newBlock.isSignatureValid());\t\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tpayment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(200).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK INVALID TRANSACTION SIGNATURE\n\t\tassertEquals(false, newBlock.isSignatureValid());\t\n\t}", "public double sumTransactions() {\n\t\treturn checkIfTransactionsExist(true);\n\t}", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "@Override\r\n\tpublic byte[] countersign(final byte[] sign,\r\n final String algorithm,\r\n final CounterSignTarget targetType,\r\n final Object[] targets,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException {\r\n throw new UnsupportedOperationException(\"No es posible realizar contrafirmas de ficheros ODF\"); //$NON-NLS-1$\r\n }", "public void printTransactions() {\n for (int i = 0; i < transactions.size(); i++) {\n\t\t\tint indeks = i+1;\n\t\t\tSystem.out.println(\"Transactions \" + indeks + \": \" + transactions.get(i).getType() + \" \" + transactions.get(i).getAmount());\n\t\t}\n }", "public int updatePayment2(int requestId, int amount);", "private void convertTransactionToBitStream(){\n bitTransactionList = new ArrayList<>();\n itemListMap2 = new HashMap<>();\n \n for(int i=0; i<transactions_set.size(); i++){\n ArrayList curr_tr = transactions_set.get(i);\n \n if(curr_tr.size() >= min_itemset_size_K){ \n int freqItem = 0;\n BitSet bitset = new BitSet(bitsetLen);\n \n for(int j=0; j<curr_tr.size(); j++){\n try{\n int item = (int)curr_tr.get(j);\n bitset.set(itemIndex.get(item), true);\n freqItem++;\n }\n catch(Exception e){}\n }\n if(freqItem >= min_itemset_size_K){\n bitTransactionList.add(bitset);\n// System.out.println(bitset);\n HashSet<BitSet> subset_2 = createSubsetsOfLen2(bitset);\n for(BitSet sub_b : subset_2){\n itemListMap2.put(sub_b, itemListMap2.getOrDefault(sub_b, 0)+1);\n }\n }\n }\n }\n \n itemListMap2.values().removeIf(val -> val<min_sup);\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_5_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t\t\r\n\t\t\t\tHashMap<String,Object> o2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t\t\r\n\t\t\t\to = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\to2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "protected int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws IOException {\n return serializator.write(output, mostSigBits) +\n serializator.write(output, leastSigBits);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return instance.getTransactions(index);\n }", "public void onOutputSpent(MoneroOutputWallet output);", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public static void main(String[] args)\n\t{\n \n\t\tSystem.out.println(\"Enter the size of transaction array\");\n int trSize = sc.nextInt();\n\n // creating an array of provided size\n int[] transactions = new int[trSize];\n \n // get the elements of the array (in a loop)\n System.out.println(\"Enter the values of array\");\n for (int i = 0; i < transactions.length; i++) {\n transactions[i] = sc.nextInt();\n }\n // get the number of targets\n System.out.println(\"Enter the total no of targets that needs to be achieved\");\n int numTargets = sc.nextInt();\n \n // get in target one-by-one (loop)\n for (int i = 0; i < numTargets; i++) {\n \n \t// Get TargetValue\n System.out.println(\"Enter the value of target\");\n int target = sc.nextInt();\n \n int sum =0;\n for ( int j=0; j < transactions.length; j++) {\n \tsum = sum + transactions[j];\n \t\n \tif ( sum >= target) {\n \tSystem.out.println(\"Target achieved after \" + (j+1) + \" transactions\" );\n \tbreak; // break out of the innermost for loop\n \t}\n \t\n \t//we come to the last transactions, yet target is not achieved\n \tif (j == transactions.length - 1) {\n \t\tSystem.out.println( \"Given target is not achieved\");\n \t}\n \t\n }\n \n \n\t}\n\n}", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public double calculatePay() {\n\t\treturn 0;\r\n\t}", "public byte[] signNativeByTransDataDefault(UInt256 uInt256) {\n return new byte[0];\n }", "@Suspendable\n @Override\n protected void checkTransaction(SignedTransaction stx) throws FlowException {\n }", "com.google.protobuf.ByteString\n getOutputBytes();", "com.google.protobuf.ByteString\n getTranCodeBytes();", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_1() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public float getInputsValue() {\n\t\tfloat total = 0;\n\t\tfor (TransactionInput i : inputs) {\n\t\t\tif (i.getUTXO() == null)\n\t\t\t\tcontinue; // if Transaction can't be found skip it\n\t\t\ttotal += i.getUTXO().getValue();\n\t\t}\n\t\treturn total;\n\t}", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }" ]
[ "0.6159733", "0.59689933", "0.589428", "0.5756902", "0.57402194", "0.56859154", "0.56721807", "0.5637813", "0.5592145", "0.5576518", "0.5491765", "0.5470686", "0.5430834", "0.5358753", "0.5358753", "0.5358753", "0.53461564", "0.5307082", "0.52533996", "0.5240322", "0.5190462", "0.51507604", "0.5129066", "0.5127569", "0.5083162", "0.5064059", "0.50343573", "0.5009548", "0.49968874", "0.49893466", "0.49677435", "0.49677435", "0.49677435", "0.4962916", "0.4948351", "0.49416536", "0.4940025", "0.49287498", "0.49031627", "0.48969245", "0.4892023", "0.48822185", "0.48698023", "0.48688632", "0.48649135", "0.48628554", "0.48256552", "0.47981858", "0.4793885", "0.4793407", "0.4768888", "0.4768888", "0.4768888", "0.47677594", "0.47562104", "0.47514212", "0.47490582", "0.47333866", "0.47300485", "0.47300485", "0.47212848", "0.47189197", "0.47163257", "0.47116205", "0.46987715", "0.46951908", "0.46937752", "0.46896154", "0.46886653", "0.46746448", "0.46724787", "0.46684882", "0.4666781", "0.4666447", "0.46659714", "0.46610832", "0.46557936", "0.46557936", "0.46557936", "0.46529654", "0.4652265", "0.4649212", "0.46420932", "0.46242723", "0.46233037", "0.4616067", "0.4615847", "0.46125874", "0.4607859", "0.46071175", "0.46046627", "0.4604134", "0.45967475", "0.4594377", "0.45860416", "0.4585746", "0.4580786", "0.4577845", "0.45748726", "0.45700264" ]
0.5130814
22
Where to send refunds, if a refund is necessary repeated .payments.Output refund_to = 3;
java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public Integer getRefund() {\n return refund;\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public int getRefundId() {\n return refundId;\n }", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "private void addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureRefundToIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, refundTo_);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public String getRefundId() {\n return refundId;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //[email protected]\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public String getRefundReason() {\n return refundReason;\n }", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "int getRefundToCount();", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "private void removeRefundTo(int index) {\n ensureRefundToIsMutable();\n refundTo_.remove(index);\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "@Override\n\tpublic ResultBO<?> refundQuery(PayQueryParamVO payQueryParamVO) {\n\t\treturn super.refundQuery(payQueryParamVO);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public void refundConfirmation(String fName, String customerEmail, double price, int numOfTicket, int bookingNo){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"[email protected]\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"Refund Confirmation - Receipt\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \\t\"+fName + \"!\\n\\n\"\r\n\t + \"You requested on booking #\" +bookingNo+\".\"\r\n\t + \"Your \"+numOfTicket+\" ticket(s)\"\r\n\t + \" will be refunded within few days.\\n\"\r\n\t + \"Total refund price: $\"+price+\"\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "int updateByPrimaryKeySelective(TRefundOrder record);", "public void requestRefundResponse(Message message, JsonObject payload){\n System.out.println(\"Response Status Message:\" + message.getStatusMessage());\n AsyncResponse response = this.responseHandler.getRestResponseObject(message.getRequestId());\n response.resume(Response.status(message.getStatus()).entity(message.getStatusMessage()).build());\n }", "int updateByPrimaryKey(TRefundOrder record);", "@Test\n public void refundTicket() {\n Ticket ticket = givenTicketInOrderedBilled();\n\n // when\n boolean refundTicket = ticket.refundTicket();\n\n // then\n assertTrue(refundTicket);\n assertTicketInState(ticket, TicketStateType.TICKET_RETURNED, TransactionStateType.TRANSACTION_BILLED, 6);\n }", "int deleteByPrimaryKey(String refundorderid);", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "private void refundSeats() {\n\t\tint numSeats;\n\n\t\tSystem.out.print(\"Please enter the number of seats to refund: \");\n\t\tnumSeats = Integer.parseInt(sc.nextLine());\n\t\t\n\t\t// Reject attempt to refund more seats than are available\n\t\tif (numSeats > coach.numSeatsBooked()) {\n\t\t\tSystem.out.printf(\"Unable to refund %d seats. Only %d booked\\n\", \n\t\t\t\t\tnumSeats, coach.numSeatsBooked());\n\t\t\treturn;\n\t\t}\n\t\t// Refund each of the requested seats\n\t\tfor (int i = 0; i < numSeats; i++) {\n\t\t\tint seatPos;\n\t\t\tboolean refundResult;\n\t\t\tSystem.out.println(\"Seats refunded: \" + i);\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Please enter the seat position to refund: \");\n\t\t\t\tseatPos = Integer.parseInt(sc.nextLine());\n\t\t\t\t// Attempt to refund seat\n\t\t\t\trefundResult = coach.refundSeat(seatPos);\n\t\t\t\tif (refundResult == false)\n\t\t\t\t\tSystem.out.println(\"Seat position wasn't booked. Please try again\");\n\t\t\t} while (refundResult == false);\n\t\t}\n\t\tcoach.printReceipt();\n\t}", "@Test\n public void create() throws RazorpayException{\n JSONObject request = new JSONObject(\"{\" +\n \"\\\"amount\\\":\\\"100\\\",\" +\n \"\\\"speed\\\":\\\"normal\\\",\" +\n \"\\\"notes\\\":{\\\"notes_key_1\\\":\\\"BeammeupScotty.\\\",\" +\n \"\\\"notes_key_2\\\":\\\"Engage\\\"},\" +\n \"\\\"receipt\\\":\\\"ReceiptNo.31\\\"}\");\n\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 500100,\\n\" +\n \" \\\"receipt\\\": \\\"Receipt No. 31\\\",\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FCXKPFtYfPXJPy\\\",\\n\" +\n \" \\\"notes\\\": [],\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": null\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078866,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\"\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.create(request);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n assertEquals(\"refund\",fetch.get(\"entity\"));\n assertEquals(500100,(int)fetch.get(\"amount\"));\n assertEquals(\"INR\",fetch.get(\"currency\"));\n String createRequest = getHost(Constants.REFUNDS);\n verifySentRequest(true, request.toString(), createRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void refill(int amount) {\n myAmount = myAmount + amount;\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "public int updatePayment2(int requestId, int amount);", "abstract void updateRecurringTransactions(Ui ui) throws BankException;", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) {\n copyOnWrite();\n instance.setRefundTo(index,\n builderForValue.build());\n return this;\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@Override\n\tpublic void updateRefundExpressNo(WxAddress address) {\n\t\torderMapper.updateRefundExpressNo(address);\n\t}", "void savingListRecurringExpenditure(Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {\n // Testing redo loan\n RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();\n paramsPastDate.setDisbursalDateDD(\"25\");\n paramsPastDate.setDisbursalDateMM(\"02\");\n paramsPastDate.setDisbursalDateYYYY(\"2011\");\n paramsPastDate.setLoanAmount(\"3000.0\");\n paramsPastDate.setInterestRate(\"10\");\n paramsPastDate.setNumberOfInstallments(\"52\");\n RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();\n paramsCurrentDate.setDisbursalDateDD(\"22\");\n paramsCurrentDate.setDisbursalDateMM(\"2\");\n paramsCurrentDate.setDisbursalDateYYYY(\"2012\");\n LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal(\"Default Group\", \"WeeklyGroupFlatLoanWithOnetimeFee\", paramsPastDate, paramsCurrentDate, 0, true);\n loanAccountPage.verifyStatus(\"Active in Good Standing\");\n loanAccountPage.verifyPerformanceHistory(\"51\", \"0\");\n // Testing multiple reverse payments\n String payAmount = \"63\";\n String reverseNote = \"Reversed \";\n int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);\n for (int i = 0; i < 3; i++) {\n ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();\n applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));\n }\n verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);\n }" ]
[ "0.6837944", "0.6680033", "0.6635527", "0.64984614", "0.6490293", "0.6458677", "0.640111", "0.6312843", "0.6292688", "0.6289198", "0.62770647", "0.62703866", "0.6268327", "0.62219656", "0.61801535", "0.61697423", "0.6169161", "0.6164256", "0.61364824", "0.6108931", "0.6102661", "0.6092728", "0.60053396", "0.5997363", "0.5988169", "0.59800667", "0.5945139", "0.59295446", "0.5900006", "0.5897482", "0.5889186", "0.58681554", "0.5802513", "0.57614625", "0.5735428", "0.5724823", "0.56932974", "0.5633742", "0.5622858", "0.56198025", "0.5595889", "0.5595132", "0.5592855", "0.55329424", "0.5518848", "0.54763395", "0.5459372", "0.54249287", "0.54048276", "0.53774804", "0.536774", "0.53553265", "0.53296226", "0.5320603", "0.5298545", "0.52805144", "0.5273551", "0.5242453", "0.52363044", "0.5232598", "0.5228981", "0.52167726", "0.5210289", "0.5191241", "0.511909", "0.5082907", "0.5064823", "0.50403845", "0.5006747", "0.49981862", "0.4996693", "0.49768206", "0.4927039", "0.49256676", "0.49243656", "0.49225584", "0.48957184", "0.4890607", "0.48827323", "0.4865215", "0.4860659", "0.4845886", "0.48433134", "0.4826012", "0.47943598", "0.47792602", "0.4777408", "0.4758452", "0.47537193", "0.47391224", "0.47372243", "0.47263432", "0.4724899", "0.47087073", "0.47056893", "0.47038674", "0.46679506", "0.46627954", "0.46511096", "0.46307105" ]
0.62800956
10
Where to send refunds, if a refund is necessary repeated .payments.Output refund_to = 3;
com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public Integer getRefund() {\n return refund;\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public int getRefundId() {\n return refundId;\n }", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "private void addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureRefundToIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, refundTo_);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public String getRefundId() {\n return refundId;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //[email protected]\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public String getRefundReason() {\n return refundReason;\n }", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "int getRefundToCount();", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "private void removeRefundTo(int index) {\n ensureRefundToIsMutable();\n refundTo_.remove(index);\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "@Override\n\tpublic ResultBO<?> refundQuery(PayQueryParamVO payQueryParamVO) {\n\t\treturn super.refundQuery(payQueryParamVO);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public void refundConfirmation(String fName, String customerEmail, double price, int numOfTicket, int bookingNo){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"[email protected]\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"Refund Confirmation - Receipt\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \\t\"+fName + \"!\\n\\n\"\r\n\t + \"You requested on booking #\" +bookingNo+\".\"\r\n\t + \"Your \"+numOfTicket+\" ticket(s)\"\r\n\t + \" will be refunded within few days.\\n\"\r\n\t + \"Total refund price: $\"+price+\"\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "int updateByPrimaryKeySelective(TRefundOrder record);", "public void requestRefundResponse(Message message, JsonObject payload){\n System.out.println(\"Response Status Message:\" + message.getStatusMessage());\n AsyncResponse response = this.responseHandler.getRestResponseObject(message.getRequestId());\n response.resume(Response.status(message.getStatus()).entity(message.getStatusMessage()).build());\n }", "int updateByPrimaryKey(TRefundOrder record);", "@Test\n public void refundTicket() {\n Ticket ticket = givenTicketInOrderedBilled();\n\n // when\n boolean refundTicket = ticket.refundTicket();\n\n // then\n assertTrue(refundTicket);\n assertTicketInState(ticket, TicketStateType.TICKET_RETURNED, TransactionStateType.TRANSACTION_BILLED, 6);\n }", "int deleteByPrimaryKey(String refundorderid);", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "private void refundSeats() {\n\t\tint numSeats;\n\n\t\tSystem.out.print(\"Please enter the number of seats to refund: \");\n\t\tnumSeats = Integer.parseInt(sc.nextLine());\n\t\t\n\t\t// Reject attempt to refund more seats than are available\n\t\tif (numSeats > coach.numSeatsBooked()) {\n\t\t\tSystem.out.printf(\"Unable to refund %d seats. Only %d booked\\n\", \n\t\t\t\t\tnumSeats, coach.numSeatsBooked());\n\t\t\treturn;\n\t\t}\n\t\t// Refund each of the requested seats\n\t\tfor (int i = 0; i < numSeats; i++) {\n\t\t\tint seatPos;\n\t\t\tboolean refundResult;\n\t\t\tSystem.out.println(\"Seats refunded: \" + i);\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Please enter the seat position to refund: \");\n\t\t\t\tseatPos = Integer.parseInt(sc.nextLine());\n\t\t\t\t// Attempt to refund seat\n\t\t\t\trefundResult = coach.refundSeat(seatPos);\n\t\t\t\tif (refundResult == false)\n\t\t\t\t\tSystem.out.println(\"Seat position wasn't booked. Please try again\");\n\t\t\t} while (refundResult == false);\n\t\t}\n\t\tcoach.printReceipt();\n\t}", "@Test\n public void create() throws RazorpayException{\n JSONObject request = new JSONObject(\"{\" +\n \"\\\"amount\\\":\\\"100\\\",\" +\n \"\\\"speed\\\":\\\"normal\\\",\" +\n \"\\\"notes\\\":{\\\"notes_key_1\\\":\\\"BeammeupScotty.\\\",\" +\n \"\\\"notes_key_2\\\":\\\"Engage\\\"},\" +\n \"\\\"receipt\\\":\\\"ReceiptNo.31\\\"}\");\n\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 500100,\\n\" +\n \" \\\"receipt\\\": \\\"Receipt No. 31\\\",\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FCXKPFtYfPXJPy\\\",\\n\" +\n \" \\\"notes\\\": [],\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": null\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078866,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\"\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.create(request);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n assertEquals(\"refund\",fetch.get(\"entity\"));\n assertEquals(500100,(int)fetch.get(\"amount\"));\n assertEquals(\"INR\",fetch.get(\"currency\"));\n String createRequest = getHost(Constants.REFUNDS);\n verifySentRequest(true, request.toString(), createRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void refill(int amount) {\n myAmount = myAmount + amount;\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "public int updatePayment2(int requestId, int amount);", "abstract void updateRecurringTransactions(Ui ui) throws BankException;", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) {\n copyOnWrite();\n instance.setRefundTo(index,\n builderForValue.build());\n return this;\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@Override\n\tpublic void updateRefundExpressNo(WxAddress address) {\n\t\torderMapper.updateRefundExpressNo(address);\n\t}", "void savingListRecurringExpenditure(Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {\n // Testing redo loan\n RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();\n paramsPastDate.setDisbursalDateDD(\"25\");\n paramsPastDate.setDisbursalDateMM(\"02\");\n paramsPastDate.setDisbursalDateYYYY(\"2011\");\n paramsPastDate.setLoanAmount(\"3000.0\");\n paramsPastDate.setInterestRate(\"10\");\n paramsPastDate.setNumberOfInstallments(\"52\");\n RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();\n paramsCurrentDate.setDisbursalDateDD(\"22\");\n paramsCurrentDate.setDisbursalDateMM(\"2\");\n paramsCurrentDate.setDisbursalDateYYYY(\"2012\");\n LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal(\"Default Group\", \"WeeklyGroupFlatLoanWithOnetimeFee\", paramsPastDate, paramsCurrentDate, 0, true);\n loanAccountPage.verifyStatus(\"Active in Good Standing\");\n loanAccountPage.verifyPerformanceHistory(\"51\", \"0\");\n // Testing multiple reverse payments\n String payAmount = \"63\";\n String reverseNote = \"Reversed \";\n int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);\n for (int i = 0; i < 3; i++) {\n ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();\n applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));\n }\n verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);\n }" ]
[ "0.6681329", "0.6634763", "0.6498553", "0.64901006", "0.64587116", "0.63995904", "0.6312238", "0.6293596", "0.6288418", "0.6279265", "0.6277259", "0.6270693", "0.6268615", "0.6222925", "0.6180539", "0.6170511", "0.61689126", "0.6164209", "0.61356705", "0.6109727", "0.6103068", "0.6092381", "0.60068417", "0.59968257", "0.5988425", "0.5978771", "0.5945487", "0.5930432", "0.5899949", "0.5896912", "0.5889083", "0.58662415", "0.58019036", "0.5762031", "0.57353044", "0.57242036", "0.5693331", "0.56340647", "0.56234425", "0.5620447", "0.55960333", "0.559603", "0.5592814", "0.5533532", "0.551844", "0.54760706", "0.54592615", "0.5424499", "0.54047036", "0.5378222", "0.53679264", "0.53568435", "0.5329663", "0.5321128", "0.52991027", "0.52812773", "0.52741176", "0.5241854", "0.52357745", "0.52319705", "0.5229508", "0.52169293", "0.52099484", "0.51905406", "0.5120019", "0.50832796", "0.50649965", "0.5040515", "0.50067997", "0.49981776", "0.49972928", "0.4976616", "0.49266282", "0.4925381", "0.49243638", "0.49239317", "0.4896078", "0.4891509", "0.48818544", "0.48640975", "0.48607588", "0.48458338", "0.48438704", "0.48244044", "0.47945988", "0.4778403", "0.47762603", "0.47572893", "0.47532403", "0.4739214", "0.4737618", "0.47262642", "0.4725167", "0.47088572", "0.4705267", "0.47044212", "0.46677262", "0.46615815", "0.46509013", "0.46304008" ]
0.68370944
0
Where to send refunds, if a refund is necessary repeated .payments.Output refund_to = 3;
int getRefundToCount();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public Integer getRefund() {\n return refund;\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public int getRefundId() {\n return refundId;\n }", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "private void addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureRefundToIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, refundTo_);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public String getRefundId() {\n return refundId;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //[email protected]\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public String getRefundReason() {\n return refundReason;\n }", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "private void removeRefundTo(int index) {\n ensureRefundToIsMutable();\n refundTo_.remove(index);\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "@Override\n\tpublic ResultBO<?> refundQuery(PayQueryParamVO payQueryParamVO) {\n\t\treturn super.refundQuery(payQueryParamVO);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public void refundConfirmation(String fName, String customerEmail, double price, int numOfTicket, int bookingNo){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"[email protected]\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"Refund Confirmation - Receipt\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \\t\"+fName + \"!\\n\\n\"\r\n\t + \"You requested on booking #\" +bookingNo+\".\"\r\n\t + \"Your \"+numOfTicket+\" ticket(s)\"\r\n\t + \" will be refunded within few days.\\n\"\r\n\t + \"Total refund price: $\"+price+\"\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "int updateByPrimaryKeySelective(TRefundOrder record);", "public void requestRefundResponse(Message message, JsonObject payload){\n System.out.println(\"Response Status Message:\" + message.getStatusMessage());\n AsyncResponse response = this.responseHandler.getRestResponseObject(message.getRequestId());\n response.resume(Response.status(message.getStatus()).entity(message.getStatusMessage()).build());\n }", "int updateByPrimaryKey(TRefundOrder record);", "@Test\n public void refundTicket() {\n Ticket ticket = givenTicketInOrderedBilled();\n\n // when\n boolean refundTicket = ticket.refundTicket();\n\n // then\n assertTrue(refundTicket);\n assertTicketInState(ticket, TicketStateType.TICKET_RETURNED, TransactionStateType.TRANSACTION_BILLED, 6);\n }", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "int deleteByPrimaryKey(String refundorderid);", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "private void refundSeats() {\n\t\tint numSeats;\n\n\t\tSystem.out.print(\"Please enter the number of seats to refund: \");\n\t\tnumSeats = Integer.parseInt(sc.nextLine());\n\t\t\n\t\t// Reject attempt to refund more seats than are available\n\t\tif (numSeats > coach.numSeatsBooked()) {\n\t\t\tSystem.out.printf(\"Unable to refund %d seats. Only %d booked\\n\", \n\t\t\t\t\tnumSeats, coach.numSeatsBooked());\n\t\t\treturn;\n\t\t}\n\t\t// Refund each of the requested seats\n\t\tfor (int i = 0; i < numSeats; i++) {\n\t\t\tint seatPos;\n\t\t\tboolean refundResult;\n\t\t\tSystem.out.println(\"Seats refunded: \" + i);\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Please enter the seat position to refund: \");\n\t\t\t\tseatPos = Integer.parseInt(sc.nextLine());\n\t\t\t\t// Attempt to refund seat\n\t\t\t\trefundResult = coach.refundSeat(seatPos);\n\t\t\t\tif (refundResult == false)\n\t\t\t\t\tSystem.out.println(\"Seat position wasn't booked. Please try again\");\n\t\t\t} while (refundResult == false);\n\t\t}\n\t\tcoach.printReceipt();\n\t}", "@Test\n public void create() throws RazorpayException{\n JSONObject request = new JSONObject(\"{\" +\n \"\\\"amount\\\":\\\"100\\\",\" +\n \"\\\"speed\\\":\\\"normal\\\",\" +\n \"\\\"notes\\\":{\\\"notes_key_1\\\":\\\"BeammeupScotty.\\\",\" +\n \"\\\"notes_key_2\\\":\\\"Engage\\\"},\" +\n \"\\\"receipt\\\":\\\"ReceiptNo.31\\\"}\");\n\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 500100,\\n\" +\n \" \\\"receipt\\\": \\\"Receipt No. 31\\\",\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FCXKPFtYfPXJPy\\\",\\n\" +\n \" \\\"notes\\\": [],\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": null\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078866,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\"\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.create(request);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n assertEquals(\"refund\",fetch.get(\"entity\"));\n assertEquals(500100,(int)fetch.get(\"amount\"));\n assertEquals(\"INR\",fetch.get(\"currency\"));\n String createRequest = getHost(Constants.REFUNDS);\n verifySentRequest(true, request.toString(), createRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void refill(int amount) {\n myAmount = myAmount + amount;\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "public int updatePayment2(int requestId, int amount);", "abstract void updateRecurringTransactions(Ui ui) throws BankException;", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) {\n copyOnWrite();\n instance.setRefundTo(index,\n builderForValue.build());\n return this;\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@Override\n\tpublic void updateRefundExpressNo(WxAddress address) {\n\t\torderMapper.updateRefundExpressNo(address);\n\t}", "void savingListRecurringExpenditure(Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {\n // Testing redo loan\n RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();\n paramsPastDate.setDisbursalDateDD(\"25\");\n paramsPastDate.setDisbursalDateMM(\"02\");\n paramsPastDate.setDisbursalDateYYYY(\"2011\");\n paramsPastDate.setLoanAmount(\"3000.0\");\n paramsPastDate.setInterestRate(\"10\");\n paramsPastDate.setNumberOfInstallments(\"52\");\n RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();\n paramsCurrentDate.setDisbursalDateDD(\"22\");\n paramsCurrentDate.setDisbursalDateMM(\"2\");\n paramsCurrentDate.setDisbursalDateYYYY(\"2012\");\n LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal(\"Default Group\", \"WeeklyGroupFlatLoanWithOnetimeFee\", paramsPastDate, paramsCurrentDate, 0, true);\n loanAccountPage.verifyStatus(\"Active in Good Standing\");\n loanAccountPage.verifyPerformanceHistory(\"51\", \"0\");\n // Testing multiple reverse payments\n String payAmount = \"63\";\n String reverseNote = \"Reversed \";\n int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);\n for (int i = 0; i < 3; i++) {\n ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();\n applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));\n }\n verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);\n }" ]
[ "0.68360114", "0.6679548", "0.6636148", "0.64972943", "0.6489704", "0.64574003", "0.6400954", "0.63106453", "0.62928164", "0.62868726", "0.62789595", "0.6276871", "0.62697357", "0.6269048", "0.6221172", "0.61808693", "0.6169364", "0.61678493", "0.6164", "0.61343324", "0.61085606", "0.61028427", "0.60915077", "0.6004669", "0.5998025", "0.5987001", "0.5980783", "0.5945281", "0.5929114", "0.58991045", "0.5897043", "0.5888135", "0.5869045", "0.5802867", "0.57613575", "0.5734901", "0.5724553", "0.5692248", "0.56333226", "0.5620339", "0.55948776", "0.55938464", "0.5591977", "0.55320287", "0.5518626", "0.5476253", "0.54583144", "0.54244095", "0.5404604", "0.53778553", "0.5367501", "0.53568405", "0.5329338", "0.5321334", "0.52995294", "0.5279812", "0.52729315", "0.5241934", "0.5237215", "0.52315784", "0.52289134", "0.5216264", "0.52098674", "0.51898277", "0.51189667", "0.50826937", "0.5065194", "0.50399506", "0.50068235", "0.49981308", "0.4997383", "0.49759045", "0.4927424", "0.49246466", "0.49245727", "0.49223724", "0.48961973", "0.48887706", "0.48819163", "0.48657683", "0.4859479", "0.48444656", "0.48432097", "0.48264188", "0.4795589", "0.47791338", "0.47773278", "0.47566816", "0.47538295", "0.47388142", "0.47366804", "0.4725859", "0.47243515", "0.47092706", "0.47049552", "0.47047704", "0.4668362", "0.46616542", "0.46512684", "0.4631796" ]
0.562193
39
Humanreadable message for the merchant optional string memo = 4;
boolean hasMemo();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getMemo();", "java.lang.String getMemo();", "java.lang.String getMemo();", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "private String getMessage() {\n\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\r\n\t\t\r\n\t\tboolean addSign = prefs.getBoolean(\"addsign\", true);\r\n\t\t\r\n\t\ttry {\r\n\t\t\r\n\t\tdefMessage = \"I am busy right now and will call you latter.\";\r\n\t\t\r\n\t\tfinalMessage = prefs.getString(\"message\", defMessage);\r\n\t\tif(finalMessage.equals(\"\"))\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t} catch (RuntimeException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t}\r\n\t\t\r\n\t\tif(addSign)\r\n\t\t\tfinalMessage += \"\\nSent using Calls and SMS Blocker for android.\\nDownload from: https://play.google.com/store/apps/details?id=com.atiffarrukh.callandsmsblocker\";\r\n\t\treturn finalMessage;\r\n\t}", "@Override\n public String getPayMemo() {\n return String.format(\"Employee ID: %d, Pay Date: %s\", this.getEmpID(),\n HRUtility.dateToStr(new Date()));\n }", "public java.lang.String getMemo() {\r\n return memo;\r\n }", "public void setMemo(String memo) {\n\t\tMEMO = memo;\n\t}", "public void setMemo(java.lang.String memo) {\r\n this.memo = memo;\r\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public void setMemo (java.lang.String memo) {\r\n\t\tthis.memo = memo;\r\n\t}", "@Override\n public String getMessage() {\n String chuoi=\"\";\n if (maCD.length()!=5)\n chuoi=\"MaCD bao gom 5 ki tu\";\n else if (soBaiHat<10)\n chuoi=\"So bai hat phai lon hon 10 bai\";\n return\n chuoi;\n }", "public void setMemo(String memo) {\n this.memo = memo == null ? null : memo.trim();\n }", "public java.lang.String getMemo () {\r\n\t\treturn memo;\r\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo == null ? null : memo.trim();\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public String getSMemo() {\n return sMemo;\n }", "private String createOrderSummary(String userName, int price, boolean addWhippedCream, boolean addChocolate, boolean addCinnamon, boolean addMarshmallows){\n String priceMessage = \"Name: \" + userName;\n priceMessage = priceMessage + \"\\nAdd Marshmallows? \" + addMarshmallows;\n priceMessage = priceMessage + \"\\nAdd Cinnamon? \" + addCinnamon;\n priceMessage = priceMessage + \"\\nAdd Whipped Cream? \" + addWhippedCream;\n priceMessage = priceMessage + \"\\nAdd Chocolate? \" + addChocolate;\n priceMessage = priceMessage + \"\\nQuantity: \" + quantity;\n priceMessage = priceMessage + \"\\nTotal: $\" + price;\n priceMessage = priceMessage + \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String getPayMemo() throws ParseException {\n return \"Employee ID: \" + getEmpID() + \", Pay Date: \" + HRDateUtils.strToDate(\"2019-10-01\");\n }", "public String showInfoMedi(){\n\t\tString msg = \"\";\n\n\t\tmsg += \"NOMBRE DE LA MEDICINA: \"+name+\"\\n\";\n\t\tmsg += \"LA DOSIS: \"+dose+\"\\n\";\n\t\tmsg += \"COSTO POR DOSIS: \"+doseCost+\"\\n\";\n\t\tmsg += \"FRECUENCIA QUE ESTA DEBE SER APLICADA: \"+frecuency+\"\\n\";\n\n\t\treturn msg;\n\t}", "private String createOrderSummary(int price,boolean addWhippedCream,boolean addChocolate,String name){\n String priceMessage=\"Name :\"+name;\n priceMessage+=\"\\nadd whipped cream ? \"+addWhippedCream;\n priceMessage+=\"\\nadd chocolate ? \"+addChocolate;\n priceMessage+=\"\\nQuantity \"+quantity;\n priceMessage+=\"\\nTotal :$ \"+price;\n priceMessage+=\"\\nThank you!\";\n return priceMessage;\n }", "@Override\r\n public String receita() {\n return \"Misturar os ingredientes; bater no liquidificador; colocar na máquina de waffle por 10m\";\r\n }", "private String createOrderSummary (String name, int price, boolean addWhippedCream, boolean addChocolate) {\n String priceMessage = getString(R.string.order_summary_name, name);\n priceMessage += \"\\n\" + getString(R.string.order_summary_whipped_cream, addWhippedCream);\n priceMessage += \"\\n\" + getString(R.string.order_summary_chocolate, addChocolate);\n priceMessage += \"\\n\" + getString(R.string.order_summary_quantity, quantity);\n priceMessage += \"\\nTotal: \" + price;\n priceMessage += \"\\n\" + getString(R.string.thank_you);\n return priceMessage;\n }", "public void setSMemo(String sMemo) {\n this.sMemo = sMemo;\n }", "public String getDescription()\r\n\t{\r\n\t\tStringBuilder msgreturn = new StringBuilder().append(m_name).append(\" \").append(m_taxBaseAmt.toString());\r\n\t\treturn msgreturn.toString();\r\n\t}", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@Override\n public String getDescription() {\n return \"Arbitrary message\";\n }", "public String getMessage()\n {\n return String.format(\"MessageType=%s,TransactionId=%s,TerminalId=%s,MerchantId=%s,FingerData=%s,CustomerId=%s,IdData=%s, CustomerData=%s\", this.messageType, this.transactionId, this.terminalId, this.merchantId, this.fingerData, this.customerId, this.idData, this.customerData);\n }", "private String buildMessage(String message) {\n\t\tif(message != null && message.contains(\"@record\")) {\n\t\t\tmessage = message.replaceAll(\"@record\", answerUser);\n\t\t\trecorded.put(owner.id(), answerUser);\n\t\t}\n\t\t//o sistema substitui o texto !id pelo id do usuário da conversa\n\t\tif(message != null && message.contains(\"!id\")) {\n\t\t\tmessage = message.replaceAll(\"!id\", owner.id() + \"\");\n\t\t}\n\t\t//o sistema verifica se tem alguma gravacao para o código recebido\n\t\tif(message != null && message.contains(\"#find\")) {\n\t\t\tString gravacao = recorded.get(Integer.parseInt(userLatestAnswer.get(owner.id())));\n\t\t\t//se houver gravacao, o sistema informa qual o desejo do amigo secreto\n\t\t\tif(gravacao != null)\n\t\t\t\tmessage = message.replaceAll(\"#find\", gravacao);\n\t\t\t//caso nao haja gravacao, o sistema notifica o usuário da situacao\n\t\t\telse\n\t\t\t\tmessage = \"O código informado não corresponde ao desejo de um amigo secreto... por favor tente novamente\";\n\t\t}\n\n\t\treturn message;\n\t}", "@Override\n\tpublic String getText() {\n\t\treturn \"MMS: \" + text;\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "private String getOrderDetails(Order order) {\n String message = getString(R.string.total) + \"\\n\" + getString(R.string.name) + \": \" + order.getCustomerName() +\n \"\\n\" + getString(R.string.add_cream) + \"? \" + String.valueOf(order.isHasWhippedCream()) +\n \"\\n\" + getString(R.string.add_chocolate) + \"? \" + String.valueOf(order.isHasChocolate()) +\n \"\\n\" + getString(R.string.quantity) + \": \" + order.getCupsNumber() + \"\\n\" + getString(R.string.resut) +\n \": $\" + MainActivity.calculatePrice(order) + \"\\n\" + getString(R.string.thanks) + \"!\";\n return message;\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "public String getMessage()\n {\n return super.getMessage()+promo_error+\"not found\";\n }", "private static String build3PidErrorMessage(Context context, @StringRes int errorMessageRes, @Nullable String additionalInfo) {\n StringBuilder builder = new StringBuilder();\n builder.append(context.getString(errorMessageRes));\n\n if (additionalInfo != null) {\n builder.append(' ');\n builder.append(context.getString(R.string.account_additional_info, additionalInfo));\n }\n\n return builder.toString();\n }", "@Override\n public String getDescription() {\n return \"Mint currency\";\n }", "@Override\n public String getDescription() {\n return \"Digital goods purchase\";\n }", "private String createOrderSummary(int price, boolean addWhippedCream, boolean addChocolate ,String name)\n {\n if (addWhippedCream==true) price+= (numOfCufee) ;\n if (addChocolate == true ) price+=(2*numOfCufee) ;\n String priceMessage = \"Name: \"+name;\n priceMessage += \"\\nAdd whipped cream? \" + addWhippedCream;\n priceMessage += \"\\nAdd chocolate? \" + addChocolate;\n priceMessage += \"\\nQuantity: \" + numOfCufee;\n priceMessage += \"\\nTotal: $\" + price;\n priceMessage += \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String descripcion() {\n return \"Viaje incentivo que te envia la empresa \" + empresa;\n }", "public String getMoneyRemark() {\n return moneyRemark;\n }", "private String getMessageSummary() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(MAIL_FROM).append(\":\").append(props.getProperty(MAIL_FROM, \"\"));\n\n\t\tif (props.containsKey(MAIL_REPLY_TO)) {\n\t\t\tsb.append(\",\").append(MAIL_REPLY_TO).append(\":\").append(props.getProperty(MAIL_REPLY_TO));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_TO).append(\":\").append(props.getProperty(MAIL_TO));\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_CC).append(\":\").append(props.getProperty(MAIL_CC));\n\t\t}\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_BCC).append(\":\").append(props.getProperty(MAIL_BCC));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_SUBJECT).append(\":\").append(props.getProperty(MAIL_SUBJECT, \"\"));\n\n\t\treturn sb.toString();\n\t}", "private String geraMensagem(Mensagem msg) {\n\t\treturn new StringBuilder()\n\t\t\t.append(msg.remetente.nome)\n\t\t\t.append(\" enviou para \")\n\t\t\t.append(msg.destinatario.nome)\n\t\t\t.append(\" uma mensagem suspeita.\")\n\t\t\t.toString();\n\t}", "private String buildResultMessage() {\n String result;\n byte[] digest = new byte[20];\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-1\");\n digest = md.digest(phonepartBytes);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n\n byte[] checksumBytes = new byte[4];\n System.arraycopy(digest, 0, checksumBytes, 0, 4);\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n try {\n outputStream.write(checksumBytes);\n outputStream.write(phonepartBytes);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n byte[] completeOutputBytes = outputStream.toByteArray();\n result = Util.insertPeriodically(new Base32().encodeAsString(completeOutputBytes), 4);\n result = result.replaceAll(\"=\", \"\");\n return result;\n }", "public String getSupMemo() {\n return supMemo;\n }", "public void writeMassege() {\n m = ChatClient.message;\n jtaChatHistory.setText(\"You : \" + m);\n //writeMassageServer();\n }", "private String createOrderSummary(int price, boolean cream, boolean chocolate, String name){\n String orderSummary = \"Name: \"+name+\"\\n\" +\n \"Add whipped cream? \" + cream +\"\\n\"+\n \"Add chocolate? \" + chocolate + \"\\n\" +\n \"Quantity: \"+\n quantity +\n \"\\nTotal: $\" + price +\n \"\\n\" + getString(R.string.thankyou) + \"!\";\n return orderSummary;\n }", "@Override\n public String getDescription() {\n return \"Digital goods feedback\";\n }", "public String getRemark()\n/* */ {\n/* 255 */ return this.remark;\n/* */ }", "@Override\n public String getMessage() {\n String result =\"Audio Message {\\n\";\n result +=\"\\tID: \"+ID+\"\\n\";\n result +=\"\\tBuffer Size: \"+bufferSize+\"\\n\";\n result +=\"}\";\n \n return result;\n }", "public String creerMessage(){\n return profile.getMessage();\n }", "BigInteger getMessage();", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private String m50433y() {\n if (TextUtils.isEmpty(this.f30738i0.getText().toString().trim())) {\n return this.f30720S.getString(C10232R.string.payment_error_blank_field);\n }\n return !CardPaymentParams.m53961m(this.f30738i0.getText().toString().trim()) ? this.f30720S.getString(C10232R.string.checkout_error_card_holder_invalid) : \"\";\n }", "private String getOrderSummary() {\n final int numberOfCoffees = getNumberOfCoffees();\n if (numberOfCoffees == 0) {\n return Constants.FREE_MESSAGE;\n }\n\n final String name = ((EditText) findViewById(R.id.name_edit_text))\n .getText().toString();\n\n return Constants.NAME + \": \" +\n (name.isEmpty() ? Constants.DEFAULT_NAME : name) + \"\\n\" +\n getToppingsSummary() + \"\\n\" +\n Constants.QUANTITY + \": \" + numberOfCoffees + \"\\n\" +\n Constants.TOTAL + \": \" +\n NumberFormat.getCurrencyInstance().format(getTotalPrice()) + \"\\n\" +\n Constants.BYE_GREETING;\n }", "String getMessage();", "String getMessage();", "String getMessage();", "public String getMerchantNo();", "@Override\n public String getDescription() {\n return \"Digital goods delivery\";\n }", "private String createOrderSummary(int price, String name, boolean hasWhippedCream,\n boolean hasChocolate){\n return getString(R.string.order_summary_name, name) +\n \"\\n\" + getString(R.string.add_whipped_cream, hasWhippedCream) +\n \"\\n\" + getString(R.string.add_chocolate, hasChocolate) +\n \"\\n\" + getString(R.string.order_quantity, quantity) +\n \"\\n\" + getString(R.string.order_total, price) +\n \"\\n\" + getString(R.string.thank_you);\n }", "@Override\r\n\tpublic String getMessage() {\n\t\treturn \"홀수입력 !!\";\r\n\t}", "private String generateOrderSummary(String name, int quantity, boolean whippedCreamChecked, boolean chocolateChecked) {\n int price = calculatePrice(quantity, whippedCreamChecked, chocolateChecked);\n\n String priceMessage = \"Name: \"+ name + \"\\n\" +\n \"Add whipped cream? \"+ whippedCreamChecked + \"\\n\" +\n \"Chocolate? \"+ chocolateChecked + \"\\n\" +\n \"Quantity: \" + quantity + \"\\n\" +\n \"Total: $ \" + price + \"\\n\" +\n \"Thank you!\";\n\n return priceMessage;\n }", "@Override\n public String getMailetInfo() {\n return \"Sieve Mailbox Mailet\";\n }", "public String returnMessage () {\n String msg = getString(R.string.result, score);\n if (score > 7) {\n msg += \"\\n\" + getString(R.string.fabulous);\n }\n else if (score >= 5 && score <= 7) {\n msg += \"\\n\" + getString(R.string.good_job);\n }\n else {\n msg += \"\\n\" + getString(R.string.try_again);\n }\n return msg;\n }", "public String getMessage(){\n return(message);\n }", "private String m50388c(PaymentError paymentError) {\n try {\n return new JSONObject(paymentError.mo40763b()).getString(\"description\");\n } catch (Exception unused) {\n return paymentError.mo40764c();\n }\n }", "java.lang.String getBuyDescribe();", "public abstract void msgPayment(Customer customer, Cash cash);", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();" ]
[ "0.6530689", "0.6530689", "0.6530689", "0.64228755", "0.63587", "0.63587", "0.63587", "0.63587", "0.62296426", "0.62271774", "0.61935705", "0.61930877", "0.6159983", "0.6152955", "0.6152955", "0.6152955", "0.6146322", "0.6146322", "0.6146322", "0.6134969", "0.6122359", "0.6122359", "0.6122359", "0.6101424", "0.60919434", "0.6082051", "0.6073869", "0.6057527", "0.6045923", "0.6045923", "0.5982354", "0.59194446", "0.5909853", "0.5868013", "0.58608526", "0.5734803", "0.569782", "0.5665116", "0.5621606", "0.5590498", "0.5590498", "0.5590498", "0.55802053", "0.55775243", "0.5564015", "0.55494684", "0.5524799", "0.5524799", "0.5524799", "0.5524594", "0.54906577", "0.5437719", "0.5397792", "0.53976196", "0.53916323", "0.53908175", "0.53849983", "0.5376101", "0.5373217", "0.5370599", "0.5361155", "0.5353887", "0.5349328", "0.5348964", "0.5335186", "0.5311137", "0.5303364", "0.53020096", "0.53015757", "0.5298194", "0.52960545", "0.52935654", "0.5286505", "0.5286505", "0.5286505", "0.5284396", "0.5266947", "0.52659756", "0.5259939", "0.5255565", "0.5244451", "0.52355653", "0.5228516", "0.52243024", "0.5207915", "0.5204521", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433" ]
0.0
-1
Humanreadable message for the merchant optional string memo = 4;
java.lang.String getMemo();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "private String getMessage() {\n\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\r\n\t\t\r\n\t\tboolean addSign = prefs.getBoolean(\"addsign\", true);\r\n\t\t\r\n\t\ttry {\r\n\t\t\r\n\t\tdefMessage = \"I am busy right now and will call you latter.\";\r\n\t\t\r\n\t\tfinalMessage = prefs.getString(\"message\", defMessage);\r\n\t\tif(finalMessage.equals(\"\"))\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t} catch (RuntimeException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t}\r\n\t\t\r\n\t\tif(addSign)\r\n\t\t\tfinalMessage += \"\\nSent using Calls and SMS Blocker for android.\\nDownload from: https://play.google.com/store/apps/details?id=com.atiffarrukh.callandsmsblocker\";\r\n\t\treturn finalMessage;\r\n\t}", "@Override\n public String getPayMemo() {\n return String.format(\"Employee ID: %d, Pay Date: %s\", this.getEmpID(),\n HRUtility.dateToStr(new Date()));\n }", "public void setMemo(String memo) {\n\t\tMEMO = memo;\n\t}", "public java.lang.String getMemo() {\r\n return memo;\r\n }", "public void setMemo(java.lang.String memo) {\r\n this.memo = memo;\r\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public void setMemo (java.lang.String memo) {\r\n\t\tthis.memo = memo;\r\n\t}", "@Override\n public String getMessage() {\n String chuoi=\"\";\n if (maCD.length()!=5)\n chuoi=\"MaCD bao gom 5 ki tu\";\n else if (soBaiHat<10)\n chuoi=\"So bai hat phai lon hon 10 bai\";\n return\n chuoi;\n }", "public void setMemo(String memo) {\n this.memo = memo == null ? null : memo.trim();\n }", "public java.lang.String getMemo () {\r\n\t\treturn memo;\r\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo == null ? null : memo.trim();\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public String getSMemo() {\n return sMemo;\n }", "private String createOrderSummary(String userName, int price, boolean addWhippedCream, boolean addChocolate, boolean addCinnamon, boolean addMarshmallows){\n String priceMessage = \"Name: \" + userName;\n priceMessage = priceMessage + \"\\nAdd Marshmallows? \" + addMarshmallows;\n priceMessage = priceMessage + \"\\nAdd Cinnamon? \" + addCinnamon;\n priceMessage = priceMessage + \"\\nAdd Whipped Cream? \" + addWhippedCream;\n priceMessage = priceMessage + \"\\nAdd Chocolate? \" + addChocolate;\n priceMessage = priceMessage + \"\\nQuantity: \" + quantity;\n priceMessage = priceMessage + \"\\nTotal: $\" + price;\n priceMessage = priceMessage + \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String getPayMemo() throws ParseException {\n return \"Employee ID: \" + getEmpID() + \", Pay Date: \" + HRDateUtils.strToDate(\"2019-10-01\");\n }", "public String showInfoMedi(){\n\t\tString msg = \"\";\n\n\t\tmsg += \"NOMBRE DE LA MEDICINA: \"+name+\"\\n\";\n\t\tmsg += \"LA DOSIS: \"+dose+\"\\n\";\n\t\tmsg += \"COSTO POR DOSIS: \"+doseCost+\"\\n\";\n\t\tmsg += \"FRECUENCIA QUE ESTA DEBE SER APLICADA: \"+frecuency+\"\\n\";\n\n\t\treturn msg;\n\t}", "private String createOrderSummary(int price,boolean addWhippedCream,boolean addChocolate,String name){\n String priceMessage=\"Name :\"+name;\n priceMessage+=\"\\nadd whipped cream ? \"+addWhippedCream;\n priceMessage+=\"\\nadd chocolate ? \"+addChocolate;\n priceMessage+=\"\\nQuantity \"+quantity;\n priceMessage+=\"\\nTotal :$ \"+price;\n priceMessage+=\"\\nThank you!\";\n return priceMessage;\n }", "@Override\r\n public String receita() {\n return \"Misturar os ingredientes; bater no liquidificador; colocar na máquina de waffle por 10m\";\r\n }", "private String createOrderSummary (String name, int price, boolean addWhippedCream, boolean addChocolate) {\n String priceMessage = getString(R.string.order_summary_name, name);\n priceMessage += \"\\n\" + getString(R.string.order_summary_whipped_cream, addWhippedCream);\n priceMessage += \"\\n\" + getString(R.string.order_summary_chocolate, addChocolate);\n priceMessage += \"\\n\" + getString(R.string.order_summary_quantity, quantity);\n priceMessage += \"\\nTotal: \" + price;\n priceMessage += \"\\n\" + getString(R.string.thank_you);\n return priceMessage;\n }", "public void setSMemo(String sMemo) {\n this.sMemo = sMemo;\n }", "public String getDescription()\r\n\t{\r\n\t\tStringBuilder msgreturn = new StringBuilder().append(m_name).append(\" \").append(m_taxBaseAmt.toString());\r\n\t\treturn msgreturn.toString();\r\n\t}", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@Override\n public String getDescription() {\n return \"Arbitrary message\";\n }", "public String getMessage()\n {\n return String.format(\"MessageType=%s,TransactionId=%s,TerminalId=%s,MerchantId=%s,FingerData=%s,CustomerId=%s,IdData=%s, CustomerData=%s\", this.messageType, this.transactionId, this.terminalId, this.merchantId, this.fingerData, this.customerId, this.idData, this.customerData);\n }", "private String buildMessage(String message) {\n\t\tif(message != null && message.contains(\"@record\")) {\n\t\t\tmessage = message.replaceAll(\"@record\", answerUser);\n\t\t\trecorded.put(owner.id(), answerUser);\n\t\t}\n\t\t//o sistema substitui o texto !id pelo id do usuário da conversa\n\t\tif(message != null && message.contains(\"!id\")) {\n\t\t\tmessage = message.replaceAll(\"!id\", owner.id() + \"\");\n\t\t}\n\t\t//o sistema verifica se tem alguma gravacao para o código recebido\n\t\tif(message != null && message.contains(\"#find\")) {\n\t\t\tString gravacao = recorded.get(Integer.parseInt(userLatestAnswer.get(owner.id())));\n\t\t\t//se houver gravacao, o sistema informa qual o desejo do amigo secreto\n\t\t\tif(gravacao != null)\n\t\t\t\tmessage = message.replaceAll(\"#find\", gravacao);\n\t\t\t//caso nao haja gravacao, o sistema notifica o usuário da situacao\n\t\t\telse\n\t\t\t\tmessage = \"O código informado não corresponde ao desejo de um amigo secreto... por favor tente novamente\";\n\t\t}\n\n\t\treturn message;\n\t}", "@Override\n\tpublic String getText() {\n\t\treturn \"MMS: \" + text;\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "private String getOrderDetails(Order order) {\n String message = getString(R.string.total) + \"\\n\" + getString(R.string.name) + \": \" + order.getCustomerName() +\n \"\\n\" + getString(R.string.add_cream) + \"? \" + String.valueOf(order.isHasWhippedCream()) +\n \"\\n\" + getString(R.string.add_chocolate) + \"? \" + String.valueOf(order.isHasChocolate()) +\n \"\\n\" + getString(R.string.quantity) + \": \" + order.getCupsNumber() + \"\\n\" + getString(R.string.resut) +\n \": $\" + MainActivity.calculatePrice(order) + \"\\n\" + getString(R.string.thanks) + \"!\";\n return message;\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "public String getMessage()\n {\n return super.getMessage()+promo_error+\"not found\";\n }", "private static String build3PidErrorMessage(Context context, @StringRes int errorMessageRes, @Nullable String additionalInfo) {\n StringBuilder builder = new StringBuilder();\n builder.append(context.getString(errorMessageRes));\n\n if (additionalInfo != null) {\n builder.append(' ');\n builder.append(context.getString(R.string.account_additional_info, additionalInfo));\n }\n\n return builder.toString();\n }", "@Override\n public String getDescription() {\n return \"Mint currency\";\n }", "@Override\n public String getDescription() {\n return \"Digital goods purchase\";\n }", "private String createOrderSummary(int price, boolean addWhippedCream, boolean addChocolate ,String name)\n {\n if (addWhippedCream==true) price+= (numOfCufee) ;\n if (addChocolate == true ) price+=(2*numOfCufee) ;\n String priceMessage = \"Name: \"+name;\n priceMessage += \"\\nAdd whipped cream? \" + addWhippedCream;\n priceMessage += \"\\nAdd chocolate? \" + addChocolate;\n priceMessage += \"\\nQuantity: \" + numOfCufee;\n priceMessage += \"\\nTotal: $\" + price;\n priceMessage += \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String descripcion() {\n return \"Viaje incentivo que te envia la empresa \" + empresa;\n }", "public String getMoneyRemark() {\n return moneyRemark;\n }", "private String getMessageSummary() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(MAIL_FROM).append(\":\").append(props.getProperty(MAIL_FROM, \"\"));\n\n\t\tif (props.containsKey(MAIL_REPLY_TO)) {\n\t\t\tsb.append(\",\").append(MAIL_REPLY_TO).append(\":\").append(props.getProperty(MAIL_REPLY_TO));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_TO).append(\":\").append(props.getProperty(MAIL_TO));\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_CC).append(\":\").append(props.getProperty(MAIL_CC));\n\t\t}\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_BCC).append(\":\").append(props.getProperty(MAIL_BCC));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_SUBJECT).append(\":\").append(props.getProperty(MAIL_SUBJECT, \"\"));\n\n\t\treturn sb.toString();\n\t}", "private String geraMensagem(Mensagem msg) {\n\t\treturn new StringBuilder()\n\t\t\t.append(msg.remetente.nome)\n\t\t\t.append(\" enviou para \")\n\t\t\t.append(msg.destinatario.nome)\n\t\t\t.append(\" uma mensagem suspeita.\")\n\t\t\t.toString();\n\t}", "private String buildResultMessage() {\n String result;\n byte[] digest = new byte[20];\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-1\");\n digest = md.digest(phonepartBytes);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n\n byte[] checksumBytes = new byte[4];\n System.arraycopy(digest, 0, checksumBytes, 0, 4);\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n try {\n outputStream.write(checksumBytes);\n outputStream.write(phonepartBytes);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n byte[] completeOutputBytes = outputStream.toByteArray();\n result = Util.insertPeriodically(new Base32().encodeAsString(completeOutputBytes), 4);\n result = result.replaceAll(\"=\", \"\");\n return result;\n }", "public String getSupMemo() {\n return supMemo;\n }", "public void writeMassege() {\n m = ChatClient.message;\n jtaChatHistory.setText(\"You : \" + m);\n //writeMassageServer();\n }", "private String createOrderSummary(int price, boolean cream, boolean chocolate, String name){\n String orderSummary = \"Name: \"+name+\"\\n\" +\n \"Add whipped cream? \" + cream +\"\\n\"+\n \"Add chocolate? \" + chocolate + \"\\n\" +\n \"Quantity: \"+\n quantity +\n \"\\nTotal: $\" + price +\n \"\\n\" + getString(R.string.thankyou) + \"!\";\n return orderSummary;\n }", "@Override\n public String getDescription() {\n return \"Digital goods feedback\";\n }", "public String getRemark()\n/* */ {\n/* 255 */ return this.remark;\n/* */ }", "@Override\n public String getMessage() {\n String result =\"Audio Message {\\n\";\n result +=\"\\tID: \"+ID+\"\\n\";\n result +=\"\\tBuffer Size: \"+bufferSize+\"\\n\";\n result +=\"}\";\n \n return result;\n }", "public String creerMessage(){\n return profile.getMessage();\n }", "BigInteger getMessage();", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private String m50433y() {\n if (TextUtils.isEmpty(this.f30738i0.getText().toString().trim())) {\n return this.f30720S.getString(C10232R.string.payment_error_blank_field);\n }\n return !CardPaymentParams.m53961m(this.f30738i0.getText().toString().trim()) ? this.f30720S.getString(C10232R.string.checkout_error_card_holder_invalid) : \"\";\n }", "private String getOrderSummary() {\n final int numberOfCoffees = getNumberOfCoffees();\n if (numberOfCoffees == 0) {\n return Constants.FREE_MESSAGE;\n }\n\n final String name = ((EditText) findViewById(R.id.name_edit_text))\n .getText().toString();\n\n return Constants.NAME + \": \" +\n (name.isEmpty() ? Constants.DEFAULT_NAME : name) + \"\\n\" +\n getToppingsSummary() + \"\\n\" +\n Constants.QUANTITY + \": \" + numberOfCoffees + \"\\n\" +\n Constants.TOTAL + \": \" +\n NumberFormat.getCurrencyInstance().format(getTotalPrice()) + \"\\n\" +\n Constants.BYE_GREETING;\n }", "String getMessage();", "String getMessage();", "String getMessage();", "public String getMerchantNo();", "@Override\n public String getDescription() {\n return \"Digital goods delivery\";\n }", "private String createOrderSummary(int price, String name, boolean hasWhippedCream,\n boolean hasChocolate){\n return getString(R.string.order_summary_name, name) +\n \"\\n\" + getString(R.string.add_whipped_cream, hasWhippedCream) +\n \"\\n\" + getString(R.string.add_chocolate, hasChocolate) +\n \"\\n\" + getString(R.string.order_quantity, quantity) +\n \"\\n\" + getString(R.string.order_total, price) +\n \"\\n\" + getString(R.string.thank_you);\n }", "@Override\r\n\tpublic String getMessage() {\n\t\treturn \"홀수입력 !!\";\r\n\t}", "private String generateOrderSummary(String name, int quantity, boolean whippedCreamChecked, boolean chocolateChecked) {\n int price = calculatePrice(quantity, whippedCreamChecked, chocolateChecked);\n\n String priceMessage = \"Name: \"+ name + \"\\n\" +\n \"Add whipped cream? \"+ whippedCreamChecked + \"\\n\" +\n \"Chocolate? \"+ chocolateChecked + \"\\n\" +\n \"Quantity: \" + quantity + \"\\n\" +\n \"Total: $ \" + price + \"\\n\" +\n \"Thank you!\";\n\n return priceMessage;\n }", "@Override\n public String getMailetInfo() {\n return \"Sieve Mailbox Mailet\";\n }", "public String returnMessage () {\n String msg = getString(R.string.result, score);\n if (score > 7) {\n msg += \"\\n\" + getString(R.string.fabulous);\n }\n else if (score >= 5 && score <= 7) {\n msg += \"\\n\" + getString(R.string.good_job);\n }\n else {\n msg += \"\\n\" + getString(R.string.try_again);\n }\n return msg;\n }", "public String getMessage(){\n return(message);\n }", "private String m50388c(PaymentError paymentError) {\n try {\n return new JSONObject(paymentError.mo40763b()).getString(\"description\");\n } catch (Exception unused) {\n return paymentError.mo40764c();\n }\n }", "java.lang.String getBuyDescribe();", "public abstract void msgPayment(Customer customer, Cash cash);", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();" ]
[ "0.64215565", "0.63572776", "0.63572776", "0.63572776", "0.63572776", "0.6230878", "0.6226878", "0.61937135", "0.6192103", "0.61602914", "0.615164", "0.615164", "0.615164", "0.6146373", "0.6146373", "0.6146373", "0.61349267", "0.6120991", "0.6120991", "0.6120991", "0.61019516", "0.6093255", "0.60826933", "0.6072336", "0.6058279", "0.60461986", "0.60461986", "0.59808815", "0.59198743", "0.5909179", "0.5868135", "0.58613884", "0.5735315", "0.5698737", "0.5665372", "0.562132", "0.5588627", "0.5588627", "0.5588627", "0.5581732", "0.55789053", "0.5565189", "0.5550607", "0.552437", "0.552437", "0.552437", "0.55241656", "0.54899883", "0.5438751", "0.5399326", "0.5397901", "0.5391264", "0.5390979", "0.5386106", "0.53759724", "0.5374274", "0.5371592", "0.5360501", "0.5352885", "0.5349294", "0.5349294", "0.53355414", "0.5310743", "0.5305369", "0.5303087", "0.5302099", "0.52958566", "0.5294715", "0.5292624", "0.5287689", "0.5287689", "0.5287689", "0.5281478", "0.5266776", "0.5266263", "0.5261392", "0.5255795", "0.52441424", "0.52365196", "0.522935", "0.5223733", "0.5207632", "0.52022713", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134" ]
0.6528686
2
Humanreadable message for the merchant optional string memo = 4;
com.google.protobuf.ByteString getMemoBytes();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getMemo();", "java.lang.String getMemo();", "java.lang.String getMemo();", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "private String getMessage() {\n\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\r\n\t\t\r\n\t\tboolean addSign = prefs.getBoolean(\"addsign\", true);\r\n\t\t\r\n\t\ttry {\r\n\t\t\r\n\t\tdefMessage = \"I am busy right now and will call you latter.\";\r\n\t\t\r\n\t\tfinalMessage = prefs.getString(\"message\", defMessage);\r\n\t\tif(finalMessage.equals(\"\"))\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t} catch (RuntimeException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t}\r\n\t\t\r\n\t\tif(addSign)\r\n\t\t\tfinalMessage += \"\\nSent using Calls and SMS Blocker for android.\\nDownload from: https://play.google.com/store/apps/details?id=com.atiffarrukh.callandsmsblocker\";\r\n\t\treturn finalMessage;\r\n\t}", "@Override\n public String getPayMemo() {\n return String.format(\"Employee ID: %d, Pay Date: %s\", this.getEmpID(),\n HRUtility.dateToStr(new Date()));\n }", "public void setMemo(String memo) {\n\t\tMEMO = memo;\n\t}", "public java.lang.String getMemo() {\r\n return memo;\r\n }", "public void setMemo(java.lang.String memo) {\r\n this.memo = memo;\r\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public void setMemo (java.lang.String memo) {\r\n\t\tthis.memo = memo;\r\n\t}", "@Override\n public String getMessage() {\n String chuoi=\"\";\n if (maCD.length()!=5)\n chuoi=\"MaCD bao gom 5 ki tu\";\n else if (soBaiHat<10)\n chuoi=\"So bai hat phai lon hon 10 bai\";\n return\n chuoi;\n }", "public void setMemo(String memo) {\n this.memo = memo == null ? null : memo.trim();\n }", "public java.lang.String getMemo () {\r\n\t\treturn memo;\r\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo == null ? null : memo.trim();\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public String getSMemo() {\n return sMemo;\n }", "private String createOrderSummary(String userName, int price, boolean addWhippedCream, boolean addChocolate, boolean addCinnamon, boolean addMarshmallows){\n String priceMessage = \"Name: \" + userName;\n priceMessage = priceMessage + \"\\nAdd Marshmallows? \" + addMarshmallows;\n priceMessage = priceMessage + \"\\nAdd Cinnamon? \" + addCinnamon;\n priceMessage = priceMessage + \"\\nAdd Whipped Cream? \" + addWhippedCream;\n priceMessage = priceMessage + \"\\nAdd Chocolate? \" + addChocolate;\n priceMessage = priceMessage + \"\\nQuantity: \" + quantity;\n priceMessage = priceMessage + \"\\nTotal: $\" + price;\n priceMessage = priceMessage + \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String getPayMemo() throws ParseException {\n return \"Employee ID: \" + getEmpID() + \", Pay Date: \" + HRDateUtils.strToDate(\"2019-10-01\");\n }", "public String showInfoMedi(){\n\t\tString msg = \"\";\n\n\t\tmsg += \"NOMBRE DE LA MEDICINA: \"+name+\"\\n\";\n\t\tmsg += \"LA DOSIS: \"+dose+\"\\n\";\n\t\tmsg += \"COSTO POR DOSIS: \"+doseCost+\"\\n\";\n\t\tmsg += \"FRECUENCIA QUE ESTA DEBE SER APLICADA: \"+frecuency+\"\\n\";\n\n\t\treturn msg;\n\t}", "private String createOrderSummary(int price,boolean addWhippedCream,boolean addChocolate,String name){\n String priceMessage=\"Name :\"+name;\n priceMessage+=\"\\nadd whipped cream ? \"+addWhippedCream;\n priceMessage+=\"\\nadd chocolate ? \"+addChocolate;\n priceMessage+=\"\\nQuantity \"+quantity;\n priceMessage+=\"\\nTotal :$ \"+price;\n priceMessage+=\"\\nThank you!\";\n return priceMessage;\n }", "@Override\r\n public String receita() {\n return \"Misturar os ingredientes; bater no liquidificador; colocar na máquina de waffle por 10m\";\r\n }", "private String createOrderSummary (String name, int price, boolean addWhippedCream, boolean addChocolate) {\n String priceMessage = getString(R.string.order_summary_name, name);\n priceMessage += \"\\n\" + getString(R.string.order_summary_whipped_cream, addWhippedCream);\n priceMessage += \"\\n\" + getString(R.string.order_summary_chocolate, addChocolate);\n priceMessage += \"\\n\" + getString(R.string.order_summary_quantity, quantity);\n priceMessage += \"\\nTotal: \" + price;\n priceMessage += \"\\n\" + getString(R.string.thank_you);\n return priceMessage;\n }", "public void setSMemo(String sMemo) {\n this.sMemo = sMemo;\n }", "public String getDescription()\r\n\t{\r\n\t\tStringBuilder msgreturn = new StringBuilder().append(m_name).append(\" \").append(m_taxBaseAmt.toString());\r\n\t\treturn msgreturn.toString();\r\n\t}", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@Override\n public String getDescription() {\n return \"Arbitrary message\";\n }", "public String getMessage()\n {\n return String.format(\"MessageType=%s,TransactionId=%s,TerminalId=%s,MerchantId=%s,FingerData=%s,CustomerId=%s,IdData=%s, CustomerData=%s\", this.messageType, this.transactionId, this.terminalId, this.merchantId, this.fingerData, this.customerId, this.idData, this.customerData);\n }", "private String buildMessage(String message) {\n\t\tif(message != null && message.contains(\"@record\")) {\n\t\t\tmessage = message.replaceAll(\"@record\", answerUser);\n\t\t\trecorded.put(owner.id(), answerUser);\n\t\t}\n\t\t//o sistema substitui o texto !id pelo id do usuário da conversa\n\t\tif(message != null && message.contains(\"!id\")) {\n\t\t\tmessage = message.replaceAll(\"!id\", owner.id() + \"\");\n\t\t}\n\t\t//o sistema verifica se tem alguma gravacao para o código recebido\n\t\tif(message != null && message.contains(\"#find\")) {\n\t\t\tString gravacao = recorded.get(Integer.parseInt(userLatestAnswer.get(owner.id())));\n\t\t\t//se houver gravacao, o sistema informa qual o desejo do amigo secreto\n\t\t\tif(gravacao != null)\n\t\t\t\tmessage = message.replaceAll(\"#find\", gravacao);\n\t\t\t//caso nao haja gravacao, o sistema notifica o usuário da situacao\n\t\t\telse\n\t\t\t\tmessage = \"O código informado não corresponde ao desejo de um amigo secreto... por favor tente novamente\";\n\t\t}\n\n\t\treturn message;\n\t}", "@Override\n\tpublic String getText() {\n\t\treturn \"MMS: \" + text;\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "private String getOrderDetails(Order order) {\n String message = getString(R.string.total) + \"\\n\" + getString(R.string.name) + \": \" + order.getCustomerName() +\n \"\\n\" + getString(R.string.add_cream) + \"? \" + String.valueOf(order.isHasWhippedCream()) +\n \"\\n\" + getString(R.string.add_chocolate) + \"? \" + String.valueOf(order.isHasChocolate()) +\n \"\\n\" + getString(R.string.quantity) + \": \" + order.getCupsNumber() + \"\\n\" + getString(R.string.resut) +\n \": $\" + MainActivity.calculatePrice(order) + \"\\n\" + getString(R.string.thanks) + \"!\";\n return message;\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "public String getMessage()\n {\n return super.getMessage()+promo_error+\"not found\";\n }", "private static String build3PidErrorMessage(Context context, @StringRes int errorMessageRes, @Nullable String additionalInfo) {\n StringBuilder builder = new StringBuilder();\n builder.append(context.getString(errorMessageRes));\n\n if (additionalInfo != null) {\n builder.append(' ');\n builder.append(context.getString(R.string.account_additional_info, additionalInfo));\n }\n\n return builder.toString();\n }", "@Override\n public String getDescription() {\n return \"Mint currency\";\n }", "@Override\n public String getDescription() {\n return \"Digital goods purchase\";\n }", "private String createOrderSummary(int price, boolean addWhippedCream, boolean addChocolate ,String name)\n {\n if (addWhippedCream==true) price+= (numOfCufee) ;\n if (addChocolate == true ) price+=(2*numOfCufee) ;\n String priceMessage = \"Name: \"+name;\n priceMessage += \"\\nAdd whipped cream? \" + addWhippedCream;\n priceMessage += \"\\nAdd chocolate? \" + addChocolate;\n priceMessage += \"\\nQuantity: \" + numOfCufee;\n priceMessage += \"\\nTotal: $\" + price;\n priceMessage += \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String descripcion() {\n return \"Viaje incentivo que te envia la empresa \" + empresa;\n }", "public String getMoneyRemark() {\n return moneyRemark;\n }", "private String getMessageSummary() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(MAIL_FROM).append(\":\").append(props.getProperty(MAIL_FROM, \"\"));\n\n\t\tif (props.containsKey(MAIL_REPLY_TO)) {\n\t\t\tsb.append(\",\").append(MAIL_REPLY_TO).append(\":\").append(props.getProperty(MAIL_REPLY_TO));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_TO).append(\":\").append(props.getProperty(MAIL_TO));\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_CC).append(\":\").append(props.getProperty(MAIL_CC));\n\t\t}\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_BCC).append(\":\").append(props.getProperty(MAIL_BCC));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_SUBJECT).append(\":\").append(props.getProperty(MAIL_SUBJECT, \"\"));\n\n\t\treturn sb.toString();\n\t}", "private String geraMensagem(Mensagem msg) {\n\t\treturn new StringBuilder()\n\t\t\t.append(msg.remetente.nome)\n\t\t\t.append(\" enviou para \")\n\t\t\t.append(msg.destinatario.nome)\n\t\t\t.append(\" uma mensagem suspeita.\")\n\t\t\t.toString();\n\t}", "private String buildResultMessage() {\n String result;\n byte[] digest = new byte[20];\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-1\");\n digest = md.digest(phonepartBytes);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n\n byte[] checksumBytes = new byte[4];\n System.arraycopy(digest, 0, checksumBytes, 0, 4);\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n try {\n outputStream.write(checksumBytes);\n outputStream.write(phonepartBytes);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n byte[] completeOutputBytes = outputStream.toByteArray();\n result = Util.insertPeriodically(new Base32().encodeAsString(completeOutputBytes), 4);\n result = result.replaceAll(\"=\", \"\");\n return result;\n }", "public String getSupMemo() {\n return supMemo;\n }", "public void writeMassege() {\n m = ChatClient.message;\n jtaChatHistory.setText(\"You : \" + m);\n //writeMassageServer();\n }", "private String createOrderSummary(int price, boolean cream, boolean chocolate, String name){\n String orderSummary = \"Name: \"+name+\"\\n\" +\n \"Add whipped cream? \" + cream +\"\\n\"+\n \"Add chocolate? \" + chocolate + \"\\n\" +\n \"Quantity: \"+\n quantity +\n \"\\nTotal: $\" + price +\n \"\\n\" + getString(R.string.thankyou) + \"!\";\n return orderSummary;\n }", "@Override\n public String getDescription() {\n return \"Digital goods feedback\";\n }", "public String getRemark()\n/* */ {\n/* 255 */ return this.remark;\n/* */ }", "@Override\n public String getMessage() {\n String result =\"Audio Message {\\n\";\n result +=\"\\tID: \"+ID+\"\\n\";\n result +=\"\\tBuffer Size: \"+bufferSize+\"\\n\";\n result +=\"}\";\n \n return result;\n }", "public String creerMessage(){\n return profile.getMessage();\n }", "BigInteger getMessage();", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private String m50433y() {\n if (TextUtils.isEmpty(this.f30738i0.getText().toString().trim())) {\n return this.f30720S.getString(C10232R.string.payment_error_blank_field);\n }\n return !CardPaymentParams.m53961m(this.f30738i0.getText().toString().trim()) ? this.f30720S.getString(C10232R.string.checkout_error_card_holder_invalid) : \"\";\n }", "private String getOrderSummary() {\n final int numberOfCoffees = getNumberOfCoffees();\n if (numberOfCoffees == 0) {\n return Constants.FREE_MESSAGE;\n }\n\n final String name = ((EditText) findViewById(R.id.name_edit_text))\n .getText().toString();\n\n return Constants.NAME + \": \" +\n (name.isEmpty() ? Constants.DEFAULT_NAME : name) + \"\\n\" +\n getToppingsSummary() + \"\\n\" +\n Constants.QUANTITY + \": \" + numberOfCoffees + \"\\n\" +\n Constants.TOTAL + \": \" +\n NumberFormat.getCurrencyInstance().format(getTotalPrice()) + \"\\n\" +\n Constants.BYE_GREETING;\n }", "String getMessage();", "String getMessage();", "String getMessage();", "public String getMerchantNo();", "@Override\n public String getDescription() {\n return \"Digital goods delivery\";\n }", "private String createOrderSummary(int price, String name, boolean hasWhippedCream,\n boolean hasChocolate){\n return getString(R.string.order_summary_name, name) +\n \"\\n\" + getString(R.string.add_whipped_cream, hasWhippedCream) +\n \"\\n\" + getString(R.string.add_chocolate, hasChocolate) +\n \"\\n\" + getString(R.string.order_quantity, quantity) +\n \"\\n\" + getString(R.string.order_total, price) +\n \"\\n\" + getString(R.string.thank_you);\n }", "@Override\r\n\tpublic String getMessage() {\n\t\treturn \"홀수입력 !!\";\r\n\t}", "private String generateOrderSummary(String name, int quantity, boolean whippedCreamChecked, boolean chocolateChecked) {\n int price = calculatePrice(quantity, whippedCreamChecked, chocolateChecked);\n\n String priceMessage = \"Name: \"+ name + \"\\n\" +\n \"Add whipped cream? \"+ whippedCreamChecked + \"\\n\" +\n \"Chocolate? \"+ chocolateChecked + \"\\n\" +\n \"Quantity: \" + quantity + \"\\n\" +\n \"Total: $ \" + price + \"\\n\" +\n \"Thank you!\";\n\n return priceMessage;\n }", "@Override\n public String getMailetInfo() {\n return \"Sieve Mailbox Mailet\";\n }", "public String returnMessage () {\n String msg = getString(R.string.result, score);\n if (score > 7) {\n msg += \"\\n\" + getString(R.string.fabulous);\n }\n else if (score >= 5 && score <= 7) {\n msg += \"\\n\" + getString(R.string.good_job);\n }\n else {\n msg += \"\\n\" + getString(R.string.try_again);\n }\n return msg;\n }", "public String getMessage(){\n return(message);\n }", "private String m50388c(PaymentError paymentError) {\n try {\n return new JSONObject(paymentError.mo40763b()).getString(\"description\");\n } catch (Exception unused) {\n return paymentError.mo40764c();\n }\n }", "java.lang.String getBuyDescribe();", "public abstract void msgPayment(Customer customer, Cash cash);", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();" ]
[ "0.6528686", "0.6528686", "0.6528686", "0.64215565", "0.63572776", "0.63572776", "0.63572776", "0.63572776", "0.6230878", "0.6226878", "0.61937135", "0.6192103", "0.61602914", "0.615164", "0.615164", "0.615164", "0.6146373", "0.6146373", "0.6146373", "0.61349267", "0.6120991", "0.6120991", "0.6120991", "0.61019516", "0.6093255", "0.60826933", "0.6072336", "0.6058279", "0.60461986", "0.60461986", "0.59808815", "0.59198743", "0.5909179", "0.5868135", "0.58613884", "0.5735315", "0.5698737", "0.5665372", "0.562132", "0.5588627", "0.5588627", "0.5588627", "0.5581732", "0.55789053", "0.5565189", "0.5550607", "0.552437", "0.552437", "0.552437", "0.55241656", "0.54899883", "0.5438751", "0.5399326", "0.5397901", "0.5391264", "0.5390979", "0.5386106", "0.53759724", "0.5374274", "0.5371592", "0.5360501", "0.5352885", "0.5349294", "0.5349294", "0.53355414", "0.5310743", "0.5305369", "0.5303087", "0.5302099", "0.52958566", "0.5294715", "0.5292624", "0.5287689", "0.5287689", "0.5287689", "0.5281478", "0.5266776", "0.5266263", "0.5261392", "0.5255795", "0.52441424", "0.52365196", "0.522935", "0.5223733", "0.5207632", "0.52022713", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134" ]
0.0
-1
From PaymentDetails.merchant_data optional bytes merchant_data = 1;
@java.lang.Override public boolean hasMerchantData() { return ((bitField0_ & 0x00000001) != 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setMerchantData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000020;\n merchantData_ = value;\n }", "private void setMerchantData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000001;\n merchantData_ = value;\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return merchantData_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return merchantData_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return instance.getMerchantData();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return instance.getMerchantData();\n }", "public Builder setMerchantData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setMerchantData(value);\n return this;\n }", "public Builder setMerchantData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setMerchantData(value);\n return this;\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000020) != 0);\n }", "private void clearMerchantData() {\n bitField0_ = (bitField0_ & ~0x00000020);\n merchantData_ = getDefaultInstance().getMerchantData();\n }", "private void clearMerchantData() {\n bitField0_ = (bitField0_ & ~0x00000001);\n merchantData_ = getDefaultInstance().getMerchantData();\n }", "public String getPaymentData() {\n return paymentData;\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "boolean hasMerchantData();", "boolean hasMerchantData();", "public void setMerchantCode (java.lang.String merchantCode) {\r\n\t\tthis.merchantCode = merchantCode;\r\n\t}", "public String getMerchant() {\n return _merchant;\n }", "public Long getMerchantId()\n {\n return merchantId;\n }", "public void setMerchantNum(String merchantNum) {\n this.merchantNum = FileUtils.hexStringFromatByF(10, \"\");\n }", "public void setMerchantId(Long merchantId) {\n this.merchantId = merchantId;\n }", "public String getMerchantTag() {\n return this.merchantTag;\n }", "public String getMerchantNo();", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public Long getMerchantId() {\n return merchantId;\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId;\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId;\n }", "public java.lang.String getMerchantCode () {\r\n\t\treturn merchantCode;\r\n\t}", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "public void setMerchantName(String merchantName) {\n this.merchantName = merchantName;\n }", "public void setMerchantId (java.lang.Long merchantId) {\r\n\t\tthis.merchantId = merchantId;\r\n\t}", "public String getMerchantAccountCode() {\n return merchantAccountCode;\n }", "private JsonObjectBuilder merchantToJsonBuilder(Merchant merchant) {\n\n // Any way to avoid converting to a String?\n String jsonMerchant = jsonb.toJson(merchant);\n try (JsonReader jsonReader = Json.createReader(new StringReader(jsonMerchant))) {\n JsonObject merchantJson = jsonReader.readObject();\n JsonObjectBuilder merchantBuilder = Json.createObjectBuilder();\n merchantJson.forEach((k, v) -> {\n merchantBuilder.add(k, v);\n });\n return merchantBuilder;\n }\n }", "boolean verifyDeveloperPayload(Purchase p) {\n\t String payload = p.getDeveloperPayload();\n\n\t return true;\n\t }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId == null ? null : merchantId.trim();\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId == null ? null : merchantId.trim();\n }", "public String getMerchantReference() {\n return this.merchantReference;\n }", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "public String getMerchantAccount() {\n return merchantAccount;\n }", "@Override\n\tpublic String pay(ZFTMerchantConfig merchant, ZFTOrderConfig order) throws Exception {\n\t\treturn null;\n\t}", "public void setMerchantTransNo (java.lang.String merchantTransNo) {\r\n\t\tthis.merchantTransNo = merchantTransNo;\r\n\t}", "public void setAdditionalBillingData(com.ipcommerce.schemas.CWS.v2_0.Transactions.PersonalInfo additionalBillingData) {\n this.additionalBillingData = additionalBillingData;\n }", "public String getMerchantReference() {\n return merchantReference;\n }", "void setPaymentInformation(String information);", "public void sendPaymentToMerchant() {\n // Check for successful send and a BIP70 Payment requirement\n if (lastBitcoinSentEvent != null && lastBitcoinSentEvent.isSendWasSuccessful()) {\n Preconditions.checkNotNull(getPaymentRequestData());\n Preconditions.checkState(getPaymentRequestData().isPresent());\n Preconditions.checkNotNull(getPaymentRequestData().get().getPaymentSessionSummary());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().isPresent());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().get().hasPaymentSession());\n\n PaymentSessionSummary paymentSessionSummary = getPaymentRequestData().get().getPaymentSessionSummary().get();\n\n // Send the Payment message to the merchant\n try {\n final List<Transaction> transactionsSent = Lists.newArrayList(lastBitcoinSentEvent.getTransaction().get());\n final PaymentRequestData finalPaymentRequestData = getPaymentRequestData().get();\n\n final Optional<PaymentSessionSummary.PaymentProtocolResponseDto> dto = paymentSessionSummary.sendPaymentSessionPayment(\n transactionsSent,\n lastBitcoinSentEvent.getChangeAddress(),\n getSendBitcoinEnterPaymentMemoPanelModel().getPaymentMemo());\n\n final Protos.Payment finalPayment = dto.get().getFinalPayment();\n final ListenableFuture<PaymentProtocol.Ack> future = dto.get().getFuture();\n\n if (future != null) {\n Futures.addCallback(\n future, new FutureCallback<PaymentProtocol.Ack>() {\n @Override\n public void onSuccess(PaymentProtocol.Ack result) {\n\n // Have successfully received a PaymentAck from the merchant\n log.info(\"Received PaymentAck from merchant. Memo: {}\", result.getMemo());\n getSendBitcoinShowPaymentACKMemoPanelModel().setPaymentACKMemo(result.getMemo());\n\n PaymentProtocolService paymentProtocolService = CoreServices.getPaymentProtocolService();\n\n if (finalPayment != null) {\n Optional<Protos.PaymentACK> paymentACK = paymentProtocolService.newPaymentACK(finalPayment, result.getMemo());\n\n finalPaymentRequestData.setPayment(Optional.of(finalPayment));\n finalPaymentRequestData.setPaymentACK(paymentACK);\n log.debug(\"Saving PaymentMemo of {} and PaymentACKMemo of {}\", finalPayment.getMemo(), paymentACK.isPresent() ? paymentACK.get().getMemo() : \"n/a\");\n WalletService walletService = CoreServices.getOrCreateWalletService(WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletId());\n walletService.addPaymentRequestData(finalPaymentRequestData);\n\n // Write payments\n CharSequence password = WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletPassword().getPassword();\n if (password != null) {\n walletService.writePayments(password);\n }\n\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(true, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_OK, null));\n } else {\n log.error(\"No payment and hence cannot save payment or paymentACK\");\n }\n }\n\n @Override\n public void onFailure(Throwable t) {\n // Failed to communicate with the merchant\n log.error(\"Unexpected failure\", t);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{t.getClass().getCanonicalName() + \" \" + t.getMessage()}));\n }\n });\n } else {\n throw new PaymentProtocolException(\"Failed to create future from Ack\");\n }\n } catch (IOException | PaymentProtocolException e) {\n log.error(\"Unexpected failure\", e);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{e.getClass().getCanonicalName() + \" \" + e.getMessage()}));\n }\n } else {\n String message = \"Bitcoin not sent successfully so no payment sent to requestor\";\n log.debug(message);\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(false, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED, new String[]{message}));\n }\n }", "public String getMerchantName() {\n return merchantName;\n }", "boolean verifyDeveloperPayload(Purchase p) {\n return DEVELOPER_PAYLOAD.equals(p.getDeveloperPayload());\n }", "public java.lang.Long getMerchantId () {\r\n\t\treturn merchantId;\r\n\t}", "@ApiModelProperty(required = true, value = \"merchant resource for the store\")\n @JsonProperty(\"merchant\")\n public EntityInfo getMerchant() {\n return merchant;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == PayUmoneyFlowManager.REQUEST_CODE_PAYMENT && resultCode == RESULT_OK && data !=\n null) {\n TransactionResponse transactionResponse = data.getParcelableExtra(PayUmoneyFlowManager\n .INTENT_EXTRA_TRANSACTION_RESPONSE);\n\n ResultModel resultModel = data.getParcelableExtra(PayUmoneyFlowManager.ARG_RESULT);\n\n // Check which object is non-null\n if (transactionResponse != null && transactionResponse.getPayuResponse() != null) {\n if (transactionResponse.getTransactionStatus().equals(TransactionResponse.TransactionStatus.SUCCESSFUL)) {\n //Success Transaction\n AddPayment(name, ridequantity, Amount);\n } else {\n Intent intent = new Intent();\n setResult(RESULT_OK, intent);\n finish();\n\n }\n\n // Response from Payumoney\n// String payuResponse = transactionResponse.getPayuResponse();\n//\n//// Response from SURl and FURL\n// String merchantResponse = transactionResponse.getTransactionDetails();\n//\n// new AlertDialog.Builder(this)\n// .setCancelable(false)\n// .setMessage(\"Payu's Data : \" + payuResponse + \"\\n\\n\\n Merchant's Data: \" + merchantResponse)\n// .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {\n// public void onClick(DialogInterface dialog, int whichButton) {\n// dialog.dismiss();\n// }\n// }).show();\n\n } else if (resultModel != null && resultModel.getError() != null) {\n Log.d(TAG, \"Error response : \" + resultModel.getError().getTransactionResponse());\n } else {\n Log.d(TAG, \"Both objects are null!\");\n }\n }\n }", "public String getMerchantAccount() {\n return merchantAccount;\n }", "@JsonProperty(\"MerchantId\")\n public String getMerchantId() {\n return merchantId;\n }", "public Builder setPaymentHashBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n paymentHash_ = value;\n onChanged();\n return this;\n }", "public void setPaymentinformation (java.lang.String paymentinformation) {\r\n\t\tthis.paymentinformation = paymentinformation;\r\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public void setMerchantName(String merchantName) {\n\t\tthis.merchantName = merchantName;\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n String payload = p.getDeveloperPayload();\n\n /*\n * TODO: verify that the developer payload of the purchase is correct. It will be\n * the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase and\n * verifying it here might seem like a good approach, but this will fail in the\n * case where the user purchases an item on one device and then uses your app on\n * a different device, because on the other device you will not have access to the\n * random string you originally generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different between them,\n * so that one user's purchase can't be replayed to another user.\n *\n * 2. The payload must be such that you can verify it even when the app wasn't the\n * one who initiated the purchase flow (so that items purchased by the user on\n * one device work on other devices owned by the user).\n *\n * Using your own server to store and verify developer payloads across app\n * installations is recommended.\n */\n\n return true;\n }", "boolean verifyDeveloperPayload(Purchase p) {\n\t\t/*String payload = */p.getDeveloperPayload();\n\n\t\t/*\n\t\t * TODO: verify that the developer payload of the purchase is correct.\n\t\t * It will be the same one that you sent when initiating the purchase.\n\t\t * \n\t\t * WARNING: Locally generating a random string when starting a purchase\n\t\t * and verifying it here might seem like a good approach, but this will\n\t\t * fail in the case where the user purchases an item on one device and\n\t\t * then uses your app on a different device, because on the other device\n\t\t * you will not have access to the random string you originally\n\t\t * generated.\n\t\t * \n\t\t * So a good developer payload has these characteristics:\n\t\t * \n\t\t * 1. If two different users purchase an item, the payload is different\n\t\t * between them, so that one user's purchase can't be replayed to\n\t\t * another user.\n\t\t * \n\t\t * 2. The payload must be such that you can verify it even when the app\n\t\t * wasn't the one who initiated the purchase flow (so that items\n\t\t * purchased by the user on one device work on other devices owned by\n\t\t * the user).\n\t\t * \n\t\t * Using your own server to store and verify developer payloads across\n\t\t * app installations is recommended.\n\t\t */\n\n\t\treturn true;\n\t}", "@Override\r\n\tpublic JSONObject init(Merchant merchant, PayeeVo v) {\n\t\tJSONObject valid = this.valid(merchant,v.getTotal_amount());\r\n\t\tif (valid.getBooleanValue(\"state\")){\r\n\t\t\tPayee payee = this.getPayee();\r\n\t\t\tif (payee != null){\r\n\t\t\t\tv.setCost(String.valueOf(merchant.getFee()));\r\n\t\t\t\tv.setmId(String.valueOf(merchant.getId()));\r\n\t\t\t\tJSONObject result = this.execute(payee, v);\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t\treturn Result.error.toJson(\"代付服务关闭\");\r\n\t\t}\r\n\t\treturn valid;\r\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n\t\tString payload = p.getDeveloperPayload();\n\n\t\t/*\n\t\t * TODO: verify that the developer payload of the purchase is correct.\n\t\t * It will be the same one that you sent when initiating the purchase.\n\t\t * \n\t\t * WARNING: Locally generating a random string when starting a purchase\n\t\t * and verifying it here might seem like a good approach, but this will\n\t\t * fail in the case where the user purchases an item on one device and\n\t\t * then uses your app on a different device, because on the other device\n\t\t * you will not have access to the random string you originally\n\t\t * generated.\n\t\t * \n\t\t * So a good developer payload has these characteristics:\n\t\t * \n\t\t * 1. If two different users purchase an item, the payload is different\n\t\t * between them, so that one user's purchase can't be replayed to\n\t\t * another user.\n\t\t * \n\t\t * 2. The payload must be such that you can verify it even when the app\n\t\t * wasn't the one who initiated the purchase flow (so that items\n\t\t * purchased by the user on one device work on other devices owned by\n\t\t * the user).\n\t\t * \n\t\t * Using your own server to store and verify developer payloads across\n\t\t * app installations is recommended.\n\t\t */\n\n\t\treturn true;\n\t}", "public void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@Override\n public void onChanged(@Nullable Merchant merchant) {\n }", "private void m50363B() {\n try {\n TokenPaymentParams tokenPaymentParams = new TokenPaymentParams(this.f30711G0, this.f30708D0, this.f30709E0.getBrand(), this.f30737h0.getText().toString());\n StringBuilder sb = new StringBuilder();\n sb.append(this.f30720S.getString(C10232R.string.checkout_ui_callback_scheme));\n sb.append(\"://callback\");\n tokenPaymentParams.mo40895e(sb.toString());\n this.f30754y0.mo41066a(new Transaction((PaymentParams) tokenPaymentParams));\n this.f30728a.mo23628i(C11645a.f33474f, \"credit_card\");\n } catch (PaymentException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tprotected byte[] prepare_data() {\n\t\tbyte[] ret_byte = null;\n\t\tJSONObject json_object = new JSONObject();\n\t\ttry {\n\t\t\tjson_object.put(Jsonkey.string_transitionid_key, \"\");\n\t\t\tjson_object.put(Jsonkey.string_magicid_key, \"\");\n\t\t\tJSONObject json_content = new JSONObject();\n\t\t\tjson_object.put(Jsonkey.string_content_key, json_content);\n\t\t\tjson_content.put(Jsonkey.string_ctype_key, \"verify_login_request\");\n\t\t\tJSONObject json_cvalue = new JSONObject();\n\t\t\tjson_content.put(Jsonkey.string_cvalue_key, json_cvalue);\n\t\t\tjson_cvalue.put(Jsonkey.string_user_name_key, user_name);\n\t\t\tjson_cvalue.put(Jsonkey.string_user_password_key, user_password);\n\t\t\t\n\t\t\tString json_string = json_object.toString();\n\t\t\tret_byte = json_string.getBytes();\n\t\t} catch (JSONException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn ret_byte;\n\t}", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public CreditCard getDefaultPaymentInfo();", "public Builder clearMerchantData() {\n copyOnWrite();\n instance.clearMerchantData();\n return this;\n }", "public Builder clearMerchantData() {\n copyOnWrite();\n instance.clearMerchantData();\n return this;\n }", "public void setPaymentInfoInCart(CreditCard cc);", "@Test\n\tpublic void testInvalidMerchantTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\t//database.addCustomer(merchant); Merchant not in database\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This merchant is not a DTUPay user\",verifyParticipants);\n\t}", "public Merchant() {}", "public String getDeveloperPayload(){\n return developerPayload;\n }", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private void returnDeposit(String paymentInfo) {\n }", "boolean hasSerializedPaymentDetails();", "private GetMerchantByParkingResponse(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "public Object adjustBankSysexForEmit(byte[] data, Model model)\n {\n return data;\n }", "public IBankTransfert payment();", "public void parsingAdditionalData() {\n\t\tString AdditionalData = billPayBean.getAdditionalData();\n\t\tswitch (Integer.parseInt(billPayBean.getBillerId())) {\n\t\tcase 91901:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(95,120));\n\t\t\tbillPayBean.setMeterNumber(AdditionalData.substring(7,18));\n\t\t\tbillPayBean.setBillNumber(AdditionalData.substring(18,30));\n\t\t\tbreak;\n\t\tcase 91951:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(47,72));\n\t\t\tbillPayBean.setBillNumber(AdditionalData.substring(0,12));\n\t\t\tbreak;\n\t\tcase 91999:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(66,91));\n\t\t\tbillPayBean.setRegNumber(AdditionalData.substring(0,13));\n\t\t\tbreak;\n\t\tdefault:\n\t\t}\n\t\treturn ;\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "public void parseParameter(byte[] data)\n {\n return; \n }", "public String getMerchantOrderReference() {\n return merchantOrderReference;\n }", "public void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "public String getJP_BankDataCustomerCode2();", "public String getMerchantName() {\n\t\treturn merchantName;\n\t}", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "String getPaymentInformation();", "@ApiModelProperty(value = \"If provided, then the value overrides the one present in onboarding data. If the merchantCategoryCode value is not populated in onboarding data then this field is mandatory.<br><br><b>Note:</b> required if not provided during onboarding\")\n public Integer getMerchantCategoryCode() {\n return merchantCategoryCode;\n }", "private void setPaymentUrlBytes(\n com.google.protobuf.ByteString value) {\n paymentUrl_ = value.toStringUtf8();\n bitField0_ |= 0x00000010;\n }", "public void navigateToBaseActivity() throws JSONException {\n\n String merchantKey = jsonObject.getString(\"merchantKey\");\n String amount = jsonObject.getString(\"amount\");\n String email = jsonObject.getString(\"email\");\n String value = jsonObject.getString(\"value\");\n String firstName = jsonObject.getString(\"firstName\");\n String phone = jsonObject.getString(\"phone\");\n String txnId = jsonObject.getString(\"txnId\");\n String sUrl = jsonObject.getString(\"sUrl\");\n String fUrl = jsonObject.getString(\"fUrl\");\n String udf1 = jsonObject.getString(\"udf1\");\n String udf2 = jsonObject.getString(\"udf2\");\n String udf3 = jsonObject.getString(\"udf3\");\n String udf4 = jsonObject.getString(\"udf4\");\n String udf5 = jsonObject.getString(\"udf5\");\n salt = jsonObject.getString(\"salt\");\n int environment;\n if (value.equals(\"test\"))\n environment = PayuConstants.STAGING_ENV;\n else\n environment = PayuConstants.PRODUCTION_ENV;\n String userCredentials = merchantKey + \":\" + email;\n mPaymentParams = new PaymentParams();\n mPaymentParams.setKey(merchantKey);\n mPaymentParams.setAmount(amount);\n mPaymentParams.setProductInfo(\"GoCharge power bank charges\");\n mPaymentParams.setFirstName(firstName);\n mPaymentParams.setEmail(email);\n mPaymentParams.setPhone(phone);\n mPaymentParams.setTxnId(txnId);\n mPaymentParams.setSurl(sUrl);\n mPaymentParams.setFurl(fUrl);\n mPaymentParams.setNotifyURL(mPaymentParams.getSurl()); //for lazy pay\n mPaymentParams.setUdf1(udf1);\n mPaymentParams.setUdf2(udf2);\n mPaymentParams.setUdf3(udf3);\n mPaymentParams.setUdf4(udf4);\n mPaymentParams.setUdf5(udf5);\n mPaymentParams.setUserCredentials(userCredentials);\n payuConfig = new PayuConfig();\n payuConfig.setEnvironment(environment);\n generateHashFromSDK(mPaymentParams, salt);\n\n }" ]
[ "0.7797878", "0.7792317", "0.7576705", "0.7576705", "0.7245536", "0.7245536", "0.65965265", "0.65965265", "0.6441234", "0.6441234", "0.6365573", "0.6266621", "0.6256194", "0.6004995", "0.5960035", "0.5960035", "0.5947056", "0.5947056", "0.58740574", "0.58174014", "0.5815027", "0.57904", "0.5772378", "0.5712262", "0.5707434", "0.57050234", "0.5663499", "0.5663499", "0.5663499", "0.5663499", "0.56537306", "0.5625793", "0.5625793", "0.5624708", "0.5578377", "0.55726254", "0.55664283", "0.55484265", "0.550419", "0.5482835", "0.5421655", "0.5421655", "0.5415372", "0.54131126", "0.54128706", "0.5404621", "0.5385307", "0.5372647", "0.53644437", "0.5350224", "0.5333747", "0.53325576", "0.53187823", "0.53149253", "0.53112227", "0.53014064", "0.52871287", "0.52828753", "0.52243704", "0.52226204", "0.52161986", "0.5213542", "0.5210726", "0.52069104", "0.5202626", "0.51968086", "0.51535314", "0.5134901", "0.5125114", "0.51184654", "0.5114022", "0.5111866", "0.5101681", "0.50886583", "0.5080938", "0.5080938", "0.5070717", "0.5068492", "0.5062835", "0.5061179", "0.50579846", "0.5047382", "0.5035092", "0.503343", "0.50154245", "0.5001425", "0.49932283", "0.49913195", "0.49904835", "0.49813762", "0.49802393", "0.4975058", "0.49726185", "0.49587435", "0.49582055", "0.49455696", "0.49408665", "0.49390778", "0.49340296", "0.49195302" ]
0.63249433
11
From PaymentDetails.merchant_data optional bytes merchant_data = 1;
@java.lang.Override public com.google.protobuf.ByteString getMerchantData() { return merchantData_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setMerchantData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000020;\n merchantData_ = value;\n }", "private void setMerchantData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000001;\n merchantData_ = value;\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return instance.getMerchantData();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return instance.getMerchantData();\n }", "public Builder setMerchantData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setMerchantData(value);\n return this;\n }", "public Builder setMerchantData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setMerchantData(value);\n return this;\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000020) != 0);\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "private void clearMerchantData() {\n bitField0_ = (bitField0_ & ~0x00000020);\n merchantData_ = getDefaultInstance().getMerchantData();\n }", "private void clearMerchantData() {\n bitField0_ = (bitField0_ & ~0x00000001);\n merchantData_ = getDefaultInstance().getMerchantData();\n }", "public String getPaymentData() {\n return paymentData;\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "boolean hasMerchantData();", "boolean hasMerchantData();", "public void setMerchantCode (java.lang.String merchantCode) {\r\n\t\tthis.merchantCode = merchantCode;\r\n\t}", "public String getMerchant() {\n return _merchant;\n }", "public Long getMerchantId()\n {\n return merchantId;\n }", "public void setMerchantNum(String merchantNum) {\n this.merchantNum = FileUtils.hexStringFromatByF(10, \"\");\n }", "public void setMerchantId(Long merchantId) {\n this.merchantId = merchantId;\n }", "public String getMerchantTag() {\n return this.merchantTag;\n }", "public String getMerchantNo();", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public Long getMerchantId() {\n return merchantId;\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId;\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId;\n }", "public java.lang.String getMerchantCode () {\r\n\t\treturn merchantCode;\r\n\t}", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "public void setMerchantName(String merchantName) {\n this.merchantName = merchantName;\n }", "public void setMerchantId (java.lang.Long merchantId) {\r\n\t\tthis.merchantId = merchantId;\r\n\t}", "public String getMerchantAccountCode() {\n return merchantAccountCode;\n }", "private JsonObjectBuilder merchantToJsonBuilder(Merchant merchant) {\n\n // Any way to avoid converting to a String?\n String jsonMerchant = jsonb.toJson(merchant);\n try (JsonReader jsonReader = Json.createReader(new StringReader(jsonMerchant))) {\n JsonObject merchantJson = jsonReader.readObject();\n JsonObjectBuilder merchantBuilder = Json.createObjectBuilder();\n merchantJson.forEach((k, v) -> {\n merchantBuilder.add(k, v);\n });\n return merchantBuilder;\n }\n }", "boolean verifyDeveloperPayload(Purchase p) {\n\t String payload = p.getDeveloperPayload();\n\n\t return true;\n\t }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId == null ? null : merchantId.trim();\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId == null ? null : merchantId.trim();\n }", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "public String getMerchantReference() {\n return this.merchantReference;\n }", "public String getMerchantAccount() {\n return merchantAccount;\n }", "@Override\n\tpublic String pay(ZFTMerchantConfig merchant, ZFTOrderConfig order) throws Exception {\n\t\treturn null;\n\t}", "public void setMerchantTransNo (java.lang.String merchantTransNo) {\r\n\t\tthis.merchantTransNo = merchantTransNo;\r\n\t}", "public void setAdditionalBillingData(com.ipcommerce.schemas.CWS.v2_0.Transactions.PersonalInfo additionalBillingData) {\n this.additionalBillingData = additionalBillingData;\n }", "public String getMerchantReference() {\n return merchantReference;\n }", "void setPaymentInformation(String information);", "public void sendPaymentToMerchant() {\n // Check for successful send and a BIP70 Payment requirement\n if (lastBitcoinSentEvent != null && lastBitcoinSentEvent.isSendWasSuccessful()) {\n Preconditions.checkNotNull(getPaymentRequestData());\n Preconditions.checkState(getPaymentRequestData().isPresent());\n Preconditions.checkNotNull(getPaymentRequestData().get().getPaymentSessionSummary());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().isPresent());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().get().hasPaymentSession());\n\n PaymentSessionSummary paymentSessionSummary = getPaymentRequestData().get().getPaymentSessionSummary().get();\n\n // Send the Payment message to the merchant\n try {\n final List<Transaction> transactionsSent = Lists.newArrayList(lastBitcoinSentEvent.getTransaction().get());\n final PaymentRequestData finalPaymentRequestData = getPaymentRequestData().get();\n\n final Optional<PaymentSessionSummary.PaymentProtocolResponseDto> dto = paymentSessionSummary.sendPaymentSessionPayment(\n transactionsSent,\n lastBitcoinSentEvent.getChangeAddress(),\n getSendBitcoinEnterPaymentMemoPanelModel().getPaymentMemo());\n\n final Protos.Payment finalPayment = dto.get().getFinalPayment();\n final ListenableFuture<PaymentProtocol.Ack> future = dto.get().getFuture();\n\n if (future != null) {\n Futures.addCallback(\n future, new FutureCallback<PaymentProtocol.Ack>() {\n @Override\n public void onSuccess(PaymentProtocol.Ack result) {\n\n // Have successfully received a PaymentAck from the merchant\n log.info(\"Received PaymentAck from merchant. Memo: {}\", result.getMemo());\n getSendBitcoinShowPaymentACKMemoPanelModel().setPaymentACKMemo(result.getMemo());\n\n PaymentProtocolService paymentProtocolService = CoreServices.getPaymentProtocolService();\n\n if (finalPayment != null) {\n Optional<Protos.PaymentACK> paymentACK = paymentProtocolService.newPaymentACK(finalPayment, result.getMemo());\n\n finalPaymentRequestData.setPayment(Optional.of(finalPayment));\n finalPaymentRequestData.setPaymentACK(paymentACK);\n log.debug(\"Saving PaymentMemo of {} and PaymentACKMemo of {}\", finalPayment.getMemo(), paymentACK.isPresent() ? paymentACK.get().getMemo() : \"n/a\");\n WalletService walletService = CoreServices.getOrCreateWalletService(WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletId());\n walletService.addPaymentRequestData(finalPaymentRequestData);\n\n // Write payments\n CharSequence password = WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletPassword().getPassword();\n if (password != null) {\n walletService.writePayments(password);\n }\n\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(true, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_OK, null));\n } else {\n log.error(\"No payment and hence cannot save payment or paymentACK\");\n }\n }\n\n @Override\n public void onFailure(Throwable t) {\n // Failed to communicate with the merchant\n log.error(\"Unexpected failure\", t);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{t.getClass().getCanonicalName() + \" \" + t.getMessage()}));\n }\n });\n } else {\n throw new PaymentProtocolException(\"Failed to create future from Ack\");\n }\n } catch (IOException | PaymentProtocolException e) {\n log.error(\"Unexpected failure\", e);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{e.getClass().getCanonicalName() + \" \" + e.getMessage()}));\n }\n } else {\n String message = \"Bitcoin not sent successfully so no payment sent to requestor\";\n log.debug(message);\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(false, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED, new String[]{message}));\n }\n }", "public String getMerchantName() {\n return merchantName;\n }", "boolean verifyDeveloperPayload(Purchase p) {\n return DEVELOPER_PAYLOAD.equals(p.getDeveloperPayload());\n }", "public java.lang.Long getMerchantId () {\r\n\t\treturn merchantId;\r\n\t}", "@ApiModelProperty(required = true, value = \"merchant resource for the store\")\n @JsonProperty(\"merchant\")\n public EntityInfo getMerchant() {\n return merchant;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == PayUmoneyFlowManager.REQUEST_CODE_PAYMENT && resultCode == RESULT_OK && data !=\n null) {\n TransactionResponse transactionResponse = data.getParcelableExtra(PayUmoneyFlowManager\n .INTENT_EXTRA_TRANSACTION_RESPONSE);\n\n ResultModel resultModel = data.getParcelableExtra(PayUmoneyFlowManager.ARG_RESULT);\n\n // Check which object is non-null\n if (transactionResponse != null && transactionResponse.getPayuResponse() != null) {\n if (transactionResponse.getTransactionStatus().equals(TransactionResponse.TransactionStatus.SUCCESSFUL)) {\n //Success Transaction\n AddPayment(name, ridequantity, Amount);\n } else {\n Intent intent = new Intent();\n setResult(RESULT_OK, intent);\n finish();\n\n }\n\n // Response from Payumoney\n// String payuResponse = transactionResponse.getPayuResponse();\n//\n//// Response from SURl and FURL\n// String merchantResponse = transactionResponse.getTransactionDetails();\n//\n// new AlertDialog.Builder(this)\n// .setCancelable(false)\n// .setMessage(\"Payu's Data : \" + payuResponse + \"\\n\\n\\n Merchant's Data: \" + merchantResponse)\n// .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {\n// public void onClick(DialogInterface dialog, int whichButton) {\n// dialog.dismiss();\n// }\n// }).show();\n\n } else if (resultModel != null && resultModel.getError() != null) {\n Log.d(TAG, \"Error response : \" + resultModel.getError().getTransactionResponse());\n } else {\n Log.d(TAG, \"Both objects are null!\");\n }\n }\n }", "public String getMerchantAccount() {\n return merchantAccount;\n }", "@JsonProperty(\"MerchantId\")\n public String getMerchantId() {\n return merchantId;\n }", "public Builder setPaymentHashBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n paymentHash_ = value;\n onChanged();\n return this;\n }", "public void setPaymentinformation (java.lang.String paymentinformation) {\r\n\t\tthis.paymentinformation = paymentinformation;\r\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public void setMerchantName(String merchantName) {\n\t\tthis.merchantName = merchantName;\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n String payload = p.getDeveloperPayload();\n\n /*\n * TODO: verify that the developer payload of the purchase is correct. It will be\n * the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase and\n * verifying it here might seem like a good approach, but this will fail in the\n * case where the user purchases an item on one device and then uses your app on\n * a different device, because on the other device you will not have access to the\n * random string you originally generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different between them,\n * so that one user's purchase can't be replayed to another user.\n *\n * 2. The payload must be such that you can verify it even when the app wasn't the\n * one who initiated the purchase flow (so that items purchased by the user on\n * one device work on other devices owned by the user).\n *\n * Using your own server to store and verify developer payloads across app\n * installations is recommended.\n */\n\n return true;\n }", "boolean verifyDeveloperPayload(Purchase p) {\n\t\t/*String payload = */p.getDeveloperPayload();\n\n\t\t/*\n\t\t * TODO: verify that the developer payload of the purchase is correct.\n\t\t * It will be the same one that you sent when initiating the purchase.\n\t\t * \n\t\t * WARNING: Locally generating a random string when starting a purchase\n\t\t * and verifying it here might seem like a good approach, but this will\n\t\t * fail in the case where the user purchases an item on one device and\n\t\t * then uses your app on a different device, because on the other device\n\t\t * you will not have access to the random string you originally\n\t\t * generated.\n\t\t * \n\t\t * So a good developer payload has these characteristics:\n\t\t * \n\t\t * 1. If two different users purchase an item, the payload is different\n\t\t * between them, so that one user's purchase can't be replayed to\n\t\t * another user.\n\t\t * \n\t\t * 2. The payload must be such that you can verify it even when the app\n\t\t * wasn't the one who initiated the purchase flow (so that items\n\t\t * purchased by the user on one device work on other devices owned by\n\t\t * the user).\n\t\t * \n\t\t * Using your own server to store and verify developer payloads across\n\t\t * app installations is recommended.\n\t\t */\n\n\t\treturn true;\n\t}", "@Override\r\n\tpublic JSONObject init(Merchant merchant, PayeeVo v) {\n\t\tJSONObject valid = this.valid(merchant,v.getTotal_amount());\r\n\t\tif (valid.getBooleanValue(\"state\")){\r\n\t\t\tPayee payee = this.getPayee();\r\n\t\t\tif (payee != null){\r\n\t\t\t\tv.setCost(String.valueOf(merchant.getFee()));\r\n\t\t\t\tv.setmId(String.valueOf(merchant.getId()));\r\n\t\t\t\tJSONObject result = this.execute(payee, v);\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t\treturn Result.error.toJson(\"代付服务关闭\");\r\n\t\t}\r\n\t\treturn valid;\r\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n\t\tString payload = p.getDeveloperPayload();\n\n\t\t/*\n\t\t * TODO: verify that the developer payload of the purchase is correct.\n\t\t * It will be the same one that you sent when initiating the purchase.\n\t\t * \n\t\t * WARNING: Locally generating a random string when starting a purchase\n\t\t * and verifying it here might seem like a good approach, but this will\n\t\t * fail in the case where the user purchases an item on one device and\n\t\t * then uses your app on a different device, because on the other device\n\t\t * you will not have access to the random string you originally\n\t\t * generated.\n\t\t * \n\t\t * So a good developer payload has these characteristics:\n\t\t * \n\t\t * 1. If two different users purchase an item, the payload is different\n\t\t * between them, so that one user's purchase can't be replayed to\n\t\t * another user.\n\t\t * \n\t\t * 2. The payload must be such that you can verify it even when the app\n\t\t * wasn't the one who initiated the purchase flow (so that items\n\t\t * purchased by the user on one device work on other devices owned by\n\t\t * the user).\n\t\t * \n\t\t * Using your own server to store and verify developer payloads across\n\t\t * app installations is recommended.\n\t\t */\n\n\t\treturn true;\n\t}", "public void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@Override\n public void onChanged(@Nullable Merchant merchant) {\n }", "private void m50363B() {\n try {\n TokenPaymentParams tokenPaymentParams = new TokenPaymentParams(this.f30711G0, this.f30708D0, this.f30709E0.getBrand(), this.f30737h0.getText().toString());\n StringBuilder sb = new StringBuilder();\n sb.append(this.f30720S.getString(C10232R.string.checkout_ui_callback_scheme));\n sb.append(\"://callback\");\n tokenPaymentParams.mo40895e(sb.toString());\n this.f30754y0.mo41066a(new Transaction((PaymentParams) tokenPaymentParams));\n this.f30728a.mo23628i(C11645a.f33474f, \"credit_card\");\n } catch (PaymentException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tprotected byte[] prepare_data() {\n\t\tbyte[] ret_byte = null;\n\t\tJSONObject json_object = new JSONObject();\n\t\ttry {\n\t\t\tjson_object.put(Jsonkey.string_transitionid_key, \"\");\n\t\t\tjson_object.put(Jsonkey.string_magicid_key, \"\");\n\t\t\tJSONObject json_content = new JSONObject();\n\t\t\tjson_object.put(Jsonkey.string_content_key, json_content);\n\t\t\tjson_content.put(Jsonkey.string_ctype_key, \"verify_login_request\");\n\t\t\tJSONObject json_cvalue = new JSONObject();\n\t\t\tjson_content.put(Jsonkey.string_cvalue_key, json_cvalue);\n\t\t\tjson_cvalue.put(Jsonkey.string_user_name_key, user_name);\n\t\t\tjson_cvalue.put(Jsonkey.string_user_password_key, user_password);\n\t\t\t\n\t\t\tString json_string = json_object.toString();\n\t\t\tret_byte = json_string.getBytes();\n\t\t} catch (JSONException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn ret_byte;\n\t}", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public CreditCard getDefaultPaymentInfo();", "public Builder clearMerchantData() {\n copyOnWrite();\n instance.clearMerchantData();\n return this;\n }", "public Builder clearMerchantData() {\n copyOnWrite();\n instance.clearMerchantData();\n return this;\n }", "public void setPaymentInfoInCart(CreditCard cc);", "@Test\n\tpublic void testInvalidMerchantTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\t//database.addCustomer(merchant); Merchant not in database\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This merchant is not a DTUPay user\",verifyParticipants);\n\t}", "public String getDeveloperPayload(){\n return developerPayload;\n }", "public Merchant() {}", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private void returnDeposit(String paymentInfo) {\n }", "boolean hasSerializedPaymentDetails();", "private GetMerchantByParkingResponse(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "public Object adjustBankSysexForEmit(byte[] data, Model model)\n {\n return data;\n }", "public IBankTransfert payment();", "public void parsingAdditionalData() {\n\t\tString AdditionalData = billPayBean.getAdditionalData();\n\t\tswitch (Integer.parseInt(billPayBean.getBillerId())) {\n\t\tcase 91901:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(95,120));\n\t\t\tbillPayBean.setMeterNumber(AdditionalData.substring(7,18));\n\t\t\tbillPayBean.setBillNumber(AdditionalData.substring(18,30));\n\t\t\tbreak;\n\t\tcase 91951:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(47,72));\n\t\t\tbillPayBean.setBillNumber(AdditionalData.substring(0,12));\n\t\t\tbreak;\n\t\tcase 91999:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(66,91));\n\t\t\tbillPayBean.setRegNumber(AdditionalData.substring(0,13));\n\t\t\tbreak;\n\t\tdefault:\n\t\t}\n\t\treturn ;\n\t}", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public void parseParameter(byte[] data)\n {\n return; \n }", "public String getMerchantOrderReference() {\n return merchantOrderReference;\n }", "public void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "public String getMerchantName() {\n\t\treturn merchantName;\n\t}", "public String getJP_BankDataCustomerCode2();", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "String getPaymentInformation();", "@ApiModelProperty(value = \"If provided, then the value overrides the one present in onboarding data. If the merchantCategoryCode value is not populated in onboarding data then this field is mandatory.<br><br><b>Note:</b> required if not provided during onboarding\")\n public Integer getMerchantCategoryCode() {\n return merchantCategoryCode;\n }", "private void setPaymentUrlBytes(\n com.google.protobuf.ByteString value) {\n paymentUrl_ = value.toStringUtf8();\n bitField0_ |= 0x00000010;\n }", "public void navigateToBaseActivity() throws JSONException {\n\n String merchantKey = jsonObject.getString(\"merchantKey\");\n String amount = jsonObject.getString(\"amount\");\n String email = jsonObject.getString(\"email\");\n String value = jsonObject.getString(\"value\");\n String firstName = jsonObject.getString(\"firstName\");\n String phone = jsonObject.getString(\"phone\");\n String txnId = jsonObject.getString(\"txnId\");\n String sUrl = jsonObject.getString(\"sUrl\");\n String fUrl = jsonObject.getString(\"fUrl\");\n String udf1 = jsonObject.getString(\"udf1\");\n String udf2 = jsonObject.getString(\"udf2\");\n String udf3 = jsonObject.getString(\"udf3\");\n String udf4 = jsonObject.getString(\"udf4\");\n String udf5 = jsonObject.getString(\"udf5\");\n salt = jsonObject.getString(\"salt\");\n int environment;\n if (value.equals(\"test\"))\n environment = PayuConstants.STAGING_ENV;\n else\n environment = PayuConstants.PRODUCTION_ENV;\n String userCredentials = merchantKey + \":\" + email;\n mPaymentParams = new PaymentParams();\n mPaymentParams.setKey(merchantKey);\n mPaymentParams.setAmount(amount);\n mPaymentParams.setProductInfo(\"GoCharge power bank charges\");\n mPaymentParams.setFirstName(firstName);\n mPaymentParams.setEmail(email);\n mPaymentParams.setPhone(phone);\n mPaymentParams.setTxnId(txnId);\n mPaymentParams.setSurl(sUrl);\n mPaymentParams.setFurl(fUrl);\n mPaymentParams.setNotifyURL(mPaymentParams.getSurl()); //for lazy pay\n mPaymentParams.setUdf1(udf1);\n mPaymentParams.setUdf2(udf2);\n mPaymentParams.setUdf3(udf3);\n mPaymentParams.setUdf4(udf4);\n mPaymentParams.setUdf5(udf5);\n mPaymentParams.setUserCredentials(userCredentials);\n payuConfig = new PayuConfig();\n payuConfig.setEnvironment(environment);\n generateHashFromSDK(mPaymentParams, salt);\n\n }" ]
[ "0.7797422", "0.77918124", "0.75766045", "0.75766045", "0.6597311", "0.6597311", "0.6441166", "0.6441166", "0.63655734", "0.6324887", "0.62667197", "0.62563246", "0.6005362", "0.5960295", "0.5960295", "0.59463644", "0.59463644", "0.5873643", "0.58162814", "0.5814753", "0.57891667", "0.5772042", "0.57114214", "0.5705532", "0.5704619", "0.5662944", "0.5662944", "0.5662944", "0.5662944", "0.5653525", "0.5625046", "0.5625046", "0.562438", "0.5577743", "0.55719674", "0.5565961", "0.55476195", "0.5503755", "0.5482933", "0.5420203", "0.5420203", "0.54144263", "0.5414363", "0.541154", "0.54030347", "0.5383753", "0.5372269", "0.5363541", "0.5348345", "0.5332825", "0.5331783", "0.5319071", "0.5314819", "0.53104293", "0.53003657", "0.5285834", "0.5282473", "0.5224128", "0.52218544", "0.52146405", "0.52129304", "0.52108216", "0.52069247", "0.5201274", "0.51969695", "0.515134", "0.513523", "0.5125502", "0.51180404", "0.5112707", "0.5112191", "0.5102199", "0.50883555", "0.5081001", "0.5081001", "0.5068579", "0.50668013", "0.50616", "0.50615776", "0.50562394", "0.5046173", "0.5034452", "0.50321424", "0.5015906", "0.5000806", "0.49917835", "0.4990597", "0.49896547", "0.49815026", "0.49793768", "0.49725616", "0.49724683", "0.49575555", "0.49566895", "0.49451298", "0.49393365", "0.493865", "0.49326822", "0.49184534" ]
0.72464305
4
From PaymentDetails.merchant_data optional bytes merchant_data = 1;
private void setMerchantData(com.google.protobuf.ByteString value) { java.lang.Class<?> valueClass = value.getClass(); bitField0_ |= 0x00000001; merchantData_ = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setMerchantData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000020;\n merchantData_ = value;\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return merchantData_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return merchantData_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return instance.getMerchantData();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return instance.getMerchantData();\n }", "public Builder setMerchantData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setMerchantData(value);\n return this;\n }", "public Builder setMerchantData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setMerchantData(value);\n return this;\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000020) != 0);\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "private void clearMerchantData() {\n bitField0_ = (bitField0_ & ~0x00000020);\n merchantData_ = getDefaultInstance().getMerchantData();\n }", "private void clearMerchantData() {\n bitField0_ = (bitField0_ & ~0x00000001);\n merchantData_ = getDefaultInstance().getMerchantData();\n }", "public String getPaymentData() {\n return paymentData;\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "boolean hasMerchantData();", "boolean hasMerchantData();", "public void setMerchantCode (java.lang.String merchantCode) {\r\n\t\tthis.merchantCode = merchantCode;\r\n\t}", "public String getMerchant() {\n return _merchant;\n }", "public Long getMerchantId()\n {\n return merchantId;\n }", "public void setMerchantNum(String merchantNum) {\n this.merchantNum = FileUtils.hexStringFromatByF(10, \"\");\n }", "public void setMerchantId(Long merchantId) {\n this.merchantId = merchantId;\n }", "public String getMerchantTag() {\n return this.merchantTag;\n }", "public String getMerchantNo();", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public Long getMerchantId() {\n return merchantId;\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId;\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId;\n }", "public java.lang.String getMerchantCode () {\r\n\t\treturn merchantCode;\r\n\t}", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "public void setMerchantName(String merchantName) {\n this.merchantName = merchantName;\n }", "public void setMerchantId (java.lang.Long merchantId) {\r\n\t\tthis.merchantId = merchantId;\r\n\t}", "public String getMerchantAccountCode() {\n return merchantAccountCode;\n }", "private JsonObjectBuilder merchantToJsonBuilder(Merchant merchant) {\n\n // Any way to avoid converting to a String?\n String jsonMerchant = jsonb.toJson(merchant);\n try (JsonReader jsonReader = Json.createReader(new StringReader(jsonMerchant))) {\n JsonObject merchantJson = jsonReader.readObject();\n JsonObjectBuilder merchantBuilder = Json.createObjectBuilder();\n merchantJson.forEach((k, v) -> {\n merchantBuilder.add(k, v);\n });\n return merchantBuilder;\n }\n }", "boolean verifyDeveloperPayload(Purchase p) {\n\t String payload = p.getDeveloperPayload();\n\n\t return true;\n\t }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId == null ? null : merchantId.trim();\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId == null ? null : merchantId.trim();\n }", "public String getMerchantReference() {\n return this.merchantReference;\n }", "public String getMerchantAccount() {\n return merchantAccount;\n }", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "@Override\n\tpublic String pay(ZFTMerchantConfig merchant, ZFTOrderConfig order) throws Exception {\n\t\treturn null;\n\t}", "public void setMerchantTransNo (java.lang.String merchantTransNo) {\r\n\t\tthis.merchantTransNo = merchantTransNo;\r\n\t}", "public void setAdditionalBillingData(com.ipcommerce.schemas.CWS.v2_0.Transactions.PersonalInfo additionalBillingData) {\n this.additionalBillingData = additionalBillingData;\n }", "public String getMerchantReference() {\n return merchantReference;\n }", "void setPaymentInformation(String information);", "public void sendPaymentToMerchant() {\n // Check for successful send and a BIP70 Payment requirement\n if (lastBitcoinSentEvent != null && lastBitcoinSentEvent.isSendWasSuccessful()) {\n Preconditions.checkNotNull(getPaymentRequestData());\n Preconditions.checkState(getPaymentRequestData().isPresent());\n Preconditions.checkNotNull(getPaymentRequestData().get().getPaymentSessionSummary());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().isPresent());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().get().hasPaymentSession());\n\n PaymentSessionSummary paymentSessionSummary = getPaymentRequestData().get().getPaymentSessionSummary().get();\n\n // Send the Payment message to the merchant\n try {\n final List<Transaction> transactionsSent = Lists.newArrayList(lastBitcoinSentEvent.getTransaction().get());\n final PaymentRequestData finalPaymentRequestData = getPaymentRequestData().get();\n\n final Optional<PaymentSessionSummary.PaymentProtocolResponseDto> dto = paymentSessionSummary.sendPaymentSessionPayment(\n transactionsSent,\n lastBitcoinSentEvent.getChangeAddress(),\n getSendBitcoinEnterPaymentMemoPanelModel().getPaymentMemo());\n\n final Protos.Payment finalPayment = dto.get().getFinalPayment();\n final ListenableFuture<PaymentProtocol.Ack> future = dto.get().getFuture();\n\n if (future != null) {\n Futures.addCallback(\n future, new FutureCallback<PaymentProtocol.Ack>() {\n @Override\n public void onSuccess(PaymentProtocol.Ack result) {\n\n // Have successfully received a PaymentAck from the merchant\n log.info(\"Received PaymentAck from merchant. Memo: {}\", result.getMemo());\n getSendBitcoinShowPaymentACKMemoPanelModel().setPaymentACKMemo(result.getMemo());\n\n PaymentProtocolService paymentProtocolService = CoreServices.getPaymentProtocolService();\n\n if (finalPayment != null) {\n Optional<Protos.PaymentACK> paymentACK = paymentProtocolService.newPaymentACK(finalPayment, result.getMemo());\n\n finalPaymentRequestData.setPayment(Optional.of(finalPayment));\n finalPaymentRequestData.setPaymentACK(paymentACK);\n log.debug(\"Saving PaymentMemo of {} and PaymentACKMemo of {}\", finalPayment.getMemo(), paymentACK.isPresent() ? paymentACK.get().getMemo() : \"n/a\");\n WalletService walletService = CoreServices.getOrCreateWalletService(WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletId());\n walletService.addPaymentRequestData(finalPaymentRequestData);\n\n // Write payments\n CharSequence password = WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletPassword().getPassword();\n if (password != null) {\n walletService.writePayments(password);\n }\n\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(true, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_OK, null));\n } else {\n log.error(\"No payment and hence cannot save payment or paymentACK\");\n }\n }\n\n @Override\n public void onFailure(Throwable t) {\n // Failed to communicate with the merchant\n log.error(\"Unexpected failure\", t);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{t.getClass().getCanonicalName() + \" \" + t.getMessage()}));\n }\n });\n } else {\n throw new PaymentProtocolException(\"Failed to create future from Ack\");\n }\n } catch (IOException | PaymentProtocolException e) {\n log.error(\"Unexpected failure\", e);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{e.getClass().getCanonicalName() + \" \" + e.getMessage()}));\n }\n } else {\n String message = \"Bitcoin not sent successfully so no payment sent to requestor\";\n log.debug(message);\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(false, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED, new String[]{message}));\n }\n }", "public String getMerchantName() {\n return merchantName;\n }", "boolean verifyDeveloperPayload(Purchase p) {\n return DEVELOPER_PAYLOAD.equals(p.getDeveloperPayload());\n }", "public java.lang.Long getMerchantId () {\r\n\t\treturn merchantId;\r\n\t}", "@ApiModelProperty(required = true, value = \"merchant resource for the store\")\n @JsonProperty(\"merchant\")\n public EntityInfo getMerchant() {\n return merchant;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == PayUmoneyFlowManager.REQUEST_CODE_PAYMENT && resultCode == RESULT_OK && data !=\n null) {\n TransactionResponse transactionResponse = data.getParcelableExtra(PayUmoneyFlowManager\n .INTENT_EXTRA_TRANSACTION_RESPONSE);\n\n ResultModel resultModel = data.getParcelableExtra(PayUmoneyFlowManager.ARG_RESULT);\n\n // Check which object is non-null\n if (transactionResponse != null && transactionResponse.getPayuResponse() != null) {\n if (transactionResponse.getTransactionStatus().equals(TransactionResponse.TransactionStatus.SUCCESSFUL)) {\n //Success Transaction\n AddPayment(name, ridequantity, Amount);\n } else {\n Intent intent = new Intent();\n setResult(RESULT_OK, intent);\n finish();\n\n }\n\n // Response from Payumoney\n// String payuResponse = transactionResponse.getPayuResponse();\n//\n//// Response from SURl and FURL\n// String merchantResponse = transactionResponse.getTransactionDetails();\n//\n// new AlertDialog.Builder(this)\n// .setCancelable(false)\n// .setMessage(\"Payu's Data : \" + payuResponse + \"\\n\\n\\n Merchant's Data: \" + merchantResponse)\n// .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {\n// public void onClick(DialogInterface dialog, int whichButton) {\n// dialog.dismiss();\n// }\n// }).show();\n\n } else if (resultModel != null && resultModel.getError() != null) {\n Log.d(TAG, \"Error response : \" + resultModel.getError().getTransactionResponse());\n } else {\n Log.d(TAG, \"Both objects are null!\");\n }\n }\n }", "public String getMerchantAccount() {\n return merchantAccount;\n }", "@JsonProperty(\"MerchantId\")\n public String getMerchantId() {\n return merchantId;\n }", "public Builder setPaymentHashBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n paymentHash_ = value;\n onChanged();\n return this;\n }", "public void setPaymentinformation (java.lang.String paymentinformation) {\r\n\t\tthis.paymentinformation = paymentinformation;\r\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public void setMerchantName(String merchantName) {\n\t\tthis.merchantName = merchantName;\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n String payload = p.getDeveloperPayload();\n\n /*\n * TODO: verify that the developer payload of the purchase is correct. It will be\n * the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase and\n * verifying it here might seem like a good approach, but this will fail in the\n * case where the user purchases an item on one device and then uses your app on\n * a different device, because on the other device you will not have access to the\n * random string you originally generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different between them,\n * so that one user's purchase can't be replayed to another user.\n *\n * 2. The payload must be such that you can verify it even when the app wasn't the\n * one who initiated the purchase flow (so that items purchased by the user on\n * one device work on other devices owned by the user).\n *\n * Using your own server to store and verify developer payloads across app\n * installations is recommended.\n */\n\n return true;\n }", "boolean verifyDeveloperPayload(Purchase p) {\n\t\t/*String payload = */p.getDeveloperPayload();\n\n\t\t/*\n\t\t * TODO: verify that the developer payload of the purchase is correct.\n\t\t * It will be the same one that you sent when initiating the purchase.\n\t\t * \n\t\t * WARNING: Locally generating a random string when starting a purchase\n\t\t * and verifying it here might seem like a good approach, but this will\n\t\t * fail in the case where the user purchases an item on one device and\n\t\t * then uses your app on a different device, because on the other device\n\t\t * you will not have access to the random string you originally\n\t\t * generated.\n\t\t * \n\t\t * So a good developer payload has these characteristics:\n\t\t * \n\t\t * 1. If two different users purchase an item, the payload is different\n\t\t * between them, so that one user's purchase can't be replayed to\n\t\t * another user.\n\t\t * \n\t\t * 2. The payload must be such that you can verify it even when the app\n\t\t * wasn't the one who initiated the purchase flow (so that items\n\t\t * purchased by the user on one device work on other devices owned by\n\t\t * the user).\n\t\t * \n\t\t * Using your own server to store and verify developer payloads across\n\t\t * app installations is recommended.\n\t\t */\n\n\t\treturn true;\n\t}", "@Override\r\n\tpublic JSONObject init(Merchant merchant, PayeeVo v) {\n\t\tJSONObject valid = this.valid(merchant,v.getTotal_amount());\r\n\t\tif (valid.getBooleanValue(\"state\")){\r\n\t\t\tPayee payee = this.getPayee();\r\n\t\t\tif (payee != null){\r\n\t\t\t\tv.setCost(String.valueOf(merchant.getFee()));\r\n\t\t\t\tv.setmId(String.valueOf(merchant.getId()));\r\n\t\t\t\tJSONObject result = this.execute(payee, v);\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t\treturn Result.error.toJson(\"代付服务关闭\");\r\n\t\t}\r\n\t\treturn valid;\r\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n\t\tString payload = p.getDeveloperPayload();\n\n\t\t/*\n\t\t * TODO: verify that the developer payload of the purchase is correct.\n\t\t * It will be the same one that you sent when initiating the purchase.\n\t\t * \n\t\t * WARNING: Locally generating a random string when starting a purchase\n\t\t * and verifying it here might seem like a good approach, but this will\n\t\t * fail in the case where the user purchases an item on one device and\n\t\t * then uses your app on a different device, because on the other device\n\t\t * you will not have access to the random string you originally\n\t\t * generated.\n\t\t * \n\t\t * So a good developer payload has these characteristics:\n\t\t * \n\t\t * 1. If two different users purchase an item, the payload is different\n\t\t * between them, so that one user's purchase can't be replayed to\n\t\t * another user.\n\t\t * \n\t\t * 2. The payload must be such that you can verify it even when the app\n\t\t * wasn't the one who initiated the purchase flow (so that items\n\t\t * purchased by the user on one device work on other devices owned by\n\t\t * the user).\n\t\t * \n\t\t * Using your own server to store and verify developer payloads across\n\t\t * app installations is recommended.\n\t\t */\n\n\t\treturn true;\n\t}", "public void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@Override\n public void onChanged(@Nullable Merchant merchant) {\n }", "private void m50363B() {\n try {\n TokenPaymentParams tokenPaymentParams = new TokenPaymentParams(this.f30711G0, this.f30708D0, this.f30709E0.getBrand(), this.f30737h0.getText().toString());\n StringBuilder sb = new StringBuilder();\n sb.append(this.f30720S.getString(C10232R.string.checkout_ui_callback_scheme));\n sb.append(\"://callback\");\n tokenPaymentParams.mo40895e(sb.toString());\n this.f30754y0.mo41066a(new Transaction((PaymentParams) tokenPaymentParams));\n this.f30728a.mo23628i(C11645a.f33474f, \"credit_card\");\n } catch (PaymentException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tprotected byte[] prepare_data() {\n\t\tbyte[] ret_byte = null;\n\t\tJSONObject json_object = new JSONObject();\n\t\ttry {\n\t\t\tjson_object.put(Jsonkey.string_transitionid_key, \"\");\n\t\t\tjson_object.put(Jsonkey.string_magicid_key, \"\");\n\t\t\tJSONObject json_content = new JSONObject();\n\t\t\tjson_object.put(Jsonkey.string_content_key, json_content);\n\t\t\tjson_content.put(Jsonkey.string_ctype_key, \"verify_login_request\");\n\t\t\tJSONObject json_cvalue = new JSONObject();\n\t\t\tjson_content.put(Jsonkey.string_cvalue_key, json_cvalue);\n\t\t\tjson_cvalue.put(Jsonkey.string_user_name_key, user_name);\n\t\t\tjson_cvalue.put(Jsonkey.string_user_password_key, user_password);\n\t\t\t\n\t\t\tString json_string = json_object.toString();\n\t\t\tret_byte = json_string.getBytes();\n\t\t} catch (JSONException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn ret_byte;\n\t}", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public CreditCard getDefaultPaymentInfo();", "public Builder clearMerchantData() {\n copyOnWrite();\n instance.clearMerchantData();\n return this;\n }", "public Builder clearMerchantData() {\n copyOnWrite();\n instance.clearMerchantData();\n return this;\n }", "public void setPaymentInfoInCart(CreditCard cc);", "@Test\n\tpublic void testInvalidMerchantTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\t//database.addCustomer(merchant); Merchant not in database\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This merchant is not a DTUPay user\",verifyParticipants);\n\t}", "public Merchant() {}", "public String getDeveloperPayload(){\n return developerPayload;\n }", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private void returnDeposit(String paymentInfo) {\n }", "private GetMerchantByParkingResponse(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "boolean hasSerializedPaymentDetails();", "public Object adjustBankSysexForEmit(byte[] data, Model model)\n {\n return data;\n }", "public IBankTransfert payment();", "public void parsingAdditionalData() {\n\t\tString AdditionalData = billPayBean.getAdditionalData();\n\t\tswitch (Integer.parseInt(billPayBean.getBillerId())) {\n\t\tcase 91901:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(95,120));\n\t\t\tbillPayBean.setMeterNumber(AdditionalData.substring(7,18));\n\t\t\tbillPayBean.setBillNumber(AdditionalData.substring(18,30));\n\t\t\tbreak;\n\t\tcase 91951:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(47,72));\n\t\t\tbillPayBean.setBillNumber(AdditionalData.substring(0,12));\n\t\t\tbreak;\n\t\tcase 91999:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(66,91));\n\t\t\tbillPayBean.setRegNumber(AdditionalData.substring(0,13));\n\t\t\tbreak;\n\t\tdefault:\n\t\t}\n\t\treturn ;\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "public void parseParameter(byte[] data)\n {\n return; \n }", "public String getMerchantOrderReference() {\n return merchantOrderReference;\n }", "public void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "public String getJP_BankDataCustomerCode2();", "public String getMerchantName() {\n\t\treturn merchantName;\n\t}", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "String getPaymentInformation();", "@ApiModelProperty(value = \"If provided, then the value overrides the one present in onboarding data. If the merchantCategoryCode value is not populated in onboarding data then this field is mandatory.<br><br><b>Note:</b> required if not provided during onboarding\")\n public Integer getMerchantCategoryCode() {\n return merchantCategoryCode;\n }", "private void setPaymentUrlBytes(\n com.google.protobuf.ByteString value) {\n paymentUrl_ = value.toStringUtf8();\n bitField0_ |= 0x00000010;\n }", "public void navigateToBaseActivity() throws JSONException {\n\n String merchantKey = jsonObject.getString(\"merchantKey\");\n String amount = jsonObject.getString(\"amount\");\n String email = jsonObject.getString(\"email\");\n String value = jsonObject.getString(\"value\");\n String firstName = jsonObject.getString(\"firstName\");\n String phone = jsonObject.getString(\"phone\");\n String txnId = jsonObject.getString(\"txnId\");\n String sUrl = jsonObject.getString(\"sUrl\");\n String fUrl = jsonObject.getString(\"fUrl\");\n String udf1 = jsonObject.getString(\"udf1\");\n String udf2 = jsonObject.getString(\"udf2\");\n String udf3 = jsonObject.getString(\"udf3\");\n String udf4 = jsonObject.getString(\"udf4\");\n String udf5 = jsonObject.getString(\"udf5\");\n salt = jsonObject.getString(\"salt\");\n int environment;\n if (value.equals(\"test\"))\n environment = PayuConstants.STAGING_ENV;\n else\n environment = PayuConstants.PRODUCTION_ENV;\n String userCredentials = merchantKey + \":\" + email;\n mPaymentParams = new PaymentParams();\n mPaymentParams.setKey(merchantKey);\n mPaymentParams.setAmount(amount);\n mPaymentParams.setProductInfo(\"GoCharge power bank charges\");\n mPaymentParams.setFirstName(firstName);\n mPaymentParams.setEmail(email);\n mPaymentParams.setPhone(phone);\n mPaymentParams.setTxnId(txnId);\n mPaymentParams.setSurl(sUrl);\n mPaymentParams.setFurl(fUrl);\n mPaymentParams.setNotifyURL(mPaymentParams.getSurl()); //for lazy pay\n mPaymentParams.setUdf1(udf1);\n mPaymentParams.setUdf2(udf2);\n mPaymentParams.setUdf3(udf3);\n mPaymentParams.setUdf4(udf4);\n mPaymentParams.setUdf5(udf5);\n mPaymentParams.setUserCredentials(userCredentials);\n payuConfig = new PayuConfig();\n payuConfig.setEnvironment(environment);\n generateHashFromSDK(mPaymentParams, salt);\n\n }" ]
[ "0.7797542", "0.7576785", "0.7576785", "0.72457767", "0.72457767", "0.6597282", "0.6597282", "0.64411324", "0.64411324", "0.63645166", "0.63239515", "0.6267365", "0.62569773", "0.6004758", "0.59594744", "0.59594744", "0.5946166", "0.5946166", "0.58732635", "0.58180135", "0.5815311", "0.57901794", "0.57724446", "0.5712245", "0.5707533", "0.5704003", "0.56633335", "0.56633335", "0.56633335", "0.56633335", "0.56539625", "0.5625574", "0.5625574", "0.562408", "0.55771023", "0.5571984", "0.55662656", "0.5547567", "0.5505207", "0.54818773", "0.5420988", "0.5420988", "0.5415817", "0.54126877", "0.5412118", "0.5403655", "0.5384956", "0.5371296", "0.5364792", "0.5349802", "0.5333934", "0.53318715", "0.5318022", "0.53150094", "0.5311886", "0.53004605", "0.52869076", "0.52826893", "0.52229816", "0.52220863", "0.5215288", "0.5212707", "0.520925", "0.52054906", "0.5201921", "0.5195478", "0.51524246", "0.5134985", "0.51245314", "0.51188505", "0.5113095", "0.5111281", "0.51038957", "0.5090348", "0.50824", "0.50824", "0.5070004", "0.50679225", "0.5064237", "0.50615", "0.5058139", "0.50473297", "0.5033698", "0.50334597", "0.5015592", "0.50028926", "0.49933758", "0.49906015", "0.49895284", "0.49803907", "0.4980213", "0.4973967", "0.49706343", "0.49578786", "0.4957266", "0.49444962", "0.494076", "0.49392447", "0.49329844", "0.4918309" ]
0.7791984
1
From PaymentDetails.merchant_data optional bytes merchant_data = 1;
private void clearMerchantData() { bitField0_ = (bitField0_ & ~0x00000001); merchantData_ = getDefaultInstance().getMerchantData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setMerchantData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000020;\n merchantData_ = value;\n }", "private void setMerchantData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000001;\n merchantData_ = value;\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return merchantData_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return merchantData_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return instance.getMerchantData();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return instance.getMerchantData();\n }", "public Builder setMerchantData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setMerchantData(value);\n return this;\n }", "public Builder setMerchantData(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setMerchantData(value);\n return this;\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000020) != 0);\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "private void clearMerchantData() {\n bitField0_ = (bitField0_ & ~0x00000020);\n merchantData_ = getDefaultInstance().getMerchantData();\n }", "public String getPaymentData() {\n return paymentData;\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "boolean hasMerchantData();", "boolean hasMerchantData();", "public void setMerchantCode (java.lang.String merchantCode) {\r\n\t\tthis.merchantCode = merchantCode;\r\n\t}", "public String getMerchant() {\n return _merchant;\n }", "public Long getMerchantId()\n {\n return merchantId;\n }", "public void setMerchantNum(String merchantNum) {\n this.merchantNum = FileUtils.hexStringFromatByF(10, \"\");\n }", "public void setMerchantId(Long merchantId) {\n this.merchantId = merchantId;\n }", "public String getMerchantTag() {\n return this.merchantTag;\n }", "public String getMerchantNo();", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public String getMerchantId() {\n return merchantId;\n }", "public Long getMerchantId() {\n return merchantId;\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId;\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId;\n }", "public java.lang.String getMerchantCode () {\r\n\t\treturn merchantCode;\r\n\t}", "private void setSerializedPaymentDetails(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000008;\n serializedPaymentDetails_ = value;\n }", "public void setMerchantName(String merchantName) {\n this.merchantName = merchantName;\n }", "public void setMerchantId (java.lang.Long merchantId) {\r\n\t\tthis.merchantId = merchantId;\r\n\t}", "public String getMerchantAccountCode() {\n return merchantAccountCode;\n }", "private JsonObjectBuilder merchantToJsonBuilder(Merchant merchant) {\n\n // Any way to avoid converting to a String?\n String jsonMerchant = jsonb.toJson(merchant);\n try (JsonReader jsonReader = Json.createReader(new StringReader(jsonMerchant))) {\n JsonObject merchantJson = jsonReader.readObject();\n JsonObjectBuilder merchantBuilder = Json.createObjectBuilder();\n merchantJson.forEach((k, v) -> {\n merchantBuilder.add(k, v);\n });\n return merchantBuilder;\n }\n }", "boolean verifyDeveloperPayload(Purchase p) {\n\t String payload = p.getDeveloperPayload();\n\n\t return true;\n\t }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId == null ? null : merchantId.trim();\n }", "public void setMerchantId(String merchantId) {\n this.merchantId = merchantId == null ? null : merchantId.trim();\n }", "public String getMerchantReference() {\n return this.merchantReference;\n }", "public String getMerchantAccount() {\n return merchantAccount;\n }", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "@Override\n\tpublic String pay(ZFTMerchantConfig merchant, ZFTOrderConfig order) throws Exception {\n\t\treturn null;\n\t}", "public void setMerchantTransNo (java.lang.String merchantTransNo) {\r\n\t\tthis.merchantTransNo = merchantTransNo;\r\n\t}", "public void setAdditionalBillingData(com.ipcommerce.schemas.CWS.v2_0.Transactions.PersonalInfo additionalBillingData) {\n this.additionalBillingData = additionalBillingData;\n }", "public String getMerchantReference() {\n return merchantReference;\n }", "void setPaymentInformation(String information);", "public void sendPaymentToMerchant() {\n // Check for successful send and a BIP70 Payment requirement\n if (lastBitcoinSentEvent != null && lastBitcoinSentEvent.isSendWasSuccessful()) {\n Preconditions.checkNotNull(getPaymentRequestData());\n Preconditions.checkState(getPaymentRequestData().isPresent());\n Preconditions.checkNotNull(getPaymentRequestData().get().getPaymentSessionSummary());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().isPresent());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().get().hasPaymentSession());\n\n PaymentSessionSummary paymentSessionSummary = getPaymentRequestData().get().getPaymentSessionSummary().get();\n\n // Send the Payment message to the merchant\n try {\n final List<Transaction> transactionsSent = Lists.newArrayList(lastBitcoinSentEvent.getTransaction().get());\n final PaymentRequestData finalPaymentRequestData = getPaymentRequestData().get();\n\n final Optional<PaymentSessionSummary.PaymentProtocolResponseDto> dto = paymentSessionSummary.sendPaymentSessionPayment(\n transactionsSent,\n lastBitcoinSentEvent.getChangeAddress(),\n getSendBitcoinEnterPaymentMemoPanelModel().getPaymentMemo());\n\n final Protos.Payment finalPayment = dto.get().getFinalPayment();\n final ListenableFuture<PaymentProtocol.Ack> future = dto.get().getFuture();\n\n if (future != null) {\n Futures.addCallback(\n future, new FutureCallback<PaymentProtocol.Ack>() {\n @Override\n public void onSuccess(PaymentProtocol.Ack result) {\n\n // Have successfully received a PaymentAck from the merchant\n log.info(\"Received PaymentAck from merchant. Memo: {}\", result.getMemo());\n getSendBitcoinShowPaymentACKMemoPanelModel().setPaymentACKMemo(result.getMemo());\n\n PaymentProtocolService paymentProtocolService = CoreServices.getPaymentProtocolService();\n\n if (finalPayment != null) {\n Optional<Protos.PaymentACK> paymentACK = paymentProtocolService.newPaymentACK(finalPayment, result.getMemo());\n\n finalPaymentRequestData.setPayment(Optional.of(finalPayment));\n finalPaymentRequestData.setPaymentACK(paymentACK);\n log.debug(\"Saving PaymentMemo of {} and PaymentACKMemo of {}\", finalPayment.getMemo(), paymentACK.isPresent() ? paymentACK.get().getMemo() : \"n/a\");\n WalletService walletService = CoreServices.getOrCreateWalletService(WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletId());\n walletService.addPaymentRequestData(finalPaymentRequestData);\n\n // Write payments\n CharSequence password = WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletPassword().getPassword();\n if (password != null) {\n walletService.writePayments(password);\n }\n\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(true, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_OK, null));\n } else {\n log.error(\"No payment and hence cannot save payment or paymentACK\");\n }\n }\n\n @Override\n public void onFailure(Throwable t) {\n // Failed to communicate with the merchant\n log.error(\"Unexpected failure\", t);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{t.getClass().getCanonicalName() + \" \" + t.getMessage()}));\n }\n });\n } else {\n throw new PaymentProtocolException(\"Failed to create future from Ack\");\n }\n } catch (IOException | PaymentProtocolException e) {\n log.error(\"Unexpected failure\", e);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{e.getClass().getCanonicalName() + \" \" + e.getMessage()}));\n }\n } else {\n String message = \"Bitcoin not sent successfully so no payment sent to requestor\";\n log.debug(message);\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(false, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED, new String[]{message}));\n }\n }", "public String getMerchantName() {\n return merchantName;\n }", "boolean verifyDeveloperPayload(Purchase p) {\n return DEVELOPER_PAYLOAD.equals(p.getDeveloperPayload());\n }", "public java.lang.Long getMerchantId () {\r\n\t\treturn merchantId;\r\n\t}", "@ApiModelProperty(required = true, value = \"merchant resource for the store\")\n @JsonProperty(\"merchant\")\n public EntityInfo getMerchant() {\n return merchant;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == PayUmoneyFlowManager.REQUEST_CODE_PAYMENT && resultCode == RESULT_OK && data !=\n null) {\n TransactionResponse transactionResponse = data.getParcelableExtra(PayUmoneyFlowManager\n .INTENT_EXTRA_TRANSACTION_RESPONSE);\n\n ResultModel resultModel = data.getParcelableExtra(PayUmoneyFlowManager.ARG_RESULT);\n\n // Check which object is non-null\n if (transactionResponse != null && transactionResponse.getPayuResponse() != null) {\n if (transactionResponse.getTransactionStatus().equals(TransactionResponse.TransactionStatus.SUCCESSFUL)) {\n //Success Transaction\n AddPayment(name, ridequantity, Amount);\n } else {\n Intent intent = new Intent();\n setResult(RESULT_OK, intent);\n finish();\n\n }\n\n // Response from Payumoney\n// String payuResponse = transactionResponse.getPayuResponse();\n//\n//// Response from SURl and FURL\n// String merchantResponse = transactionResponse.getTransactionDetails();\n//\n// new AlertDialog.Builder(this)\n// .setCancelable(false)\n// .setMessage(\"Payu's Data : \" + payuResponse + \"\\n\\n\\n Merchant's Data: \" + merchantResponse)\n// .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {\n// public void onClick(DialogInterface dialog, int whichButton) {\n// dialog.dismiss();\n// }\n// }).show();\n\n } else if (resultModel != null && resultModel.getError() != null) {\n Log.d(TAG, \"Error response : \" + resultModel.getError().getTransactionResponse());\n } else {\n Log.d(TAG, \"Both objects are null!\");\n }\n }\n }", "public String getMerchantAccount() {\n return merchantAccount;\n }", "@JsonProperty(\"MerchantId\")\n public String getMerchantId() {\n return merchantId;\n }", "public Builder setPaymentHashBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n paymentHash_ = value;\n onChanged();\n return this;\n }", "public void setPaymentinformation (java.lang.String paymentinformation) {\r\n\t\tthis.paymentinformation = paymentinformation;\r\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public void setMerchantName(String merchantName) {\n\t\tthis.merchantName = merchantName;\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n String payload = p.getDeveloperPayload();\n\n /*\n * TODO: verify that the developer payload of the purchase is correct. It will be\n * the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase and\n * verifying it here might seem like a good approach, but this will fail in the\n * case where the user purchases an item on one device and then uses your app on\n * a different device, because on the other device you will not have access to the\n * random string you originally generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different between them,\n * so that one user's purchase can't be replayed to another user.\n *\n * 2. The payload must be such that you can verify it even when the app wasn't the\n * one who initiated the purchase flow (so that items purchased by the user on\n * one device work on other devices owned by the user).\n *\n * Using your own server to store and verify developer payloads across app\n * installations is recommended.\n */\n\n return true;\n }", "boolean verifyDeveloperPayload(Purchase p) {\n\t\t/*String payload = */p.getDeveloperPayload();\n\n\t\t/*\n\t\t * TODO: verify that the developer payload of the purchase is correct.\n\t\t * It will be the same one that you sent when initiating the purchase.\n\t\t * \n\t\t * WARNING: Locally generating a random string when starting a purchase\n\t\t * and verifying it here might seem like a good approach, but this will\n\t\t * fail in the case where the user purchases an item on one device and\n\t\t * then uses your app on a different device, because on the other device\n\t\t * you will not have access to the random string you originally\n\t\t * generated.\n\t\t * \n\t\t * So a good developer payload has these characteristics:\n\t\t * \n\t\t * 1. If two different users purchase an item, the payload is different\n\t\t * between them, so that one user's purchase can't be replayed to\n\t\t * another user.\n\t\t * \n\t\t * 2. The payload must be such that you can verify it even when the app\n\t\t * wasn't the one who initiated the purchase flow (so that items\n\t\t * purchased by the user on one device work on other devices owned by\n\t\t * the user).\n\t\t * \n\t\t * Using your own server to store and verify developer payloads across\n\t\t * app installations is recommended.\n\t\t */\n\n\t\treturn true;\n\t}", "@Override\r\n\tpublic JSONObject init(Merchant merchant, PayeeVo v) {\n\t\tJSONObject valid = this.valid(merchant,v.getTotal_amount());\r\n\t\tif (valid.getBooleanValue(\"state\")){\r\n\t\t\tPayee payee = this.getPayee();\r\n\t\t\tif (payee != null){\r\n\t\t\t\tv.setCost(String.valueOf(merchant.getFee()));\r\n\t\t\t\tv.setmId(String.valueOf(merchant.getId()));\r\n\t\t\t\tJSONObject result = this.execute(payee, v);\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t\treturn Result.error.toJson(\"代付服务关闭\");\r\n\t\t}\r\n\t\treturn valid;\r\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n\t\tString payload = p.getDeveloperPayload();\n\n\t\t/*\n\t\t * TODO: verify that the developer payload of the purchase is correct.\n\t\t * It will be the same one that you sent when initiating the purchase.\n\t\t * \n\t\t * WARNING: Locally generating a random string when starting a purchase\n\t\t * and verifying it here might seem like a good approach, but this will\n\t\t * fail in the case where the user purchases an item on one device and\n\t\t * then uses your app on a different device, because on the other device\n\t\t * you will not have access to the random string you originally\n\t\t * generated.\n\t\t * \n\t\t * So a good developer payload has these characteristics:\n\t\t * \n\t\t * 1. If two different users purchase an item, the payload is different\n\t\t * between them, so that one user's purchase can't be replayed to\n\t\t * another user.\n\t\t * \n\t\t * 2. The payload must be such that you can verify it even when the app\n\t\t * wasn't the one who initiated the purchase flow (so that items\n\t\t * purchased by the user on one device work on other devices owned by\n\t\t * the user).\n\t\t * \n\t\t * Using your own server to store and verify developer payloads across\n\t\t * app installations is recommended.\n\t\t */\n\n\t\treturn true;\n\t}", "public void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);", "@Override\n public byte getType() {\n return TYPE_PAYMENT;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSerializedPaymentDetails() {\n return serializedPaymentDetails_;\n }", "@Override\n public void onChanged(@Nullable Merchant merchant) {\n }", "private void m50363B() {\n try {\n TokenPaymentParams tokenPaymentParams = new TokenPaymentParams(this.f30711G0, this.f30708D0, this.f30709E0.getBrand(), this.f30737h0.getText().toString());\n StringBuilder sb = new StringBuilder();\n sb.append(this.f30720S.getString(C10232R.string.checkout_ui_callback_scheme));\n sb.append(\"://callback\");\n tokenPaymentParams.mo40895e(sb.toString());\n this.f30754y0.mo41066a(new Transaction((PaymentParams) tokenPaymentParams));\n this.f30728a.mo23628i(C11645a.f33474f, \"credit_card\");\n } catch (PaymentException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tprotected byte[] prepare_data() {\n\t\tbyte[] ret_byte = null;\n\t\tJSONObject json_object = new JSONObject();\n\t\ttry {\n\t\t\tjson_object.put(Jsonkey.string_transitionid_key, \"\");\n\t\t\tjson_object.put(Jsonkey.string_magicid_key, \"\");\n\t\t\tJSONObject json_content = new JSONObject();\n\t\t\tjson_object.put(Jsonkey.string_content_key, json_content);\n\t\t\tjson_content.put(Jsonkey.string_ctype_key, \"verify_login_request\");\n\t\t\tJSONObject json_cvalue = new JSONObject();\n\t\t\tjson_content.put(Jsonkey.string_cvalue_key, json_cvalue);\n\t\t\tjson_cvalue.put(Jsonkey.string_user_name_key, user_name);\n\t\t\tjson_cvalue.put(Jsonkey.string_user_password_key, user_password);\n\t\t\t\n\t\t\tString json_string = json_object.toString();\n\t\t\tret_byte = json_string.getBytes();\n\t\t} catch (JSONException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn ret_byte;\n\t}", "com.dogecoin.protocols.payments.Protos.Payment getPayment();", "public CreditCard getDefaultPaymentInfo();", "public Builder clearMerchantData() {\n copyOnWrite();\n instance.clearMerchantData();\n return this;\n }", "public Builder clearMerchantData() {\n copyOnWrite();\n instance.clearMerchantData();\n return this;\n }", "public void setPaymentInfoInCart(CreditCard cc);", "@Test\n\tpublic void testInvalidMerchantTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\t//database.addCustomer(merchant); Merchant not in database\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This merchant is not a DTUPay user\",verifyParticipants);\n\t}", "public Merchant() {}", "public String getDeveloperPayload(){\n return developerPayload;\n }", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private void returnDeposit(String paymentInfo) {\n }", "private GetMerchantByParkingResponse(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "boolean hasSerializedPaymentDetails();", "public Object adjustBankSysexForEmit(byte[] data, Model model)\n {\n return data;\n }", "public IBankTransfert payment();", "public void parsingAdditionalData() {\n\t\tString AdditionalData = billPayBean.getAdditionalData();\n\t\tswitch (Integer.parseInt(billPayBean.getBillerId())) {\n\t\tcase 91901:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(95,120));\n\t\t\tbillPayBean.setMeterNumber(AdditionalData.substring(7,18));\n\t\t\tbillPayBean.setBillNumber(AdditionalData.substring(18,30));\n\t\t\tbreak;\n\t\tcase 91951:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(47,72));\n\t\t\tbillPayBean.setBillNumber(AdditionalData.substring(0,12));\n\t\t\tbreak;\n\t\tcase 91999:\n\t\t\tbillPayBean.setCustomerName(AdditionalData.substring(66,91));\n\t\t\tbillPayBean.setRegNumber(AdditionalData.substring(0,13));\n\t\t\tbreak;\n\t\tdefault:\n\t\t}\n\t\treturn ;\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "public void parseParameter(byte[] data)\n {\n return; \n }", "public String getMerchantOrderReference() {\n return merchantOrderReference;\n }", "public void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "public String getJP_BankDataCustomerCode2();", "public String getMerchantName() {\n\t\treturn merchantName;\n\t}", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "String getPaymentInformation();", "@ApiModelProperty(value = \"If provided, then the value overrides the one present in onboarding data. If the merchantCategoryCode value is not populated in onboarding data then this field is mandatory.<br><br><b>Note:</b> required if not provided during onboarding\")\n public Integer getMerchantCategoryCode() {\n return merchantCategoryCode;\n }", "private void setPaymentUrlBytes(\n com.google.protobuf.ByteString value) {\n paymentUrl_ = value.toStringUtf8();\n bitField0_ |= 0x00000010;\n }", "public void navigateToBaseActivity() throws JSONException {\n\n String merchantKey = jsonObject.getString(\"merchantKey\");\n String amount = jsonObject.getString(\"amount\");\n String email = jsonObject.getString(\"email\");\n String value = jsonObject.getString(\"value\");\n String firstName = jsonObject.getString(\"firstName\");\n String phone = jsonObject.getString(\"phone\");\n String txnId = jsonObject.getString(\"txnId\");\n String sUrl = jsonObject.getString(\"sUrl\");\n String fUrl = jsonObject.getString(\"fUrl\");\n String udf1 = jsonObject.getString(\"udf1\");\n String udf2 = jsonObject.getString(\"udf2\");\n String udf3 = jsonObject.getString(\"udf3\");\n String udf4 = jsonObject.getString(\"udf4\");\n String udf5 = jsonObject.getString(\"udf5\");\n salt = jsonObject.getString(\"salt\");\n int environment;\n if (value.equals(\"test\"))\n environment = PayuConstants.STAGING_ENV;\n else\n environment = PayuConstants.PRODUCTION_ENV;\n String userCredentials = merchantKey + \":\" + email;\n mPaymentParams = new PaymentParams();\n mPaymentParams.setKey(merchantKey);\n mPaymentParams.setAmount(amount);\n mPaymentParams.setProductInfo(\"GoCharge power bank charges\");\n mPaymentParams.setFirstName(firstName);\n mPaymentParams.setEmail(email);\n mPaymentParams.setPhone(phone);\n mPaymentParams.setTxnId(txnId);\n mPaymentParams.setSurl(sUrl);\n mPaymentParams.setFurl(fUrl);\n mPaymentParams.setNotifyURL(mPaymentParams.getSurl()); //for lazy pay\n mPaymentParams.setUdf1(udf1);\n mPaymentParams.setUdf2(udf2);\n mPaymentParams.setUdf3(udf3);\n mPaymentParams.setUdf4(udf4);\n mPaymentParams.setUdf5(udf5);\n mPaymentParams.setUserCredentials(userCredentials);\n payuConfig = new PayuConfig();\n payuConfig.setEnvironment(environment);\n generateHashFromSDK(mPaymentParams, salt);\n\n }" ]
[ "0.7797542", "0.7791984", "0.7576785", "0.7576785", "0.72457767", "0.72457767", "0.6597282", "0.6597282", "0.64411324", "0.64411324", "0.63645166", "0.63239515", "0.6267365", "0.6004758", "0.59594744", "0.59594744", "0.5946166", "0.5946166", "0.58732635", "0.58180135", "0.5815311", "0.57901794", "0.57724446", "0.5712245", "0.5707533", "0.5704003", "0.56633335", "0.56633335", "0.56633335", "0.56633335", "0.56539625", "0.5625574", "0.5625574", "0.562408", "0.55771023", "0.5571984", "0.55662656", "0.5547567", "0.5505207", "0.54818773", "0.5420988", "0.5420988", "0.5415817", "0.54126877", "0.5412118", "0.5403655", "0.5384956", "0.5371296", "0.5364792", "0.5349802", "0.5333934", "0.53318715", "0.5318022", "0.53150094", "0.5311886", "0.53004605", "0.52869076", "0.52826893", "0.52229816", "0.52220863", "0.5215288", "0.5212707", "0.520925", "0.52054906", "0.5201921", "0.5195478", "0.51524246", "0.5134985", "0.51245314", "0.51188505", "0.5113095", "0.5111281", "0.51038957", "0.5090348", "0.50824", "0.50824", "0.5070004", "0.50679225", "0.5064237", "0.50615", "0.5058139", "0.50473297", "0.5033698", "0.50334597", "0.5015592", "0.50028926", "0.49933758", "0.49906015", "0.49895284", "0.49803907", "0.4980213", "0.4973967", "0.49706343", "0.49578786", "0.4957266", "0.49444962", "0.494076", "0.49392447", "0.49329844", "0.4918309" ]
0.62569773
13
Signed transactions that satisfy PaymentDetails.outputs repeated bytes transactions = 2;
@java.lang.Override public java.util.List<com.google.protobuf.ByteString> getTransactionsList() { return transactions_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testValidOutputValues() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, -20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(-20, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testNoDoubleSpending() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Alice wants double spending: transfers 10 coins to Bob, 20 to Cal again\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1: input 0\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n\n // Sign for tx1: input 1\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(1).addSignature(sig2);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testHandleTxs() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // Cal transfers 5 coins to Bob, Bob transfers 2 coins to Alice\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0); // index 0 refers to output 1 of tx1\n tx2.addInput(tx1.getHash(), 1); // index 1 refers to output 1 of tx1\n tx2.addOutput(2, kpAlice.getPublic());\n tx2.addOutput(5, kpBob.getPublic());\n\n // Sign for tx2\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx2.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(0).addSignature(sig2);\n\n byte[] sig3 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpCal.getPrivate());\n sig.update(tx2.getRawDataToSign(1));\n sig3 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(1).addSignature(sig3);\n tx2.finalize();\n\n // Alice transfers 3 coins to Cal\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(), 0);\n tx3.addOutput(3, kpCal.getPublic());\n\n // Sign for tx3\n byte[] sig4 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx3.getRawDataToSign(0));\n sig4 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx3.getInput(0).addSignature(sig4);\n tx3.finalize();\n\n Transaction[] acceptedTx = txHandler.handleTxs(new Transaction[] {tx1, tx2, tx3});\n // tx1, tx2 supposed to be valid, tx3 supposed to be invalid\n assertEquals(acceptedTx.length, 2);\n // assertFalse(txHandler.isValidTx(tx3));\n }", "public boolean processTransaction() {\n\n // Checks to see if the signature can be verified.\n if (verifySignature() == false) {\n System.out.println(\"# Transaction signature could not be verified.\");\n return false;\n }\n\n // Gathers all transaction inputs, making sure they are unspent.\n for (TransactionInput i : inputs) {\n i.UTXO = BasicBlockchain.UTXOs.get(i.transactionOutputId);\n }\n\n // Checks if transaction amount is valid.\n if (getInputsValue() < BasicBlockchain.minimumTransaction) {\n System.out.println(\"# Transaction inputs are too small.\");\n return false;\n }\n\n // Generates transaction outputs.\n // Get value of the inputs then the leftover change.\n float leftOver = getInputsValue() - value;\n transactionId = calculateHash();\n // Send value to recipient.\n outputs.add(new TransactionOutput(this.recipient, value, transactionId));\n // Send the leftover \"change\" back to sender.\n outputs.add(new TransactionOutput(this.sender, leftOver, transactionId));\n\n\n // Adds outputs to the unspent list.\n for (TransactionOutput o : outputs) {\n BasicBlockchain.UTXOs.put(o.id, o);\n }\n\n // Removes the transaction inputs from the blockchain's UTXO list as spent.\n for (TransactionInput i : inputs) {\n if (i.UTXO == null) continue;\n BasicBlockchain.UTXOs.remove(i.UTXO.id);\n }\n\n return true;\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutput();", "public static void main(String[] args) throws AddressFormatException {\n\n// generateMultisig();\n String getSignedTransaction = signFirstTime();\n String rawtx = signSecondTime(getSignedTransaction);\n\n System.out.println(\"rawtx ->\"+ rawtx);\n }", "private static String signFirstTime() throws AddressFormatException\n {\n ECKey key1 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n\n\n // Use the redeem script we have saved somewhere to start building the transaction\n Script redeemScript = new Script(hexStringToByteArray(\"5221021ae8964b8529dc3e52955f2cabd967e08c52008dbcca8e054143b668f3998f4a210306be609ef37366ab0f3dd4096ac23a6ee4d561fc469fa60003f799b0121ad1072102199f3d89fa00e6f55dd6ecdd911457d7264415914957db124d53bf0064963f3853ae\"));\n\n // Start building the transaction by adding the unspent inputs we want to use\n // The data is taken from blockchain.info, and can be found here: https://blockchain.info/rawtx/ca1884b8f2e0ba88249a86ec5ddca04f937f12d4fac299af41a9b51643302077\n Transaction spendTx = new Transaction(params);\n ScriptBuilder scriptBuilder = new ScriptBuilder();\n scriptBuilder.data(new String(\"a9145204ad7c5fa5a2491cd91c332e28c87221194ca087\").getBytes()); // Script of this output\n TransactionInput input = spendTx.addInput(new Sha256Hash(\"fed695bf5e2c15286956a7bd3464c5beb97ef064e1f9406eba189ea844733e7c\"), 1, scriptBuilder.build());\n\n // Add outputs to the person receiving bitcoins\n Address receiverAddress = new Address(params, \"n2cWhs5sbWFCwzuuWWsVM9ubPwykGtX75T\");\n Coin charge = Coin.valueOf(1000000); // 0.1 mBTC\n Script outputScript = ScriptBuilder.createOutputScript(receiverAddress);\n spendTx.addOutput(charge, outputScript);\n\n /*8888888888888888888888888888888888888888888888888888888888888*/\n\n // Sign the first part of the transaction using private key #1\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature ecdsaSignature = key1.sign(sighash);\n TransactionSignature transactionSignarture = new TransactionSignature(ecdsaSignature, Transaction.SigHash.ALL, false);\n\n // Create p2sh multisig input script\n Script inputScript = ScriptBuilder.createP2SHMultiSigInputScript(Arrays.asList(transactionSignarture), redeemScript);\n\n // Add the script signature to the input\n input.setScriptSig(inputScript);\n System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "private ArrayList<Long> storeTransactionInputs(long transactionId, ArrayList<TransactionInput> inputs, int isCoinbase){\n \t\tint inputindex = 0;\n \t\tlong previousOutputId;\n \t\tString prevOutputHash;\n \t\tResultSet findOutputResults;\n \t\tResultSet generatedKey;\n \t\tLong addressId;\n \t\tArrayList<Long> addressIdz=new ArrayList<Long>();\n \t\ttry {\n \t\tfor (TransactionInput i : inputs) {\n\t\t\t\n \t\t\tprevOutputHash = HexBin.encode(i.outpoint.hash);\n \t\t\tfindTransactionOutputStatement.setString(1, prevOutputHash);\n \t\t\tfindTransactionOutputStatement.setLong(2, i.outpoint.index);\n \t\t\tfindOutputResults = findTransactionOutputStatement\n \t\t\t\t\t.executeQuery();\n \t\t\tif (findOutputResults.next()) {\n \t\t\t\tpreviousOutputId = findOutputResults.getLong(1);\n\t\t\t\taddressId=findOutputResults.getLong(2);\n \t\t\t} else {\n \t\t\t\tpreviousOutputId = 0;\n\t\t\t\taddressId=null;\n \t\t\t}\n \t\t\tfindOutputResults.close();\n \t\t\tinsertTransactionInputStatement.setLong(1, transactionId);\n \t\t\tinsertTransactionInputStatement.setInt(2, inputindex);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(3, previousOutputId);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setString(4, prevOutputHash);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(5, i.outpoint.index);\n \t\t\tinsertTransactionInputStatement.setLong(6,\n \t\t\t\t\ti.scriptBytes.length);\n \t\t\tinsertTransactionInputStatement.setString(7,\n \t\t\t\t\tHexBin.encode(i.scriptBytes));\n \t\t\tinsertTransactionInputStatement.setLong(8, i.sequence);\n \t\t\tinsertTransactionInputStatement.setBoolean(9,\n \t\t\t\t\ti.isCoinBase());\n\t\t\tif(addressId!=null){\n \t\t\t\tinsertTransactionInputStatement.setLong(10,addressId);\n \t\t\t\taddressIdz.add(addressId);\n\t\t\t} else {\n \t\t\t\t// TODO Auto-generated catch block\n \t\t\t\tinsertTransactionInputStatement.setNull(10,\n \t\t\t\t\t\tjava.sql.Types.INTEGER);\n \t\t\t}\n \t\t\tinsertTransactionInputStatement.execute();\n \t\t\t\n \t\t}\n \t\t\n \t\t\n \t} catch (SQLException e1) {\n \t\t// TODO Auto-generated catch block\n \t\te1.printStackTrace();\n \t}\n \t\treturn addressIdz;\n \t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputOrBuilder();", "List<TransactionVO> addPendingTransactions(List<SignedTransaction> transactions);", "@Test\n public void TxHandlerTestThird() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid output number(wrong number of coins to transfer)\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1 scrooge to alice 20coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: Alice --> Bob -5coins [*Invalid output number*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(-5, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n // tx3: Alice --> Bob 90coins [*Invalid output number*]\n Transaction tx3 = new Transaction();\n tx3.addInput(tx1.getHash(), 0);\n tx3.addOutput(90, pkBob.getPublic());\n tx3.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n }", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "private static String signSecondTime(String transactionString)\n {\n Transaction spendTx = new Transaction(params, hexStringToByteArray(transactionString));\n\n // Get the input chunks\n Script inputScript = spendTx.getInput(0).getScriptSig();\n List<ScriptChunk> scriptChunks = inputScript.getChunks();\n\n // Create a list of all signatures. Start by extracting the existing ones from the list of script schunks.\n // The last signature in the script chunk list is the redeemScript\n List<TransactionSignature> signatureList = new ArrayList<TransactionSignature>();\n Iterator<ScriptChunk> iterator = scriptChunks.iterator();\n Script redeemScript = null;\n\n while (iterator.hasNext())\n {\n ScriptChunk chunk = iterator.next();\n\n if (iterator.hasNext() && chunk.opcode != 0)\n {\n TransactionSignature transactionSignarture = TransactionSignature.decodeFromBitcoin(chunk.data, false);\n signatureList.add(transactionSignarture);\n } else\n {\n redeemScript = new Script(chunk.data);\n }\n }\n\n // Create the sighash using the redeem script\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature secondSignature;\n\n // Take out the key and sign the signhash\n //ECKey key2 = createKeyFromSha256Passphrase(\"Super secret key 2\");\n ECKey key2 = ECKey.fromPrivate(new BigInteger(\"68123968917867656952640885027449260190826636504009580537802764798766700329220\"));\n// ECKey key2 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n secondSignature = key2.sign(sighash);\n\n // Add the second signature to the signature list\n TransactionSignature transactionSignarture = new TransactionSignature(secondSignature, Transaction.SigHash.ALL, false);\n signatureList.add(transactionSignarture);\n\n // Rebuild p2sh multisig input script\n inputScript = ScriptBuilder.createP2SHMultiSigInputScript(signatureList, redeemScript);\n spendTx.getInput(0).setScriptSig(inputScript);\n\n //System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "@Test\n public void testOutputsInUTXOPool() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is NOT put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // UTXO pool does not contains the UTXO\n assertFalse(txHandler.isValidTx(tx1));\n\n // Put output of createCoinTx to the pool\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler1 = new TxHandler(utxoPool);\n\n // UTXO pool now contains the UTXO\n assertTrue(txHandler1.isValidTx(tx1));\n }", "@Test\n public void testValidBalance() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 100 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(100, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "RequestResult postSignRequests(TriphaseRequest[] requests) throws IOException,\n CertificateEncodingException, SAXException;", "public IBankTransfert payment();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static boolean isSigned_entries_receiveEst() {\n return false;\n }", "com.google.protobuf.ByteString getTransactions(int index);", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "@Suspendable\n @Override\n public SignedTransaction call() throws FlowException {\n\n Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);\n//\n\n // Source\n AccountInfo issuerOwner = subFlow(new AccountInfoByName(acctNameSource)).get(0).getState().getData();\n PublicKey issuerOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty issuerOwnerAnonParty = new AnonymousParty(issuerOwnerKey);\n\n AccountInfo targetOwner = subFlow(new AccountInfoByName(acctNameTarget)).get(0).getState().getData();\n PublicKey targetOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty targetOwnerAnonParty = new AnonymousParty(targetOwnerKey);\n\n\n AssetForAccountState outputAsset = new AssetForAccountState(issuerOwnerAnonParty, targetOwnerAnonParty,\n asset.getState().getData().getName(), asset.getState().getData().getValue());\n\n\n TransactionBuilder txBuilder = new TransactionBuilder(notary)\n .addInputState(asset)\n .addOutputState(outputAsset, AssetForAccountContract.ID)\n .addCommand(new AssetForAccountContract.Commands.Transfer(), issuerOwnerKey);\n\n txBuilder.verify(getServiceHub());\n\n SignedTransaction fullySignedTransaction = getServiceHub().signInitialTransaction(txBuilder, issuerOwnerKey);\n\n //return fullySignedTransaction;\n return subFlow(new FinalityFlow(fullySignedTransaction, Collections.emptyList()));\n }", "private boolean areOutputsSpent(Transaction tx){\n // Need to see if tx inputs are contained in the blockchain UTXOs\n for(TransactionInput i : tx.inputs){\n if(!currentBlockchain.UTXOs.containsKey(i.previousOutId)){\n return true;\n }\n }\n return false;\n }", "BigInteger getDigitalSignature();", "public static long deepTransactionCheck(Transaction tx, UtxoUpdateBuffer utxo_buffer, BlockHeader block_header, NetworkParams params)\n throws ValidationException\n {\n try(TimeRecordAuto tra_blk = TimeRecord.openAuto(\"Validation.deepTransactionCheck\"))\n {\n TransactionInner inner = null;\n\n try\n {\n inner = TransactionInner.parseFrom(tx.getInnerData());\n }\n catch(java.io.IOException e)\n {\n throw new ValidationException(\"error parsing tx on second pass somehow\", e);\n }\n\n long sum_of_inputs = 0L;\n // Make sure all inputs exist\n for(TransactionInput in : inner.getInputsList())\n {\n TransactionOutput matching_out = utxo_buffer.getOutputMatching(in);\n if (matching_out == null)\n {\n throw new ValidationException(String.format(\"No matching output for input %s\", new ChainHash(in.getSrcTxId())));\n }\n validateSpendable(matching_out, block_header, params);\n sum_of_inputs += matching_out.getValue();\n\n // SIP-4 check\n if (block_header.getBlockHeight() >= params.getActivationHeightTxInValue())\n {\n if (in.getValue() != 0L)\n {\n if (in.getValue() != matching_out.getValue())\n {\n throw new ValidationException(String.format(\"Input value does not match: %d %d\", matching_out.getValue(), in.getValue()));\n }\n }\n }\n utxo_buffer.useOutput(matching_out, new ChainHash(in.getSrcTxId()), in.getSrcTxOutIdx());\n }\n\n long spent = 0L;\n // Sum up all outputs\n int out_idx =0;\n ArrayList<ByteString> raw_output_list = TransactionUtil.extractWireFormatTxOut(tx);\n\n for(TransactionOutput out : inner.getOutputsList())\n {\n validateTransactionOutput(out, block_header, params);\n spent+=out.getValue();\n utxo_buffer.addOutput(raw_output_list, out, new ChainHash(tx.getTxHash()), out_idx);\n out_idx++;\n\n }\n\n spent+=inner.getFee();\n\n if (!inner.getIsCoinbase())\n {\n if (sum_of_inputs != spent)\n {\n throw new ValidationException(String.format(\"Transaction took in %d and spent %d\", sum_of_inputs, spent));\n }\n }\n \n return inner.getFee();\n }\n }", "@Test\n public void TxHandlerTestSecond() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the double spending\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(25, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1: one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx 2:Scrooge --> Bob 20coins [*Double-spending*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx0.getHash(), 0);\n tx2.addOutput(25, pkBob.getPublic());\n tx2.signTx(pkScrooge.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n\n }", "String signITRByAssesse(String PAN,String xml, DigitalSignatureWrapper digitalSignatureWrapper) throws MissingPrivateKeyException,InvalidDigitalSignatureException,Exception;", "public boolean processTransaction() {\r\n\t\t\r\n\t\t\tif(verifySignature() == false) {\r\n\t\t\t\tSystem.out.println(\"#Transaction Signature failed to verify\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\ttransactionId = calulateHash();\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "public static boolean isSigned_receivets() {\n return true;\n }", "@Override\n public boolean isValid() {\n final BlockChainInt outputHash = getOutputHash();\n\n return inputs.stream().map(input -> input.verifySignature(outputHash)).reduce(true, (a, b) -> a && b)\n && outputs.stream().map(output -> output.getAmount() >= 0).reduce(true, (a, b) -> a && b)\n && getTransactionFee() >= 0;\n }", "@Override\n public void run() {\n byte[] deviceTxPayload = CoreServices.getOrCreateHardwareWalletService().get().getContext().getSerializedTx().toByteArray();\n\n log.info(\"DeviceTx payload:\\n{}\", Utils.HEX.encode(deviceTxPayload));\n\n // Load deviceTx\n Transaction deviceTx = new Transaction(MainNetParams.get(), deviceTxPayload);\n\n log.info(\"deviceTx:\\n{}\", deviceTx.toString());\n\n // Check the signatures are canonical\n for (TransactionInput txInput : deviceTx.getInputs()) {\n byte[] signature = txInput.getScriptSig().getChunks().get(0).data;\n if (signature != null) {\n log.debug(\n \"Is signature canonical test result '{}' for txInput '{}', signature '{}'\",\n TransactionSignature.isEncodingCanonical(signature),\n txInput.toString(),\n Utils.HEX.encode(signature));\n } else {\n log.warn(\"No signature data\");\n }\n }\n\n log.debug(\"Committing and broadcasting the last tx\");\n\n BitcoinNetworkService bitcoinNetworkService = CoreServices.getOrCreateBitcoinNetworkService();\n\n if (bitcoinNetworkService.getLastSendRequestSummaryOptional().isPresent()\n && bitcoinNetworkService.getLastWalletOptional().isPresent()) {\n\n SendRequestSummary sendRequestSummary = bitcoinNetworkService.getLastSendRequestSummaryOptional().get();\n\n // Check the unsigned and signed tx are essentially the same as a check against malware attacks on the Trezor\n if (TransactionUtils.checkEssentiallyEqual(sendRequestSummary.getSendRequest().get().tx, deviceTx)) {\n // Substitute the signed tx from the trezor\n log.debug(\n \"Substituting the Trezor signed tx '{}' for the unsigned version {}\",\n deviceTx.toString(),\n sendRequestSummary.getSendRequest().get().tx.toString()\n );\n sendRequestSummary.getSendRequest().get().tx = deviceTx;\n log.debug(\"The transaction fee was {}\", sendRequestSummary.getSendRequest().get().fee);\n\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_TRANSACTION_CREATED_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n\n // Get the last wallet\n Wallet wallet = bitcoinNetworkService.getLastWalletOptional().get();\n\n // Commit and broadcast\n bitcoinNetworkService.commitAndBroadcast(sendRequestSummary, wallet, paymentRequestData);\n\n // Ensure the header is switched off whilst the send is in progress\n ViewEvents.fireViewChangedEvent(ViewKey.HEADER, false);\n } else {\n // The signed transaction is essentially different from what was sent to it - abort send\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_FAILURE_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n }\n } else {\n log.debug(\"Cannot commit and broadcast the last send as it is not present in bitcoinNetworkService\");\n }\n // Clear the previous remembered tx\n bitcoinNetworkService.setLastSendRequestSummaryOptional(Optional.<SendRequestSummary>absent());\n bitcoinNetworkService.setLastWalletOptional(Optional.<Wallet>absent());\n }", "@Test\n public void TxHandlerTestForth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid signature\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx1: scrooge to alice 20 coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: alice to bob 20coins[signed by bob]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(20, pkBob.getPublic());\n tx2.signTx(pkBob.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n }", "@Override\n public byte[] createDataToSignInput(\n Transaction transaction,\n int inputIndex,\n long amountInSat,\n PublicKeyTriple publicKeyTriple) {\n\n final byte[] redeemScript = createRedeemScript(publicKeyTriple);\n\n return TransactionHelpers.getDataToSign(\n transaction,\n inputIndex,\n new Script(redeemScript)\n );\n }", "public TransactionResponse processAllTransaction() throws ParseException {\n TransactionResponse response = new TransactionResponse();\n\n //User0\n response.setTransaction(new Transaction(\"user0\",\"0001\", \"type0\",\"user0_Billing\",\"user0_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-00\")));\n\n //User1\n response.setTransaction(new Transaction(\"user1\", \"0101\",\"type0\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user1\", \"0102\", \"type1\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-00\")));\n\n //User2\n response.setTransaction(new Transaction(\"user2\", \"0201\", \"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-01-00\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0202\", \"type2\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0203\",\"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n //User3\n response.setTransaction(new Transaction(\"user3\", \"0301\",\"type0\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user3\", \"0302\",\"type1\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n return response;\n }", "com.dogecoin.protocols.payments.Protos.Output getOutputs(int index);", "@Test\n public void TxHandlerTestFifth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the input not in the UtxoPool\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n //tx1: Scrooge --> Alice 20coins [Pay Coins *NOT added to UTXO pool* due to accidents]\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n utxo = new UTXO(tx1.getHash(),0);\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n utxoPool.removeUTXO(utxo);\n assertTrue(\"tx1:UTXO has been removed.\", utxoPool.getAllUTXO().size() == 0);\n\n\n // tx2: Alice --> Bob 15coins [Pay Coins *Previous Tx NOT in UTXO pool*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(15, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 0);\n\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "private static void createDummyTransactions() {\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 10L, new Transaction(10000d, \"cars\", 0L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 11L, new Transaction(15000d, \"shopping\", 10L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 12L, new Transaction(20000d, \"keys\", 11L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 13L, new Transaction(25000d, \"furniture\", 12L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 14L, new Transaction(30000d, \"keys\", 13L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 15L, new Transaction(40000d, \"cars\", 14L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 16L, new Transaction(50000d, \"cars\", 15L)));\n }", "@Test\n public void TxHandlerTestFirst() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test some basic functions of TxHandler\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n // tx0: Scrooge --> Scrooge 25coins [Create Coins]\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx( pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n\n // tx1: Scrooge --> Scrooge 4coins [Divide Coins]\n //\t Scrooge --> Scrooge 5coins\n //\t Scrooge --> Scrooge 6coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(),0);\n\n tx1.addOutput(4,pkScrooge.getPublic());\n tx1.addOutput(5,pkScrooge.getPublic());\n tx1.addOutput(6,pkScrooge.getPublic());\n\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx2: Scrooge --> Alice 4coins [Pay separately]\n //\t Scrooge --> Alice 5coins\n // Scrooge --> Bob 6coins\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addInput(tx1.getHash(), 1);\n tx2.addInput(tx1.getHash(), 2);\n\n tx2.addOutput(4, pkAlice.getPublic());\n tx2.addOutput(5, pkAlice.getPublic());\n tx2.addOutput(6, pkBob.getPublic());\n\n tx2.signTx(pkScrooge.getPrivate(), 0);\n tx2.signTx(pkScrooge.getPrivate(), 1);\n tx2.signTx(pkScrooge.getPrivate(), 2);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx3:Alice --> Alice 2coins [Divide Coins]\n // Alice --> Alice 2coins\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(),0);\n\n tx3.addOutput(2, pkAlice.getPublic());\n tx3.addOutput(2, pkAlice.getPublic());\n\n tx3.signTx(pkAlice.getPrivate(),0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 4);\n\n // tx4: Alice --> Bob 2coins [Pay jointly]\n // Alice --> Bob 5coins\n Transaction tx4 = new Transaction();\n tx4.addInput(tx3.getHash(),0);\n tx4.addInput(tx2.getHash(),1);\n\n tx4.addOutput(7, pkBob.getPublic());\n\n tx4.signTx(pkAlice.getPrivate(), 0);\n tx4.signTx(pkAlice.getPrivate(),1);\n\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx4) returns: \" + txHandler.isValidTx(tx4));\n assertTrue(\"tx4:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx4}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx4:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n// System.out.println(\"tx4.hashCode returns: \" + tx4.hashCode());\n }", "public ParametricStatement[] createForPaymentTransaction(PaymentTransaction paymentTransaction)\n throws SQLException {\n int multiplier = 1;\n Date date = paymentTransaction.getProcessDate();\n if (paymentTransaction instanceof VoidTransaction) {\n VoidTransaction trans = (VoidTransaction)paymentTransaction;\n ITransaction originalTrans = trans.getOriginalTransaction();\n if (originalTrans instanceof PaymentTransaction) {\n multiplier = -1;\n paymentTransaction = (PaymentTransaction)originalTrans;\n } else {\n // Do nothing if original was not a payment transaction.\n return new ParametricStatement[0];\n }\n }\n ArrayList parametricStatements = new ArrayList();\n String storeId = paymentTransaction.getStore().getId();\n String operatorId = paymentTransaction.getTheOperator().getId();\n // String registerId = paymentTransaction.getId();\n // int registerIdIndex = registerId.indexOf('*') + 1;\n // registerId = registerId.substring(registerIdIndex, registerId.indexOf('*', registerIdIndex));\n String registerId = paymentTransaction.getRegisterId();\n PaymentSummary[] currentPaymentSummaries = this.selectByDateStoreId(date, storeId);\n List newPaymentSummaries = new ArrayList();\n Payment[] payments = paymentTransaction.getPaymentsArray();\n for (int paymentIndex = 0; paymentIndex < payments.length; paymentIndex++) {\n ArmCurrency paymentAmount = payments[paymentIndex].getAmount().multiply(multiplier);\n String paymentType = payments[paymentIndex].getTransactionPaymentName();\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n boolean found = false;\n //to find if this payment type is already in the database\n for (int summaryIndex = 0; summaryIndex < currentPaymentSummaries.length; summaryIndex++) {\n if (currentPaymentSummaries[summaryIndex].getEmployeeId().equals(operatorId)\n && currentPaymentSummaries[summaryIndex].getRegisterId().equals(registerId)\n && currentPaymentSummaries[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n currentPaymentSummaries[summaryIndex].doSetPaymentTotal(paymentAmount.add(\n currentPaymentSummaries[summaryIndex].getPaymentTotal()));\n int mediaCount = ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).\n getMediaCount();\n ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n // work-around for cloudscape date truncation problem.\n currentPaymentSummaries[summaryIndex].doSetDate(date);\n List list = fromObjectToBean(currentPaymentSummaries[summaryIndex]).toList();\n list.add(currentPaymentSummaries[summaryIndex].getId());\n parametricStatements.add(new ParametricStatement(updateSql, list));\n break;\n }\n }\n //to find if it is already in the newPaymentSummaries List\n if (!found) {\n PaymentSummary[] newPaymentSummaryArray = (PaymentSummary[])newPaymentSummaries.toArray(new\n PaymentSummary[0]);\n for (int summaryIndex = 0; summaryIndex < newPaymentSummaryArray.length; summaryIndex++) {\n if (newPaymentSummaryArray[summaryIndex].getEmployeeId().equals(operatorId)\n && newPaymentSummaryArray[summaryIndex].getRegisterId().equals(registerId)\n && newPaymentSummaryArray[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n ArmCurrency newTotal = paymentAmount.add(newPaymentSummaryArray[summaryIndex].\n getPaymentTotal());\n int mediaCount = ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).\n getMediaCount();\n newPaymentSummaryArray[summaryIndex].doSetPaymentTotal(newTotal);\n ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n }\n }\n }\n if (!found) {\n CMSPaymentSummary paymentSummary = new CMSPaymentSummary();\n paymentSummary.doSetDate(date);\n paymentSummary.doSetEmployeeId(operatorId);\n paymentSummary.doSetStoreId(storeId);\n paymentSummary.doSetRegisterId(registerId);\n paymentSummary.doSetPaymentTotal(paymentAmount);\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n paymentSummary.doSetPaymentType(paymentType);\n paymentSummary.doSetId(this.getNextChelseaId());\n paymentSummary.doSetMediaCount(paymentSummary.getMediaCount() + 1);\n newPaymentSummaries.add(paymentSummary);\n }\n }\n for (int i = 0; i < newPaymentSummaries.size(); i++) {\n PaymentSummary paymentSummary = (PaymentSummary)newPaymentSummaries.get(i);\n parametricStatements.add(new ParametricStatement(insertSql\n , fromObjectToBean(paymentSummary).toList()));\n }\n return (ParametricStatement[])parametricStatements.toArray(new ParametricStatement[\n parametricStatements.size()]);\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "@Test\n public void transactionSum() {\n final Transaction transaction1 = new Transaction(\"774cedda\", State.CANCELED, 1000L, new Date());\n final Account account1 = new Account(\"1001\", 0L, Collections.singletonList(transaction1));\n final Transaction transaction2 = new Transaction(\"337868a7\", State.FINISHED, 8000L, new Date());\n final Transaction transaction3 = new Transaction(\"f8047f86\", State.CANCELED, 10000L, new Date());\n final Account account2 = new Account(\"1002\", 8000L, Arrays.asList(transaction2, transaction3));\n\n final long actual = calcSumOfCancelledTransOnNonEmptyAccounts(Arrays.asList(account1, account2));\n\n Assert.assertEquals(actual, 10_000L);\n }", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutputs(int index);", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "public abstract void generateReceipt(Transaction trans);", "public Transaction getDummyTransaction(String action) {\n\n\t\t// Long payerAccountNum = 111l;\n\t\tLong payerRealmNum = 0l;\n\t\tLong payerShardNum = 0l;\n\t\t// Long nodeAccountNum=123l;\n\t\tLong nodeRealmNum = 0l;\n\t\tLong nodeShardNum = 0l;\n\t\tlong transactionFee = 0l;\n\t\tTimestamp startTime =\n\t\t\t\tRequestBuilder.getTimestamp(Instant.now(Clock.systemUTC()).minusSeconds(13));\n\t\tDuration transactionDuration = RequestBuilder.getDuration(100);\n\t\tboolean generateRecord = false;\n\t\tString memo = \"UnitTesting\";\n\t\tint thresholdValue = 10;\n\t\tList<Key> keyList = new ArrayList<>();\n\t\tKeyPair pair = new KeyPairGenerator().generateKeyPair();\n\t\tbyte[] pubKey = ((EdDSAPublicKey) pair.getPublic()).getAbyte();\n\t\tKey akey =\n\t\t\t\tKey.newBuilder().setEd25519(ByteString.copyFromUtf8((MiscUtils.commonsBytesToHex(pubKey)))).build();\n\t\tPrivateKey priv = pair.getPrivate();\n\t\tkeyList.add(akey);\n\t\tlong initBal = 100;\n\t\tlong sendRecordThreshold = 5;\n\t\tlong receiveRecordThreshold = 5;\n\t\tboolean receiverSign = false;\n\t\tDuration autoRenew = RequestBuilder.getDuration(100);\n\t\t;\n\t\tlong proxyAccountNum = 12345l;\n\t\tlong proxyRealmNum = 0l;\n\t\tlong proxyShardNum = 0l;\n\t\tint proxyFraction = 10;\n\t\tint maxReceiveProxyFraction = 10;\n\t\tlong shardID = 0l;\n\t\tlong realmID = 0l;\n\n\t\tTransaction trx = null;\n\t\tSignatureList sigList = SignatureList.getDefaultInstance();\n\t\tTimestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\n\t\t/**\n\t\t * SignatureList sigList = SignatureList.getDefaultInstance(); Transaction transferTx =\n\t\t * RequestBuilder.getCryptoTransferRequest( payer.getAccountNum(), payer.getRealmNum(),\n\t\t * payer.getShardNum(), nodeAccount.getAccountNum(), nodeAccount.getRealmNum(),\n\t\t * nodeAccount.getShardNum(), 800, timestamp, transactionDuration, false, \"test\", sigList,\n\t\t * payer.getAccountNum(), -100l, nodeAccount.getAccountNum(), 100l); transferTx =\n\t\t * TransactionSigner.signTransaction(transferTx, accountKeys.get(payer));\n\t\t */\n\n\t\tif (\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t\ttrx = RequestBuilder.getCryptoTransferRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 800, timestamp,\n\t\t\t\t\ttransactionDuration, false, \"test\", sigList, payerAccountId.getAccountNum(), -100l,\n\t\t\t\t\tnodeAccountId.getAccountNum(), 100l);\n\t\t\t// trx = TransactionSigner.signTransaction(trx, account2keyMap.get(payerAccountId));\n\t\t}\n\n\t\tif (\"createContract\".equalsIgnoreCase(action)) {\n\t\t\tFileID fileID = FileID.newBuilder().setFileNum(9999l).setRealmNum(1l).setShardNum(2l).build();\n\n\t\t\ttrx = RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 50000000000l, timestamp,\n\t\t\t\t\ttransactionDuration, true, \"createContract\", DEFAULT_CONTRACT_OP_GAS, fileID,\n\t\t\t\t\tByteString.EMPTY, 0, transactionDuration,\n\t\t\t\t\tSignatureList.newBuilder().addSigs(\n\t\t\t\t\t\t\tSignature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t\t\t\t\t\t.build(),\n\t\t\t\t\t\"\");\n\t\t}\n\n\t\t// if(\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t// long durationInSeconds = DAY_SEC * 30;\n\t\t// * Duration contractAutoRenew = Duration.newBuilder().setSeconds(durationInSeconds).build();\n\t\t// * Timestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\t\t// * Duration transactionDuration = RequestBuilder.getDuration(30, 0);\n\t\t// * Transaction createContractRequest =\n\t\t// RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t// * payerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t// * nodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 100l, timestamp,\n\t\t// transactionDuration, true, \"createContract\",\n\t\t// * DEFAULT_CONTRACT_OP_GAS, contractFile, ByteString.EMPTY, 0, contractAutoRenew,\n\t\t// * SignatureList.newBuilder()\n\t\t// *\n\t\t// .addSigs(Signature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t// * .build());\n\t\t// }\n\n\t\treturn trx;\n\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public static byte[] secondOutputStep(byte[] S){\n\t\tStringBuffer string = new StringBuffer();\n\t\tfor (int i = 1; i < S.length; i+=2) {\n\t\t\tstring.append(getBit(S[i],7));\n\t\t}\n\t\tbyte[] bval = new BigInteger(string.toString(), 2).toByteArray();\n\t\tif(bval.length > 16){\n\t\t\treturn Arrays.copyOfRange(bval,1,bval.length);\n\t\t}else{\n\t\t\treturn bval;\n\t\t}\n\t\t\n\t}", "public double printOutput() {\r\n return calculateNetPay();\r\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "public boolean doTransaction() {\r\n int nonce = -1;\r\n TransactionOperation transactionOperation = null;\r\n try {\r\n double balance;\r\n \r\n //read the stream for requests from client\r\n byte[] cipherText = (byte [])is.readObject();\r\n \r\n // decrypt the ciphertext to obtain the signed message\r\n ATMSessionMessage atmSessionMessage = (ATMSessionMessage) crypto.decryptRijndael(cipherText, kSession);\r\n if(!(currTimeStamp < atmSessionMessage.getTimeStamp())) error (\"Time stamp does not match\");\r\n \r\n //interpret the transaction operation in the request\r\n SignedMessage signedMessage = atmSessionMessage.getSignedMessage();\r\n \r\n \r\n \t\t//verify signature\r\n \t\ttry {\r\n \t\t\tif(!crypto.verify(signedMessage.msg, signedMessage.signature, currAcct.kPub))\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"Digital signature failed...\");\r\n \t\t\t}\r\n \t\t\tSystem.out.println(\"Message signature valid...\");\r\n \t\t} catch (SignatureException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t} catch (KeyException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\t\r\n TransactionMessage transactionMessage = (TransactionMessage)signedMessage.getObject();\r\n transactionOperation = transactionMessage.getOperation();\r\n \r\n //print the signed message\r\n System.out.println(\"\\n\" + (new Date()).toString());\r\n System.out.println(signedMessage.toString());\r\n \r\n //strip out the parameters embedded \r\n nonce = atmSessionMessage.getNonce();\r\n double value = transactionMessage.getValue();\r\n \r\n //print the timestamp when the transaction takes place\r\n Date now = new Date();\r\n System.out.println(\"\\n\" + now.toString());\r\n \r\n //re-route the request to the appropriate handling function\r\n if(transactionOperation == TransactionOperation.Deposit) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" DEPOSIT: \" + value);\r\n currAcct.deposit(value);\r\n \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Deposit Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.Withdraw) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" WITHDRAW: \" + value);\r\n \t currAcct.withdraw(value);\r\n \t \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Withdrawal Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.EndSession) \r\n \t {\r\n \t \tSystem.out.println(\"\\nTerminating session with ACCT#: \" + currAcct.getNumber());\r\n \t \treturn false;\r\n \t \t\r\n \t }\r\n \r\n accts.save();\r\n //create a successful reply Success and set the balance\r\n balance = currAcct.getBalance(); \r\n transactionMessage = new TransactionMessage(MessageType.ResponseSuccess,transactionOperation,balance);\r\n atmSessionMessage = new ATMSessionMessage(transactionMessage);\r\n \r\n //set the nonce \r\n atmSessionMessage.setNonce(nonce);\r\n currTimeStamp = atmSessionMessage.getTimeStamp();\r\n //encrypt the response and send it\r\n cipherText = crypto.encryptRijndael(atmSessionMessage, kSession);\r\n os.writeObject((Serializable)cipherText);\r\n \r\n //Logging.....\r\n //get the signed message and encrypt it\r\n \r\n signedMessage.encryptMessage(this.kLog);\r\n \r\n //encrypt the action\r\n //archive the signed message for logging and non-repudiation purposes \r\n SignedAction signedAction = new SignedAction(currAcct.getNumber(), atmSessionMessage.getTimeStamp(), signedMessage);\r\n \r\n //flush out transaction record to the audit file\r\n BankServer.log.write(signedAction);\r\n \r\n\t return true;\r\n }\r\n catch(Exception e){\r\n if(e instanceof TransException) replyFailure(transactionOperation,nonce);\r\n System.out.println(\"Terminating session with ACCT#: \" + currAcct.getNumber());\r\n \t//e.printStackTrace();\r\n \r\n return true;\r\n }\r\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutput();", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_3() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return transactions_.get(index);\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "protected void pktsOut(int n) {}", "@Test\n\tpublic void testTransfer() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"acc2\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(02, \"acc1\", 00000, 200.00, \"\"));\n\t\ttransactions.add(2, new Transaction(02, \"acc2\", 00001, 200.00, \"\"));\n\t\ttransactions.add(3, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\t// ArrayList<Account> expected = new ArrayList();\n\t\t// expected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\t\t// expected.add(1, new Account(00001, \"acc2\", true, 1050.00, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Money Transfered\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"money not transfered\", testResult);\n\t}", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputOrBuilder();", "public void calculatePayment() {}", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_4_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString ticketId = roc.createTickets(1, true)[0].get(\"ticketId\").getAsString();\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tuserData, ticketId);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true, ticketId);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void fixedPayerAndReceiverTest() {\n double fixedRate = 0.015;\n GeneratorAttributeIR attribute = new GeneratorAttributeIR(Period.ofYears(7));\n double notional = 1.0e8;\n ZonedDateTime date = DateUtils.getUTCDate(2013, 9, 10);\n SwapFixedIborDefinition def1 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute);\n SwapFixedIborDefinition def2 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, true);\n assertEquals(def1, def2);\n SwapFixedIborDefinition def3 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, false);\n assertFalse(def1.equals(def3));\n int nIbor = def1.getIborLeg().getNumberOfPayments();\n int nFixed = def1.getFixedLeg().getNumberOfPayments();\n assertEquals(nIbor, def3.getIborLeg().getNumberOfPayments());\n assertEquals(nFixed, def3.getFixedLeg().getNumberOfPayments());\n assertEquals(def1.getIborLeg().getIborIndex(), def3.getIborLeg().getIborIndex());\n assertEquals(def1.getIborLeg().getCalendar(), def3.getIborLeg().getCalendar());\n assertEquals(def1.getCurrency(), def3.getIborLeg().getCurrency());\n for (int i = 0; i < nIbor; ++i) {\n CouponIborDefinition ibor1 = def1.getIborLeg().getNthPayment(i);\n CouponIborDefinition ibor3 = def3.getIborLeg().getNthPayment(i);\n assertEquals(ibor1.getNotional(), -ibor3.getNotional());\n assertEquals(ibor1.getAccrualStartDate(), ibor3.getAccrualStartDate());\n assertEquals(ibor1.getAccrualEndDate(), ibor3.getAccrualEndDate());\n assertEquals(ibor1.getFixingDate(), ibor3.getFixingDate());\n assertEquals(ibor1.getPaymentDate(), ibor3.getPaymentDate());\n assertEquals(ibor1.getPaymentYearFraction(), ibor3.getPaymentYearFraction());\n }\n for (int i = 0; i < nFixed; ++i) {\n CouponFixedDefinition fixed1 = def1.getFixedLeg().getNthPayment(i);\n CouponFixedDefinition fixed3 = def3.getFixedLeg().getNthPayment(i);\n assertEquals(fixed1.getNotional(), -fixed3.getNotional());\n assertEquals(fixed1.getAccrualStartDate(), fixed3.getAccrualStartDate());\n assertEquals(fixed1.getAccrualEndDate(), fixed3.getAccrualEndDate());\n assertEquals(fixed1.getPaymentDate(), fixed3.getPaymentDate());\n assertEquals(fixed1.getPaymentYearFraction(), fixed3.getPaymentYearFraction());\n }\n }", "public static Transaction generateSendTransaction(String strPrivateKey, String creatorAddress, String receiverAddress,\n TransactionHistory transactionHistory) {\n List<Creation> creations = new ArrayList<Creation>();\n List<Input> inputs = new ArrayList<Input>();\n List<Output> outputs = new ArrayList<Output>();\n\n // Get sender address from private key\n BigInteger privateKey = Bitcoin.decodePrivateKey(strPrivateKey);\n byte[] publicKey = Bitcoin.generatePublicKey(privateKey);\n String senderAddress = Bitcoin.publicKeyToAddress(publicKey);\n\n // Variable for counting number of coupons in referred transaction outputs\n int couponsInInputs = 0;\n\n // Find previous transaction outputs to refer to\n Iterator<Transaction> transactionIterator = transactionHistory.iterator();\n while (transactionIterator.hasNext() && couponsInInputs < 1) {\n Transaction transaction = transactionIterator.next();\n Iterator<Output> outputIterator = transaction.getOutputs().iterator();\n while (outputIterator.hasNext() && couponsInInputs < 1) {\n Output output = outputIterator.next();\n if (output.getCreatorAddress().equals(creatorAddress) && output.getAddress().equals(senderAddress)\n && output.getInputId() == 0) {\n Input input = new Input(output.getOutputId());\n inputs.add(input);\n couponsInInputs += output.getAmount();\n }\n }\n }\n\n // Check if enough coupons are available\n if (couponsInInputs <= 0) {\n throw new IllegalArgumentException();\n }\n\n // Set that 1 coupon should be sent to receiver address\n Output output = new Output(creatorAddress, 1, receiverAddress);\n outputs.add(output);\n\n // Send remaining coupons in referred transaction outputs back to the user as change\n if (couponsInInputs > 1) {\n Output changeOutput = new Output(creatorAddress, couponsInInputs - 1, senderAddress);\n outputs.add(changeOutput);\n }\n\n // Create transaction, sign it and return it\n Transaction transaction = new Transaction(creations, inputs, outputs);\n transaction.signTransaction(privateKey);\n return transaction;\n\n }", "public int[] getTsumoPayment(boolean isDealer) {\r\n int[] output = new int[2];\r\n if (isDealer) {\r\n output[0] = basicPoints * 2;\r\n output[1] = 0;\r\n } else {\r\n output[0] = basicPoints * 1;\r\n output[1] = basicPoints * 2;\r\n }\r\n output[0] = (int)(100*Math.ceil(output[0]/100.0));\r\n output[1] = (int)(100*Math.ceil(output[1]/100.0));\r\n \r\n return output;\r\n }", "@Test\n\tpublic void validateSignatureBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock newBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE VALID\n\t\tassertEquals(true, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\ttransactionsSignature = new byte[64];\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID GENERATOR SIGNATURE\n\t\tnewBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), newBlock.getTimestamp(), newBlock.getGeneratingBalance(), generator, new byte[32]);\n\t\ttransactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t///CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//VALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = newBlock.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID TRANSACTION SIGNATURE\n\t\tassertEquals(true, newBlock.isSignatureValid());\t\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tpayment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(200).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK INVALID TRANSACTION SIGNATURE\n\t\tassertEquals(false, newBlock.isSignatureValid());\t\n\t}", "public double sumTransactions() {\n\t\treturn checkIfTransactionsExist(true);\n\t}", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "public void printTransactions() {\n for (int i = 0; i < transactions.size(); i++) {\n\t\t\tint indeks = i+1;\n\t\t\tSystem.out.println(\"Transactions \" + indeks + \": \" + transactions.get(i).getType() + \" \" + transactions.get(i).getAmount());\n\t\t}\n }", "@Override\r\n\tpublic byte[] countersign(final byte[] sign,\r\n final String algorithm,\r\n final CounterSignTarget targetType,\r\n final Object[] targets,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException {\r\n throw new UnsupportedOperationException(\"No es posible realizar contrafirmas de ficheros ODF\"); //$NON-NLS-1$\r\n }", "public int updatePayment2(int requestId, int amount);", "private void convertTransactionToBitStream(){\n bitTransactionList = new ArrayList<>();\n itemListMap2 = new HashMap<>();\n \n for(int i=0; i<transactions_set.size(); i++){\n ArrayList curr_tr = transactions_set.get(i);\n \n if(curr_tr.size() >= min_itemset_size_K){ \n int freqItem = 0;\n BitSet bitset = new BitSet(bitsetLen);\n \n for(int j=0; j<curr_tr.size(); j++){\n try{\n int item = (int)curr_tr.get(j);\n bitset.set(itemIndex.get(item), true);\n freqItem++;\n }\n catch(Exception e){}\n }\n if(freqItem >= min_itemset_size_K){\n bitTransactionList.add(bitset);\n// System.out.println(bitset);\n HashSet<BitSet> subset_2 = createSubsetsOfLen2(bitset);\n for(BitSet sub_b : subset_2){\n itemListMap2.put(sub_b, itemListMap2.getOrDefault(sub_b, 0)+1);\n }\n }\n }\n }\n \n itemListMap2.values().removeIf(val -> val<min_sup);\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_5_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t\t\r\n\t\t\t\tHashMap<String,Object> o2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t\t\r\n\t\t\t\to = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\to2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return instance.getTransactions(index);\n }", "protected int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws IOException {\n return serializator.write(output, mostSigBits) +\n serializator.write(output, leastSigBits);\n }", "public void onOutputSpent(MoneroOutputWallet output);", "public static void main(String[] args)\n\t{\n \n\t\tSystem.out.println(\"Enter the size of transaction array\");\n int trSize = sc.nextInt();\n\n // creating an array of provided size\n int[] transactions = new int[trSize];\n \n // get the elements of the array (in a loop)\n System.out.println(\"Enter the values of array\");\n for (int i = 0; i < transactions.length; i++) {\n transactions[i] = sc.nextInt();\n }\n // get the number of targets\n System.out.println(\"Enter the total no of targets that needs to be achieved\");\n int numTargets = sc.nextInt();\n \n // get in target one-by-one (loop)\n for (int i = 0; i < numTargets; i++) {\n \n \t// Get TargetValue\n System.out.println(\"Enter the value of target\");\n int target = sc.nextInt();\n \n int sum =0;\n for ( int j=0; j < transactions.length; j++) {\n \tsum = sum + transactions[j];\n \t\n \tif ( sum >= target) {\n \tSystem.out.println(\"Target achieved after \" + (j+1) + \" transactions\" );\n \tbreak; // break out of the innermost for loop\n \t}\n \t\n \t//we come to the last transactions, yet target is not achieved\n \tif (j == transactions.length - 1) {\n \t\tSystem.out.println( \"Given target is not achieved\");\n \t}\n \t\n }\n \n \n\t}\n\n}", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public double calculatePay() {\n\t\treturn 0;\r\n\t}", "public byte[] signNativeByTransDataDefault(UInt256 uInt256) {\n return new byte[0];\n }", "@Suspendable\n @Override\n protected void checkTransaction(SignedTransaction stx) throws FlowException {\n }", "com.google.protobuf.ByteString\n getOutputBytes();", "com.google.protobuf.ByteString\n getTranCodeBytes();", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "public float getInputsValue() {\n\t\tfloat total = 0;\n\t\tfor (TransactionInput i : inputs) {\n\t\t\tif (i.getUTXO() == null)\n\t\t\t\tcontinue; // if Transaction can't be found skip it\n\t\t\ttotal += i.getUTXO().getValue();\n\t\t}\n\t\treturn total;\n\t}", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_1() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }" ]
[ "0.61595416", "0.5966926", "0.5893284", "0.57574815", "0.57380486", "0.56829846", "0.5668829", "0.5640629", "0.55908084", "0.5576276", "0.549149", "0.5468646", "0.5428697", "0.5360827", "0.5360827", "0.5360827", "0.5346331", "0.5305661", "0.525313", "0.52381736", "0.51885766", "0.5148147", "0.51314443", "0.5125945", "0.51255107", "0.50846374", "0.5060251", "0.50338894", "0.50077987", "0.4994864", "0.49875298", "0.49698073", "0.49698073", "0.49698073", "0.49596593", "0.4949018", "0.49411756", "0.49386016", "0.4928867", "0.49035704", "0.49003276", "0.48912862", "0.48795715", "0.48694947", "0.48674142", "0.48642266", "0.48613507", "0.48246202", "0.47959137", "0.47953072", "0.47908524", "0.47715572", "0.47715572", "0.47715572", "0.4765489", "0.4753552", "0.47508267", "0.47471234", "0.47317925", "0.47285673", "0.47285673", "0.4719286", "0.47174066", "0.4714295", "0.47125024", "0.46985352", "0.46933845", "0.46927908", "0.46907243", "0.46877164", "0.46726155", "0.46705523", "0.46680796", "0.46678", "0.46671906", "0.4663788", "0.46598783", "0.4658921", "0.4658921", "0.4658921", "0.46515226", "0.4651428", "0.46477026", "0.4641957", "0.46230626", "0.4621864", "0.46166465", "0.46140277", "0.46129876", "0.46080026", "0.46053308", "0.4601807", "0.4601678", "0.45944613", "0.45911747", "0.4586006", "0.45831758", "0.4578833", "0.4576443", "0.45755768", "0.4566767" ]
0.0
-1
Signed transactions that satisfy PaymentDetails.outputs repeated bytes transactions = 2;
@java.lang.Override public int getTransactionsCount() { return transactions_.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testValidOutputValues() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, -20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(-20, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testNoDoubleSpending() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Alice wants double spending: transfers 10 coins to Bob, 20 to Cal again\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1: input 0\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n\n // Sign for tx1: input 1\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(1).addSignature(sig2);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testHandleTxs() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // Cal transfers 5 coins to Bob, Bob transfers 2 coins to Alice\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0); // index 0 refers to output 1 of tx1\n tx2.addInput(tx1.getHash(), 1); // index 1 refers to output 1 of tx1\n tx2.addOutput(2, kpAlice.getPublic());\n tx2.addOutput(5, kpBob.getPublic());\n\n // Sign for tx2\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx2.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(0).addSignature(sig2);\n\n byte[] sig3 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpCal.getPrivate());\n sig.update(tx2.getRawDataToSign(1));\n sig3 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(1).addSignature(sig3);\n tx2.finalize();\n\n // Alice transfers 3 coins to Cal\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(), 0);\n tx3.addOutput(3, kpCal.getPublic());\n\n // Sign for tx3\n byte[] sig4 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx3.getRawDataToSign(0));\n sig4 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx3.getInput(0).addSignature(sig4);\n tx3.finalize();\n\n Transaction[] acceptedTx = txHandler.handleTxs(new Transaction[] {tx1, tx2, tx3});\n // tx1, tx2 supposed to be valid, tx3 supposed to be invalid\n assertEquals(acceptedTx.length, 2);\n // assertFalse(txHandler.isValidTx(tx3));\n }", "public boolean processTransaction() {\n\n // Checks to see if the signature can be verified.\n if (verifySignature() == false) {\n System.out.println(\"# Transaction signature could not be verified.\");\n return false;\n }\n\n // Gathers all transaction inputs, making sure they are unspent.\n for (TransactionInput i : inputs) {\n i.UTXO = BasicBlockchain.UTXOs.get(i.transactionOutputId);\n }\n\n // Checks if transaction amount is valid.\n if (getInputsValue() < BasicBlockchain.minimumTransaction) {\n System.out.println(\"# Transaction inputs are too small.\");\n return false;\n }\n\n // Generates transaction outputs.\n // Get value of the inputs then the leftover change.\n float leftOver = getInputsValue() - value;\n transactionId = calculateHash();\n // Send value to recipient.\n outputs.add(new TransactionOutput(this.recipient, value, transactionId));\n // Send the leftover \"change\" back to sender.\n outputs.add(new TransactionOutput(this.sender, leftOver, transactionId));\n\n\n // Adds outputs to the unspent list.\n for (TransactionOutput o : outputs) {\n BasicBlockchain.UTXOs.put(o.id, o);\n }\n\n // Removes the transaction inputs from the blockchain's UTXO list as spent.\n for (TransactionInput i : inputs) {\n if (i.UTXO == null) continue;\n BasicBlockchain.UTXOs.remove(i.UTXO.id);\n }\n\n return true;\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutput();", "public static void main(String[] args) throws AddressFormatException {\n\n// generateMultisig();\n String getSignedTransaction = signFirstTime();\n String rawtx = signSecondTime(getSignedTransaction);\n\n System.out.println(\"rawtx ->\"+ rawtx);\n }", "private static String signFirstTime() throws AddressFormatException\n {\n ECKey key1 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n\n\n // Use the redeem script we have saved somewhere to start building the transaction\n Script redeemScript = new Script(hexStringToByteArray(\"5221021ae8964b8529dc3e52955f2cabd967e08c52008dbcca8e054143b668f3998f4a210306be609ef37366ab0f3dd4096ac23a6ee4d561fc469fa60003f799b0121ad1072102199f3d89fa00e6f55dd6ecdd911457d7264415914957db124d53bf0064963f3853ae\"));\n\n // Start building the transaction by adding the unspent inputs we want to use\n // The data is taken from blockchain.info, and can be found here: https://blockchain.info/rawtx/ca1884b8f2e0ba88249a86ec5ddca04f937f12d4fac299af41a9b51643302077\n Transaction spendTx = new Transaction(params);\n ScriptBuilder scriptBuilder = new ScriptBuilder();\n scriptBuilder.data(new String(\"a9145204ad7c5fa5a2491cd91c332e28c87221194ca087\").getBytes()); // Script of this output\n TransactionInput input = spendTx.addInput(new Sha256Hash(\"fed695bf5e2c15286956a7bd3464c5beb97ef064e1f9406eba189ea844733e7c\"), 1, scriptBuilder.build());\n\n // Add outputs to the person receiving bitcoins\n Address receiverAddress = new Address(params, \"n2cWhs5sbWFCwzuuWWsVM9ubPwykGtX75T\");\n Coin charge = Coin.valueOf(1000000); // 0.1 mBTC\n Script outputScript = ScriptBuilder.createOutputScript(receiverAddress);\n spendTx.addOutput(charge, outputScript);\n\n /*8888888888888888888888888888888888888888888888888888888888888*/\n\n // Sign the first part of the transaction using private key #1\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature ecdsaSignature = key1.sign(sighash);\n TransactionSignature transactionSignarture = new TransactionSignature(ecdsaSignature, Transaction.SigHash.ALL, false);\n\n // Create p2sh multisig input script\n Script inputScript = ScriptBuilder.createP2SHMultiSigInputScript(Arrays.asList(transactionSignarture), redeemScript);\n\n // Add the script signature to the input\n input.setScriptSig(inputScript);\n System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "private ArrayList<Long> storeTransactionInputs(long transactionId, ArrayList<TransactionInput> inputs, int isCoinbase){\n \t\tint inputindex = 0;\n \t\tlong previousOutputId;\n \t\tString prevOutputHash;\n \t\tResultSet findOutputResults;\n \t\tResultSet generatedKey;\n \t\tLong addressId;\n \t\tArrayList<Long> addressIdz=new ArrayList<Long>();\n \t\ttry {\n \t\tfor (TransactionInput i : inputs) {\n\t\t\t\n \t\t\tprevOutputHash = HexBin.encode(i.outpoint.hash);\n \t\t\tfindTransactionOutputStatement.setString(1, prevOutputHash);\n \t\t\tfindTransactionOutputStatement.setLong(2, i.outpoint.index);\n \t\t\tfindOutputResults = findTransactionOutputStatement\n \t\t\t\t\t.executeQuery();\n \t\t\tif (findOutputResults.next()) {\n \t\t\t\tpreviousOutputId = findOutputResults.getLong(1);\n\t\t\t\taddressId=findOutputResults.getLong(2);\n \t\t\t} else {\n \t\t\t\tpreviousOutputId = 0;\n\t\t\t\taddressId=null;\n \t\t\t}\n \t\t\tfindOutputResults.close();\n \t\t\tinsertTransactionInputStatement.setLong(1, transactionId);\n \t\t\tinsertTransactionInputStatement.setInt(2, inputindex);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(3, previousOutputId);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setString(4, prevOutputHash);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(5, i.outpoint.index);\n \t\t\tinsertTransactionInputStatement.setLong(6,\n \t\t\t\t\ti.scriptBytes.length);\n \t\t\tinsertTransactionInputStatement.setString(7,\n \t\t\t\t\tHexBin.encode(i.scriptBytes));\n \t\t\tinsertTransactionInputStatement.setLong(8, i.sequence);\n \t\t\tinsertTransactionInputStatement.setBoolean(9,\n \t\t\t\t\ti.isCoinBase());\n\t\t\tif(addressId!=null){\n \t\t\t\tinsertTransactionInputStatement.setLong(10,addressId);\n \t\t\t\taddressIdz.add(addressId);\n\t\t\t} else {\n \t\t\t\t// TODO Auto-generated catch block\n \t\t\t\tinsertTransactionInputStatement.setNull(10,\n \t\t\t\t\t\tjava.sql.Types.INTEGER);\n \t\t\t}\n \t\t\tinsertTransactionInputStatement.execute();\n \t\t\t\n \t\t}\n \t\t\n \t\t\n \t} catch (SQLException e1) {\n \t\t// TODO Auto-generated catch block\n \t\te1.printStackTrace();\n \t}\n \t\treturn addressIdz;\n \t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputOrBuilder();", "List<TransactionVO> addPendingTransactions(List<SignedTransaction> transactions);", "@Test\n public void TxHandlerTestThird() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid output number(wrong number of coins to transfer)\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1 scrooge to alice 20coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: Alice --> Bob -5coins [*Invalid output number*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(-5, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n // tx3: Alice --> Bob 90coins [*Invalid output number*]\n Transaction tx3 = new Transaction();\n tx3.addInput(tx1.getHash(), 0);\n tx3.addOutput(90, pkBob.getPublic());\n tx3.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n }", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "private static String signSecondTime(String transactionString)\n {\n Transaction spendTx = new Transaction(params, hexStringToByteArray(transactionString));\n\n // Get the input chunks\n Script inputScript = spendTx.getInput(0).getScriptSig();\n List<ScriptChunk> scriptChunks = inputScript.getChunks();\n\n // Create a list of all signatures. Start by extracting the existing ones from the list of script schunks.\n // The last signature in the script chunk list is the redeemScript\n List<TransactionSignature> signatureList = new ArrayList<TransactionSignature>();\n Iterator<ScriptChunk> iterator = scriptChunks.iterator();\n Script redeemScript = null;\n\n while (iterator.hasNext())\n {\n ScriptChunk chunk = iterator.next();\n\n if (iterator.hasNext() && chunk.opcode != 0)\n {\n TransactionSignature transactionSignarture = TransactionSignature.decodeFromBitcoin(chunk.data, false);\n signatureList.add(transactionSignarture);\n } else\n {\n redeemScript = new Script(chunk.data);\n }\n }\n\n // Create the sighash using the redeem script\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature secondSignature;\n\n // Take out the key and sign the signhash\n //ECKey key2 = createKeyFromSha256Passphrase(\"Super secret key 2\");\n ECKey key2 = ECKey.fromPrivate(new BigInteger(\"68123968917867656952640885027449260190826636504009580537802764798766700329220\"));\n// ECKey key2 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n secondSignature = key2.sign(sighash);\n\n // Add the second signature to the signature list\n TransactionSignature transactionSignarture = new TransactionSignature(secondSignature, Transaction.SigHash.ALL, false);\n signatureList.add(transactionSignarture);\n\n // Rebuild p2sh multisig input script\n inputScript = ScriptBuilder.createP2SHMultiSigInputScript(signatureList, redeemScript);\n spendTx.getInput(0).setScriptSig(inputScript);\n\n //System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "@Test\n public void testOutputsInUTXOPool() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is NOT put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // UTXO pool does not contains the UTXO\n assertFalse(txHandler.isValidTx(tx1));\n\n // Put output of createCoinTx to the pool\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler1 = new TxHandler(utxoPool);\n\n // UTXO pool now contains the UTXO\n assertTrue(txHandler1.isValidTx(tx1));\n }", "@Test\n public void testValidBalance() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 100 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(100, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "RequestResult postSignRequests(TriphaseRequest[] requests) throws IOException,\n CertificateEncodingException, SAXException;", "public IBankTransfert payment();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static boolean isSigned_entries_receiveEst() {\n return false;\n }", "com.google.protobuf.ByteString getTransactions(int index);", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "@Suspendable\n @Override\n public SignedTransaction call() throws FlowException {\n\n Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);\n//\n\n // Source\n AccountInfo issuerOwner = subFlow(new AccountInfoByName(acctNameSource)).get(0).getState().getData();\n PublicKey issuerOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty issuerOwnerAnonParty = new AnonymousParty(issuerOwnerKey);\n\n AccountInfo targetOwner = subFlow(new AccountInfoByName(acctNameTarget)).get(0).getState().getData();\n PublicKey targetOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty targetOwnerAnonParty = new AnonymousParty(targetOwnerKey);\n\n\n AssetForAccountState outputAsset = new AssetForAccountState(issuerOwnerAnonParty, targetOwnerAnonParty,\n asset.getState().getData().getName(), asset.getState().getData().getValue());\n\n\n TransactionBuilder txBuilder = new TransactionBuilder(notary)\n .addInputState(asset)\n .addOutputState(outputAsset, AssetForAccountContract.ID)\n .addCommand(new AssetForAccountContract.Commands.Transfer(), issuerOwnerKey);\n\n txBuilder.verify(getServiceHub());\n\n SignedTransaction fullySignedTransaction = getServiceHub().signInitialTransaction(txBuilder, issuerOwnerKey);\n\n //return fullySignedTransaction;\n return subFlow(new FinalityFlow(fullySignedTransaction, Collections.emptyList()));\n }", "private boolean areOutputsSpent(Transaction tx){\n // Need to see if tx inputs are contained in the blockchain UTXOs\n for(TransactionInput i : tx.inputs){\n if(!currentBlockchain.UTXOs.containsKey(i.previousOutId)){\n return true;\n }\n }\n return false;\n }", "BigInteger getDigitalSignature();", "public static long deepTransactionCheck(Transaction tx, UtxoUpdateBuffer utxo_buffer, BlockHeader block_header, NetworkParams params)\n throws ValidationException\n {\n try(TimeRecordAuto tra_blk = TimeRecord.openAuto(\"Validation.deepTransactionCheck\"))\n {\n TransactionInner inner = null;\n\n try\n {\n inner = TransactionInner.parseFrom(tx.getInnerData());\n }\n catch(java.io.IOException e)\n {\n throw new ValidationException(\"error parsing tx on second pass somehow\", e);\n }\n\n long sum_of_inputs = 0L;\n // Make sure all inputs exist\n for(TransactionInput in : inner.getInputsList())\n {\n TransactionOutput matching_out = utxo_buffer.getOutputMatching(in);\n if (matching_out == null)\n {\n throw new ValidationException(String.format(\"No matching output for input %s\", new ChainHash(in.getSrcTxId())));\n }\n validateSpendable(matching_out, block_header, params);\n sum_of_inputs += matching_out.getValue();\n\n // SIP-4 check\n if (block_header.getBlockHeight() >= params.getActivationHeightTxInValue())\n {\n if (in.getValue() != 0L)\n {\n if (in.getValue() != matching_out.getValue())\n {\n throw new ValidationException(String.format(\"Input value does not match: %d %d\", matching_out.getValue(), in.getValue()));\n }\n }\n }\n utxo_buffer.useOutput(matching_out, new ChainHash(in.getSrcTxId()), in.getSrcTxOutIdx());\n }\n\n long spent = 0L;\n // Sum up all outputs\n int out_idx =0;\n ArrayList<ByteString> raw_output_list = TransactionUtil.extractWireFormatTxOut(tx);\n\n for(TransactionOutput out : inner.getOutputsList())\n {\n validateTransactionOutput(out, block_header, params);\n spent+=out.getValue();\n utxo_buffer.addOutput(raw_output_list, out, new ChainHash(tx.getTxHash()), out_idx);\n out_idx++;\n\n }\n\n spent+=inner.getFee();\n\n if (!inner.getIsCoinbase())\n {\n if (sum_of_inputs != spent)\n {\n throw new ValidationException(String.format(\"Transaction took in %d and spent %d\", sum_of_inputs, spent));\n }\n }\n \n return inner.getFee();\n }\n }", "@Test\n public void TxHandlerTestSecond() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the double spending\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(25, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1: one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx 2:Scrooge --> Bob 20coins [*Double-spending*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx0.getHash(), 0);\n tx2.addOutput(25, pkBob.getPublic());\n tx2.signTx(pkScrooge.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n\n }", "String signITRByAssesse(String PAN,String xml, DigitalSignatureWrapper digitalSignatureWrapper) throws MissingPrivateKeyException,InvalidDigitalSignatureException,Exception;", "public boolean processTransaction() {\r\n\t\t\r\n\t\t\tif(verifySignature() == false) {\r\n\t\t\t\tSystem.out.println(\"#Transaction Signature failed to verify\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\ttransactionId = calulateHash();\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "public static boolean isSigned_receivets() {\n return true;\n }", "@Override\n public boolean isValid() {\n final BlockChainInt outputHash = getOutputHash();\n\n return inputs.stream().map(input -> input.verifySignature(outputHash)).reduce(true, (a, b) -> a && b)\n && outputs.stream().map(output -> output.getAmount() >= 0).reduce(true, (a, b) -> a && b)\n && getTransactionFee() >= 0;\n }", "@Override\n public void run() {\n byte[] deviceTxPayload = CoreServices.getOrCreateHardwareWalletService().get().getContext().getSerializedTx().toByteArray();\n\n log.info(\"DeviceTx payload:\\n{}\", Utils.HEX.encode(deviceTxPayload));\n\n // Load deviceTx\n Transaction deviceTx = new Transaction(MainNetParams.get(), deviceTxPayload);\n\n log.info(\"deviceTx:\\n{}\", deviceTx.toString());\n\n // Check the signatures are canonical\n for (TransactionInput txInput : deviceTx.getInputs()) {\n byte[] signature = txInput.getScriptSig().getChunks().get(0).data;\n if (signature != null) {\n log.debug(\n \"Is signature canonical test result '{}' for txInput '{}', signature '{}'\",\n TransactionSignature.isEncodingCanonical(signature),\n txInput.toString(),\n Utils.HEX.encode(signature));\n } else {\n log.warn(\"No signature data\");\n }\n }\n\n log.debug(\"Committing and broadcasting the last tx\");\n\n BitcoinNetworkService bitcoinNetworkService = CoreServices.getOrCreateBitcoinNetworkService();\n\n if (bitcoinNetworkService.getLastSendRequestSummaryOptional().isPresent()\n && bitcoinNetworkService.getLastWalletOptional().isPresent()) {\n\n SendRequestSummary sendRequestSummary = bitcoinNetworkService.getLastSendRequestSummaryOptional().get();\n\n // Check the unsigned and signed tx are essentially the same as a check against malware attacks on the Trezor\n if (TransactionUtils.checkEssentiallyEqual(sendRequestSummary.getSendRequest().get().tx, deviceTx)) {\n // Substitute the signed tx from the trezor\n log.debug(\n \"Substituting the Trezor signed tx '{}' for the unsigned version {}\",\n deviceTx.toString(),\n sendRequestSummary.getSendRequest().get().tx.toString()\n );\n sendRequestSummary.getSendRequest().get().tx = deviceTx;\n log.debug(\"The transaction fee was {}\", sendRequestSummary.getSendRequest().get().fee);\n\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_TRANSACTION_CREATED_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n\n // Get the last wallet\n Wallet wallet = bitcoinNetworkService.getLastWalletOptional().get();\n\n // Commit and broadcast\n bitcoinNetworkService.commitAndBroadcast(sendRequestSummary, wallet, paymentRequestData);\n\n // Ensure the header is switched off whilst the send is in progress\n ViewEvents.fireViewChangedEvent(ViewKey.HEADER, false);\n } else {\n // The signed transaction is essentially different from what was sent to it - abort send\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_FAILURE_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n }\n } else {\n log.debug(\"Cannot commit and broadcast the last send as it is not present in bitcoinNetworkService\");\n }\n // Clear the previous remembered tx\n bitcoinNetworkService.setLastSendRequestSummaryOptional(Optional.<SendRequestSummary>absent());\n bitcoinNetworkService.setLastWalletOptional(Optional.<Wallet>absent());\n }", "@Test\n public void TxHandlerTestForth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid signature\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx1: scrooge to alice 20 coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: alice to bob 20coins[signed by bob]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(20, pkBob.getPublic());\n tx2.signTx(pkBob.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n }", "@Override\n public byte[] createDataToSignInput(\n Transaction transaction,\n int inputIndex,\n long amountInSat,\n PublicKeyTriple publicKeyTriple) {\n\n final byte[] redeemScript = createRedeemScript(publicKeyTriple);\n\n return TransactionHelpers.getDataToSign(\n transaction,\n inputIndex,\n new Script(redeemScript)\n );\n }", "public TransactionResponse processAllTransaction() throws ParseException {\n TransactionResponse response = new TransactionResponse();\n\n //User0\n response.setTransaction(new Transaction(\"user0\",\"0001\", \"type0\",\"user0_Billing\",\"user0_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-00\")));\n\n //User1\n response.setTransaction(new Transaction(\"user1\", \"0101\",\"type0\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user1\", \"0102\", \"type1\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-00\")));\n\n //User2\n response.setTransaction(new Transaction(\"user2\", \"0201\", \"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-01-00\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0202\", \"type2\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0203\",\"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n //User3\n response.setTransaction(new Transaction(\"user3\", \"0301\",\"type0\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user3\", \"0302\",\"type1\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n return response;\n }", "com.dogecoin.protocols.payments.Protos.Output getOutputs(int index);", "@Test\n public void TxHandlerTestFifth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the input not in the UtxoPool\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n //tx1: Scrooge --> Alice 20coins [Pay Coins *NOT added to UTXO pool* due to accidents]\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n utxo = new UTXO(tx1.getHash(),0);\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n utxoPool.removeUTXO(utxo);\n assertTrue(\"tx1:UTXO has been removed.\", utxoPool.getAllUTXO().size() == 0);\n\n\n // tx2: Alice --> Bob 15coins [Pay Coins *Previous Tx NOT in UTXO pool*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(15, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 0);\n\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "private static void createDummyTransactions() {\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 10L, new Transaction(10000d, \"cars\", 0L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 11L, new Transaction(15000d, \"shopping\", 10L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 12L, new Transaction(20000d, \"keys\", 11L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 13L, new Transaction(25000d, \"furniture\", 12L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 14L, new Transaction(30000d, \"keys\", 13L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 15L, new Transaction(40000d, \"cars\", 14L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 16L, new Transaction(50000d, \"cars\", 15L)));\n }", "@Test\n public void TxHandlerTestFirst() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test some basic functions of TxHandler\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n // tx0: Scrooge --> Scrooge 25coins [Create Coins]\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx( pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n\n // tx1: Scrooge --> Scrooge 4coins [Divide Coins]\n //\t Scrooge --> Scrooge 5coins\n //\t Scrooge --> Scrooge 6coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(),0);\n\n tx1.addOutput(4,pkScrooge.getPublic());\n tx1.addOutput(5,pkScrooge.getPublic());\n tx1.addOutput(6,pkScrooge.getPublic());\n\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx2: Scrooge --> Alice 4coins [Pay separately]\n //\t Scrooge --> Alice 5coins\n // Scrooge --> Bob 6coins\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addInput(tx1.getHash(), 1);\n tx2.addInput(tx1.getHash(), 2);\n\n tx2.addOutput(4, pkAlice.getPublic());\n tx2.addOutput(5, pkAlice.getPublic());\n tx2.addOutput(6, pkBob.getPublic());\n\n tx2.signTx(pkScrooge.getPrivate(), 0);\n tx2.signTx(pkScrooge.getPrivate(), 1);\n tx2.signTx(pkScrooge.getPrivate(), 2);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx3:Alice --> Alice 2coins [Divide Coins]\n // Alice --> Alice 2coins\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(),0);\n\n tx3.addOutput(2, pkAlice.getPublic());\n tx3.addOutput(2, pkAlice.getPublic());\n\n tx3.signTx(pkAlice.getPrivate(),0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 4);\n\n // tx4: Alice --> Bob 2coins [Pay jointly]\n // Alice --> Bob 5coins\n Transaction tx4 = new Transaction();\n tx4.addInput(tx3.getHash(),0);\n tx4.addInput(tx2.getHash(),1);\n\n tx4.addOutput(7, pkBob.getPublic());\n\n tx4.signTx(pkAlice.getPrivate(), 0);\n tx4.signTx(pkAlice.getPrivate(),1);\n\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx4) returns: \" + txHandler.isValidTx(tx4));\n assertTrue(\"tx4:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx4}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx4:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n// System.out.println(\"tx4.hashCode returns: \" + tx4.hashCode());\n }", "public ParametricStatement[] createForPaymentTransaction(PaymentTransaction paymentTransaction)\n throws SQLException {\n int multiplier = 1;\n Date date = paymentTransaction.getProcessDate();\n if (paymentTransaction instanceof VoidTransaction) {\n VoidTransaction trans = (VoidTransaction)paymentTransaction;\n ITransaction originalTrans = trans.getOriginalTransaction();\n if (originalTrans instanceof PaymentTransaction) {\n multiplier = -1;\n paymentTransaction = (PaymentTransaction)originalTrans;\n } else {\n // Do nothing if original was not a payment transaction.\n return new ParametricStatement[0];\n }\n }\n ArrayList parametricStatements = new ArrayList();\n String storeId = paymentTransaction.getStore().getId();\n String operatorId = paymentTransaction.getTheOperator().getId();\n // String registerId = paymentTransaction.getId();\n // int registerIdIndex = registerId.indexOf('*') + 1;\n // registerId = registerId.substring(registerIdIndex, registerId.indexOf('*', registerIdIndex));\n String registerId = paymentTransaction.getRegisterId();\n PaymentSummary[] currentPaymentSummaries = this.selectByDateStoreId(date, storeId);\n List newPaymentSummaries = new ArrayList();\n Payment[] payments = paymentTransaction.getPaymentsArray();\n for (int paymentIndex = 0; paymentIndex < payments.length; paymentIndex++) {\n ArmCurrency paymentAmount = payments[paymentIndex].getAmount().multiply(multiplier);\n String paymentType = payments[paymentIndex].getTransactionPaymentName();\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n boolean found = false;\n //to find if this payment type is already in the database\n for (int summaryIndex = 0; summaryIndex < currentPaymentSummaries.length; summaryIndex++) {\n if (currentPaymentSummaries[summaryIndex].getEmployeeId().equals(operatorId)\n && currentPaymentSummaries[summaryIndex].getRegisterId().equals(registerId)\n && currentPaymentSummaries[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n currentPaymentSummaries[summaryIndex].doSetPaymentTotal(paymentAmount.add(\n currentPaymentSummaries[summaryIndex].getPaymentTotal()));\n int mediaCount = ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).\n getMediaCount();\n ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n // work-around for cloudscape date truncation problem.\n currentPaymentSummaries[summaryIndex].doSetDate(date);\n List list = fromObjectToBean(currentPaymentSummaries[summaryIndex]).toList();\n list.add(currentPaymentSummaries[summaryIndex].getId());\n parametricStatements.add(new ParametricStatement(updateSql, list));\n break;\n }\n }\n //to find if it is already in the newPaymentSummaries List\n if (!found) {\n PaymentSummary[] newPaymentSummaryArray = (PaymentSummary[])newPaymentSummaries.toArray(new\n PaymentSummary[0]);\n for (int summaryIndex = 0; summaryIndex < newPaymentSummaryArray.length; summaryIndex++) {\n if (newPaymentSummaryArray[summaryIndex].getEmployeeId().equals(operatorId)\n && newPaymentSummaryArray[summaryIndex].getRegisterId().equals(registerId)\n && newPaymentSummaryArray[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n ArmCurrency newTotal = paymentAmount.add(newPaymentSummaryArray[summaryIndex].\n getPaymentTotal());\n int mediaCount = ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).\n getMediaCount();\n newPaymentSummaryArray[summaryIndex].doSetPaymentTotal(newTotal);\n ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n }\n }\n }\n if (!found) {\n CMSPaymentSummary paymentSummary = new CMSPaymentSummary();\n paymentSummary.doSetDate(date);\n paymentSummary.doSetEmployeeId(operatorId);\n paymentSummary.doSetStoreId(storeId);\n paymentSummary.doSetRegisterId(registerId);\n paymentSummary.doSetPaymentTotal(paymentAmount);\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n paymentSummary.doSetPaymentType(paymentType);\n paymentSummary.doSetId(this.getNextChelseaId());\n paymentSummary.doSetMediaCount(paymentSummary.getMediaCount() + 1);\n newPaymentSummaries.add(paymentSummary);\n }\n }\n for (int i = 0; i < newPaymentSummaries.size(); i++) {\n PaymentSummary paymentSummary = (PaymentSummary)newPaymentSummaries.get(i);\n parametricStatements.add(new ParametricStatement(insertSql\n , fromObjectToBean(paymentSummary).toList()));\n }\n return (ParametricStatement[])parametricStatements.toArray(new ParametricStatement[\n parametricStatements.size()]);\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "@Test\n public void transactionSum() {\n final Transaction transaction1 = new Transaction(\"774cedda\", State.CANCELED, 1000L, new Date());\n final Account account1 = new Account(\"1001\", 0L, Collections.singletonList(transaction1));\n final Transaction transaction2 = new Transaction(\"337868a7\", State.FINISHED, 8000L, new Date());\n final Transaction transaction3 = new Transaction(\"f8047f86\", State.CANCELED, 10000L, new Date());\n final Account account2 = new Account(\"1002\", 8000L, Arrays.asList(transaction2, transaction3));\n\n final long actual = calcSumOfCancelledTransOnNonEmptyAccounts(Arrays.asList(account1, account2));\n\n Assert.assertEquals(actual, 10_000L);\n }", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutputs(int index);", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "public abstract void generateReceipt(Transaction trans);", "public Transaction getDummyTransaction(String action) {\n\n\t\t// Long payerAccountNum = 111l;\n\t\tLong payerRealmNum = 0l;\n\t\tLong payerShardNum = 0l;\n\t\t// Long nodeAccountNum=123l;\n\t\tLong nodeRealmNum = 0l;\n\t\tLong nodeShardNum = 0l;\n\t\tlong transactionFee = 0l;\n\t\tTimestamp startTime =\n\t\t\t\tRequestBuilder.getTimestamp(Instant.now(Clock.systemUTC()).minusSeconds(13));\n\t\tDuration transactionDuration = RequestBuilder.getDuration(100);\n\t\tboolean generateRecord = false;\n\t\tString memo = \"UnitTesting\";\n\t\tint thresholdValue = 10;\n\t\tList<Key> keyList = new ArrayList<>();\n\t\tKeyPair pair = new KeyPairGenerator().generateKeyPair();\n\t\tbyte[] pubKey = ((EdDSAPublicKey) pair.getPublic()).getAbyte();\n\t\tKey akey =\n\t\t\t\tKey.newBuilder().setEd25519(ByteString.copyFromUtf8((MiscUtils.commonsBytesToHex(pubKey)))).build();\n\t\tPrivateKey priv = pair.getPrivate();\n\t\tkeyList.add(akey);\n\t\tlong initBal = 100;\n\t\tlong sendRecordThreshold = 5;\n\t\tlong receiveRecordThreshold = 5;\n\t\tboolean receiverSign = false;\n\t\tDuration autoRenew = RequestBuilder.getDuration(100);\n\t\t;\n\t\tlong proxyAccountNum = 12345l;\n\t\tlong proxyRealmNum = 0l;\n\t\tlong proxyShardNum = 0l;\n\t\tint proxyFraction = 10;\n\t\tint maxReceiveProxyFraction = 10;\n\t\tlong shardID = 0l;\n\t\tlong realmID = 0l;\n\n\t\tTransaction trx = null;\n\t\tSignatureList sigList = SignatureList.getDefaultInstance();\n\t\tTimestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\n\t\t/**\n\t\t * SignatureList sigList = SignatureList.getDefaultInstance(); Transaction transferTx =\n\t\t * RequestBuilder.getCryptoTransferRequest( payer.getAccountNum(), payer.getRealmNum(),\n\t\t * payer.getShardNum(), nodeAccount.getAccountNum(), nodeAccount.getRealmNum(),\n\t\t * nodeAccount.getShardNum(), 800, timestamp, transactionDuration, false, \"test\", sigList,\n\t\t * payer.getAccountNum(), -100l, nodeAccount.getAccountNum(), 100l); transferTx =\n\t\t * TransactionSigner.signTransaction(transferTx, accountKeys.get(payer));\n\t\t */\n\n\t\tif (\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t\ttrx = RequestBuilder.getCryptoTransferRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 800, timestamp,\n\t\t\t\t\ttransactionDuration, false, \"test\", sigList, payerAccountId.getAccountNum(), -100l,\n\t\t\t\t\tnodeAccountId.getAccountNum(), 100l);\n\t\t\t// trx = TransactionSigner.signTransaction(trx, account2keyMap.get(payerAccountId));\n\t\t}\n\n\t\tif (\"createContract\".equalsIgnoreCase(action)) {\n\t\t\tFileID fileID = FileID.newBuilder().setFileNum(9999l).setRealmNum(1l).setShardNum(2l).build();\n\n\t\t\ttrx = RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 50000000000l, timestamp,\n\t\t\t\t\ttransactionDuration, true, \"createContract\", DEFAULT_CONTRACT_OP_GAS, fileID,\n\t\t\t\t\tByteString.EMPTY, 0, transactionDuration,\n\t\t\t\t\tSignatureList.newBuilder().addSigs(\n\t\t\t\t\t\t\tSignature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t\t\t\t\t\t.build(),\n\t\t\t\t\t\"\");\n\t\t}\n\n\t\t// if(\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t// long durationInSeconds = DAY_SEC * 30;\n\t\t// * Duration contractAutoRenew = Duration.newBuilder().setSeconds(durationInSeconds).build();\n\t\t// * Timestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\t\t// * Duration transactionDuration = RequestBuilder.getDuration(30, 0);\n\t\t// * Transaction createContractRequest =\n\t\t// RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t// * payerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t// * nodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 100l, timestamp,\n\t\t// transactionDuration, true, \"createContract\",\n\t\t// * DEFAULT_CONTRACT_OP_GAS, contractFile, ByteString.EMPTY, 0, contractAutoRenew,\n\t\t// * SignatureList.newBuilder()\n\t\t// *\n\t\t// .addSigs(Signature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t// * .build());\n\t\t// }\n\n\t\treturn trx;\n\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public static byte[] secondOutputStep(byte[] S){\n\t\tStringBuffer string = new StringBuffer();\n\t\tfor (int i = 1; i < S.length; i+=2) {\n\t\t\tstring.append(getBit(S[i],7));\n\t\t}\n\t\tbyte[] bval = new BigInteger(string.toString(), 2).toByteArray();\n\t\tif(bval.length > 16){\n\t\t\treturn Arrays.copyOfRange(bval,1,bval.length);\n\t\t}else{\n\t\t\treturn bval;\n\t\t}\n\t\t\n\t}", "public double printOutput() {\r\n return calculateNetPay();\r\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "public boolean doTransaction() {\r\n int nonce = -1;\r\n TransactionOperation transactionOperation = null;\r\n try {\r\n double balance;\r\n \r\n //read the stream for requests from client\r\n byte[] cipherText = (byte [])is.readObject();\r\n \r\n // decrypt the ciphertext to obtain the signed message\r\n ATMSessionMessage atmSessionMessage = (ATMSessionMessage) crypto.decryptRijndael(cipherText, kSession);\r\n if(!(currTimeStamp < atmSessionMessage.getTimeStamp())) error (\"Time stamp does not match\");\r\n \r\n //interpret the transaction operation in the request\r\n SignedMessage signedMessage = atmSessionMessage.getSignedMessage();\r\n \r\n \r\n \t\t//verify signature\r\n \t\ttry {\r\n \t\t\tif(!crypto.verify(signedMessage.msg, signedMessage.signature, currAcct.kPub))\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"Digital signature failed...\");\r\n \t\t\t}\r\n \t\t\tSystem.out.println(\"Message signature valid...\");\r\n \t\t} catch (SignatureException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t} catch (KeyException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\t\r\n TransactionMessage transactionMessage = (TransactionMessage)signedMessage.getObject();\r\n transactionOperation = transactionMessage.getOperation();\r\n \r\n //print the signed message\r\n System.out.println(\"\\n\" + (new Date()).toString());\r\n System.out.println(signedMessage.toString());\r\n \r\n //strip out the parameters embedded \r\n nonce = atmSessionMessage.getNonce();\r\n double value = transactionMessage.getValue();\r\n \r\n //print the timestamp when the transaction takes place\r\n Date now = new Date();\r\n System.out.println(\"\\n\" + now.toString());\r\n \r\n //re-route the request to the appropriate handling function\r\n if(transactionOperation == TransactionOperation.Deposit) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" DEPOSIT: \" + value);\r\n currAcct.deposit(value);\r\n \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Deposit Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.Withdraw) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" WITHDRAW: \" + value);\r\n \t currAcct.withdraw(value);\r\n \t \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Withdrawal Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.EndSession) \r\n \t {\r\n \t \tSystem.out.println(\"\\nTerminating session with ACCT#: \" + currAcct.getNumber());\r\n \t \treturn false;\r\n \t \t\r\n \t }\r\n \r\n accts.save();\r\n //create a successful reply Success and set the balance\r\n balance = currAcct.getBalance(); \r\n transactionMessage = new TransactionMessage(MessageType.ResponseSuccess,transactionOperation,balance);\r\n atmSessionMessage = new ATMSessionMessage(transactionMessage);\r\n \r\n //set the nonce \r\n atmSessionMessage.setNonce(nonce);\r\n currTimeStamp = atmSessionMessage.getTimeStamp();\r\n //encrypt the response and send it\r\n cipherText = crypto.encryptRijndael(atmSessionMessage, kSession);\r\n os.writeObject((Serializable)cipherText);\r\n \r\n //Logging.....\r\n //get the signed message and encrypt it\r\n \r\n signedMessage.encryptMessage(this.kLog);\r\n \r\n //encrypt the action\r\n //archive the signed message for logging and non-repudiation purposes \r\n SignedAction signedAction = new SignedAction(currAcct.getNumber(), atmSessionMessage.getTimeStamp(), signedMessage);\r\n \r\n //flush out transaction record to the audit file\r\n BankServer.log.write(signedAction);\r\n \r\n\t return true;\r\n }\r\n catch(Exception e){\r\n if(e instanceof TransException) replyFailure(transactionOperation,nonce);\r\n System.out.println(\"Terminating session with ACCT#: \" + currAcct.getNumber());\r\n \t//e.printStackTrace();\r\n \r\n return true;\r\n }\r\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutput();", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_3() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return transactions_.get(index);\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "protected void pktsOut(int n) {}", "@Test\n\tpublic void testTransfer() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"acc2\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(02, \"acc1\", 00000, 200.00, \"\"));\n\t\ttransactions.add(2, new Transaction(02, \"acc2\", 00001, 200.00, \"\"));\n\t\ttransactions.add(3, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\t// ArrayList<Account> expected = new ArrayList();\n\t\t// expected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\t\t// expected.add(1, new Account(00001, \"acc2\", true, 1050.00, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Money Transfered\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"money not transfered\", testResult);\n\t}", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputOrBuilder();", "public void calculatePayment() {}", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_4_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString ticketId = roc.createTickets(1, true)[0].get(\"ticketId\").getAsString();\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tuserData, ticketId);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true, ticketId);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void fixedPayerAndReceiverTest() {\n double fixedRate = 0.015;\n GeneratorAttributeIR attribute = new GeneratorAttributeIR(Period.ofYears(7));\n double notional = 1.0e8;\n ZonedDateTime date = DateUtils.getUTCDate(2013, 9, 10);\n SwapFixedIborDefinition def1 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute);\n SwapFixedIborDefinition def2 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, true);\n assertEquals(def1, def2);\n SwapFixedIborDefinition def3 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, false);\n assertFalse(def1.equals(def3));\n int nIbor = def1.getIborLeg().getNumberOfPayments();\n int nFixed = def1.getFixedLeg().getNumberOfPayments();\n assertEquals(nIbor, def3.getIborLeg().getNumberOfPayments());\n assertEquals(nFixed, def3.getFixedLeg().getNumberOfPayments());\n assertEquals(def1.getIborLeg().getIborIndex(), def3.getIborLeg().getIborIndex());\n assertEquals(def1.getIborLeg().getCalendar(), def3.getIborLeg().getCalendar());\n assertEquals(def1.getCurrency(), def3.getIborLeg().getCurrency());\n for (int i = 0; i < nIbor; ++i) {\n CouponIborDefinition ibor1 = def1.getIborLeg().getNthPayment(i);\n CouponIborDefinition ibor3 = def3.getIborLeg().getNthPayment(i);\n assertEquals(ibor1.getNotional(), -ibor3.getNotional());\n assertEquals(ibor1.getAccrualStartDate(), ibor3.getAccrualStartDate());\n assertEquals(ibor1.getAccrualEndDate(), ibor3.getAccrualEndDate());\n assertEquals(ibor1.getFixingDate(), ibor3.getFixingDate());\n assertEquals(ibor1.getPaymentDate(), ibor3.getPaymentDate());\n assertEquals(ibor1.getPaymentYearFraction(), ibor3.getPaymentYearFraction());\n }\n for (int i = 0; i < nFixed; ++i) {\n CouponFixedDefinition fixed1 = def1.getFixedLeg().getNthPayment(i);\n CouponFixedDefinition fixed3 = def3.getFixedLeg().getNthPayment(i);\n assertEquals(fixed1.getNotional(), -fixed3.getNotional());\n assertEquals(fixed1.getAccrualStartDate(), fixed3.getAccrualStartDate());\n assertEquals(fixed1.getAccrualEndDate(), fixed3.getAccrualEndDate());\n assertEquals(fixed1.getPaymentDate(), fixed3.getPaymentDate());\n assertEquals(fixed1.getPaymentYearFraction(), fixed3.getPaymentYearFraction());\n }\n }", "public static Transaction generateSendTransaction(String strPrivateKey, String creatorAddress, String receiverAddress,\n TransactionHistory transactionHistory) {\n List<Creation> creations = new ArrayList<Creation>();\n List<Input> inputs = new ArrayList<Input>();\n List<Output> outputs = new ArrayList<Output>();\n\n // Get sender address from private key\n BigInteger privateKey = Bitcoin.decodePrivateKey(strPrivateKey);\n byte[] publicKey = Bitcoin.generatePublicKey(privateKey);\n String senderAddress = Bitcoin.publicKeyToAddress(publicKey);\n\n // Variable for counting number of coupons in referred transaction outputs\n int couponsInInputs = 0;\n\n // Find previous transaction outputs to refer to\n Iterator<Transaction> transactionIterator = transactionHistory.iterator();\n while (transactionIterator.hasNext() && couponsInInputs < 1) {\n Transaction transaction = transactionIterator.next();\n Iterator<Output> outputIterator = transaction.getOutputs().iterator();\n while (outputIterator.hasNext() && couponsInInputs < 1) {\n Output output = outputIterator.next();\n if (output.getCreatorAddress().equals(creatorAddress) && output.getAddress().equals(senderAddress)\n && output.getInputId() == 0) {\n Input input = new Input(output.getOutputId());\n inputs.add(input);\n couponsInInputs += output.getAmount();\n }\n }\n }\n\n // Check if enough coupons are available\n if (couponsInInputs <= 0) {\n throw new IllegalArgumentException();\n }\n\n // Set that 1 coupon should be sent to receiver address\n Output output = new Output(creatorAddress, 1, receiverAddress);\n outputs.add(output);\n\n // Send remaining coupons in referred transaction outputs back to the user as change\n if (couponsInInputs > 1) {\n Output changeOutput = new Output(creatorAddress, couponsInInputs - 1, senderAddress);\n outputs.add(changeOutput);\n }\n\n // Create transaction, sign it and return it\n Transaction transaction = new Transaction(creations, inputs, outputs);\n transaction.signTransaction(privateKey);\n return transaction;\n\n }", "public int[] getTsumoPayment(boolean isDealer) {\r\n int[] output = new int[2];\r\n if (isDealer) {\r\n output[0] = basicPoints * 2;\r\n output[1] = 0;\r\n } else {\r\n output[0] = basicPoints * 1;\r\n output[1] = basicPoints * 2;\r\n }\r\n output[0] = (int)(100*Math.ceil(output[0]/100.0));\r\n output[1] = (int)(100*Math.ceil(output[1]/100.0));\r\n \r\n return output;\r\n }", "@Test\n\tpublic void validateSignatureBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock newBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE VALID\n\t\tassertEquals(true, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\ttransactionsSignature = new byte[64];\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID GENERATOR SIGNATURE\n\t\tnewBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), newBlock.getTimestamp(), newBlock.getGeneratingBalance(), generator, new byte[32]);\n\t\ttransactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t///CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//VALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = newBlock.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID TRANSACTION SIGNATURE\n\t\tassertEquals(true, newBlock.isSignatureValid());\t\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tpayment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(200).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK INVALID TRANSACTION SIGNATURE\n\t\tassertEquals(false, newBlock.isSignatureValid());\t\n\t}", "public double sumTransactions() {\n\t\treturn checkIfTransactionsExist(true);\n\t}", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "@Override\r\n\tpublic byte[] countersign(final byte[] sign,\r\n final String algorithm,\r\n final CounterSignTarget targetType,\r\n final Object[] targets,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException {\r\n throw new UnsupportedOperationException(\"No es posible realizar contrafirmas de ficheros ODF\"); //$NON-NLS-1$\r\n }", "public void printTransactions() {\n for (int i = 0; i < transactions.size(); i++) {\n\t\t\tint indeks = i+1;\n\t\t\tSystem.out.println(\"Transactions \" + indeks + \": \" + transactions.get(i).getType() + \" \" + transactions.get(i).getAmount());\n\t\t}\n }", "public int updatePayment2(int requestId, int amount);", "private void convertTransactionToBitStream(){\n bitTransactionList = new ArrayList<>();\n itemListMap2 = new HashMap<>();\n \n for(int i=0; i<transactions_set.size(); i++){\n ArrayList curr_tr = transactions_set.get(i);\n \n if(curr_tr.size() >= min_itemset_size_K){ \n int freqItem = 0;\n BitSet bitset = new BitSet(bitsetLen);\n \n for(int j=0; j<curr_tr.size(); j++){\n try{\n int item = (int)curr_tr.get(j);\n bitset.set(itemIndex.get(item), true);\n freqItem++;\n }\n catch(Exception e){}\n }\n if(freqItem >= min_itemset_size_K){\n bitTransactionList.add(bitset);\n// System.out.println(bitset);\n HashSet<BitSet> subset_2 = createSubsetsOfLen2(bitset);\n for(BitSet sub_b : subset_2){\n itemListMap2.put(sub_b, itemListMap2.getOrDefault(sub_b, 0)+1);\n }\n }\n }\n }\n \n itemListMap2.values().removeIf(val -> val<min_sup);\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_5_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t\t\r\n\t\t\t\tHashMap<String,Object> o2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t\t\r\n\t\t\t\to = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\to2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "protected int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws IOException {\n return serializator.write(output, mostSigBits) +\n serializator.write(output, leastSigBits);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return instance.getTransactions(index);\n }", "public void onOutputSpent(MoneroOutputWallet output);", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public static void main(String[] args)\n\t{\n \n\t\tSystem.out.println(\"Enter the size of transaction array\");\n int trSize = sc.nextInt();\n\n // creating an array of provided size\n int[] transactions = new int[trSize];\n \n // get the elements of the array (in a loop)\n System.out.println(\"Enter the values of array\");\n for (int i = 0; i < transactions.length; i++) {\n transactions[i] = sc.nextInt();\n }\n // get the number of targets\n System.out.println(\"Enter the total no of targets that needs to be achieved\");\n int numTargets = sc.nextInt();\n \n // get in target one-by-one (loop)\n for (int i = 0; i < numTargets; i++) {\n \n \t// Get TargetValue\n System.out.println(\"Enter the value of target\");\n int target = sc.nextInt();\n \n int sum =0;\n for ( int j=0; j < transactions.length; j++) {\n \tsum = sum + transactions[j];\n \t\n \tif ( sum >= target) {\n \tSystem.out.println(\"Target achieved after \" + (j+1) + \" transactions\" );\n \tbreak; // break out of the innermost for loop\n \t}\n \t\n \t//we come to the last transactions, yet target is not achieved\n \tif (j == transactions.length - 1) {\n \t\tSystem.out.println( \"Given target is not achieved\");\n \t}\n \t\n }\n \n \n\t}\n\n}", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public double calculatePay() {\n\t\treturn 0;\r\n\t}", "public byte[] signNativeByTransDataDefault(UInt256 uInt256) {\n return new byte[0];\n }", "@Suspendable\n @Override\n protected void checkTransaction(SignedTransaction stx) throws FlowException {\n }", "com.google.protobuf.ByteString\n getOutputBytes();", "com.google.protobuf.ByteString\n getTranCodeBytes();", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_1() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public float getInputsValue() {\n\t\tfloat total = 0;\n\t\tfor (TransactionInput i : inputs) {\n\t\t\tif (i.getUTXO() == null)\n\t\t\t\tcontinue; // if Transaction can't be found skip it\n\t\t\ttotal += i.getUTXO().getValue();\n\t\t}\n\t\treturn total;\n\t}", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }" ]
[ "0.6159733", "0.59689933", "0.589428", "0.5756902", "0.57402194", "0.56859154", "0.56721807", "0.5637813", "0.5592145", "0.5576518", "0.5491765", "0.5470686", "0.5430834", "0.5358753", "0.5358753", "0.5358753", "0.53461564", "0.5307082", "0.52533996", "0.5240322", "0.5190462", "0.51507604", "0.5130814", "0.5129066", "0.5127569", "0.5083162", "0.5064059", "0.50343573", "0.5009548", "0.49968874", "0.49893466", "0.49677435", "0.49677435", "0.49677435", "0.4962916", "0.4948351", "0.49416536", "0.4940025", "0.49287498", "0.49031627", "0.48969245", "0.4892023", "0.48822185", "0.48698023", "0.48688632", "0.48649135", "0.48628554", "0.48256552", "0.47981858", "0.4793885", "0.4793407", "0.4768888", "0.4768888", "0.4768888", "0.47677594", "0.47562104", "0.47514212", "0.47490582", "0.47333866", "0.47300485", "0.47300485", "0.47212848", "0.47189197", "0.47163257", "0.47116205", "0.46987715", "0.46951908", "0.46937752", "0.46896154", "0.46886653", "0.46746448", "0.46724787", "0.46684882", "0.4666781", "0.4666447", "0.46659714", "0.46610832", "0.46557936", "0.46557936", "0.46557936", "0.46529654", "0.4652265", "0.4649212", "0.46420932", "0.46242723", "0.46233037", "0.4616067", "0.4615847", "0.46125874", "0.4607859", "0.46071175", "0.46046627", "0.4604134", "0.45967475", "0.4594377", "0.45860416", "0.4585746", "0.4580786", "0.4577845", "0.45748726", "0.45700264" ]
0.0
-1
Signed transactions that satisfy PaymentDetails.outputs repeated bytes transactions = 2;
@java.lang.Override public com.google.protobuf.ByteString getTransactions(int index) { return transactions_.get(index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testValidOutputValues() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, -20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(-20, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testNoDoubleSpending() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Alice wants double spending: transfers 10 coins to Bob, 20 to Cal again\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1: input 0\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n\n // Sign for tx1: input 1\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(1).addSignature(sig2);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testHandleTxs() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // Cal transfers 5 coins to Bob, Bob transfers 2 coins to Alice\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0); // index 0 refers to output 1 of tx1\n tx2.addInput(tx1.getHash(), 1); // index 1 refers to output 1 of tx1\n tx2.addOutput(2, kpAlice.getPublic());\n tx2.addOutput(5, kpBob.getPublic());\n\n // Sign for tx2\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx2.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(0).addSignature(sig2);\n\n byte[] sig3 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpCal.getPrivate());\n sig.update(tx2.getRawDataToSign(1));\n sig3 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(1).addSignature(sig3);\n tx2.finalize();\n\n // Alice transfers 3 coins to Cal\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(), 0);\n tx3.addOutput(3, kpCal.getPublic());\n\n // Sign for tx3\n byte[] sig4 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx3.getRawDataToSign(0));\n sig4 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx3.getInput(0).addSignature(sig4);\n tx3.finalize();\n\n Transaction[] acceptedTx = txHandler.handleTxs(new Transaction[] {tx1, tx2, tx3});\n // tx1, tx2 supposed to be valid, tx3 supposed to be invalid\n assertEquals(acceptedTx.length, 2);\n // assertFalse(txHandler.isValidTx(tx3));\n }", "public boolean processTransaction() {\n\n // Checks to see if the signature can be verified.\n if (verifySignature() == false) {\n System.out.println(\"# Transaction signature could not be verified.\");\n return false;\n }\n\n // Gathers all transaction inputs, making sure they are unspent.\n for (TransactionInput i : inputs) {\n i.UTXO = BasicBlockchain.UTXOs.get(i.transactionOutputId);\n }\n\n // Checks if transaction amount is valid.\n if (getInputsValue() < BasicBlockchain.minimumTransaction) {\n System.out.println(\"# Transaction inputs are too small.\");\n return false;\n }\n\n // Generates transaction outputs.\n // Get value of the inputs then the leftover change.\n float leftOver = getInputsValue() - value;\n transactionId = calculateHash();\n // Send value to recipient.\n outputs.add(new TransactionOutput(this.recipient, value, transactionId));\n // Send the leftover \"change\" back to sender.\n outputs.add(new TransactionOutput(this.sender, leftOver, transactionId));\n\n\n // Adds outputs to the unspent list.\n for (TransactionOutput o : outputs) {\n BasicBlockchain.UTXOs.put(o.id, o);\n }\n\n // Removes the transaction inputs from the blockchain's UTXO list as spent.\n for (TransactionInput i : inputs) {\n if (i.UTXO == null) continue;\n BasicBlockchain.UTXOs.remove(i.UTXO.id);\n }\n\n return true;\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutput();", "public static void main(String[] args) throws AddressFormatException {\n\n// generateMultisig();\n String getSignedTransaction = signFirstTime();\n String rawtx = signSecondTime(getSignedTransaction);\n\n System.out.println(\"rawtx ->\"+ rawtx);\n }", "private static String signFirstTime() throws AddressFormatException\n {\n ECKey key1 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n\n\n // Use the redeem script we have saved somewhere to start building the transaction\n Script redeemScript = new Script(hexStringToByteArray(\"5221021ae8964b8529dc3e52955f2cabd967e08c52008dbcca8e054143b668f3998f4a210306be609ef37366ab0f3dd4096ac23a6ee4d561fc469fa60003f799b0121ad1072102199f3d89fa00e6f55dd6ecdd911457d7264415914957db124d53bf0064963f3853ae\"));\n\n // Start building the transaction by adding the unspent inputs we want to use\n // The data is taken from blockchain.info, and can be found here: https://blockchain.info/rawtx/ca1884b8f2e0ba88249a86ec5ddca04f937f12d4fac299af41a9b51643302077\n Transaction spendTx = new Transaction(params);\n ScriptBuilder scriptBuilder = new ScriptBuilder();\n scriptBuilder.data(new String(\"a9145204ad7c5fa5a2491cd91c332e28c87221194ca087\").getBytes()); // Script of this output\n TransactionInput input = spendTx.addInput(new Sha256Hash(\"fed695bf5e2c15286956a7bd3464c5beb97ef064e1f9406eba189ea844733e7c\"), 1, scriptBuilder.build());\n\n // Add outputs to the person receiving bitcoins\n Address receiverAddress = new Address(params, \"n2cWhs5sbWFCwzuuWWsVM9ubPwykGtX75T\");\n Coin charge = Coin.valueOf(1000000); // 0.1 mBTC\n Script outputScript = ScriptBuilder.createOutputScript(receiverAddress);\n spendTx.addOutput(charge, outputScript);\n\n /*8888888888888888888888888888888888888888888888888888888888888*/\n\n // Sign the first part of the transaction using private key #1\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature ecdsaSignature = key1.sign(sighash);\n TransactionSignature transactionSignarture = new TransactionSignature(ecdsaSignature, Transaction.SigHash.ALL, false);\n\n // Create p2sh multisig input script\n Script inputScript = ScriptBuilder.createP2SHMultiSigInputScript(Arrays.asList(transactionSignarture), redeemScript);\n\n // Add the script signature to the input\n input.setScriptSig(inputScript);\n System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "private ArrayList<Long> storeTransactionInputs(long transactionId, ArrayList<TransactionInput> inputs, int isCoinbase){\n \t\tint inputindex = 0;\n \t\tlong previousOutputId;\n \t\tString prevOutputHash;\n \t\tResultSet findOutputResults;\n \t\tResultSet generatedKey;\n \t\tLong addressId;\n \t\tArrayList<Long> addressIdz=new ArrayList<Long>();\n \t\ttry {\n \t\tfor (TransactionInput i : inputs) {\n\t\t\t\n \t\t\tprevOutputHash = HexBin.encode(i.outpoint.hash);\n \t\t\tfindTransactionOutputStatement.setString(1, prevOutputHash);\n \t\t\tfindTransactionOutputStatement.setLong(2, i.outpoint.index);\n \t\t\tfindOutputResults = findTransactionOutputStatement\n \t\t\t\t\t.executeQuery();\n \t\t\tif (findOutputResults.next()) {\n \t\t\t\tpreviousOutputId = findOutputResults.getLong(1);\n\t\t\t\taddressId=findOutputResults.getLong(2);\n \t\t\t} else {\n \t\t\t\tpreviousOutputId = 0;\n\t\t\t\taddressId=null;\n \t\t\t}\n \t\t\tfindOutputResults.close();\n \t\t\tinsertTransactionInputStatement.setLong(1, transactionId);\n \t\t\tinsertTransactionInputStatement.setInt(2, inputindex);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(3, previousOutputId);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setString(4, prevOutputHash);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(5, i.outpoint.index);\n \t\t\tinsertTransactionInputStatement.setLong(6,\n \t\t\t\t\ti.scriptBytes.length);\n \t\t\tinsertTransactionInputStatement.setString(7,\n \t\t\t\t\tHexBin.encode(i.scriptBytes));\n \t\t\tinsertTransactionInputStatement.setLong(8, i.sequence);\n \t\t\tinsertTransactionInputStatement.setBoolean(9,\n \t\t\t\t\ti.isCoinBase());\n\t\t\tif(addressId!=null){\n \t\t\t\tinsertTransactionInputStatement.setLong(10,addressId);\n \t\t\t\taddressIdz.add(addressId);\n\t\t\t} else {\n \t\t\t\t// TODO Auto-generated catch block\n \t\t\t\tinsertTransactionInputStatement.setNull(10,\n \t\t\t\t\t\tjava.sql.Types.INTEGER);\n \t\t\t}\n \t\t\tinsertTransactionInputStatement.execute();\n \t\t\t\n \t\t}\n \t\t\n \t\t\n \t} catch (SQLException e1) {\n \t\t// TODO Auto-generated catch block\n \t\te1.printStackTrace();\n \t}\n \t\treturn addressIdz;\n \t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputOrBuilder();", "List<TransactionVO> addPendingTransactions(List<SignedTransaction> transactions);", "@Test\n public void TxHandlerTestThird() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid output number(wrong number of coins to transfer)\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1 scrooge to alice 20coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: Alice --> Bob -5coins [*Invalid output number*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(-5, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n // tx3: Alice --> Bob 90coins [*Invalid output number*]\n Transaction tx3 = new Transaction();\n tx3.addInput(tx1.getHash(), 0);\n tx3.addOutput(90, pkBob.getPublic());\n tx3.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n }", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "private static String signSecondTime(String transactionString)\n {\n Transaction spendTx = new Transaction(params, hexStringToByteArray(transactionString));\n\n // Get the input chunks\n Script inputScript = spendTx.getInput(0).getScriptSig();\n List<ScriptChunk> scriptChunks = inputScript.getChunks();\n\n // Create a list of all signatures. Start by extracting the existing ones from the list of script schunks.\n // The last signature in the script chunk list is the redeemScript\n List<TransactionSignature> signatureList = new ArrayList<TransactionSignature>();\n Iterator<ScriptChunk> iterator = scriptChunks.iterator();\n Script redeemScript = null;\n\n while (iterator.hasNext())\n {\n ScriptChunk chunk = iterator.next();\n\n if (iterator.hasNext() && chunk.opcode != 0)\n {\n TransactionSignature transactionSignarture = TransactionSignature.decodeFromBitcoin(chunk.data, false);\n signatureList.add(transactionSignarture);\n } else\n {\n redeemScript = new Script(chunk.data);\n }\n }\n\n // Create the sighash using the redeem script\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature secondSignature;\n\n // Take out the key and sign the signhash\n //ECKey key2 = createKeyFromSha256Passphrase(\"Super secret key 2\");\n ECKey key2 = ECKey.fromPrivate(new BigInteger(\"68123968917867656952640885027449260190826636504009580537802764798766700329220\"));\n// ECKey key2 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n secondSignature = key2.sign(sighash);\n\n // Add the second signature to the signature list\n TransactionSignature transactionSignarture = new TransactionSignature(secondSignature, Transaction.SigHash.ALL, false);\n signatureList.add(transactionSignarture);\n\n // Rebuild p2sh multisig input script\n inputScript = ScriptBuilder.createP2SHMultiSigInputScript(signatureList, redeemScript);\n spendTx.getInput(0).setScriptSig(inputScript);\n\n //System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "@Test\n public void testOutputsInUTXOPool() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is NOT put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // UTXO pool does not contains the UTXO\n assertFalse(txHandler.isValidTx(tx1));\n\n // Put output of createCoinTx to the pool\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler1 = new TxHandler(utxoPool);\n\n // UTXO pool now contains the UTXO\n assertTrue(txHandler1.isValidTx(tx1));\n }", "@Test\n public void testValidBalance() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 100 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(100, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "RequestResult postSignRequests(TriphaseRequest[] requests) throws IOException,\n CertificateEncodingException, SAXException;", "public IBankTransfert payment();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static boolean isSigned_entries_receiveEst() {\n return false;\n }", "com.google.protobuf.ByteString getTransactions(int index);", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "@Suspendable\n @Override\n public SignedTransaction call() throws FlowException {\n\n Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);\n//\n\n // Source\n AccountInfo issuerOwner = subFlow(new AccountInfoByName(acctNameSource)).get(0).getState().getData();\n PublicKey issuerOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty issuerOwnerAnonParty = new AnonymousParty(issuerOwnerKey);\n\n AccountInfo targetOwner = subFlow(new AccountInfoByName(acctNameTarget)).get(0).getState().getData();\n PublicKey targetOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty targetOwnerAnonParty = new AnonymousParty(targetOwnerKey);\n\n\n AssetForAccountState outputAsset = new AssetForAccountState(issuerOwnerAnonParty, targetOwnerAnonParty,\n asset.getState().getData().getName(), asset.getState().getData().getValue());\n\n\n TransactionBuilder txBuilder = new TransactionBuilder(notary)\n .addInputState(asset)\n .addOutputState(outputAsset, AssetForAccountContract.ID)\n .addCommand(new AssetForAccountContract.Commands.Transfer(), issuerOwnerKey);\n\n txBuilder.verify(getServiceHub());\n\n SignedTransaction fullySignedTransaction = getServiceHub().signInitialTransaction(txBuilder, issuerOwnerKey);\n\n //return fullySignedTransaction;\n return subFlow(new FinalityFlow(fullySignedTransaction, Collections.emptyList()));\n }", "private boolean areOutputsSpent(Transaction tx){\n // Need to see if tx inputs are contained in the blockchain UTXOs\n for(TransactionInput i : tx.inputs){\n if(!currentBlockchain.UTXOs.containsKey(i.previousOutId)){\n return true;\n }\n }\n return false;\n }", "BigInteger getDigitalSignature();", "public static long deepTransactionCheck(Transaction tx, UtxoUpdateBuffer utxo_buffer, BlockHeader block_header, NetworkParams params)\n throws ValidationException\n {\n try(TimeRecordAuto tra_blk = TimeRecord.openAuto(\"Validation.deepTransactionCheck\"))\n {\n TransactionInner inner = null;\n\n try\n {\n inner = TransactionInner.parseFrom(tx.getInnerData());\n }\n catch(java.io.IOException e)\n {\n throw new ValidationException(\"error parsing tx on second pass somehow\", e);\n }\n\n long sum_of_inputs = 0L;\n // Make sure all inputs exist\n for(TransactionInput in : inner.getInputsList())\n {\n TransactionOutput matching_out = utxo_buffer.getOutputMatching(in);\n if (matching_out == null)\n {\n throw new ValidationException(String.format(\"No matching output for input %s\", new ChainHash(in.getSrcTxId())));\n }\n validateSpendable(matching_out, block_header, params);\n sum_of_inputs += matching_out.getValue();\n\n // SIP-4 check\n if (block_header.getBlockHeight() >= params.getActivationHeightTxInValue())\n {\n if (in.getValue() != 0L)\n {\n if (in.getValue() != matching_out.getValue())\n {\n throw new ValidationException(String.format(\"Input value does not match: %d %d\", matching_out.getValue(), in.getValue()));\n }\n }\n }\n utxo_buffer.useOutput(matching_out, new ChainHash(in.getSrcTxId()), in.getSrcTxOutIdx());\n }\n\n long spent = 0L;\n // Sum up all outputs\n int out_idx =0;\n ArrayList<ByteString> raw_output_list = TransactionUtil.extractWireFormatTxOut(tx);\n\n for(TransactionOutput out : inner.getOutputsList())\n {\n validateTransactionOutput(out, block_header, params);\n spent+=out.getValue();\n utxo_buffer.addOutput(raw_output_list, out, new ChainHash(tx.getTxHash()), out_idx);\n out_idx++;\n\n }\n\n spent+=inner.getFee();\n\n if (!inner.getIsCoinbase())\n {\n if (sum_of_inputs != spent)\n {\n throw new ValidationException(String.format(\"Transaction took in %d and spent %d\", sum_of_inputs, spent));\n }\n }\n \n return inner.getFee();\n }\n }", "@Test\n public void TxHandlerTestSecond() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the double spending\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(25, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1: one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx 2:Scrooge --> Bob 20coins [*Double-spending*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx0.getHash(), 0);\n tx2.addOutput(25, pkBob.getPublic());\n tx2.signTx(pkScrooge.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n\n }", "String signITRByAssesse(String PAN,String xml, DigitalSignatureWrapper digitalSignatureWrapper) throws MissingPrivateKeyException,InvalidDigitalSignatureException,Exception;", "public boolean processTransaction() {\r\n\t\t\r\n\t\t\tif(verifySignature() == false) {\r\n\t\t\t\tSystem.out.println(\"#Transaction Signature failed to verify\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\ttransactionId = calulateHash();\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "public static boolean isSigned_receivets() {\n return true;\n }", "@Override\n public boolean isValid() {\n final BlockChainInt outputHash = getOutputHash();\n\n return inputs.stream().map(input -> input.verifySignature(outputHash)).reduce(true, (a, b) -> a && b)\n && outputs.stream().map(output -> output.getAmount() >= 0).reduce(true, (a, b) -> a && b)\n && getTransactionFee() >= 0;\n }", "@Override\n public void run() {\n byte[] deviceTxPayload = CoreServices.getOrCreateHardwareWalletService().get().getContext().getSerializedTx().toByteArray();\n\n log.info(\"DeviceTx payload:\\n{}\", Utils.HEX.encode(deviceTxPayload));\n\n // Load deviceTx\n Transaction deviceTx = new Transaction(MainNetParams.get(), deviceTxPayload);\n\n log.info(\"deviceTx:\\n{}\", deviceTx.toString());\n\n // Check the signatures are canonical\n for (TransactionInput txInput : deviceTx.getInputs()) {\n byte[] signature = txInput.getScriptSig().getChunks().get(0).data;\n if (signature != null) {\n log.debug(\n \"Is signature canonical test result '{}' for txInput '{}', signature '{}'\",\n TransactionSignature.isEncodingCanonical(signature),\n txInput.toString(),\n Utils.HEX.encode(signature));\n } else {\n log.warn(\"No signature data\");\n }\n }\n\n log.debug(\"Committing and broadcasting the last tx\");\n\n BitcoinNetworkService bitcoinNetworkService = CoreServices.getOrCreateBitcoinNetworkService();\n\n if (bitcoinNetworkService.getLastSendRequestSummaryOptional().isPresent()\n && bitcoinNetworkService.getLastWalletOptional().isPresent()) {\n\n SendRequestSummary sendRequestSummary = bitcoinNetworkService.getLastSendRequestSummaryOptional().get();\n\n // Check the unsigned and signed tx are essentially the same as a check against malware attacks on the Trezor\n if (TransactionUtils.checkEssentiallyEqual(sendRequestSummary.getSendRequest().get().tx, deviceTx)) {\n // Substitute the signed tx from the trezor\n log.debug(\n \"Substituting the Trezor signed tx '{}' for the unsigned version {}\",\n deviceTx.toString(),\n sendRequestSummary.getSendRequest().get().tx.toString()\n );\n sendRequestSummary.getSendRequest().get().tx = deviceTx;\n log.debug(\"The transaction fee was {}\", sendRequestSummary.getSendRequest().get().fee);\n\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_TRANSACTION_CREATED_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n\n // Get the last wallet\n Wallet wallet = bitcoinNetworkService.getLastWalletOptional().get();\n\n // Commit and broadcast\n bitcoinNetworkService.commitAndBroadcast(sendRequestSummary, wallet, paymentRequestData);\n\n // Ensure the header is switched off whilst the send is in progress\n ViewEvents.fireViewChangedEvent(ViewKey.HEADER, false);\n } else {\n // The signed transaction is essentially different from what was sent to it - abort send\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_FAILURE_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n }\n } else {\n log.debug(\"Cannot commit and broadcast the last send as it is not present in bitcoinNetworkService\");\n }\n // Clear the previous remembered tx\n bitcoinNetworkService.setLastSendRequestSummaryOptional(Optional.<SendRequestSummary>absent());\n bitcoinNetworkService.setLastWalletOptional(Optional.<Wallet>absent());\n }", "@Test\n public void TxHandlerTestForth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid signature\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx1: scrooge to alice 20 coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: alice to bob 20coins[signed by bob]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(20, pkBob.getPublic());\n tx2.signTx(pkBob.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n }", "@Override\n public byte[] createDataToSignInput(\n Transaction transaction,\n int inputIndex,\n long amountInSat,\n PublicKeyTriple publicKeyTriple) {\n\n final byte[] redeemScript = createRedeemScript(publicKeyTriple);\n\n return TransactionHelpers.getDataToSign(\n transaction,\n inputIndex,\n new Script(redeemScript)\n );\n }", "public TransactionResponse processAllTransaction() throws ParseException {\n TransactionResponse response = new TransactionResponse();\n\n //User0\n response.setTransaction(new Transaction(\"user0\",\"0001\", \"type0\",\"user0_Billing\",\"user0_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-00\")));\n\n //User1\n response.setTransaction(new Transaction(\"user1\", \"0101\",\"type0\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user1\", \"0102\", \"type1\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-00\")));\n\n //User2\n response.setTransaction(new Transaction(\"user2\", \"0201\", \"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-01-00\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0202\", \"type2\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0203\",\"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n //User3\n response.setTransaction(new Transaction(\"user3\", \"0301\",\"type0\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user3\", \"0302\",\"type1\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n return response;\n }", "com.dogecoin.protocols.payments.Protos.Output getOutputs(int index);", "@Test\n public void TxHandlerTestFifth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the input not in the UtxoPool\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n //tx1: Scrooge --> Alice 20coins [Pay Coins *NOT added to UTXO pool* due to accidents]\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n utxo = new UTXO(tx1.getHash(),0);\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n utxoPool.removeUTXO(utxo);\n assertTrue(\"tx1:UTXO has been removed.\", utxoPool.getAllUTXO().size() == 0);\n\n\n // tx2: Alice --> Bob 15coins [Pay Coins *Previous Tx NOT in UTXO pool*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(15, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 0);\n\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "private static void createDummyTransactions() {\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 10L, new Transaction(10000d, \"cars\", 0L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 11L, new Transaction(15000d, \"shopping\", 10L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 12L, new Transaction(20000d, \"keys\", 11L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 13L, new Transaction(25000d, \"furniture\", 12L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 14L, new Transaction(30000d, \"keys\", 13L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 15L, new Transaction(40000d, \"cars\", 14L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 16L, new Transaction(50000d, \"cars\", 15L)));\n }", "@Test\n public void TxHandlerTestFirst() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test some basic functions of TxHandler\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n // tx0: Scrooge --> Scrooge 25coins [Create Coins]\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx( pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n\n // tx1: Scrooge --> Scrooge 4coins [Divide Coins]\n //\t Scrooge --> Scrooge 5coins\n //\t Scrooge --> Scrooge 6coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(),0);\n\n tx1.addOutput(4,pkScrooge.getPublic());\n tx1.addOutput(5,pkScrooge.getPublic());\n tx1.addOutput(6,pkScrooge.getPublic());\n\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx2: Scrooge --> Alice 4coins [Pay separately]\n //\t Scrooge --> Alice 5coins\n // Scrooge --> Bob 6coins\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addInput(tx1.getHash(), 1);\n tx2.addInput(tx1.getHash(), 2);\n\n tx2.addOutput(4, pkAlice.getPublic());\n tx2.addOutput(5, pkAlice.getPublic());\n tx2.addOutput(6, pkBob.getPublic());\n\n tx2.signTx(pkScrooge.getPrivate(), 0);\n tx2.signTx(pkScrooge.getPrivate(), 1);\n tx2.signTx(pkScrooge.getPrivate(), 2);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx3:Alice --> Alice 2coins [Divide Coins]\n // Alice --> Alice 2coins\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(),0);\n\n tx3.addOutput(2, pkAlice.getPublic());\n tx3.addOutput(2, pkAlice.getPublic());\n\n tx3.signTx(pkAlice.getPrivate(),0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 4);\n\n // tx4: Alice --> Bob 2coins [Pay jointly]\n // Alice --> Bob 5coins\n Transaction tx4 = new Transaction();\n tx4.addInput(tx3.getHash(),0);\n tx4.addInput(tx2.getHash(),1);\n\n tx4.addOutput(7, pkBob.getPublic());\n\n tx4.signTx(pkAlice.getPrivate(), 0);\n tx4.signTx(pkAlice.getPrivate(),1);\n\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx4) returns: \" + txHandler.isValidTx(tx4));\n assertTrue(\"tx4:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx4}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx4:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n// System.out.println(\"tx4.hashCode returns: \" + tx4.hashCode());\n }", "public ParametricStatement[] createForPaymentTransaction(PaymentTransaction paymentTransaction)\n throws SQLException {\n int multiplier = 1;\n Date date = paymentTransaction.getProcessDate();\n if (paymentTransaction instanceof VoidTransaction) {\n VoidTransaction trans = (VoidTransaction)paymentTransaction;\n ITransaction originalTrans = trans.getOriginalTransaction();\n if (originalTrans instanceof PaymentTransaction) {\n multiplier = -1;\n paymentTransaction = (PaymentTransaction)originalTrans;\n } else {\n // Do nothing if original was not a payment transaction.\n return new ParametricStatement[0];\n }\n }\n ArrayList parametricStatements = new ArrayList();\n String storeId = paymentTransaction.getStore().getId();\n String operatorId = paymentTransaction.getTheOperator().getId();\n // String registerId = paymentTransaction.getId();\n // int registerIdIndex = registerId.indexOf('*') + 1;\n // registerId = registerId.substring(registerIdIndex, registerId.indexOf('*', registerIdIndex));\n String registerId = paymentTransaction.getRegisterId();\n PaymentSummary[] currentPaymentSummaries = this.selectByDateStoreId(date, storeId);\n List newPaymentSummaries = new ArrayList();\n Payment[] payments = paymentTransaction.getPaymentsArray();\n for (int paymentIndex = 0; paymentIndex < payments.length; paymentIndex++) {\n ArmCurrency paymentAmount = payments[paymentIndex].getAmount().multiply(multiplier);\n String paymentType = payments[paymentIndex].getTransactionPaymentName();\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n boolean found = false;\n //to find if this payment type is already in the database\n for (int summaryIndex = 0; summaryIndex < currentPaymentSummaries.length; summaryIndex++) {\n if (currentPaymentSummaries[summaryIndex].getEmployeeId().equals(operatorId)\n && currentPaymentSummaries[summaryIndex].getRegisterId().equals(registerId)\n && currentPaymentSummaries[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n currentPaymentSummaries[summaryIndex].doSetPaymentTotal(paymentAmount.add(\n currentPaymentSummaries[summaryIndex].getPaymentTotal()));\n int mediaCount = ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).\n getMediaCount();\n ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n // work-around for cloudscape date truncation problem.\n currentPaymentSummaries[summaryIndex].doSetDate(date);\n List list = fromObjectToBean(currentPaymentSummaries[summaryIndex]).toList();\n list.add(currentPaymentSummaries[summaryIndex].getId());\n parametricStatements.add(new ParametricStatement(updateSql, list));\n break;\n }\n }\n //to find if it is already in the newPaymentSummaries List\n if (!found) {\n PaymentSummary[] newPaymentSummaryArray = (PaymentSummary[])newPaymentSummaries.toArray(new\n PaymentSummary[0]);\n for (int summaryIndex = 0; summaryIndex < newPaymentSummaryArray.length; summaryIndex++) {\n if (newPaymentSummaryArray[summaryIndex].getEmployeeId().equals(operatorId)\n && newPaymentSummaryArray[summaryIndex].getRegisterId().equals(registerId)\n && newPaymentSummaryArray[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n ArmCurrency newTotal = paymentAmount.add(newPaymentSummaryArray[summaryIndex].\n getPaymentTotal());\n int mediaCount = ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).\n getMediaCount();\n newPaymentSummaryArray[summaryIndex].doSetPaymentTotal(newTotal);\n ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n }\n }\n }\n if (!found) {\n CMSPaymentSummary paymentSummary = new CMSPaymentSummary();\n paymentSummary.doSetDate(date);\n paymentSummary.doSetEmployeeId(operatorId);\n paymentSummary.doSetStoreId(storeId);\n paymentSummary.doSetRegisterId(registerId);\n paymentSummary.doSetPaymentTotal(paymentAmount);\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n paymentSummary.doSetPaymentType(paymentType);\n paymentSummary.doSetId(this.getNextChelseaId());\n paymentSummary.doSetMediaCount(paymentSummary.getMediaCount() + 1);\n newPaymentSummaries.add(paymentSummary);\n }\n }\n for (int i = 0; i < newPaymentSummaries.size(); i++) {\n PaymentSummary paymentSummary = (PaymentSummary)newPaymentSummaries.get(i);\n parametricStatements.add(new ParametricStatement(insertSql\n , fromObjectToBean(paymentSummary).toList()));\n }\n return (ParametricStatement[])parametricStatements.toArray(new ParametricStatement[\n parametricStatements.size()]);\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "@Test\n public void transactionSum() {\n final Transaction transaction1 = new Transaction(\"774cedda\", State.CANCELED, 1000L, new Date());\n final Account account1 = new Account(\"1001\", 0L, Collections.singletonList(transaction1));\n final Transaction transaction2 = new Transaction(\"337868a7\", State.FINISHED, 8000L, new Date());\n final Transaction transaction3 = new Transaction(\"f8047f86\", State.CANCELED, 10000L, new Date());\n final Account account2 = new Account(\"1002\", 8000L, Arrays.asList(transaction2, transaction3));\n\n final long actual = calcSumOfCancelledTransOnNonEmptyAccounts(Arrays.asList(account1, account2));\n\n Assert.assertEquals(actual, 10_000L);\n }", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutputs(int index);", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public abstract void generateReceipt(Transaction trans);", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "public Transaction getDummyTransaction(String action) {\n\n\t\t// Long payerAccountNum = 111l;\n\t\tLong payerRealmNum = 0l;\n\t\tLong payerShardNum = 0l;\n\t\t// Long nodeAccountNum=123l;\n\t\tLong nodeRealmNum = 0l;\n\t\tLong nodeShardNum = 0l;\n\t\tlong transactionFee = 0l;\n\t\tTimestamp startTime =\n\t\t\t\tRequestBuilder.getTimestamp(Instant.now(Clock.systemUTC()).minusSeconds(13));\n\t\tDuration transactionDuration = RequestBuilder.getDuration(100);\n\t\tboolean generateRecord = false;\n\t\tString memo = \"UnitTesting\";\n\t\tint thresholdValue = 10;\n\t\tList<Key> keyList = new ArrayList<>();\n\t\tKeyPair pair = new KeyPairGenerator().generateKeyPair();\n\t\tbyte[] pubKey = ((EdDSAPublicKey) pair.getPublic()).getAbyte();\n\t\tKey akey =\n\t\t\t\tKey.newBuilder().setEd25519(ByteString.copyFromUtf8((MiscUtils.commonsBytesToHex(pubKey)))).build();\n\t\tPrivateKey priv = pair.getPrivate();\n\t\tkeyList.add(akey);\n\t\tlong initBal = 100;\n\t\tlong sendRecordThreshold = 5;\n\t\tlong receiveRecordThreshold = 5;\n\t\tboolean receiverSign = false;\n\t\tDuration autoRenew = RequestBuilder.getDuration(100);\n\t\t;\n\t\tlong proxyAccountNum = 12345l;\n\t\tlong proxyRealmNum = 0l;\n\t\tlong proxyShardNum = 0l;\n\t\tint proxyFraction = 10;\n\t\tint maxReceiveProxyFraction = 10;\n\t\tlong shardID = 0l;\n\t\tlong realmID = 0l;\n\n\t\tTransaction trx = null;\n\t\tSignatureList sigList = SignatureList.getDefaultInstance();\n\t\tTimestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\n\t\t/**\n\t\t * SignatureList sigList = SignatureList.getDefaultInstance(); Transaction transferTx =\n\t\t * RequestBuilder.getCryptoTransferRequest( payer.getAccountNum(), payer.getRealmNum(),\n\t\t * payer.getShardNum(), nodeAccount.getAccountNum(), nodeAccount.getRealmNum(),\n\t\t * nodeAccount.getShardNum(), 800, timestamp, transactionDuration, false, \"test\", sigList,\n\t\t * payer.getAccountNum(), -100l, nodeAccount.getAccountNum(), 100l); transferTx =\n\t\t * TransactionSigner.signTransaction(transferTx, accountKeys.get(payer));\n\t\t */\n\n\t\tif (\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t\ttrx = RequestBuilder.getCryptoTransferRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 800, timestamp,\n\t\t\t\t\ttransactionDuration, false, \"test\", sigList, payerAccountId.getAccountNum(), -100l,\n\t\t\t\t\tnodeAccountId.getAccountNum(), 100l);\n\t\t\t// trx = TransactionSigner.signTransaction(trx, account2keyMap.get(payerAccountId));\n\t\t}\n\n\t\tif (\"createContract\".equalsIgnoreCase(action)) {\n\t\t\tFileID fileID = FileID.newBuilder().setFileNum(9999l).setRealmNum(1l).setShardNum(2l).build();\n\n\t\t\ttrx = RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 50000000000l, timestamp,\n\t\t\t\t\ttransactionDuration, true, \"createContract\", DEFAULT_CONTRACT_OP_GAS, fileID,\n\t\t\t\t\tByteString.EMPTY, 0, transactionDuration,\n\t\t\t\t\tSignatureList.newBuilder().addSigs(\n\t\t\t\t\t\t\tSignature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t\t\t\t\t\t.build(),\n\t\t\t\t\t\"\");\n\t\t}\n\n\t\t// if(\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t// long durationInSeconds = DAY_SEC * 30;\n\t\t// * Duration contractAutoRenew = Duration.newBuilder().setSeconds(durationInSeconds).build();\n\t\t// * Timestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\t\t// * Duration transactionDuration = RequestBuilder.getDuration(30, 0);\n\t\t// * Transaction createContractRequest =\n\t\t// RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t// * payerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t// * nodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 100l, timestamp,\n\t\t// transactionDuration, true, \"createContract\",\n\t\t// * DEFAULT_CONTRACT_OP_GAS, contractFile, ByteString.EMPTY, 0, contractAutoRenew,\n\t\t// * SignatureList.newBuilder()\n\t\t// *\n\t\t// .addSigs(Signature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t// * .build());\n\t\t// }\n\n\t\treturn trx;\n\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public static byte[] secondOutputStep(byte[] S){\n\t\tStringBuffer string = new StringBuffer();\n\t\tfor (int i = 1; i < S.length; i+=2) {\n\t\t\tstring.append(getBit(S[i],7));\n\t\t}\n\t\tbyte[] bval = new BigInteger(string.toString(), 2).toByteArray();\n\t\tif(bval.length > 16){\n\t\t\treturn Arrays.copyOfRange(bval,1,bval.length);\n\t\t}else{\n\t\t\treturn bval;\n\t\t}\n\t\t\n\t}", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "public double printOutput() {\r\n return calculateNetPay();\r\n }", "public boolean doTransaction() {\r\n int nonce = -1;\r\n TransactionOperation transactionOperation = null;\r\n try {\r\n double balance;\r\n \r\n //read the stream for requests from client\r\n byte[] cipherText = (byte [])is.readObject();\r\n \r\n // decrypt the ciphertext to obtain the signed message\r\n ATMSessionMessage atmSessionMessage = (ATMSessionMessage) crypto.decryptRijndael(cipherText, kSession);\r\n if(!(currTimeStamp < atmSessionMessage.getTimeStamp())) error (\"Time stamp does not match\");\r\n \r\n //interpret the transaction operation in the request\r\n SignedMessage signedMessage = atmSessionMessage.getSignedMessage();\r\n \r\n \r\n \t\t//verify signature\r\n \t\ttry {\r\n \t\t\tif(!crypto.verify(signedMessage.msg, signedMessage.signature, currAcct.kPub))\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"Digital signature failed...\");\r\n \t\t\t}\r\n \t\t\tSystem.out.println(\"Message signature valid...\");\r\n \t\t} catch (SignatureException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t} catch (KeyException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\t\r\n TransactionMessage transactionMessage = (TransactionMessage)signedMessage.getObject();\r\n transactionOperation = transactionMessage.getOperation();\r\n \r\n //print the signed message\r\n System.out.println(\"\\n\" + (new Date()).toString());\r\n System.out.println(signedMessage.toString());\r\n \r\n //strip out the parameters embedded \r\n nonce = atmSessionMessage.getNonce();\r\n double value = transactionMessage.getValue();\r\n \r\n //print the timestamp when the transaction takes place\r\n Date now = new Date();\r\n System.out.println(\"\\n\" + now.toString());\r\n \r\n //re-route the request to the appropriate handling function\r\n if(transactionOperation == TransactionOperation.Deposit) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" DEPOSIT: \" + value);\r\n currAcct.deposit(value);\r\n \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Deposit Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.Withdraw) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" WITHDRAW: \" + value);\r\n \t currAcct.withdraw(value);\r\n \t \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Withdrawal Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.EndSession) \r\n \t {\r\n \t \tSystem.out.println(\"\\nTerminating session with ACCT#: \" + currAcct.getNumber());\r\n \t \treturn false;\r\n \t \t\r\n \t }\r\n \r\n accts.save();\r\n //create a successful reply Success and set the balance\r\n balance = currAcct.getBalance(); \r\n transactionMessage = new TransactionMessage(MessageType.ResponseSuccess,transactionOperation,balance);\r\n atmSessionMessage = new ATMSessionMessage(transactionMessage);\r\n \r\n //set the nonce \r\n atmSessionMessage.setNonce(nonce);\r\n currTimeStamp = atmSessionMessage.getTimeStamp();\r\n //encrypt the response and send it\r\n cipherText = crypto.encryptRijndael(atmSessionMessage, kSession);\r\n os.writeObject((Serializable)cipherText);\r\n \r\n //Logging.....\r\n //get the signed message and encrypt it\r\n \r\n signedMessage.encryptMessage(this.kLog);\r\n \r\n //encrypt the action\r\n //archive the signed message for logging and non-repudiation purposes \r\n SignedAction signedAction = new SignedAction(currAcct.getNumber(), atmSessionMessage.getTimeStamp(), signedMessage);\r\n \r\n //flush out transaction record to the audit file\r\n BankServer.log.write(signedAction);\r\n \r\n\t return true;\r\n }\r\n catch(Exception e){\r\n if(e instanceof TransException) replyFailure(transactionOperation,nonce);\r\n System.out.println(\"Terminating session with ACCT#: \" + currAcct.getNumber());\r\n \t//e.printStackTrace();\r\n \r\n return true;\r\n }\r\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutput();", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_3() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Test\n\tpublic void testTransfer() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"acc2\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(02, \"acc1\", 00000, 200.00, \"\"));\n\t\ttransactions.add(2, new Transaction(02, \"acc2\", 00001, 200.00, \"\"));\n\t\ttransactions.add(3, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\t// ArrayList<Account> expected = new ArrayList();\n\t\t// expected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\t\t// expected.add(1, new Account(00001, \"acc2\", true, 1050.00, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Money Transfered\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"money not transfered\", testResult);\n\t}", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "protected void pktsOut(int n) {}", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputOrBuilder();", "public void calculatePayment() {}", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_4_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString ticketId = roc.createTickets(1, true)[0].get(\"ticketId\").getAsString();\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tuserData, ticketId);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true, ticketId);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void fixedPayerAndReceiverTest() {\n double fixedRate = 0.015;\n GeneratorAttributeIR attribute = new GeneratorAttributeIR(Period.ofYears(7));\n double notional = 1.0e8;\n ZonedDateTime date = DateUtils.getUTCDate(2013, 9, 10);\n SwapFixedIborDefinition def1 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute);\n SwapFixedIborDefinition def2 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, true);\n assertEquals(def1, def2);\n SwapFixedIborDefinition def3 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, false);\n assertFalse(def1.equals(def3));\n int nIbor = def1.getIborLeg().getNumberOfPayments();\n int nFixed = def1.getFixedLeg().getNumberOfPayments();\n assertEquals(nIbor, def3.getIborLeg().getNumberOfPayments());\n assertEquals(nFixed, def3.getFixedLeg().getNumberOfPayments());\n assertEquals(def1.getIborLeg().getIborIndex(), def3.getIborLeg().getIborIndex());\n assertEquals(def1.getIborLeg().getCalendar(), def3.getIborLeg().getCalendar());\n assertEquals(def1.getCurrency(), def3.getIborLeg().getCurrency());\n for (int i = 0; i < nIbor; ++i) {\n CouponIborDefinition ibor1 = def1.getIborLeg().getNthPayment(i);\n CouponIborDefinition ibor3 = def3.getIborLeg().getNthPayment(i);\n assertEquals(ibor1.getNotional(), -ibor3.getNotional());\n assertEquals(ibor1.getAccrualStartDate(), ibor3.getAccrualStartDate());\n assertEquals(ibor1.getAccrualEndDate(), ibor3.getAccrualEndDate());\n assertEquals(ibor1.getFixingDate(), ibor3.getFixingDate());\n assertEquals(ibor1.getPaymentDate(), ibor3.getPaymentDate());\n assertEquals(ibor1.getPaymentYearFraction(), ibor3.getPaymentYearFraction());\n }\n for (int i = 0; i < nFixed; ++i) {\n CouponFixedDefinition fixed1 = def1.getFixedLeg().getNthPayment(i);\n CouponFixedDefinition fixed3 = def3.getFixedLeg().getNthPayment(i);\n assertEquals(fixed1.getNotional(), -fixed3.getNotional());\n assertEquals(fixed1.getAccrualStartDate(), fixed3.getAccrualStartDate());\n assertEquals(fixed1.getAccrualEndDate(), fixed3.getAccrualEndDate());\n assertEquals(fixed1.getPaymentDate(), fixed3.getPaymentDate());\n assertEquals(fixed1.getPaymentYearFraction(), fixed3.getPaymentYearFraction());\n }\n }", "public static Transaction generateSendTransaction(String strPrivateKey, String creatorAddress, String receiverAddress,\n TransactionHistory transactionHistory) {\n List<Creation> creations = new ArrayList<Creation>();\n List<Input> inputs = new ArrayList<Input>();\n List<Output> outputs = new ArrayList<Output>();\n\n // Get sender address from private key\n BigInteger privateKey = Bitcoin.decodePrivateKey(strPrivateKey);\n byte[] publicKey = Bitcoin.generatePublicKey(privateKey);\n String senderAddress = Bitcoin.publicKeyToAddress(publicKey);\n\n // Variable for counting number of coupons in referred transaction outputs\n int couponsInInputs = 0;\n\n // Find previous transaction outputs to refer to\n Iterator<Transaction> transactionIterator = transactionHistory.iterator();\n while (transactionIterator.hasNext() && couponsInInputs < 1) {\n Transaction transaction = transactionIterator.next();\n Iterator<Output> outputIterator = transaction.getOutputs().iterator();\n while (outputIterator.hasNext() && couponsInInputs < 1) {\n Output output = outputIterator.next();\n if (output.getCreatorAddress().equals(creatorAddress) && output.getAddress().equals(senderAddress)\n && output.getInputId() == 0) {\n Input input = new Input(output.getOutputId());\n inputs.add(input);\n couponsInInputs += output.getAmount();\n }\n }\n }\n\n // Check if enough coupons are available\n if (couponsInInputs <= 0) {\n throw new IllegalArgumentException();\n }\n\n // Set that 1 coupon should be sent to receiver address\n Output output = new Output(creatorAddress, 1, receiverAddress);\n outputs.add(output);\n\n // Send remaining coupons in referred transaction outputs back to the user as change\n if (couponsInInputs > 1) {\n Output changeOutput = new Output(creatorAddress, couponsInInputs - 1, senderAddress);\n outputs.add(changeOutput);\n }\n\n // Create transaction, sign it and return it\n Transaction transaction = new Transaction(creations, inputs, outputs);\n transaction.signTransaction(privateKey);\n return transaction;\n\n }", "public int[] getTsumoPayment(boolean isDealer) {\r\n int[] output = new int[2];\r\n if (isDealer) {\r\n output[0] = basicPoints * 2;\r\n output[1] = 0;\r\n } else {\r\n output[0] = basicPoints * 1;\r\n output[1] = basicPoints * 2;\r\n }\r\n output[0] = (int)(100*Math.ceil(output[0]/100.0));\r\n output[1] = (int)(100*Math.ceil(output[1]/100.0));\r\n \r\n return output;\r\n }", "@Test\n\tpublic void validateSignatureBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock newBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE VALID\n\t\tassertEquals(true, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\ttransactionsSignature = new byte[64];\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID GENERATOR SIGNATURE\n\t\tnewBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), newBlock.getTimestamp(), newBlock.getGeneratingBalance(), generator, new byte[32]);\n\t\ttransactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t///CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//VALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = newBlock.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID TRANSACTION SIGNATURE\n\t\tassertEquals(true, newBlock.isSignatureValid());\t\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tpayment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(200).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK INVALID TRANSACTION SIGNATURE\n\t\tassertEquals(false, newBlock.isSignatureValid());\t\n\t}", "public double sumTransactions() {\n\t\treturn checkIfTransactionsExist(true);\n\t}", "public void printTransactions() {\n for (int i = 0; i < transactions.size(); i++) {\n\t\t\tint indeks = i+1;\n\t\t\tSystem.out.println(\"Transactions \" + indeks + \": \" + transactions.get(i).getType() + \" \" + transactions.get(i).getAmount());\n\t\t}\n }", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "@Override\r\n\tpublic byte[] countersign(final byte[] sign,\r\n final String algorithm,\r\n final CounterSignTarget targetType,\r\n final Object[] targets,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException {\r\n throw new UnsupportedOperationException(\"No es posible realizar contrafirmas de ficheros ODF\"); //$NON-NLS-1$\r\n }", "public int updatePayment2(int requestId, int amount);", "private void convertTransactionToBitStream(){\n bitTransactionList = new ArrayList<>();\n itemListMap2 = new HashMap<>();\n \n for(int i=0; i<transactions_set.size(); i++){\n ArrayList curr_tr = transactions_set.get(i);\n \n if(curr_tr.size() >= min_itemset_size_K){ \n int freqItem = 0;\n BitSet bitset = new BitSet(bitsetLen);\n \n for(int j=0; j<curr_tr.size(); j++){\n try{\n int item = (int)curr_tr.get(j);\n bitset.set(itemIndex.get(item), true);\n freqItem++;\n }\n catch(Exception e){}\n }\n if(freqItem >= min_itemset_size_K){\n bitTransactionList.add(bitset);\n// System.out.println(bitset);\n HashSet<BitSet> subset_2 = createSubsetsOfLen2(bitset);\n for(BitSet sub_b : subset_2){\n itemListMap2.put(sub_b, itemListMap2.getOrDefault(sub_b, 0)+1);\n }\n }\n }\n }\n \n itemListMap2.values().removeIf(val -> val<min_sup);\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_5_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t\t\r\n\t\t\t\tHashMap<String,Object> o2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t\t\r\n\t\t\t\to = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\to2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return instance.getTransactions(index);\n }", "protected int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws IOException {\n return serializator.write(output, mostSigBits) +\n serializator.write(output, leastSigBits);\n }", "public static void main(String[] args)\n\t{\n \n\t\tSystem.out.println(\"Enter the size of transaction array\");\n int trSize = sc.nextInt();\n\n // creating an array of provided size\n int[] transactions = new int[trSize];\n \n // get the elements of the array (in a loop)\n System.out.println(\"Enter the values of array\");\n for (int i = 0; i < transactions.length; i++) {\n transactions[i] = sc.nextInt();\n }\n // get the number of targets\n System.out.println(\"Enter the total no of targets that needs to be achieved\");\n int numTargets = sc.nextInt();\n \n // get in target one-by-one (loop)\n for (int i = 0; i < numTargets; i++) {\n \n \t// Get TargetValue\n System.out.println(\"Enter the value of target\");\n int target = sc.nextInt();\n \n int sum =0;\n for ( int j=0; j < transactions.length; j++) {\n \tsum = sum + transactions[j];\n \t\n \tif ( sum >= target) {\n \tSystem.out.println(\"Target achieved after \" + (j+1) + \" transactions\" );\n \tbreak; // break out of the innermost for loop\n \t}\n \t\n \t//we come to the last transactions, yet target is not achieved\n \tif (j == transactions.length - 1) {\n \t\tSystem.out.println( \"Given target is not achieved\");\n \t}\n \t\n }\n \n \n\t}\n\n}", "public void onOutputSpent(MoneroOutputWallet output);", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public double calculatePay() {\n\t\treturn 0;\r\n\t}", "public byte[] signNativeByTransDataDefault(UInt256 uInt256) {\n return new byte[0];\n }", "@Suspendable\n @Override\n protected void checkTransaction(SignedTransaction stx) throws FlowException {\n }", "com.google.protobuf.ByteString\n getTranCodeBytes();", "com.google.protobuf.ByteString\n getOutputBytes();", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_1() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public float getInputsValue() {\n\t\tfloat total = 0;\n\t\tfor (TransactionInput i : inputs) {\n\t\t\tif (i.getUTXO() == null)\n\t\t\t\tcontinue; // if Transaction can't be found skip it\n\t\t\ttotal += i.getUTXO().getValue();\n\t\t}\n\t\treturn total;\n\t}", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }" ]
[ "0.6157669", "0.5968836", "0.5894512", "0.575845", "0.57379013", "0.56862354", "0.5671643", "0.5638562", "0.55891097", "0.55805844", "0.5491049", "0.547115", "0.5430694", "0.535867", "0.535867", "0.535867", "0.5344417", "0.5307626", "0.5253172", "0.524015", "0.5189739", "0.51506877", "0.5134411", "0.51289254", "0.5127413", "0.50831395", "0.50639427", "0.5035688", "0.50094956", "0.49972042", "0.4990747", "0.4967469", "0.4967469", "0.4967469", "0.49642414", "0.4948274", "0.49423918", "0.49403173", "0.49305025", "0.49055907", "0.48962563", "0.48919266", "0.48815575", "0.48727128", "0.48690858", "0.48671517", "0.4864887", "0.48293087", "0.4796929", "0.47936854", "0.4792538", "0.47683463", "0.47675353", "0.47675353", "0.47675353", "0.47565505", "0.47514316", "0.47473222", "0.47313264", "0.47313264", "0.4730076", "0.47218332", "0.47159252", "0.47158366", "0.4699172", "0.46933794", "0.46929714", "0.4690595", "0.4686018", "0.4673744", "0.4672201", "0.46678242", "0.46676886", "0.4667487", "0.46660423", "0.46638095", "0.46557528", "0.46553993", "0.46553993", "0.46553993", "0.46531892", "0.46475676", "0.46449953", "0.4624059", "0.46231604", "0.46201655", "0.46124235", "0.46085235", "0.46082187", "0.46068537", "0.46033576", "0.4602587", "0.45972705", "0.45952573", "0.4587196", "0.4582048", "0.4580939", "0.45772147", "0.45763913", "0.4568933" ]
0.47160283
62
Signed transactions that satisfy PaymentDetails.outputs repeated bytes transactions = 2;
private void setTransactions( int index, com.google.protobuf.ByteString value) { java.lang.Class<?> valueClass = value.getClass(); ensureTransactionsIsMutable(); transactions_.set(index, value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testValidOutputValues() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, -20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(-20, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testNoDoubleSpending() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Alice wants double spending: transfers 10 coins to Bob, 20 to Cal again\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1: input 0\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n\n // Sign for tx1: input 1\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(1).addSignature(sig2);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testHandleTxs() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // Cal transfers 5 coins to Bob, Bob transfers 2 coins to Alice\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0); // index 0 refers to output 1 of tx1\n tx2.addInput(tx1.getHash(), 1); // index 1 refers to output 1 of tx1\n tx2.addOutput(2, kpAlice.getPublic());\n tx2.addOutput(5, kpBob.getPublic());\n\n // Sign for tx2\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx2.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(0).addSignature(sig2);\n\n byte[] sig3 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpCal.getPrivate());\n sig.update(tx2.getRawDataToSign(1));\n sig3 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(1).addSignature(sig3);\n tx2.finalize();\n\n // Alice transfers 3 coins to Cal\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(), 0);\n tx3.addOutput(3, kpCal.getPublic());\n\n // Sign for tx3\n byte[] sig4 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx3.getRawDataToSign(0));\n sig4 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx3.getInput(0).addSignature(sig4);\n tx3.finalize();\n\n Transaction[] acceptedTx = txHandler.handleTxs(new Transaction[] {tx1, tx2, tx3});\n // tx1, tx2 supposed to be valid, tx3 supposed to be invalid\n assertEquals(acceptedTx.length, 2);\n // assertFalse(txHandler.isValidTx(tx3));\n }", "public boolean processTransaction() {\n\n // Checks to see if the signature can be verified.\n if (verifySignature() == false) {\n System.out.println(\"# Transaction signature could not be verified.\");\n return false;\n }\n\n // Gathers all transaction inputs, making sure they are unspent.\n for (TransactionInput i : inputs) {\n i.UTXO = BasicBlockchain.UTXOs.get(i.transactionOutputId);\n }\n\n // Checks if transaction amount is valid.\n if (getInputsValue() < BasicBlockchain.minimumTransaction) {\n System.out.println(\"# Transaction inputs are too small.\");\n return false;\n }\n\n // Generates transaction outputs.\n // Get value of the inputs then the leftover change.\n float leftOver = getInputsValue() - value;\n transactionId = calculateHash();\n // Send value to recipient.\n outputs.add(new TransactionOutput(this.recipient, value, transactionId));\n // Send the leftover \"change\" back to sender.\n outputs.add(new TransactionOutput(this.sender, leftOver, transactionId));\n\n\n // Adds outputs to the unspent list.\n for (TransactionOutput o : outputs) {\n BasicBlockchain.UTXOs.put(o.id, o);\n }\n\n // Removes the transaction inputs from the blockchain's UTXO list as spent.\n for (TransactionInput i : inputs) {\n if (i.UTXO == null) continue;\n BasicBlockchain.UTXOs.remove(i.UTXO.id);\n }\n\n return true;\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutput();", "public static void main(String[] args) throws AddressFormatException {\n\n// generateMultisig();\n String getSignedTransaction = signFirstTime();\n String rawtx = signSecondTime(getSignedTransaction);\n\n System.out.println(\"rawtx ->\"+ rawtx);\n }", "private static String signFirstTime() throws AddressFormatException\n {\n ECKey key1 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n\n\n // Use the redeem script we have saved somewhere to start building the transaction\n Script redeemScript = new Script(hexStringToByteArray(\"5221021ae8964b8529dc3e52955f2cabd967e08c52008dbcca8e054143b668f3998f4a210306be609ef37366ab0f3dd4096ac23a6ee4d561fc469fa60003f799b0121ad1072102199f3d89fa00e6f55dd6ecdd911457d7264415914957db124d53bf0064963f3853ae\"));\n\n // Start building the transaction by adding the unspent inputs we want to use\n // The data is taken from blockchain.info, and can be found here: https://blockchain.info/rawtx/ca1884b8f2e0ba88249a86ec5ddca04f937f12d4fac299af41a9b51643302077\n Transaction spendTx = new Transaction(params);\n ScriptBuilder scriptBuilder = new ScriptBuilder();\n scriptBuilder.data(new String(\"a9145204ad7c5fa5a2491cd91c332e28c87221194ca087\").getBytes()); // Script of this output\n TransactionInput input = spendTx.addInput(new Sha256Hash(\"fed695bf5e2c15286956a7bd3464c5beb97ef064e1f9406eba189ea844733e7c\"), 1, scriptBuilder.build());\n\n // Add outputs to the person receiving bitcoins\n Address receiverAddress = new Address(params, \"n2cWhs5sbWFCwzuuWWsVM9ubPwykGtX75T\");\n Coin charge = Coin.valueOf(1000000); // 0.1 mBTC\n Script outputScript = ScriptBuilder.createOutputScript(receiverAddress);\n spendTx.addOutput(charge, outputScript);\n\n /*8888888888888888888888888888888888888888888888888888888888888*/\n\n // Sign the first part of the transaction using private key #1\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature ecdsaSignature = key1.sign(sighash);\n TransactionSignature transactionSignarture = new TransactionSignature(ecdsaSignature, Transaction.SigHash.ALL, false);\n\n // Create p2sh multisig input script\n Script inputScript = ScriptBuilder.createP2SHMultiSigInputScript(Arrays.asList(transactionSignarture), redeemScript);\n\n // Add the script signature to the input\n input.setScriptSig(inputScript);\n System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "private ArrayList<Long> storeTransactionInputs(long transactionId, ArrayList<TransactionInput> inputs, int isCoinbase){\n \t\tint inputindex = 0;\n \t\tlong previousOutputId;\n \t\tString prevOutputHash;\n \t\tResultSet findOutputResults;\n \t\tResultSet generatedKey;\n \t\tLong addressId;\n \t\tArrayList<Long> addressIdz=new ArrayList<Long>();\n \t\ttry {\n \t\tfor (TransactionInput i : inputs) {\n\t\t\t\n \t\t\tprevOutputHash = HexBin.encode(i.outpoint.hash);\n \t\t\tfindTransactionOutputStatement.setString(1, prevOutputHash);\n \t\t\tfindTransactionOutputStatement.setLong(2, i.outpoint.index);\n \t\t\tfindOutputResults = findTransactionOutputStatement\n \t\t\t\t\t.executeQuery();\n \t\t\tif (findOutputResults.next()) {\n \t\t\t\tpreviousOutputId = findOutputResults.getLong(1);\n\t\t\t\taddressId=findOutputResults.getLong(2);\n \t\t\t} else {\n \t\t\t\tpreviousOutputId = 0;\n\t\t\t\taddressId=null;\n \t\t\t}\n \t\t\tfindOutputResults.close();\n \t\t\tinsertTransactionInputStatement.setLong(1, transactionId);\n \t\t\tinsertTransactionInputStatement.setInt(2, inputindex);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(3, previousOutputId);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setString(4, prevOutputHash);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(5, i.outpoint.index);\n \t\t\tinsertTransactionInputStatement.setLong(6,\n \t\t\t\t\ti.scriptBytes.length);\n \t\t\tinsertTransactionInputStatement.setString(7,\n \t\t\t\t\tHexBin.encode(i.scriptBytes));\n \t\t\tinsertTransactionInputStatement.setLong(8, i.sequence);\n \t\t\tinsertTransactionInputStatement.setBoolean(9,\n \t\t\t\t\ti.isCoinBase());\n\t\t\tif(addressId!=null){\n \t\t\t\tinsertTransactionInputStatement.setLong(10,addressId);\n \t\t\t\taddressIdz.add(addressId);\n\t\t\t} else {\n \t\t\t\t// TODO Auto-generated catch block\n \t\t\t\tinsertTransactionInputStatement.setNull(10,\n \t\t\t\t\t\tjava.sql.Types.INTEGER);\n \t\t\t}\n \t\t\tinsertTransactionInputStatement.execute();\n \t\t\t\n \t\t}\n \t\t\n \t\t\n \t} catch (SQLException e1) {\n \t\t// TODO Auto-generated catch block\n \t\te1.printStackTrace();\n \t}\n \t\treturn addressIdz;\n \t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputOrBuilder();", "List<TransactionVO> addPendingTransactions(List<SignedTransaction> transactions);", "@Test\n public void TxHandlerTestThird() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid output number(wrong number of coins to transfer)\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1 scrooge to alice 20coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: Alice --> Bob -5coins [*Invalid output number*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(-5, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n // tx3: Alice --> Bob 90coins [*Invalid output number*]\n Transaction tx3 = new Transaction();\n tx3.addInput(tx1.getHash(), 0);\n tx3.addOutput(90, pkBob.getPublic());\n tx3.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n }", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "private static String signSecondTime(String transactionString)\n {\n Transaction spendTx = new Transaction(params, hexStringToByteArray(transactionString));\n\n // Get the input chunks\n Script inputScript = spendTx.getInput(0).getScriptSig();\n List<ScriptChunk> scriptChunks = inputScript.getChunks();\n\n // Create a list of all signatures. Start by extracting the existing ones from the list of script schunks.\n // The last signature in the script chunk list is the redeemScript\n List<TransactionSignature> signatureList = new ArrayList<TransactionSignature>();\n Iterator<ScriptChunk> iterator = scriptChunks.iterator();\n Script redeemScript = null;\n\n while (iterator.hasNext())\n {\n ScriptChunk chunk = iterator.next();\n\n if (iterator.hasNext() && chunk.opcode != 0)\n {\n TransactionSignature transactionSignarture = TransactionSignature.decodeFromBitcoin(chunk.data, false);\n signatureList.add(transactionSignarture);\n } else\n {\n redeemScript = new Script(chunk.data);\n }\n }\n\n // Create the sighash using the redeem script\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature secondSignature;\n\n // Take out the key and sign the signhash\n //ECKey key2 = createKeyFromSha256Passphrase(\"Super secret key 2\");\n ECKey key2 = ECKey.fromPrivate(new BigInteger(\"68123968917867656952640885027449260190826636504009580537802764798766700329220\"));\n// ECKey key2 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n secondSignature = key2.sign(sighash);\n\n // Add the second signature to the signature list\n TransactionSignature transactionSignarture = new TransactionSignature(secondSignature, Transaction.SigHash.ALL, false);\n signatureList.add(transactionSignarture);\n\n // Rebuild p2sh multisig input script\n inputScript = ScriptBuilder.createP2SHMultiSigInputScript(signatureList, redeemScript);\n spendTx.getInput(0).setScriptSig(inputScript);\n\n //System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "@Test\n public void testOutputsInUTXOPool() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is NOT put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // UTXO pool does not contains the UTXO\n assertFalse(txHandler.isValidTx(tx1));\n\n // Put output of createCoinTx to the pool\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler1 = new TxHandler(utxoPool);\n\n // UTXO pool now contains the UTXO\n assertTrue(txHandler1.isValidTx(tx1));\n }", "@Test\n public void testValidBalance() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 100 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(100, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "RequestResult postSignRequests(TriphaseRequest[] requests) throws IOException,\n CertificateEncodingException, SAXException;", "public IBankTransfert payment();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static boolean isSigned_entries_receiveEst() {\n return false;\n }", "com.google.protobuf.ByteString getTransactions(int index);", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "@Suspendable\n @Override\n public SignedTransaction call() throws FlowException {\n\n Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);\n//\n\n // Source\n AccountInfo issuerOwner = subFlow(new AccountInfoByName(acctNameSource)).get(0).getState().getData();\n PublicKey issuerOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty issuerOwnerAnonParty = new AnonymousParty(issuerOwnerKey);\n\n AccountInfo targetOwner = subFlow(new AccountInfoByName(acctNameTarget)).get(0).getState().getData();\n PublicKey targetOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty targetOwnerAnonParty = new AnonymousParty(targetOwnerKey);\n\n\n AssetForAccountState outputAsset = new AssetForAccountState(issuerOwnerAnonParty, targetOwnerAnonParty,\n asset.getState().getData().getName(), asset.getState().getData().getValue());\n\n\n TransactionBuilder txBuilder = new TransactionBuilder(notary)\n .addInputState(asset)\n .addOutputState(outputAsset, AssetForAccountContract.ID)\n .addCommand(new AssetForAccountContract.Commands.Transfer(), issuerOwnerKey);\n\n txBuilder.verify(getServiceHub());\n\n SignedTransaction fullySignedTransaction = getServiceHub().signInitialTransaction(txBuilder, issuerOwnerKey);\n\n //return fullySignedTransaction;\n return subFlow(new FinalityFlow(fullySignedTransaction, Collections.emptyList()));\n }", "private boolean areOutputsSpent(Transaction tx){\n // Need to see if tx inputs are contained in the blockchain UTXOs\n for(TransactionInput i : tx.inputs){\n if(!currentBlockchain.UTXOs.containsKey(i.previousOutId)){\n return true;\n }\n }\n return false;\n }", "BigInteger getDigitalSignature();", "public static long deepTransactionCheck(Transaction tx, UtxoUpdateBuffer utxo_buffer, BlockHeader block_header, NetworkParams params)\n throws ValidationException\n {\n try(TimeRecordAuto tra_blk = TimeRecord.openAuto(\"Validation.deepTransactionCheck\"))\n {\n TransactionInner inner = null;\n\n try\n {\n inner = TransactionInner.parseFrom(tx.getInnerData());\n }\n catch(java.io.IOException e)\n {\n throw new ValidationException(\"error parsing tx on second pass somehow\", e);\n }\n\n long sum_of_inputs = 0L;\n // Make sure all inputs exist\n for(TransactionInput in : inner.getInputsList())\n {\n TransactionOutput matching_out = utxo_buffer.getOutputMatching(in);\n if (matching_out == null)\n {\n throw new ValidationException(String.format(\"No matching output for input %s\", new ChainHash(in.getSrcTxId())));\n }\n validateSpendable(matching_out, block_header, params);\n sum_of_inputs += matching_out.getValue();\n\n // SIP-4 check\n if (block_header.getBlockHeight() >= params.getActivationHeightTxInValue())\n {\n if (in.getValue() != 0L)\n {\n if (in.getValue() != matching_out.getValue())\n {\n throw new ValidationException(String.format(\"Input value does not match: %d %d\", matching_out.getValue(), in.getValue()));\n }\n }\n }\n utxo_buffer.useOutput(matching_out, new ChainHash(in.getSrcTxId()), in.getSrcTxOutIdx());\n }\n\n long spent = 0L;\n // Sum up all outputs\n int out_idx =0;\n ArrayList<ByteString> raw_output_list = TransactionUtil.extractWireFormatTxOut(tx);\n\n for(TransactionOutput out : inner.getOutputsList())\n {\n validateTransactionOutput(out, block_header, params);\n spent+=out.getValue();\n utxo_buffer.addOutput(raw_output_list, out, new ChainHash(tx.getTxHash()), out_idx);\n out_idx++;\n\n }\n\n spent+=inner.getFee();\n\n if (!inner.getIsCoinbase())\n {\n if (sum_of_inputs != spent)\n {\n throw new ValidationException(String.format(\"Transaction took in %d and spent %d\", sum_of_inputs, spent));\n }\n }\n \n return inner.getFee();\n }\n }", "@Test\n public void TxHandlerTestSecond() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the double spending\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(25, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1: one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx 2:Scrooge --> Bob 20coins [*Double-spending*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx0.getHash(), 0);\n tx2.addOutput(25, pkBob.getPublic());\n tx2.signTx(pkScrooge.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n\n }", "String signITRByAssesse(String PAN,String xml, DigitalSignatureWrapper digitalSignatureWrapper) throws MissingPrivateKeyException,InvalidDigitalSignatureException,Exception;", "public boolean processTransaction() {\r\n\t\t\r\n\t\t\tif(verifySignature() == false) {\r\n\t\t\t\tSystem.out.println(\"#Transaction Signature failed to verify\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\ttransactionId = calulateHash();\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "public static boolean isSigned_receivets() {\n return true;\n }", "@Override\n public boolean isValid() {\n final BlockChainInt outputHash = getOutputHash();\n\n return inputs.stream().map(input -> input.verifySignature(outputHash)).reduce(true, (a, b) -> a && b)\n && outputs.stream().map(output -> output.getAmount() >= 0).reduce(true, (a, b) -> a && b)\n && getTransactionFee() >= 0;\n }", "@Override\n public void run() {\n byte[] deviceTxPayload = CoreServices.getOrCreateHardwareWalletService().get().getContext().getSerializedTx().toByteArray();\n\n log.info(\"DeviceTx payload:\\n{}\", Utils.HEX.encode(deviceTxPayload));\n\n // Load deviceTx\n Transaction deviceTx = new Transaction(MainNetParams.get(), deviceTxPayload);\n\n log.info(\"deviceTx:\\n{}\", deviceTx.toString());\n\n // Check the signatures are canonical\n for (TransactionInput txInput : deviceTx.getInputs()) {\n byte[] signature = txInput.getScriptSig().getChunks().get(0).data;\n if (signature != null) {\n log.debug(\n \"Is signature canonical test result '{}' for txInput '{}', signature '{}'\",\n TransactionSignature.isEncodingCanonical(signature),\n txInput.toString(),\n Utils.HEX.encode(signature));\n } else {\n log.warn(\"No signature data\");\n }\n }\n\n log.debug(\"Committing and broadcasting the last tx\");\n\n BitcoinNetworkService bitcoinNetworkService = CoreServices.getOrCreateBitcoinNetworkService();\n\n if (bitcoinNetworkService.getLastSendRequestSummaryOptional().isPresent()\n && bitcoinNetworkService.getLastWalletOptional().isPresent()) {\n\n SendRequestSummary sendRequestSummary = bitcoinNetworkService.getLastSendRequestSummaryOptional().get();\n\n // Check the unsigned and signed tx are essentially the same as a check against malware attacks on the Trezor\n if (TransactionUtils.checkEssentiallyEqual(sendRequestSummary.getSendRequest().get().tx, deviceTx)) {\n // Substitute the signed tx from the trezor\n log.debug(\n \"Substituting the Trezor signed tx '{}' for the unsigned version {}\",\n deviceTx.toString(),\n sendRequestSummary.getSendRequest().get().tx.toString()\n );\n sendRequestSummary.getSendRequest().get().tx = deviceTx;\n log.debug(\"The transaction fee was {}\", sendRequestSummary.getSendRequest().get().fee);\n\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_TRANSACTION_CREATED_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n\n // Get the last wallet\n Wallet wallet = bitcoinNetworkService.getLastWalletOptional().get();\n\n // Commit and broadcast\n bitcoinNetworkService.commitAndBroadcast(sendRequestSummary, wallet, paymentRequestData);\n\n // Ensure the header is switched off whilst the send is in progress\n ViewEvents.fireViewChangedEvent(ViewKey.HEADER, false);\n } else {\n // The signed transaction is essentially different from what was sent to it - abort send\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_FAILURE_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n }\n } else {\n log.debug(\"Cannot commit and broadcast the last send as it is not present in bitcoinNetworkService\");\n }\n // Clear the previous remembered tx\n bitcoinNetworkService.setLastSendRequestSummaryOptional(Optional.<SendRequestSummary>absent());\n bitcoinNetworkService.setLastWalletOptional(Optional.<Wallet>absent());\n }", "@Test\n public void TxHandlerTestForth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid signature\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx1: scrooge to alice 20 coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: alice to bob 20coins[signed by bob]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(20, pkBob.getPublic());\n tx2.signTx(pkBob.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n }", "@Override\n public byte[] createDataToSignInput(\n Transaction transaction,\n int inputIndex,\n long amountInSat,\n PublicKeyTriple publicKeyTriple) {\n\n final byte[] redeemScript = createRedeemScript(publicKeyTriple);\n\n return TransactionHelpers.getDataToSign(\n transaction,\n inputIndex,\n new Script(redeemScript)\n );\n }", "public TransactionResponse processAllTransaction() throws ParseException {\n TransactionResponse response = new TransactionResponse();\n\n //User0\n response.setTransaction(new Transaction(\"user0\",\"0001\", \"type0\",\"user0_Billing\",\"user0_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-00\")));\n\n //User1\n response.setTransaction(new Transaction(\"user1\", \"0101\",\"type0\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user1\", \"0102\", \"type1\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-00\")));\n\n //User2\n response.setTransaction(new Transaction(\"user2\", \"0201\", \"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-01-00\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0202\", \"type2\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0203\",\"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n //User3\n response.setTransaction(new Transaction(\"user3\", \"0301\",\"type0\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user3\", \"0302\",\"type1\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n return response;\n }", "com.dogecoin.protocols.payments.Protos.Output getOutputs(int index);", "@Test\n public void TxHandlerTestFifth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the input not in the UtxoPool\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n //tx1: Scrooge --> Alice 20coins [Pay Coins *NOT added to UTXO pool* due to accidents]\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n utxo = new UTXO(tx1.getHash(),0);\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n utxoPool.removeUTXO(utxo);\n assertTrue(\"tx1:UTXO has been removed.\", utxoPool.getAllUTXO().size() == 0);\n\n\n // tx2: Alice --> Bob 15coins [Pay Coins *Previous Tx NOT in UTXO pool*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(15, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 0);\n\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "private static void createDummyTransactions() {\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 10L, new Transaction(10000d, \"cars\", 0L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 11L, new Transaction(15000d, \"shopping\", 10L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 12L, new Transaction(20000d, \"keys\", 11L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 13L, new Transaction(25000d, \"furniture\", 12L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 14L, new Transaction(30000d, \"keys\", 13L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 15L, new Transaction(40000d, \"cars\", 14L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 16L, new Transaction(50000d, \"cars\", 15L)));\n }", "@Test\n public void TxHandlerTestFirst() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test some basic functions of TxHandler\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n // tx0: Scrooge --> Scrooge 25coins [Create Coins]\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx( pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n\n // tx1: Scrooge --> Scrooge 4coins [Divide Coins]\n //\t Scrooge --> Scrooge 5coins\n //\t Scrooge --> Scrooge 6coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(),0);\n\n tx1.addOutput(4,pkScrooge.getPublic());\n tx1.addOutput(5,pkScrooge.getPublic());\n tx1.addOutput(6,pkScrooge.getPublic());\n\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx2: Scrooge --> Alice 4coins [Pay separately]\n //\t Scrooge --> Alice 5coins\n // Scrooge --> Bob 6coins\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addInput(tx1.getHash(), 1);\n tx2.addInput(tx1.getHash(), 2);\n\n tx2.addOutput(4, pkAlice.getPublic());\n tx2.addOutput(5, pkAlice.getPublic());\n tx2.addOutput(6, pkBob.getPublic());\n\n tx2.signTx(pkScrooge.getPrivate(), 0);\n tx2.signTx(pkScrooge.getPrivate(), 1);\n tx2.signTx(pkScrooge.getPrivate(), 2);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx3:Alice --> Alice 2coins [Divide Coins]\n // Alice --> Alice 2coins\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(),0);\n\n tx3.addOutput(2, pkAlice.getPublic());\n tx3.addOutput(2, pkAlice.getPublic());\n\n tx3.signTx(pkAlice.getPrivate(),0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 4);\n\n // tx4: Alice --> Bob 2coins [Pay jointly]\n // Alice --> Bob 5coins\n Transaction tx4 = new Transaction();\n tx4.addInput(tx3.getHash(),0);\n tx4.addInput(tx2.getHash(),1);\n\n tx4.addOutput(7, pkBob.getPublic());\n\n tx4.signTx(pkAlice.getPrivate(), 0);\n tx4.signTx(pkAlice.getPrivate(),1);\n\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx4) returns: \" + txHandler.isValidTx(tx4));\n assertTrue(\"tx4:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx4}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx4:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n// System.out.println(\"tx4.hashCode returns: \" + tx4.hashCode());\n }", "public ParametricStatement[] createForPaymentTransaction(PaymentTransaction paymentTransaction)\n throws SQLException {\n int multiplier = 1;\n Date date = paymentTransaction.getProcessDate();\n if (paymentTransaction instanceof VoidTransaction) {\n VoidTransaction trans = (VoidTransaction)paymentTransaction;\n ITransaction originalTrans = trans.getOriginalTransaction();\n if (originalTrans instanceof PaymentTransaction) {\n multiplier = -1;\n paymentTransaction = (PaymentTransaction)originalTrans;\n } else {\n // Do nothing if original was not a payment transaction.\n return new ParametricStatement[0];\n }\n }\n ArrayList parametricStatements = new ArrayList();\n String storeId = paymentTransaction.getStore().getId();\n String operatorId = paymentTransaction.getTheOperator().getId();\n // String registerId = paymentTransaction.getId();\n // int registerIdIndex = registerId.indexOf('*') + 1;\n // registerId = registerId.substring(registerIdIndex, registerId.indexOf('*', registerIdIndex));\n String registerId = paymentTransaction.getRegisterId();\n PaymentSummary[] currentPaymentSummaries = this.selectByDateStoreId(date, storeId);\n List newPaymentSummaries = new ArrayList();\n Payment[] payments = paymentTransaction.getPaymentsArray();\n for (int paymentIndex = 0; paymentIndex < payments.length; paymentIndex++) {\n ArmCurrency paymentAmount = payments[paymentIndex].getAmount().multiply(multiplier);\n String paymentType = payments[paymentIndex].getTransactionPaymentName();\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n boolean found = false;\n //to find if this payment type is already in the database\n for (int summaryIndex = 0; summaryIndex < currentPaymentSummaries.length; summaryIndex++) {\n if (currentPaymentSummaries[summaryIndex].getEmployeeId().equals(operatorId)\n && currentPaymentSummaries[summaryIndex].getRegisterId().equals(registerId)\n && currentPaymentSummaries[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n currentPaymentSummaries[summaryIndex].doSetPaymentTotal(paymentAmount.add(\n currentPaymentSummaries[summaryIndex].getPaymentTotal()));\n int mediaCount = ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).\n getMediaCount();\n ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n // work-around for cloudscape date truncation problem.\n currentPaymentSummaries[summaryIndex].doSetDate(date);\n List list = fromObjectToBean(currentPaymentSummaries[summaryIndex]).toList();\n list.add(currentPaymentSummaries[summaryIndex].getId());\n parametricStatements.add(new ParametricStatement(updateSql, list));\n break;\n }\n }\n //to find if it is already in the newPaymentSummaries List\n if (!found) {\n PaymentSummary[] newPaymentSummaryArray = (PaymentSummary[])newPaymentSummaries.toArray(new\n PaymentSummary[0]);\n for (int summaryIndex = 0; summaryIndex < newPaymentSummaryArray.length; summaryIndex++) {\n if (newPaymentSummaryArray[summaryIndex].getEmployeeId().equals(operatorId)\n && newPaymentSummaryArray[summaryIndex].getRegisterId().equals(registerId)\n && newPaymentSummaryArray[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n ArmCurrency newTotal = paymentAmount.add(newPaymentSummaryArray[summaryIndex].\n getPaymentTotal());\n int mediaCount = ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).\n getMediaCount();\n newPaymentSummaryArray[summaryIndex].doSetPaymentTotal(newTotal);\n ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n }\n }\n }\n if (!found) {\n CMSPaymentSummary paymentSummary = new CMSPaymentSummary();\n paymentSummary.doSetDate(date);\n paymentSummary.doSetEmployeeId(operatorId);\n paymentSummary.doSetStoreId(storeId);\n paymentSummary.doSetRegisterId(registerId);\n paymentSummary.doSetPaymentTotal(paymentAmount);\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n paymentSummary.doSetPaymentType(paymentType);\n paymentSummary.doSetId(this.getNextChelseaId());\n paymentSummary.doSetMediaCount(paymentSummary.getMediaCount() + 1);\n newPaymentSummaries.add(paymentSummary);\n }\n }\n for (int i = 0; i < newPaymentSummaries.size(); i++) {\n PaymentSummary paymentSummary = (PaymentSummary)newPaymentSummaries.get(i);\n parametricStatements.add(new ParametricStatement(insertSql\n , fromObjectToBean(paymentSummary).toList()));\n }\n return (ParametricStatement[])parametricStatements.toArray(new ParametricStatement[\n parametricStatements.size()]);\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "@Test\n public void transactionSum() {\n final Transaction transaction1 = new Transaction(\"774cedda\", State.CANCELED, 1000L, new Date());\n final Account account1 = new Account(\"1001\", 0L, Collections.singletonList(transaction1));\n final Transaction transaction2 = new Transaction(\"337868a7\", State.FINISHED, 8000L, new Date());\n final Transaction transaction3 = new Transaction(\"f8047f86\", State.CANCELED, 10000L, new Date());\n final Account account2 = new Account(\"1002\", 8000L, Arrays.asList(transaction2, transaction3));\n\n final long actual = calcSumOfCancelledTransOnNonEmptyAccounts(Arrays.asList(account1, account2));\n\n Assert.assertEquals(actual, 10_000L);\n }", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutputs(int index);", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public abstract void generateReceipt(Transaction trans);", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "public Transaction getDummyTransaction(String action) {\n\n\t\t// Long payerAccountNum = 111l;\n\t\tLong payerRealmNum = 0l;\n\t\tLong payerShardNum = 0l;\n\t\t// Long nodeAccountNum=123l;\n\t\tLong nodeRealmNum = 0l;\n\t\tLong nodeShardNum = 0l;\n\t\tlong transactionFee = 0l;\n\t\tTimestamp startTime =\n\t\t\t\tRequestBuilder.getTimestamp(Instant.now(Clock.systemUTC()).minusSeconds(13));\n\t\tDuration transactionDuration = RequestBuilder.getDuration(100);\n\t\tboolean generateRecord = false;\n\t\tString memo = \"UnitTesting\";\n\t\tint thresholdValue = 10;\n\t\tList<Key> keyList = new ArrayList<>();\n\t\tKeyPair pair = new KeyPairGenerator().generateKeyPair();\n\t\tbyte[] pubKey = ((EdDSAPublicKey) pair.getPublic()).getAbyte();\n\t\tKey akey =\n\t\t\t\tKey.newBuilder().setEd25519(ByteString.copyFromUtf8((MiscUtils.commonsBytesToHex(pubKey)))).build();\n\t\tPrivateKey priv = pair.getPrivate();\n\t\tkeyList.add(akey);\n\t\tlong initBal = 100;\n\t\tlong sendRecordThreshold = 5;\n\t\tlong receiveRecordThreshold = 5;\n\t\tboolean receiverSign = false;\n\t\tDuration autoRenew = RequestBuilder.getDuration(100);\n\t\t;\n\t\tlong proxyAccountNum = 12345l;\n\t\tlong proxyRealmNum = 0l;\n\t\tlong proxyShardNum = 0l;\n\t\tint proxyFraction = 10;\n\t\tint maxReceiveProxyFraction = 10;\n\t\tlong shardID = 0l;\n\t\tlong realmID = 0l;\n\n\t\tTransaction trx = null;\n\t\tSignatureList sigList = SignatureList.getDefaultInstance();\n\t\tTimestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\n\t\t/**\n\t\t * SignatureList sigList = SignatureList.getDefaultInstance(); Transaction transferTx =\n\t\t * RequestBuilder.getCryptoTransferRequest( payer.getAccountNum(), payer.getRealmNum(),\n\t\t * payer.getShardNum(), nodeAccount.getAccountNum(), nodeAccount.getRealmNum(),\n\t\t * nodeAccount.getShardNum(), 800, timestamp, transactionDuration, false, \"test\", sigList,\n\t\t * payer.getAccountNum(), -100l, nodeAccount.getAccountNum(), 100l); transferTx =\n\t\t * TransactionSigner.signTransaction(transferTx, accountKeys.get(payer));\n\t\t */\n\n\t\tif (\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t\ttrx = RequestBuilder.getCryptoTransferRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 800, timestamp,\n\t\t\t\t\ttransactionDuration, false, \"test\", sigList, payerAccountId.getAccountNum(), -100l,\n\t\t\t\t\tnodeAccountId.getAccountNum(), 100l);\n\t\t\t// trx = TransactionSigner.signTransaction(trx, account2keyMap.get(payerAccountId));\n\t\t}\n\n\t\tif (\"createContract\".equalsIgnoreCase(action)) {\n\t\t\tFileID fileID = FileID.newBuilder().setFileNum(9999l).setRealmNum(1l).setShardNum(2l).build();\n\n\t\t\ttrx = RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 50000000000l, timestamp,\n\t\t\t\t\ttransactionDuration, true, \"createContract\", DEFAULT_CONTRACT_OP_GAS, fileID,\n\t\t\t\t\tByteString.EMPTY, 0, transactionDuration,\n\t\t\t\t\tSignatureList.newBuilder().addSigs(\n\t\t\t\t\t\t\tSignature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t\t\t\t\t\t.build(),\n\t\t\t\t\t\"\");\n\t\t}\n\n\t\t// if(\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t// long durationInSeconds = DAY_SEC * 30;\n\t\t// * Duration contractAutoRenew = Duration.newBuilder().setSeconds(durationInSeconds).build();\n\t\t// * Timestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\t\t// * Duration transactionDuration = RequestBuilder.getDuration(30, 0);\n\t\t// * Transaction createContractRequest =\n\t\t// RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t// * payerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t// * nodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 100l, timestamp,\n\t\t// transactionDuration, true, \"createContract\",\n\t\t// * DEFAULT_CONTRACT_OP_GAS, contractFile, ByteString.EMPTY, 0, contractAutoRenew,\n\t\t// * SignatureList.newBuilder()\n\t\t// *\n\t\t// .addSigs(Signature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t// * .build());\n\t\t// }\n\n\t\treturn trx;\n\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public static byte[] secondOutputStep(byte[] S){\n\t\tStringBuffer string = new StringBuffer();\n\t\tfor (int i = 1; i < S.length; i+=2) {\n\t\t\tstring.append(getBit(S[i],7));\n\t\t}\n\t\tbyte[] bval = new BigInteger(string.toString(), 2).toByteArray();\n\t\tif(bval.length > 16){\n\t\t\treturn Arrays.copyOfRange(bval,1,bval.length);\n\t\t}else{\n\t\t\treturn bval;\n\t\t}\n\t\t\n\t}", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "public double printOutput() {\r\n return calculateNetPay();\r\n }", "public boolean doTransaction() {\r\n int nonce = -1;\r\n TransactionOperation transactionOperation = null;\r\n try {\r\n double balance;\r\n \r\n //read the stream for requests from client\r\n byte[] cipherText = (byte [])is.readObject();\r\n \r\n // decrypt the ciphertext to obtain the signed message\r\n ATMSessionMessage atmSessionMessage = (ATMSessionMessage) crypto.decryptRijndael(cipherText, kSession);\r\n if(!(currTimeStamp < atmSessionMessage.getTimeStamp())) error (\"Time stamp does not match\");\r\n \r\n //interpret the transaction operation in the request\r\n SignedMessage signedMessage = atmSessionMessage.getSignedMessage();\r\n \r\n \r\n \t\t//verify signature\r\n \t\ttry {\r\n \t\t\tif(!crypto.verify(signedMessage.msg, signedMessage.signature, currAcct.kPub))\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"Digital signature failed...\");\r\n \t\t\t}\r\n \t\t\tSystem.out.println(\"Message signature valid...\");\r\n \t\t} catch (SignatureException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t} catch (KeyException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\t\r\n TransactionMessage transactionMessage = (TransactionMessage)signedMessage.getObject();\r\n transactionOperation = transactionMessage.getOperation();\r\n \r\n //print the signed message\r\n System.out.println(\"\\n\" + (new Date()).toString());\r\n System.out.println(signedMessage.toString());\r\n \r\n //strip out the parameters embedded \r\n nonce = atmSessionMessage.getNonce();\r\n double value = transactionMessage.getValue();\r\n \r\n //print the timestamp when the transaction takes place\r\n Date now = new Date();\r\n System.out.println(\"\\n\" + now.toString());\r\n \r\n //re-route the request to the appropriate handling function\r\n if(transactionOperation == TransactionOperation.Deposit) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" DEPOSIT: \" + value);\r\n currAcct.deposit(value);\r\n \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Deposit Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.Withdraw) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" WITHDRAW: \" + value);\r\n \t currAcct.withdraw(value);\r\n \t \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Withdrawal Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.EndSession) \r\n \t {\r\n \t \tSystem.out.println(\"\\nTerminating session with ACCT#: \" + currAcct.getNumber());\r\n \t \treturn false;\r\n \t \t\r\n \t }\r\n \r\n accts.save();\r\n //create a successful reply Success and set the balance\r\n balance = currAcct.getBalance(); \r\n transactionMessage = new TransactionMessage(MessageType.ResponseSuccess,transactionOperation,balance);\r\n atmSessionMessage = new ATMSessionMessage(transactionMessage);\r\n \r\n //set the nonce \r\n atmSessionMessage.setNonce(nonce);\r\n currTimeStamp = atmSessionMessage.getTimeStamp();\r\n //encrypt the response and send it\r\n cipherText = crypto.encryptRijndael(atmSessionMessage, kSession);\r\n os.writeObject((Serializable)cipherText);\r\n \r\n //Logging.....\r\n //get the signed message and encrypt it\r\n \r\n signedMessage.encryptMessage(this.kLog);\r\n \r\n //encrypt the action\r\n //archive the signed message for logging and non-repudiation purposes \r\n SignedAction signedAction = new SignedAction(currAcct.getNumber(), atmSessionMessage.getTimeStamp(), signedMessage);\r\n \r\n //flush out transaction record to the audit file\r\n BankServer.log.write(signedAction);\r\n \r\n\t return true;\r\n }\r\n catch(Exception e){\r\n if(e instanceof TransException) replyFailure(transactionOperation,nonce);\r\n System.out.println(\"Terminating session with ACCT#: \" + currAcct.getNumber());\r\n \t//e.printStackTrace();\r\n \r\n return true;\r\n }\r\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return transactions_.get(index);\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutput();", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_3() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Test\n\tpublic void testTransfer() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"acc2\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(02, \"acc1\", 00000, 200.00, \"\"));\n\t\ttransactions.add(2, new Transaction(02, \"acc2\", 00001, 200.00, \"\"));\n\t\ttransactions.add(3, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\t// ArrayList<Account> expected = new ArrayList();\n\t\t// expected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\t\t// expected.add(1, new Account(00001, \"acc2\", true, 1050.00, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Money Transfered\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"money not transfered\", testResult);\n\t}", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "protected void pktsOut(int n) {}", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputOrBuilder();", "public void calculatePayment() {}", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_4_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString ticketId = roc.createTickets(1, true)[0].get(\"ticketId\").getAsString();\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tuserData, ticketId);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true, ticketId);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void fixedPayerAndReceiverTest() {\n double fixedRate = 0.015;\n GeneratorAttributeIR attribute = new GeneratorAttributeIR(Period.ofYears(7));\n double notional = 1.0e8;\n ZonedDateTime date = DateUtils.getUTCDate(2013, 9, 10);\n SwapFixedIborDefinition def1 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute);\n SwapFixedIborDefinition def2 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, true);\n assertEquals(def1, def2);\n SwapFixedIborDefinition def3 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, false);\n assertFalse(def1.equals(def3));\n int nIbor = def1.getIborLeg().getNumberOfPayments();\n int nFixed = def1.getFixedLeg().getNumberOfPayments();\n assertEquals(nIbor, def3.getIborLeg().getNumberOfPayments());\n assertEquals(nFixed, def3.getFixedLeg().getNumberOfPayments());\n assertEquals(def1.getIborLeg().getIborIndex(), def3.getIborLeg().getIborIndex());\n assertEquals(def1.getIborLeg().getCalendar(), def3.getIborLeg().getCalendar());\n assertEquals(def1.getCurrency(), def3.getIborLeg().getCurrency());\n for (int i = 0; i < nIbor; ++i) {\n CouponIborDefinition ibor1 = def1.getIborLeg().getNthPayment(i);\n CouponIborDefinition ibor3 = def3.getIborLeg().getNthPayment(i);\n assertEquals(ibor1.getNotional(), -ibor3.getNotional());\n assertEquals(ibor1.getAccrualStartDate(), ibor3.getAccrualStartDate());\n assertEquals(ibor1.getAccrualEndDate(), ibor3.getAccrualEndDate());\n assertEquals(ibor1.getFixingDate(), ibor3.getFixingDate());\n assertEquals(ibor1.getPaymentDate(), ibor3.getPaymentDate());\n assertEquals(ibor1.getPaymentYearFraction(), ibor3.getPaymentYearFraction());\n }\n for (int i = 0; i < nFixed; ++i) {\n CouponFixedDefinition fixed1 = def1.getFixedLeg().getNthPayment(i);\n CouponFixedDefinition fixed3 = def3.getFixedLeg().getNthPayment(i);\n assertEquals(fixed1.getNotional(), -fixed3.getNotional());\n assertEquals(fixed1.getAccrualStartDate(), fixed3.getAccrualStartDate());\n assertEquals(fixed1.getAccrualEndDate(), fixed3.getAccrualEndDate());\n assertEquals(fixed1.getPaymentDate(), fixed3.getPaymentDate());\n assertEquals(fixed1.getPaymentYearFraction(), fixed3.getPaymentYearFraction());\n }\n }", "public static Transaction generateSendTransaction(String strPrivateKey, String creatorAddress, String receiverAddress,\n TransactionHistory transactionHistory) {\n List<Creation> creations = new ArrayList<Creation>();\n List<Input> inputs = new ArrayList<Input>();\n List<Output> outputs = new ArrayList<Output>();\n\n // Get sender address from private key\n BigInteger privateKey = Bitcoin.decodePrivateKey(strPrivateKey);\n byte[] publicKey = Bitcoin.generatePublicKey(privateKey);\n String senderAddress = Bitcoin.publicKeyToAddress(publicKey);\n\n // Variable for counting number of coupons in referred transaction outputs\n int couponsInInputs = 0;\n\n // Find previous transaction outputs to refer to\n Iterator<Transaction> transactionIterator = transactionHistory.iterator();\n while (transactionIterator.hasNext() && couponsInInputs < 1) {\n Transaction transaction = transactionIterator.next();\n Iterator<Output> outputIterator = transaction.getOutputs().iterator();\n while (outputIterator.hasNext() && couponsInInputs < 1) {\n Output output = outputIterator.next();\n if (output.getCreatorAddress().equals(creatorAddress) && output.getAddress().equals(senderAddress)\n && output.getInputId() == 0) {\n Input input = new Input(output.getOutputId());\n inputs.add(input);\n couponsInInputs += output.getAmount();\n }\n }\n }\n\n // Check if enough coupons are available\n if (couponsInInputs <= 0) {\n throw new IllegalArgumentException();\n }\n\n // Set that 1 coupon should be sent to receiver address\n Output output = new Output(creatorAddress, 1, receiverAddress);\n outputs.add(output);\n\n // Send remaining coupons in referred transaction outputs back to the user as change\n if (couponsInInputs > 1) {\n Output changeOutput = new Output(creatorAddress, couponsInInputs - 1, senderAddress);\n outputs.add(changeOutput);\n }\n\n // Create transaction, sign it and return it\n Transaction transaction = new Transaction(creations, inputs, outputs);\n transaction.signTransaction(privateKey);\n return transaction;\n\n }", "public int[] getTsumoPayment(boolean isDealer) {\r\n int[] output = new int[2];\r\n if (isDealer) {\r\n output[0] = basicPoints * 2;\r\n output[1] = 0;\r\n } else {\r\n output[0] = basicPoints * 1;\r\n output[1] = basicPoints * 2;\r\n }\r\n output[0] = (int)(100*Math.ceil(output[0]/100.0));\r\n output[1] = (int)(100*Math.ceil(output[1]/100.0));\r\n \r\n return output;\r\n }", "@Test\n\tpublic void validateSignatureBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock newBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE VALID\n\t\tassertEquals(true, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\ttransactionsSignature = new byte[64];\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID GENERATOR SIGNATURE\n\t\tnewBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), newBlock.getTimestamp(), newBlock.getGeneratingBalance(), generator, new byte[32]);\n\t\ttransactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t///CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//VALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = newBlock.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID TRANSACTION SIGNATURE\n\t\tassertEquals(true, newBlock.isSignatureValid());\t\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tpayment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(200).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK INVALID TRANSACTION SIGNATURE\n\t\tassertEquals(false, newBlock.isSignatureValid());\t\n\t}", "public double sumTransactions() {\n\t\treturn checkIfTransactionsExist(true);\n\t}", "public void printTransactions() {\n for (int i = 0; i < transactions.size(); i++) {\n\t\t\tint indeks = i+1;\n\t\t\tSystem.out.println(\"Transactions \" + indeks + \": \" + transactions.get(i).getType() + \" \" + transactions.get(i).getAmount());\n\t\t}\n }", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "@Override\r\n\tpublic byte[] countersign(final byte[] sign,\r\n final String algorithm,\r\n final CounterSignTarget targetType,\r\n final Object[] targets,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException {\r\n throw new UnsupportedOperationException(\"No es posible realizar contrafirmas de ficheros ODF\"); //$NON-NLS-1$\r\n }", "public int updatePayment2(int requestId, int amount);", "private void convertTransactionToBitStream(){\n bitTransactionList = new ArrayList<>();\n itemListMap2 = new HashMap<>();\n \n for(int i=0; i<transactions_set.size(); i++){\n ArrayList curr_tr = transactions_set.get(i);\n \n if(curr_tr.size() >= min_itemset_size_K){ \n int freqItem = 0;\n BitSet bitset = new BitSet(bitsetLen);\n \n for(int j=0; j<curr_tr.size(); j++){\n try{\n int item = (int)curr_tr.get(j);\n bitset.set(itemIndex.get(item), true);\n freqItem++;\n }\n catch(Exception e){}\n }\n if(freqItem >= min_itemset_size_K){\n bitTransactionList.add(bitset);\n// System.out.println(bitset);\n HashSet<BitSet> subset_2 = createSubsetsOfLen2(bitset);\n for(BitSet sub_b : subset_2){\n itemListMap2.put(sub_b, itemListMap2.getOrDefault(sub_b, 0)+1);\n }\n }\n }\n }\n \n itemListMap2.values().removeIf(val -> val<min_sup);\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_5_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t\t\r\n\t\t\t\tHashMap<String,Object> o2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t\t\r\n\t\t\t\to = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\to2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return instance.getTransactions(index);\n }", "protected int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws IOException {\n return serializator.write(output, mostSigBits) +\n serializator.write(output, leastSigBits);\n }", "public static void main(String[] args)\n\t{\n \n\t\tSystem.out.println(\"Enter the size of transaction array\");\n int trSize = sc.nextInt();\n\n // creating an array of provided size\n int[] transactions = new int[trSize];\n \n // get the elements of the array (in a loop)\n System.out.println(\"Enter the values of array\");\n for (int i = 0; i < transactions.length; i++) {\n transactions[i] = sc.nextInt();\n }\n // get the number of targets\n System.out.println(\"Enter the total no of targets that needs to be achieved\");\n int numTargets = sc.nextInt();\n \n // get in target one-by-one (loop)\n for (int i = 0; i < numTargets; i++) {\n \n \t// Get TargetValue\n System.out.println(\"Enter the value of target\");\n int target = sc.nextInt();\n \n int sum =0;\n for ( int j=0; j < transactions.length; j++) {\n \tsum = sum + transactions[j];\n \t\n \tif ( sum >= target) {\n \tSystem.out.println(\"Target achieved after \" + (j+1) + \" transactions\" );\n \tbreak; // break out of the innermost for loop\n \t}\n \t\n \t//we come to the last transactions, yet target is not achieved\n \tif (j == transactions.length - 1) {\n \t\tSystem.out.println( \"Given target is not achieved\");\n \t}\n \t\n }\n \n \n\t}\n\n}", "public void onOutputSpent(MoneroOutputWallet output);", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public double calculatePay() {\n\t\treturn 0;\r\n\t}", "public byte[] signNativeByTransDataDefault(UInt256 uInt256) {\n return new byte[0];\n }", "@Suspendable\n @Override\n protected void checkTransaction(SignedTransaction stx) throws FlowException {\n }", "com.google.protobuf.ByteString\n getTranCodeBytes();", "com.google.protobuf.ByteString\n getOutputBytes();", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_1() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public float getInputsValue() {\n\t\tfloat total = 0;\n\t\tfor (TransactionInput i : inputs) {\n\t\t\tif (i.getUTXO() == null)\n\t\t\t\tcontinue; // if Transaction can't be found skip it\n\t\t\ttotal += i.getUTXO().getValue();\n\t\t}\n\t\treturn total;\n\t}", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }" ]
[ "0.6157669", "0.5968836", "0.5894512", "0.575845", "0.57379013", "0.56862354", "0.5671643", "0.5638562", "0.55891097", "0.55805844", "0.5491049", "0.547115", "0.5430694", "0.535867", "0.535867", "0.535867", "0.5344417", "0.5307626", "0.5253172", "0.524015", "0.5189739", "0.51506877", "0.5134411", "0.51289254", "0.5127413", "0.50831395", "0.50639427", "0.5035688", "0.50094956", "0.49972042", "0.4990747", "0.4967469", "0.4967469", "0.4967469", "0.49642414", "0.4948274", "0.49423918", "0.49403173", "0.49305025", "0.49055907", "0.48962563", "0.48919266", "0.48815575", "0.48727128", "0.48690858", "0.48671517", "0.4864887", "0.48293087", "0.4796929", "0.47936854", "0.4792538", "0.47683463", "0.47675353", "0.47675353", "0.47675353", "0.47565505", "0.47514316", "0.47473222", "0.47313264", "0.47313264", "0.4730076", "0.47218332", "0.47160283", "0.47159252", "0.47158366", "0.4699172", "0.46933794", "0.46929714", "0.4690595", "0.4686018", "0.4673744", "0.4672201", "0.46678242", "0.46676886", "0.4667487", "0.46660423", "0.46638095", "0.46557528", "0.46553993", "0.46553993", "0.46553993", "0.46531892", "0.46475676", "0.46449953", "0.4624059", "0.46231604", "0.46201655", "0.46124235", "0.46085235", "0.46082187", "0.46068537", "0.46033576", "0.4602587", "0.45972705", "0.45952573", "0.4587196", "0.4582048", "0.4580939", "0.45772147", "0.45763913", "0.4568933" ]
0.0
-1
Signed transactions that satisfy PaymentDetails.outputs repeated bytes transactions = 2;
private void addTransactions(com.google.protobuf.ByteString value) { java.lang.Class<?> valueClass = value.getClass(); ensureTransactionsIsMutable(); transactions_.add(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testValidOutputValues() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, -20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(-20, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testNoDoubleSpending() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Alice wants double spending: transfers 10 coins to Bob, 20 to Cal again\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1: input 0\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n\n // Sign for tx1: input 1\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(1).addSignature(sig2);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testHandleTxs() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // Cal transfers 5 coins to Bob, Bob transfers 2 coins to Alice\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0); // index 0 refers to output 1 of tx1\n tx2.addInput(tx1.getHash(), 1); // index 1 refers to output 1 of tx1\n tx2.addOutput(2, kpAlice.getPublic());\n tx2.addOutput(5, kpBob.getPublic());\n\n // Sign for tx2\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx2.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(0).addSignature(sig2);\n\n byte[] sig3 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpCal.getPrivate());\n sig.update(tx2.getRawDataToSign(1));\n sig3 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(1).addSignature(sig3);\n tx2.finalize();\n\n // Alice transfers 3 coins to Cal\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(), 0);\n tx3.addOutput(3, kpCal.getPublic());\n\n // Sign for tx3\n byte[] sig4 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx3.getRawDataToSign(0));\n sig4 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx3.getInput(0).addSignature(sig4);\n tx3.finalize();\n\n Transaction[] acceptedTx = txHandler.handleTxs(new Transaction[] {tx1, tx2, tx3});\n // tx1, tx2 supposed to be valid, tx3 supposed to be invalid\n assertEquals(acceptedTx.length, 2);\n // assertFalse(txHandler.isValidTx(tx3));\n }", "public boolean processTransaction() {\n\n // Checks to see if the signature can be verified.\n if (verifySignature() == false) {\n System.out.println(\"# Transaction signature could not be verified.\");\n return false;\n }\n\n // Gathers all transaction inputs, making sure they are unspent.\n for (TransactionInput i : inputs) {\n i.UTXO = BasicBlockchain.UTXOs.get(i.transactionOutputId);\n }\n\n // Checks if transaction amount is valid.\n if (getInputsValue() < BasicBlockchain.minimumTransaction) {\n System.out.println(\"# Transaction inputs are too small.\");\n return false;\n }\n\n // Generates transaction outputs.\n // Get value of the inputs then the leftover change.\n float leftOver = getInputsValue() - value;\n transactionId = calculateHash();\n // Send value to recipient.\n outputs.add(new TransactionOutput(this.recipient, value, transactionId));\n // Send the leftover \"change\" back to sender.\n outputs.add(new TransactionOutput(this.sender, leftOver, transactionId));\n\n\n // Adds outputs to the unspent list.\n for (TransactionOutput o : outputs) {\n BasicBlockchain.UTXOs.put(o.id, o);\n }\n\n // Removes the transaction inputs from the blockchain's UTXO list as spent.\n for (TransactionInput i : inputs) {\n if (i.UTXO == null) continue;\n BasicBlockchain.UTXOs.remove(i.UTXO.id);\n }\n\n return true;\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutput();", "public static void main(String[] args) throws AddressFormatException {\n\n// generateMultisig();\n String getSignedTransaction = signFirstTime();\n String rawtx = signSecondTime(getSignedTransaction);\n\n System.out.println(\"rawtx ->\"+ rawtx);\n }", "private static String signFirstTime() throws AddressFormatException\n {\n ECKey key1 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n\n\n // Use the redeem script we have saved somewhere to start building the transaction\n Script redeemScript = new Script(hexStringToByteArray(\"5221021ae8964b8529dc3e52955f2cabd967e08c52008dbcca8e054143b668f3998f4a210306be609ef37366ab0f3dd4096ac23a6ee4d561fc469fa60003f799b0121ad1072102199f3d89fa00e6f55dd6ecdd911457d7264415914957db124d53bf0064963f3853ae\"));\n\n // Start building the transaction by adding the unspent inputs we want to use\n // The data is taken from blockchain.info, and can be found here: https://blockchain.info/rawtx/ca1884b8f2e0ba88249a86ec5ddca04f937f12d4fac299af41a9b51643302077\n Transaction spendTx = new Transaction(params);\n ScriptBuilder scriptBuilder = new ScriptBuilder();\n scriptBuilder.data(new String(\"a9145204ad7c5fa5a2491cd91c332e28c87221194ca087\").getBytes()); // Script of this output\n TransactionInput input = spendTx.addInput(new Sha256Hash(\"fed695bf5e2c15286956a7bd3464c5beb97ef064e1f9406eba189ea844733e7c\"), 1, scriptBuilder.build());\n\n // Add outputs to the person receiving bitcoins\n Address receiverAddress = new Address(params, \"n2cWhs5sbWFCwzuuWWsVM9ubPwykGtX75T\");\n Coin charge = Coin.valueOf(1000000); // 0.1 mBTC\n Script outputScript = ScriptBuilder.createOutputScript(receiverAddress);\n spendTx.addOutput(charge, outputScript);\n\n /*8888888888888888888888888888888888888888888888888888888888888*/\n\n // Sign the first part of the transaction using private key #1\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature ecdsaSignature = key1.sign(sighash);\n TransactionSignature transactionSignarture = new TransactionSignature(ecdsaSignature, Transaction.SigHash.ALL, false);\n\n // Create p2sh multisig input script\n Script inputScript = ScriptBuilder.createP2SHMultiSigInputScript(Arrays.asList(transactionSignarture), redeemScript);\n\n // Add the script signature to the input\n input.setScriptSig(inputScript);\n System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "private ArrayList<Long> storeTransactionInputs(long transactionId, ArrayList<TransactionInput> inputs, int isCoinbase){\n \t\tint inputindex = 0;\n \t\tlong previousOutputId;\n \t\tString prevOutputHash;\n \t\tResultSet findOutputResults;\n \t\tResultSet generatedKey;\n \t\tLong addressId;\n \t\tArrayList<Long> addressIdz=new ArrayList<Long>();\n \t\ttry {\n \t\tfor (TransactionInput i : inputs) {\n\t\t\t\n \t\t\tprevOutputHash = HexBin.encode(i.outpoint.hash);\n \t\t\tfindTransactionOutputStatement.setString(1, prevOutputHash);\n \t\t\tfindTransactionOutputStatement.setLong(2, i.outpoint.index);\n \t\t\tfindOutputResults = findTransactionOutputStatement\n \t\t\t\t\t.executeQuery();\n \t\t\tif (findOutputResults.next()) {\n \t\t\t\tpreviousOutputId = findOutputResults.getLong(1);\n\t\t\t\taddressId=findOutputResults.getLong(2);\n \t\t\t} else {\n \t\t\t\tpreviousOutputId = 0;\n\t\t\t\taddressId=null;\n \t\t\t}\n \t\t\tfindOutputResults.close();\n \t\t\tinsertTransactionInputStatement.setLong(1, transactionId);\n \t\t\tinsertTransactionInputStatement.setInt(2, inputindex);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(3, previousOutputId);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setString(4, prevOutputHash);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(5, i.outpoint.index);\n \t\t\tinsertTransactionInputStatement.setLong(6,\n \t\t\t\t\ti.scriptBytes.length);\n \t\t\tinsertTransactionInputStatement.setString(7,\n \t\t\t\t\tHexBin.encode(i.scriptBytes));\n \t\t\tinsertTransactionInputStatement.setLong(8, i.sequence);\n \t\t\tinsertTransactionInputStatement.setBoolean(9,\n \t\t\t\t\ti.isCoinBase());\n\t\t\tif(addressId!=null){\n \t\t\t\tinsertTransactionInputStatement.setLong(10,addressId);\n \t\t\t\taddressIdz.add(addressId);\n\t\t\t} else {\n \t\t\t\t// TODO Auto-generated catch block\n \t\t\t\tinsertTransactionInputStatement.setNull(10,\n \t\t\t\t\t\tjava.sql.Types.INTEGER);\n \t\t\t}\n \t\t\tinsertTransactionInputStatement.execute();\n \t\t\t\n \t\t}\n \t\t\n \t\t\n \t} catch (SQLException e1) {\n \t\t// TODO Auto-generated catch block\n \t\te1.printStackTrace();\n \t}\n \t\treturn addressIdz;\n \t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputOrBuilder();", "List<TransactionVO> addPendingTransactions(List<SignedTransaction> transactions);", "@Test\n public void TxHandlerTestThird() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid output number(wrong number of coins to transfer)\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1 scrooge to alice 20coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: Alice --> Bob -5coins [*Invalid output number*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(-5, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n // tx3: Alice --> Bob 90coins [*Invalid output number*]\n Transaction tx3 = new Transaction();\n tx3.addInput(tx1.getHash(), 0);\n tx3.addOutput(90, pkBob.getPublic());\n tx3.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n }", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "private static String signSecondTime(String transactionString)\n {\n Transaction spendTx = new Transaction(params, hexStringToByteArray(transactionString));\n\n // Get the input chunks\n Script inputScript = spendTx.getInput(0).getScriptSig();\n List<ScriptChunk> scriptChunks = inputScript.getChunks();\n\n // Create a list of all signatures. Start by extracting the existing ones from the list of script schunks.\n // The last signature in the script chunk list is the redeemScript\n List<TransactionSignature> signatureList = new ArrayList<TransactionSignature>();\n Iterator<ScriptChunk> iterator = scriptChunks.iterator();\n Script redeemScript = null;\n\n while (iterator.hasNext())\n {\n ScriptChunk chunk = iterator.next();\n\n if (iterator.hasNext() && chunk.opcode != 0)\n {\n TransactionSignature transactionSignarture = TransactionSignature.decodeFromBitcoin(chunk.data, false);\n signatureList.add(transactionSignarture);\n } else\n {\n redeemScript = new Script(chunk.data);\n }\n }\n\n // Create the sighash using the redeem script\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature secondSignature;\n\n // Take out the key and sign the signhash\n //ECKey key2 = createKeyFromSha256Passphrase(\"Super secret key 2\");\n ECKey key2 = ECKey.fromPrivate(new BigInteger(\"68123968917867656952640885027449260190826636504009580537802764798766700329220\"));\n// ECKey key2 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n secondSignature = key2.sign(sighash);\n\n // Add the second signature to the signature list\n TransactionSignature transactionSignarture = new TransactionSignature(secondSignature, Transaction.SigHash.ALL, false);\n signatureList.add(transactionSignarture);\n\n // Rebuild p2sh multisig input script\n inputScript = ScriptBuilder.createP2SHMultiSigInputScript(signatureList, redeemScript);\n spendTx.getInput(0).setScriptSig(inputScript);\n\n //System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "@Test\n public void testOutputsInUTXOPool() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is NOT put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // UTXO pool does not contains the UTXO\n assertFalse(txHandler.isValidTx(tx1));\n\n // Put output of createCoinTx to the pool\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler1 = new TxHandler(utxoPool);\n\n // UTXO pool now contains the UTXO\n assertTrue(txHandler1.isValidTx(tx1));\n }", "@Test\n public void testValidBalance() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 100 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(100, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "RequestResult postSignRequests(TriphaseRequest[] requests) throws IOException,\n CertificateEncodingException, SAXException;", "public IBankTransfert payment();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static boolean isSigned_entries_receiveEst() {\n return false;\n }", "com.google.protobuf.ByteString getTransactions(int index);", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "@Suspendable\n @Override\n public SignedTransaction call() throws FlowException {\n\n Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);\n//\n\n // Source\n AccountInfo issuerOwner = subFlow(new AccountInfoByName(acctNameSource)).get(0).getState().getData();\n PublicKey issuerOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty issuerOwnerAnonParty = new AnonymousParty(issuerOwnerKey);\n\n AccountInfo targetOwner = subFlow(new AccountInfoByName(acctNameTarget)).get(0).getState().getData();\n PublicKey targetOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty targetOwnerAnonParty = new AnonymousParty(targetOwnerKey);\n\n\n AssetForAccountState outputAsset = new AssetForAccountState(issuerOwnerAnonParty, targetOwnerAnonParty,\n asset.getState().getData().getName(), asset.getState().getData().getValue());\n\n\n TransactionBuilder txBuilder = new TransactionBuilder(notary)\n .addInputState(asset)\n .addOutputState(outputAsset, AssetForAccountContract.ID)\n .addCommand(new AssetForAccountContract.Commands.Transfer(), issuerOwnerKey);\n\n txBuilder.verify(getServiceHub());\n\n SignedTransaction fullySignedTransaction = getServiceHub().signInitialTransaction(txBuilder, issuerOwnerKey);\n\n //return fullySignedTransaction;\n return subFlow(new FinalityFlow(fullySignedTransaction, Collections.emptyList()));\n }", "private boolean areOutputsSpent(Transaction tx){\n // Need to see if tx inputs are contained in the blockchain UTXOs\n for(TransactionInput i : tx.inputs){\n if(!currentBlockchain.UTXOs.containsKey(i.previousOutId)){\n return true;\n }\n }\n return false;\n }", "BigInteger getDigitalSignature();", "public static long deepTransactionCheck(Transaction tx, UtxoUpdateBuffer utxo_buffer, BlockHeader block_header, NetworkParams params)\n throws ValidationException\n {\n try(TimeRecordAuto tra_blk = TimeRecord.openAuto(\"Validation.deepTransactionCheck\"))\n {\n TransactionInner inner = null;\n\n try\n {\n inner = TransactionInner.parseFrom(tx.getInnerData());\n }\n catch(java.io.IOException e)\n {\n throw new ValidationException(\"error parsing tx on second pass somehow\", e);\n }\n\n long sum_of_inputs = 0L;\n // Make sure all inputs exist\n for(TransactionInput in : inner.getInputsList())\n {\n TransactionOutput matching_out = utxo_buffer.getOutputMatching(in);\n if (matching_out == null)\n {\n throw new ValidationException(String.format(\"No matching output for input %s\", new ChainHash(in.getSrcTxId())));\n }\n validateSpendable(matching_out, block_header, params);\n sum_of_inputs += matching_out.getValue();\n\n // SIP-4 check\n if (block_header.getBlockHeight() >= params.getActivationHeightTxInValue())\n {\n if (in.getValue() != 0L)\n {\n if (in.getValue() != matching_out.getValue())\n {\n throw new ValidationException(String.format(\"Input value does not match: %d %d\", matching_out.getValue(), in.getValue()));\n }\n }\n }\n utxo_buffer.useOutput(matching_out, new ChainHash(in.getSrcTxId()), in.getSrcTxOutIdx());\n }\n\n long spent = 0L;\n // Sum up all outputs\n int out_idx =0;\n ArrayList<ByteString> raw_output_list = TransactionUtil.extractWireFormatTxOut(tx);\n\n for(TransactionOutput out : inner.getOutputsList())\n {\n validateTransactionOutput(out, block_header, params);\n spent+=out.getValue();\n utxo_buffer.addOutput(raw_output_list, out, new ChainHash(tx.getTxHash()), out_idx);\n out_idx++;\n\n }\n\n spent+=inner.getFee();\n\n if (!inner.getIsCoinbase())\n {\n if (sum_of_inputs != spent)\n {\n throw new ValidationException(String.format(\"Transaction took in %d and spent %d\", sum_of_inputs, spent));\n }\n }\n \n return inner.getFee();\n }\n }", "@Test\n public void TxHandlerTestSecond() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the double spending\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(25, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1: one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx 2:Scrooge --> Bob 20coins [*Double-spending*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx0.getHash(), 0);\n tx2.addOutput(25, pkBob.getPublic());\n tx2.signTx(pkScrooge.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n\n }", "String signITRByAssesse(String PAN,String xml, DigitalSignatureWrapper digitalSignatureWrapper) throws MissingPrivateKeyException,InvalidDigitalSignatureException,Exception;", "public boolean processTransaction() {\r\n\t\t\r\n\t\t\tif(verifySignature() == false) {\r\n\t\t\t\tSystem.out.println(\"#Transaction Signature failed to verify\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\ttransactionId = calulateHash();\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "public static boolean isSigned_receivets() {\n return true;\n }", "@Override\n public boolean isValid() {\n final BlockChainInt outputHash = getOutputHash();\n\n return inputs.stream().map(input -> input.verifySignature(outputHash)).reduce(true, (a, b) -> a && b)\n && outputs.stream().map(output -> output.getAmount() >= 0).reduce(true, (a, b) -> a && b)\n && getTransactionFee() >= 0;\n }", "@Override\n public void run() {\n byte[] deviceTxPayload = CoreServices.getOrCreateHardwareWalletService().get().getContext().getSerializedTx().toByteArray();\n\n log.info(\"DeviceTx payload:\\n{}\", Utils.HEX.encode(deviceTxPayload));\n\n // Load deviceTx\n Transaction deviceTx = new Transaction(MainNetParams.get(), deviceTxPayload);\n\n log.info(\"deviceTx:\\n{}\", deviceTx.toString());\n\n // Check the signatures are canonical\n for (TransactionInput txInput : deviceTx.getInputs()) {\n byte[] signature = txInput.getScriptSig().getChunks().get(0).data;\n if (signature != null) {\n log.debug(\n \"Is signature canonical test result '{}' for txInput '{}', signature '{}'\",\n TransactionSignature.isEncodingCanonical(signature),\n txInput.toString(),\n Utils.HEX.encode(signature));\n } else {\n log.warn(\"No signature data\");\n }\n }\n\n log.debug(\"Committing and broadcasting the last tx\");\n\n BitcoinNetworkService bitcoinNetworkService = CoreServices.getOrCreateBitcoinNetworkService();\n\n if (bitcoinNetworkService.getLastSendRequestSummaryOptional().isPresent()\n && bitcoinNetworkService.getLastWalletOptional().isPresent()) {\n\n SendRequestSummary sendRequestSummary = bitcoinNetworkService.getLastSendRequestSummaryOptional().get();\n\n // Check the unsigned and signed tx are essentially the same as a check against malware attacks on the Trezor\n if (TransactionUtils.checkEssentiallyEqual(sendRequestSummary.getSendRequest().get().tx, deviceTx)) {\n // Substitute the signed tx from the trezor\n log.debug(\n \"Substituting the Trezor signed tx '{}' for the unsigned version {}\",\n deviceTx.toString(),\n sendRequestSummary.getSendRequest().get().tx.toString()\n );\n sendRequestSummary.getSendRequest().get().tx = deviceTx;\n log.debug(\"The transaction fee was {}\", sendRequestSummary.getSendRequest().get().fee);\n\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_TRANSACTION_CREATED_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n\n // Get the last wallet\n Wallet wallet = bitcoinNetworkService.getLastWalletOptional().get();\n\n // Commit and broadcast\n bitcoinNetworkService.commitAndBroadcast(sendRequestSummary, wallet, paymentRequestData);\n\n // Ensure the header is switched off whilst the send is in progress\n ViewEvents.fireViewChangedEvent(ViewKey.HEADER, false);\n } else {\n // The signed transaction is essentially different from what was sent to it - abort send\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_FAILURE_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n }\n } else {\n log.debug(\"Cannot commit and broadcast the last send as it is not present in bitcoinNetworkService\");\n }\n // Clear the previous remembered tx\n bitcoinNetworkService.setLastSendRequestSummaryOptional(Optional.<SendRequestSummary>absent());\n bitcoinNetworkService.setLastWalletOptional(Optional.<Wallet>absent());\n }", "@Test\n public void TxHandlerTestForth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid signature\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx1: scrooge to alice 20 coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: alice to bob 20coins[signed by bob]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(20, pkBob.getPublic());\n tx2.signTx(pkBob.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n }", "@Override\n public byte[] createDataToSignInput(\n Transaction transaction,\n int inputIndex,\n long amountInSat,\n PublicKeyTriple publicKeyTriple) {\n\n final byte[] redeemScript = createRedeemScript(publicKeyTriple);\n\n return TransactionHelpers.getDataToSign(\n transaction,\n inputIndex,\n new Script(redeemScript)\n );\n }", "public TransactionResponse processAllTransaction() throws ParseException {\n TransactionResponse response = new TransactionResponse();\n\n //User0\n response.setTransaction(new Transaction(\"user0\",\"0001\", \"type0\",\"user0_Billing\",\"user0_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-00\")));\n\n //User1\n response.setTransaction(new Transaction(\"user1\", \"0101\",\"type0\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user1\", \"0102\", \"type1\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-00\")));\n\n //User2\n response.setTransaction(new Transaction(\"user2\", \"0201\", \"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-01-00\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0202\", \"type2\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0203\",\"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n //User3\n response.setTransaction(new Transaction(\"user3\", \"0301\",\"type0\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user3\", \"0302\",\"type1\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n return response;\n }", "com.dogecoin.protocols.payments.Protos.Output getOutputs(int index);", "@Test\n public void TxHandlerTestFifth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the input not in the UtxoPool\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n //tx1: Scrooge --> Alice 20coins [Pay Coins *NOT added to UTXO pool* due to accidents]\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n utxo = new UTXO(tx1.getHash(),0);\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n utxoPool.removeUTXO(utxo);\n assertTrue(\"tx1:UTXO has been removed.\", utxoPool.getAllUTXO().size() == 0);\n\n\n // tx2: Alice --> Bob 15coins [Pay Coins *Previous Tx NOT in UTXO pool*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(15, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 0);\n\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "private static void createDummyTransactions() {\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 10L, new Transaction(10000d, \"cars\", 0L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 11L, new Transaction(15000d, \"shopping\", 10L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 12L, new Transaction(20000d, \"keys\", 11L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 13L, new Transaction(25000d, \"furniture\", 12L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 14L, new Transaction(30000d, \"keys\", 13L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 15L, new Transaction(40000d, \"cars\", 14L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 16L, new Transaction(50000d, \"cars\", 15L)));\n }", "@Test\n public void TxHandlerTestFirst() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test some basic functions of TxHandler\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n // tx0: Scrooge --> Scrooge 25coins [Create Coins]\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx( pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n\n // tx1: Scrooge --> Scrooge 4coins [Divide Coins]\n //\t Scrooge --> Scrooge 5coins\n //\t Scrooge --> Scrooge 6coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(),0);\n\n tx1.addOutput(4,pkScrooge.getPublic());\n tx1.addOutput(5,pkScrooge.getPublic());\n tx1.addOutput(6,pkScrooge.getPublic());\n\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx2: Scrooge --> Alice 4coins [Pay separately]\n //\t Scrooge --> Alice 5coins\n // Scrooge --> Bob 6coins\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addInput(tx1.getHash(), 1);\n tx2.addInput(tx1.getHash(), 2);\n\n tx2.addOutput(4, pkAlice.getPublic());\n tx2.addOutput(5, pkAlice.getPublic());\n tx2.addOutput(6, pkBob.getPublic());\n\n tx2.signTx(pkScrooge.getPrivate(), 0);\n tx2.signTx(pkScrooge.getPrivate(), 1);\n tx2.signTx(pkScrooge.getPrivate(), 2);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx3:Alice --> Alice 2coins [Divide Coins]\n // Alice --> Alice 2coins\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(),0);\n\n tx3.addOutput(2, pkAlice.getPublic());\n tx3.addOutput(2, pkAlice.getPublic());\n\n tx3.signTx(pkAlice.getPrivate(),0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 4);\n\n // tx4: Alice --> Bob 2coins [Pay jointly]\n // Alice --> Bob 5coins\n Transaction tx4 = new Transaction();\n tx4.addInput(tx3.getHash(),0);\n tx4.addInput(tx2.getHash(),1);\n\n tx4.addOutput(7, pkBob.getPublic());\n\n tx4.signTx(pkAlice.getPrivate(), 0);\n tx4.signTx(pkAlice.getPrivate(),1);\n\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx4) returns: \" + txHandler.isValidTx(tx4));\n assertTrue(\"tx4:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx4}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx4:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n// System.out.println(\"tx4.hashCode returns: \" + tx4.hashCode());\n }", "public ParametricStatement[] createForPaymentTransaction(PaymentTransaction paymentTransaction)\n throws SQLException {\n int multiplier = 1;\n Date date = paymentTransaction.getProcessDate();\n if (paymentTransaction instanceof VoidTransaction) {\n VoidTransaction trans = (VoidTransaction)paymentTransaction;\n ITransaction originalTrans = trans.getOriginalTransaction();\n if (originalTrans instanceof PaymentTransaction) {\n multiplier = -1;\n paymentTransaction = (PaymentTransaction)originalTrans;\n } else {\n // Do nothing if original was not a payment transaction.\n return new ParametricStatement[0];\n }\n }\n ArrayList parametricStatements = new ArrayList();\n String storeId = paymentTransaction.getStore().getId();\n String operatorId = paymentTransaction.getTheOperator().getId();\n // String registerId = paymentTransaction.getId();\n // int registerIdIndex = registerId.indexOf('*') + 1;\n // registerId = registerId.substring(registerIdIndex, registerId.indexOf('*', registerIdIndex));\n String registerId = paymentTransaction.getRegisterId();\n PaymentSummary[] currentPaymentSummaries = this.selectByDateStoreId(date, storeId);\n List newPaymentSummaries = new ArrayList();\n Payment[] payments = paymentTransaction.getPaymentsArray();\n for (int paymentIndex = 0; paymentIndex < payments.length; paymentIndex++) {\n ArmCurrency paymentAmount = payments[paymentIndex].getAmount().multiply(multiplier);\n String paymentType = payments[paymentIndex].getTransactionPaymentName();\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n boolean found = false;\n //to find if this payment type is already in the database\n for (int summaryIndex = 0; summaryIndex < currentPaymentSummaries.length; summaryIndex++) {\n if (currentPaymentSummaries[summaryIndex].getEmployeeId().equals(operatorId)\n && currentPaymentSummaries[summaryIndex].getRegisterId().equals(registerId)\n && currentPaymentSummaries[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n currentPaymentSummaries[summaryIndex].doSetPaymentTotal(paymentAmount.add(\n currentPaymentSummaries[summaryIndex].getPaymentTotal()));\n int mediaCount = ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).\n getMediaCount();\n ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n // work-around for cloudscape date truncation problem.\n currentPaymentSummaries[summaryIndex].doSetDate(date);\n List list = fromObjectToBean(currentPaymentSummaries[summaryIndex]).toList();\n list.add(currentPaymentSummaries[summaryIndex].getId());\n parametricStatements.add(new ParametricStatement(updateSql, list));\n break;\n }\n }\n //to find if it is already in the newPaymentSummaries List\n if (!found) {\n PaymentSummary[] newPaymentSummaryArray = (PaymentSummary[])newPaymentSummaries.toArray(new\n PaymentSummary[0]);\n for (int summaryIndex = 0; summaryIndex < newPaymentSummaryArray.length; summaryIndex++) {\n if (newPaymentSummaryArray[summaryIndex].getEmployeeId().equals(operatorId)\n && newPaymentSummaryArray[summaryIndex].getRegisterId().equals(registerId)\n && newPaymentSummaryArray[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n ArmCurrency newTotal = paymentAmount.add(newPaymentSummaryArray[summaryIndex].\n getPaymentTotal());\n int mediaCount = ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).\n getMediaCount();\n newPaymentSummaryArray[summaryIndex].doSetPaymentTotal(newTotal);\n ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n }\n }\n }\n if (!found) {\n CMSPaymentSummary paymentSummary = new CMSPaymentSummary();\n paymentSummary.doSetDate(date);\n paymentSummary.doSetEmployeeId(operatorId);\n paymentSummary.doSetStoreId(storeId);\n paymentSummary.doSetRegisterId(registerId);\n paymentSummary.doSetPaymentTotal(paymentAmount);\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n paymentSummary.doSetPaymentType(paymentType);\n paymentSummary.doSetId(this.getNextChelseaId());\n paymentSummary.doSetMediaCount(paymentSummary.getMediaCount() + 1);\n newPaymentSummaries.add(paymentSummary);\n }\n }\n for (int i = 0; i < newPaymentSummaries.size(); i++) {\n PaymentSummary paymentSummary = (PaymentSummary)newPaymentSummaries.get(i);\n parametricStatements.add(new ParametricStatement(insertSql\n , fromObjectToBean(paymentSummary).toList()));\n }\n return (ParametricStatement[])parametricStatements.toArray(new ParametricStatement[\n parametricStatements.size()]);\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "@Test\n public void transactionSum() {\n final Transaction transaction1 = new Transaction(\"774cedda\", State.CANCELED, 1000L, new Date());\n final Account account1 = new Account(\"1001\", 0L, Collections.singletonList(transaction1));\n final Transaction transaction2 = new Transaction(\"337868a7\", State.FINISHED, 8000L, new Date());\n final Transaction transaction3 = new Transaction(\"f8047f86\", State.CANCELED, 10000L, new Date());\n final Account account2 = new Account(\"1002\", 8000L, Arrays.asList(transaction2, transaction3));\n\n final long actual = calcSumOfCancelledTransOnNonEmptyAccounts(Arrays.asList(account1, account2));\n\n Assert.assertEquals(actual, 10_000L);\n }", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutputs(int index);", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "public abstract void generateReceipt(Transaction trans);", "public Transaction getDummyTransaction(String action) {\n\n\t\t// Long payerAccountNum = 111l;\n\t\tLong payerRealmNum = 0l;\n\t\tLong payerShardNum = 0l;\n\t\t// Long nodeAccountNum=123l;\n\t\tLong nodeRealmNum = 0l;\n\t\tLong nodeShardNum = 0l;\n\t\tlong transactionFee = 0l;\n\t\tTimestamp startTime =\n\t\t\t\tRequestBuilder.getTimestamp(Instant.now(Clock.systemUTC()).minusSeconds(13));\n\t\tDuration transactionDuration = RequestBuilder.getDuration(100);\n\t\tboolean generateRecord = false;\n\t\tString memo = \"UnitTesting\";\n\t\tint thresholdValue = 10;\n\t\tList<Key> keyList = new ArrayList<>();\n\t\tKeyPair pair = new KeyPairGenerator().generateKeyPair();\n\t\tbyte[] pubKey = ((EdDSAPublicKey) pair.getPublic()).getAbyte();\n\t\tKey akey =\n\t\t\t\tKey.newBuilder().setEd25519(ByteString.copyFromUtf8((MiscUtils.commonsBytesToHex(pubKey)))).build();\n\t\tPrivateKey priv = pair.getPrivate();\n\t\tkeyList.add(akey);\n\t\tlong initBal = 100;\n\t\tlong sendRecordThreshold = 5;\n\t\tlong receiveRecordThreshold = 5;\n\t\tboolean receiverSign = false;\n\t\tDuration autoRenew = RequestBuilder.getDuration(100);\n\t\t;\n\t\tlong proxyAccountNum = 12345l;\n\t\tlong proxyRealmNum = 0l;\n\t\tlong proxyShardNum = 0l;\n\t\tint proxyFraction = 10;\n\t\tint maxReceiveProxyFraction = 10;\n\t\tlong shardID = 0l;\n\t\tlong realmID = 0l;\n\n\t\tTransaction trx = null;\n\t\tSignatureList sigList = SignatureList.getDefaultInstance();\n\t\tTimestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\n\t\t/**\n\t\t * SignatureList sigList = SignatureList.getDefaultInstance(); Transaction transferTx =\n\t\t * RequestBuilder.getCryptoTransferRequest( payer.getAccountNum(), payer.getRealmNum(),\n\t\t * payer.getShardNum(), nodeAccount.getAccountNum(), nodeAccount.getRealmNum(),\n\t\t * nodeAccount.getShardNum(), 800, timestamp, transactionDuration, false, \"test\", sigList,\n\t\t * payer.getAccountNum(), -100l, nodeAccount.getAccountNum(), 100l); transferTx =\n\t\t * TransactionSigner.signTransaction(transferTx, accountKeys.get(payer));\n\t\t */\n\n\t\tif (\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t\ttrx = RequestBuilder.getCryptoTransferRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 800, timestamp,\n\t\t\t\t\ttransactionDuration, false, \"test\", sigList, payerAccountId.getAccountNum(), -100l,\n\t\t\t\t\tnodeAccountId.getAccountNum(), 100l);\n\t\t\t// trx = TransactionSigner.signTransaction(trx, account2keyMap.get(payerAccountId));\n\t\t}\n\n\t\tif (\"createContract\".equalsIgnoreCase(action)) {\n\t\t\tFileID fileID = FileID.newBuilder().setFileNum(9999l).setRealmNum(1l).setShardNum(2l).build();\n\n\t\t\ttrx = RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 50000000000l, timestamp,\n\t\t\t\t\ttransactionDuration, true, \"createContract\", DEFAULT_CONTRACT_OP_GAS, fileID,\n\t\t\t\t\tByteString.EMPTY, 0, transactionDuration,\n\t\t\t\t\tSignatureList.newBuilder().addSigs(\n\t\t\t\t\t\t\tSignature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t\t\t\t\t\t.build(),\n\t\t\t\t\t\"\");\n\t\t}\n\n\t\t// if(\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t// long durationInSeconds = DAY_SEC * 30;\n\t\t// * Duration contractAutoRenew = Duration.newBuilder().setSeconds(durationInSeconds).build();\n\t\t// * Timestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\t\t// * Duration transactionDuration = RequestBuilder.getDuration(30, 0);\n\t\t// * Transaction createContractRequest =\n\t\t// RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t// * payerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t// * nodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 100l, timestamp,\n\t\t// transactionDuration, true, \"createContract\",\n\t\t// * DEFAULT_CONTRACT_OP_GAS, contractFile, ByteString.EMPTY, 0, contractAutoRenew,\n\t\t// * SignatureList.newBuilder()\n\t\t// *\n\t\t// .addSigs(Signature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t// * .build());\n\t\t// }\n\n\t\treturn trx;\n\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public static byte[] secondOutputStep(byte[] S){\n\t\tStringBuffer string = new StringBuffer();\n\t\tfor (int i = 1; i < S.length; i+=2) {\n\t\t\tstring.append(getBit(S[i],7));\n\t\t}\n\t\tbyte[] bval = new BigInteger(string.toString(), 2).toByteArray();\n\t\tif(bval.length > 16){\n\t\t\treturn Arrays.copyOfRange(bval,1,bval.length);\n\t\t}else{\n\t\t\treturn bval;\n\t\t}\n\t\t\n\t}", "public double printOutput() {\r\n return calculateNetPay();\r\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "public boolean doTransaction() {\r\n int nonce = -1;\r\n TransactionOperation transactionOperation = null;\r\n try {\r\n double balance;\r\n \r\n //read the stream for requests from client\r\n byte[] cipherText = (byte [])is.readObject();\r\n \r\n // decrypt the ciphertext to obtain the signed message\r\n ATMSessionMessage atmSessionMessage = (ATMSessionMessage) crypto.decryptRijndael(cipherText, kSession);\r\n if(!(currTimeStamp < atmSessionMessage.getTimeStamp())) error (\"Time stamp does not match\");\r\n \r\n //interpret the transaction operation in the request\r\n SignedMessage signedMessage = atmSessionMessage.getSignedMessage();\r\n \r\n \r\n \t\t//verify signature\r\n \t\ttry {\r\n \t\t\tif(!crypto.verify(signedMessage.msg, signedMessage.signature, currAcct.kPub))\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"Digital signature failed...\");\r\n \t\t\t}\r\n \t\t\tSystem.out.println(\"Message signature valid...\");\r\n \t\t} catch (SignatureException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t} catch (KeyException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\t\r\n TransactionMessage transactionMessage = (TransactionMessage)signedMessage.getObject();\r\n transactionOperation = transactionMessage.getOperation();\r\n \r\n //print the signed message\r\n System.out.println(\"\\n\" + (new Date()).toString());\r\n System.out.println(signedMessage.toString());\r\n \r\n //strip out the parameters embedded \r\n nonce = atmSessionMessage.getNonce();\r\n double value = transactionMessage.getValue();\r\n \r\n //print the timestamp when the transaction takes place\r\n Date now = new Date();\r\n System.out.println(\"\\n\" + now.toString());\r\n \r\n //re-route the request to the appropriate handling function\r\n if(transactionOperation == TransactionOperation.Deposit) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" DEPOSIT: \" + value);\r\n currAcct.deposit(value);\r\n \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Deposit Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.Withdraw) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" WITHDRAW: \" + value);\r\n \t currAcct.withdraw(value);\r\n \t \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Withdrawal Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.EndSession) \r\n \t {\r\n \t \tSystem.out.println(\"\\nTerminating session with ACCT#: \" + currAcct.getNumber());\r\n \t \treturn false;\r\n \t \t\r\n \t }\r\n \r\n accts.save();\r\n //create a successful reply Success and set the balance\r\n balance = currAcct.getBalance(); \r\n transactionMessage = new TransactionMessage(MessageType.ResponseSuccess,transactionOperation,balance);\r\n atmSessionMessage = new ATMSessionMessage(transactionMessage);\r\n \r\n //set the nonce \r\n atmSessionMessage.setNonce(nonce);\r\n currTimeStamp = atmSessionMessage.getTimeStamp();\r\n //encrypt the response and send it\r\n cipherText = crypto.encryptRijndael(atmSessionMessage, kSession);\r\n os.writeObject((Serializable)cipherText);\r\n \r\n //Logging.....\r\n //get the signed message and encrypt it\r\n \r\n signedMessage.encryptMessage(this.kLog);\r\n \r\n //encrypt the action\r\n //archive the signed message for logging and non-repudiation purposes \r\n SignedAction signedAction = new SignedAction(currAcct.getNumber(), atmSessionMessage.getTimeStamp(), signedMessage);\r\n \r\n //flush out transaction record to the audit file\r\n BankServer.log.write(signedAction);\r\n \r\n\t return true;\r\n }\r\n catch(Exception e){\r\n if(e instanceof TransException) replyFailure(transactionOperation,nonce);\r\n System.out.println(\"Terminating session with ACCT#: \" + currAcct.getNumber());\r\n \t//e.printStackTrace();\r\n \r\n return true;\r\n }\r\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutput();", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_3() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return transactions_.get(index);\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "protected void pktsOut(int n) {}", "@Test\n\tpublic void testTransfer() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"acc2\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(02, \"acc1\", 00000, 200.00, \"\"));\n\t\ttransactions.add(2, new Transaction(02, \"acc2\", 00001, 200.00, \"\"));\n\t\ttransactions.add(3, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\t// ArrayList<Account> expected = new ArrayList();\n\t\t// expected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\t\t// expected.add(1, new Account(00001, \"acc2\", true, 1050.00, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Money Transfered\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"money not transfered\", testResult);\n\t}", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputOrBuilder();", "public void calculatePayment() {}", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_4_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString ticketId = roc.createTickets(1, true)[0].get(\"ticketId\").getAsString();\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tuserData, ticketId);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true, ticketId);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void fixedPayerAndReceiverTest() {\n double fixedRate = 0.015;\n GeneratorAttributeIR attribute = new GeneratorAttributeIR(Period.ofYears(7));\n double notional = 1.0e8;\n ZonedDateTime date = DateUtils.getUTCDate(2013, 9, 10);\n SwapFixedIborDefinition def1 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute);\n SwapFixedIborDefinition def2 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, true);\n assertEquals(def1, def2);\n SwapFixedIborDefinition def3 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, false);\n assertFalse(def1.equals(def3));\n int nIbor = def1.getIborLeg().getNumberOfPayments();\n int nFixed = def1.getFixedLeg().getNumberOfPayments();\n assertEquals(nIbor, def3.getIborLeg().getNumberOfPayments());\n assertEquals(nFixed, def3.getFixedLeg().getNumberOfPayments());\n assertEquals(def1.getIborLeg().getIborIndex(), def3.getIborLeg().getIborIndex());\n assertEquals(def1.getIborLeg().getCalendar(), def3.getIborLeg().getCalendar());\n assertEquals(def1.getCurrency(), def3.getIborLeg().getCurrency());\n for (int i = 0; i < nIbor; ++i) {\n CouponIborDefinition ibor1 = def1.getIborLeg().getNthPayment(i);\n CouponIborDefinition ibor3 = def3.getIborLeg().getNthPayment(i);\n assertEquals(ibor1.getNotional(), -ibor3.getNotional());\n assertEquals(ibor1.getAccrualStartDate(), ibor3.getAccrualStartDate());\n assertEquals(ibor1.getAccrualEndDate(), ibor3.getAccrualEndDate());\n assertEquals(ibor1.getFixingDate(), ibor3.getFixingDate());\n assertEquals(ibor1.getPaymentDate(), ibor3.getPaymentDate());\n assertEquals(ibor1.getPaymentYearFraction(), ibor3.getPaymentYearFraction());\n }\n for (int i = 0; i < nFixed; ++i) {\n CouponFixedDefinition fixed1 = def1.getFixedLeg().getNthPayment(i);\n CouponFixedDefinition fixed3 = def3.getFixedLeg().getNthPayment(i);\n assertEquals(fixed1.getNotional(), -fixed3.getNotional());\n assertEquals(fixed1.getAccrualStartDate(), fixed3.getAccrualStartDate());\n assertEquals(fixed1.getAccrualEndDate(), fixed3.getAccrualEndDate());\n assertEquals(fixed1.getPaymentDate(), fixed3.getPaymentDate());\n assertEquals(fixed1.getPaymentYearFraction(), fixed3.getPaymentYearFraction());\n }\n }", "public static Transaction generateSendTransaction(String strPrivateKey, String creatorAddress, String receiverAddress,\n TransactionHistory transactionHistory) {\n List<Creation> creations = new ArrayList<Creation>();\n List<Input> inputs = new ArrayList<Input>();\n List<Output> outputs = new ArrayList<Output>();\n\n // Get sender address from private key\n BigInteger privateKey = Bitcoin.decodePrivateKey(strPrivateKey);\n byte[] publicKey = Bitcoin.generatePublicKey(privateKey);\n String senderAddress = Bitcoin.publicKeyToAddress(publicKey);\n\n // Variable for counting number of coupons in referred transaction outputs\n int couponsInInputs = 0;\n\n // Find previous transaction outputs to refer to\n Iterator<Transaction> transactionIterator = transactionHistory.iterator();\n while (transactionIterator.hasNext() && couponsInInputs < 1) {\n Transaction transaction = transactionIterator.next();\n Iterator<Output> outputIterator = transaction.getOutputs().iterator();\n while (outputIterator.hasNext() && couponsInInputs < 1) {\n Output output = outputIterator.next();\n if (output.getCreatorAddress().equals(creatorAddress) && output.getAddress().equals(senderAddress)\n && output.getInputId() == 0) {\n Input input = new Input(output.getOutputId());\n inputs.add(input);\n couponsInInputs += output.getAmount();\n }\n }\n }\n\n // Check if enough coupons are available\n if (couponsInInputs <= 0) {\n throw new IllegalArgumentException();\n }\n\n // Set that 1 coupon should be sent to receiver address\n Output output = new Output(creatorAddress, 1, receiverAddress);\n outputs.add(output);\n\n // Send remaining coupons in referred transaction outputs back to the user as change\n if (couponsInInputs > 1) {\n Output changeOutput = new Output(creatorAddress, couponsInInputs - 1, senderAddress);\n outputs.add(changeOutput);\n }\n\n // Create transaction, sign it and return it\n Transaction transaction = new Transaction(creations, inputs, outputs);\n transaction.signTransaction(privateKey);\n return transaction;\n\n }", "public int[] getTsumoPayment(boolean isDealer) {\r\n int[] output = new int[2];\r\n if (isDealer) {\r\n output[0] = basicPoints * 2;\r\n output[1] = 0;\r\n } else {\r\n output[0] = basicPoints * 1;\r\n output[1] = basicPoints * 2;\r\n }\r\n output[0] = (int)(100*Math.ceil(output[0]/100.0));\r\n output[1] = (int)(100*Math.ceil(output[1]/100.0));\r\n \r\n return output;\r\n }", "@Test\n\tpublic void validateSignatureBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock newBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE VALID\n\t\tassertEquals(true, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\ttransactionsSignature = new byte[64];\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID GENERATOR SIGNATURE\n\t\tnewBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), newBlock.getTimestamp(), newBlock.getGeneratingBalance(), generator, new byte[32]);\n\t\ttransactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t///CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//VALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = newBlock.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID TRANSACTION SIGNATURE\n\t\tassertEquals(true, newBlock.isSignatureValid());\t\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tpayment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(200).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK INVALID TRANSACTION SIGNATURE\n\t\tassertEquals(false, newBlock.isSignatureValid());\t\n\t}", "public double sumTransactions() {\n\t\treturn checkIfTransactionsExist(true);\n\t}", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "public void printTransactions() {\n for (int i = 0; i < transactions.size(); i++) {\n\t\t\tint indeks = i+1;\n\t\t\tSystem.out.println(\"Transactions \" + indeks + \": \" + transactions.get(i).getType() + \" \" + transactions.get(i).getAmount());\n\t\t}\n }", "@Override\r\n\tpublic byte[] countersign(final byte[] sign,\r\n final String algorithm,\r\n final CounterSignTarget targetType,\r\n final Object[] targets,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException {\r\n throw new UnsupportedOperationException(\"No es posible realizar contrafirmas de ficheros ODF\"); //$NON-NLS-1$\r\n }", "public int updatePayment2(int requestId, int amount);", "private void convertTransactionToBitStream(){\n bitTransactionList = new ArrayList<>();\n itemListMap2 = new HashMap<>();\n \n for(int i=0; i<transactions_set.size(); i++){\n ArrayList curr_tr = transactions_set.get(i);\n \n if(curr_tr.size() >= min_itemset_size_K){ \n int freqItem = 0;\n BitSet bitset = new BitSet(bitsetLen);\n \n for(int j=0; j<curr_tr.size(); j++){\n try{\n int item = (int)curr_tr.get(j);\n bitset.set(itemIndex.get(item), true);\n freqItem++;\n }\n catch(Exception e){}\n }\n if(freqItem >= min_itemset_size_K){\n bitTransactionList.add(bitset);\n// System.out.println(bitset);\n HashSet<BitSet> subset_2 = createSubsetsOfLen2(bitset);\n for(BitSet sub_b : subset_2){\n itemListMap2.put(sub_b, itemListMap2.getOrDefault(sub_b, 0)+1);\n }\n }\n }\n }\n \n itemListMap2.values().removeIf(val -> val<min_sup);\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_5_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t\t\r\n\t\t\t\tHashMap<String,Object> o2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t\t\r\n\t\t\t\to = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\to2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return instance.getTransactions(index);\n }", "protected int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws IOException {\n return serializator.write(output, mostSigBits) +\n serializator.write(output, leastSigBits);\n }", "public void onOutputSpent(MoneroOutputWallet output);", "public static void main(String[] args)\n\t{\n \n\t\tSystem.out.println(\"Enter the size of transaction array\");\n int trSize = sc.nextInt();\n\n // creating an array of provided size\n int[] transactions = new int[trSize];\n \n // get the elements of the array (in a loop)\n System.out.println(\"Enter the values of array\");\n for (int i = 0; i < transactions.length; i++) {\n transactions[i] = sc.nextInt();\n }\n // get the number of targets\n System.out.println(\"Enter the total no of targets that needs to be achieved\");\n int numTargets = sc.nextInt();\n \n // get in target one-by-one (loop)\n for (int i = 0; i < numTargets; i++) {\n \n \t// Get TargetValue\n System.out.println(\"Enter the value of target\");\n int target = sc.nextInt();\n \n int sum =0;\n for ( int j=0; j < transactions.length; j++) {\n \tsum = sum + transactions[j];\n \t\n \tif ( sum >= target) {\n \tSystem.out.println(\"Target achieved after \" + (j+1) + \" transactions\" );\n \tbreak; // break out of the innermost for loop\n \t}\n \t\n \t//we come to the last transactions, yet target is not achieved\n \tif (j == transactions.length - 1) {\n \t\tSystem.out.println( \"Given target is not achieved\");\n \t}\n \t\n }\n \n \n\t}\n\n}", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public double calculatePay() {\n\t\treturn 0;\r\n\t}", "public byte[] signNativeByTransDataDefault(UInt256 uInt256) {\n return new byte[0];\n }", "@Suspendable\n @Override\n protected void checkTransaction(SignedTransaction stx) throws FlowException {\n }", "com.google.protobuf.ByteString\n getOutputBytes();", "com.google.protobuf.ByteString\n getTranCodeBytes();", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "public float getInputsValue() {\n\t\tfloat total = 0;\n\t\tfor (TransactionInput i : inputs) {\n\t\t\tif (i.getUTXO() == null)\n\t\t\t\tcontinue; // if Transaction can't be found skip it\n\t\t\ttotal += i.getUTXO().getValue();\n\t\t}\n\t\treturn total;\n\t}", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_1() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }" ]
[ "0.61595416", "0.5966926", "0.5893284", "0.57574815", "0.57380486", "0.56829846", "0.5668829", "0.5640629", "0.55908084", "0.5576276", "0.549149", "0.5468646", "0.5428697", "0.5360827", "0.5360827", "0.5360827", "0.5346331", "0.5305661", "0.525313", "0.52381736", "0.51885766", "0.5148147", "0.51314443", "0.5125945", "0.51255107", "0.50846374", "0.5060251", "0.50338894", "0.50077987", "0.4994864", "0.49875298", "0.49698073", "0.49698073", "0.49698073", "0.49596593", "0.4949018", "0.49411756", "0.49386016", "0.4928867", "0.49035704", "0.49003276", "0.48912862", "0.48795715", "0.48694947", "0.48674142", "0.48642266", "0.48613507", "0.48246202", "0.47959137", "0.47953072", "0.47908524", "0.47715572", "0.47715572", "0.47715572", "0.4765489", "0.4753552", "0.47508267", "0.47471234", "0.47317925", "0.47285673", "0.47285673", "0.4719286", "0.47174066", "0.4714295", "0.47125024", "0.46985352", "0.46933845", "0.46927908", "0.46907243", "0.46877164", "0.46726155", "0.46705523", "0.46680796", "0.46678", "0.46671906", "0.4663788", "0.46598783", "0.4658921", "0.4658921", "0.4658921", "0.46515226", "0.4651428", "0.46477026", "0.4641957", "0.46230626", "0.4621864", "0.46166465", "0.46140277", "0.46129876", "0.46080026", "0.46053308", "0.4601807", "0.4601678", "0.45944613", "0.45911747", "0.4586006", "0.45831758", "0.4578833", "0.4576443", "0.45755768", "0.4566767" ]
0.0
-1
Signed transactions that satisfy PaymentDetails.outputs repeated bytes transactions = 2;
private void addAllTransactions( java.lang.Iterable<? extends com.google.protobuf.ByteString> values) { ensureTransactionsIsMutable(); com.google.protobuf.AbstractMessageLite.addAll( values, transactions_); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testValidOutputValues() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, -20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(-20, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testNoDoubleSpending() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Alice wants double spending: transfers 10 coins to Bob, 20 to Cal again\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1: input 0\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n\n // Sign for tx1: input 1\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(1).addSignature(sig2);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testHandleTxs() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // Cal transfers 5 coins to Bob, Bob transfers 2 coins to Alice\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0); // index 0 refers to output 1 of tx1\n tx2.addInput(tx1.getHash(), 1); // index 1 refers to output 1 of tx1\n tx2.addOutput(2, kpAlice.getPublic());\n tx2.addOutput(5, kpBob.getPublic());\n\n // Sign for tx2\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx2.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(0).addSignature(sig2);\n\n byte[] sig3 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpCal.getPrivate());\n sig.update(tx2.getRawDataToSign(1));\n sig3 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(1).addSignature(sig3);\n tx2.finalize();\n\n // Alice transfers 3 coins to Cal\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(), 0);\n tx3.addOutput(3, kpCal.getPublic());\n\n // Sign for tx3\n byte[] sig4 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx3.getRawDataToSign(0));\n sig4 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx3.getInput(0).addSignature(sig4);\n tx3.finalize();\n\n Transaction[] acceptedTx = txHandler.handleTxs(new Transaction[] {tx1, tx2, tx3});\n // tx1, tx2 supposed to be valid, tx3 supposed to be invalid\n assertEquals(acceptedTx.length, 2);\n // assertFalse(txHandler.isValidTx(tx3));\n }", "public boolean processTransaction() {\n\n // Checks to see if the signature can be verified.\n if (verifySignature() == false) {\n System.out.println(\"# Transaction signature could not be verified.\");\n return false;\n }\n\n // Gathers all transaction inputs, making sure they are unspent.\n for (TransactionInput i : inputs) {\n i.UTXO = BasicBlockchain.UTXOs.get(i.transactionOutputId);\n }\n\n // Checks if transaction amount is valid.\n if (getInputsValue() < BasicBlockchain.minimumTransaction) {\n System.out.println(\"# Transaction inputs are too small.\");\n return false;\n }\n\n // Generates transaction outputs.\n // Get value of the inputs then the leftover change.\n float leftOver = getInputsValue() - value;\n transactionId = calculateHash();\n // Send value to recipient.\n outputs.add(new TransactionOutput(this.recipient, value, transactionId));\n // Send the leftover \"change\" back to sender.\n outputs.add(new TransactionOutput(this.sender, leftOver, transactionId));\n\n\n // Adds outputs to the unspent list.\n for (TransactionOutput o : outputs) {\n BasicBlockchain.UTXOs.put(o.id, o);\n }\n\n // Removes the transaction inputs from the blockchain's UTXO list as spent.\n for (TransactionInput i : inputs) {\n if (i.UTXO == null) continue;\n BasicBlockchain.UTXOs.remove(i.UTXO.id);\n }\n\n return true;\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutput();", "public static void main(String[] args) throws AddressFormatException {\n\n// generateMultisig();\n String getSignedTransaction = signFirstTime();\n String rawtx = signSecondTime(getSignedTransaction);\n\n System.out.println(\"rawtx ->\"+ rawtx);\n }", "private static String signFirstTime() throws AddressFormatException\n {\n ECKey key1 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n\n\n // Use the redeem script we have saved somewhere to start building the transaction\n Script redeemScript = new Script(hexStringToByteArray(\"5221021ae8964b8529dc3e52955f2cabd967e08c52008dbcca8e054143b668f3998f4a210306be609ef37366ab0f3dd4096ac23a6ee4d561fc469fa60003f799b0121ad1072102199f3d89fa00e6f55dd6ecdd911457d7264415914957db124d53bf0064963f3853ae\"));\n\n // Start building the transaction by adding the unspent inputs we want to use\n // The data is taken from blockchain.info, and can be found here: https://blockchain.info/rawtx/ca1884b8f2e0ba88249a86ec5ddca04f937f12d4fac299af41a9b51643302077\n Transaction spendTx = new Transaction(params);\n ScriptBuilder scriptBuilder = new ScriptBuilder();\n scriptBuilder.data(new String(\"a9145204ad7c5fa5a2491cd91c332e28c87221194ca087\").getBytes()); // Script of this output\n TransactionInput input = spendTx.addInput(new Sha256Hash(\"fed695bf5e2c15286956a7bd3464c5beb97ef064e1f9406eba189ea844733e7c\"), 1, scriptBuilder.build());\n\n // Add outputs to the person receiving bitcoins\n Address receiverAddress = new Address(params, \"n2cWhs5sbWFCwzuuWWsVM9ubPwykGtX75T\");\n Coin charge = Coin.valueOf(1000000); // 0.1 mBTC\n Script outputScript = ScriptBuilder.createOutputScript(receiverAddress);\n spendTx.addOutput(charge, outputScript);\n\n /*8888888888888888888888888888888888888888888888888888888888888*/\n\n // Sign the first part of the transaction using private key #1\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature ecdsaSignature = key1.sign(sighash);\n TransactionSignature transactionSignarture = new TransactionSignature(ecdsaSignature, Transaction.SigHash.ALL, false);\n\n // Create p2sh multisig input script\n Script inputScript = ScriptBuilder.createP2SHMultiSigInputScript(Arrays.asList(transactionSignarture), redeemScript);\n\n // Add the script signature to the input\n input.setScriptSig(inputScript);\n System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "private ArrayList<Long> storeTransactionInputs(long transactionId, ArrayList<TransactionInput> inputs, int isCoinbase){\n \t\tint inputindex = 0;\n \t\tlong previousOutputId;\n \t\tString prevOutputHash;\n \t\tResultSet findOutputResults;\n \t\tResultSet generatedKey;\n \t\tLong addressId;\n \t\tArrayList<Long> addressIdz=new ArrayList<Long>();\n \t\ttry {\n \t\tfor (TransactionInput i : inputs) {\n\t\t\t\n \t\t\tprevOutputHash = HexBin.encode(i.outpoint.hash);\n \t\t\tfindTransactionOutputStatement.setString(1, prevOutputHash);\n \t\t\tfindTransactionOutputStatement.setLong(2, i.outpoint.index);\n \t\t\tfindOutputResults = findTransactionOutputStatement\n \t\t\t\t\t.executeQuery();\n \t\t\tif (findOutputResults.next()) {\n \t\t\t\tpreviousOutputId = findOutputResults.getLong(1);\n\t\t\t\taddressId=findOutputResults.getLong(2);\n \t\t\t} else {\n \t\t\t\tpreviousOutputId = 0;\n\t\t\t\taddressId=null;\n \t\t\t}\n \t\t\tfindOutputResults.close();\n \t\t\tinsertTransactionInputStatement.setLong(1, transactionId);\n \t\t\tinsertTransactionInputStatement.setInt(2, inputindex);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(3, previousOutputId);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setString(4, prevOutputHash);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(5, i.outpoint.index);\n \t\t\tinsertTransactionInputStatement.setLong(6,\n \t\t\t\t\ti.scriptBytes.length);\n \t\t\tinsertTransactionInputStatement.setString(7,\n \t\t\t\t\tHexBin.encode(i.scriptBytes));\n \t\t\tinsertTransactionInputStatement.setLong(8, i.sequence);\n \t\t\tinsertTransactionInputStatement.setBoolean(9,\n \t\t\t\t\ti.isCoinBase());\n\t\t\tif(addressId!=null){\n \t\t\t\tinsertTransactionInputStatement.setLong(10,addressId);\n \t\t\t\taddressIdz.add(addressId);\n\t\t\t} else {\n \t\t\t\t// TODO Auto-generated catch block\n \t\t\t\tinsertTransactionInputStatement.setNull(10,\n \t\t\t\t\t\tjava.sql.Types.INTEGER);\n \t\t\t}\n \t\t\tinsertTransactionInputStatement.execute();\n \t\t\t\n \t\t}\n \t\t\n \t\t\n \t} catch (SQLException e1) {\n \t\t// TODO Auto-generated catch block\n \t\te1.printStackTrace();\n \t}\n \t\treturn addressIdz;\n \t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputOrBuilder();", "List<TransactionVO> addPendingTransactions(List<SignedTransaction> transactions);", "@Test\n public void TxHandlerTestThird() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid output number(wrong number of coins to transfer)\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1 scrooge to alice 20coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: Alice --> Bob -5coins [*Invalid output number*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(-5, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n // tx3: Alice --> Bob 90coins [*Invalid output number*]\n Transaction tx3 = new Transaction();\n tx3.addInput(tx1.getHash(), 0);\n tx3.addOutput(90, pkBob.getPublic());\n tx3.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n }", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "private static String signSecondTime(String transactionString)\n {\n Transaction spendTx = new Transaction(params, hexStringToByteArray(transactionString));\n\n // Get the input chunks\n Script inputScript = spendTx.getInput(0).getScriptSig();\n List<ScriptChunk> scriptChunks = inputScript.getChunks();\n\n // Create a list of all signatures. Start by extracting the existing ones from the list of script schunks.\n // The last signature in the script chunk list is the redeemScript\n List<TransactionSignature> signatureList = new ArrayList<TransactionSignature>();\n Iterator<ScriptChunk> iterator = scriptChunks.iterator();\n Script redeemScript = null;\n\n while (iterator.hasNext())\n {\n ScriptChunk chunk = iterator.next();\n\n if (iterator.hasNext() && chunk.opcode != 0)\n {\n TransactionSignature transactionSignarture = TransactionSignature.decodeFromBitcoin(chunk.data, false);\n signatureList.add(transactionSignarture);\n } else\n {\n redeemScript = new Script(chunk.data);\n }\n }\n\n // Create the sighash using the redeem script\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature secondSignature;\n\n // Take out the key and sign the signhash\n //ECKey key2 = createKeyFromSha256Passphrase(\"Super secret key 2\");\n ECKey key2 = ECKey.fromPrivate(new BigInteger(\"68123968917867656952640885027449260190826636504009580537802764798766700329220\"));\n// ECKey key2 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n secondSignature = key2.sign(sighash);\n\n // Add the second signature to the signature list\n TransactionSignature transactionSignarture = new TransactionSignature(secondSignature, Transaction.SigHash.ALL, false);\n signatureList.add(transactionSignarture);\n\n // Rebuild p2sh multisig input script\n inputScript = ScriptBuilder.createP2SHMultiSigInputScript(signatureList, redeemScript);\n spendTx.getInput(0).setScriptSig(inputScript);\n\n //System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "@Test\n public void testOutputsInUTXOPool() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is NOT put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // UTXO pool does not contains the UTXO\n assertFalse(txHandler.isValidTx(tx1));\n\n // Put output of createCoinTx to the pool\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler1 = new TxHandler(utxoPool);\n\n // UTXO pool now contains the UTXO\n assertTrue(txHandler1.isValidTx(tx1));\n }", "@Test\n public void testValidBalance() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 100 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(100, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "RequestResult postSignRequests(TriphaseRequest[] requests) throws IOException,\n CertificateEncodingException, SAXException;", "public IBankTransfert payment();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static boolean isSigned_entries_receiveEst() {\n return false;\n }", "com.google.protobuf.ByteString getTransactions(int index);", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "@Suspendable\n @Override\n public SignedTransaction call() throws FlowException {\n\n Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);\n//\n\n // Source\n AccountInfo issuerOwner = subFlow(new AccountInfoByName(acctNameSource)).get(0).getState().getData();\n PublicKey issuerOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty issuerOwnerAnonParty = new AnonymousParty(issuerOwnerKey);\n\n AccountInfo targetOwner = subFlow(new AccountInfoByName(acctNameTarget)).get(0).getState().getData();\n PublicKey targetOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty targetOwnerAnonParty = new AnonymousParty(targetOwnerKey);\n\n\n AssetForAccountState outputAsset = new AssetForAccountState(issuerOwnerAnonParty, targetOwnerAnonParty,\n asset.getState().getData().getName(), asset.getState().getData().getValue());\n\n\n TransactionBuilder txBuilder = new TransactionBuilder(notary)\n .addInputState(asset)\n .addOutputState(outputAsset, AssetForAccountContract.ID)\n .addCommand(new AssetForAccountContract.Commands.Transfer(), issuerOwnerKey);\n\n txBuilder.verify(getServiceHub());\n\n SignedTransaction fullySignedTransaction = getServiceHub().signInitialTransaction(txBuilder, issuerOwnerKey);\n\n //return fullySignedTransaction;\n return subFlow(new FinalityFlow(fullySignedTransaction, Collections.emptyList()));\n }", "private boolean areOutputsSpent(Transaction tx){\n // Need to see if tx inputs are contained in the blockchain UTXOs\n for(TransactionInput i : tx.inputs){\n if(!currentBlockchain.UTXOs.containsKey(i.previousOutId)){\n return true;\n }\n }\n return false;\n }", "BigInteger getDigitalSignature();", "public static long deepTransactionCheck(Transaction tx, UtxoUpdateBuffer utxo_buffer, BlockHeader block_header, NetworkParams params)\n throws ValidationException\n {\n try(TimeRecordAuto tra_blk = TimeRecord.openAuto(\"Validation.deepTransactionCheck\"))\n {\n TransactionInner inner = null;\n\n try\n {\n inner = TransactionInner.parseFrom(tx.getInnerData());\n }\n catch(java.io.IOException e)\n {\n throw new ValidationException(\"error parsing tx on second pass somehow\", e);\n }\n\n long sum_of_inputs = 0L;\n // Make sure all inputs exist\n for(TransactionInput in : inner.getInputsList())\n {\n TransactionOutput matching_out = utxo_buffer.getOutputMatching(in);\n if (matching_out == null)\n {\n throw new ValidationException(String.format(\"No matching output for input %s\", new ChainHash(in.getSrcTxId())));\n }\n validateSpendable(matching_out, block_header, params);\n sum_of_inputs += matching_out.getValue();\n\n // SIP-4 check\n if (block_header.getBlockHeight() >= params.getActivationHeightTxInValue())\n {\n if (in.getValue() != 0L)\n {\n if (in.getValue() != matching_out.getValue())\n {\n throw new ValidationException(String.format(\"Input value does not match: %d %d\", matching_out.getValue(), in.getValue()));\n }\n }\n }\n utxo_buffer.useOutput(matching_out, new ChainHash(in.getSrcTxId()), in.getSrcTxOutIdx());\n }\n\n long spent = 0L;\n // Sum up all outputs\n int out_idx =0;\n ArrayList<ByteString> raw_output_list = TransactionUtil.extractWireFormatTxOut(tx);\n\n for(TransactionOutput out : inner.getOutputsList())\n {\n validateTransactionOutput(out, block_header, params);\n spent+=out.getValue();\n utxo_buffer.addOutput(raw_output_list, out, new ChainHash(tx.getTxHash()), out_idx);\n out_idx++;\n\n }\n\n spent+=inner.getFee();\n\n if (!inner.getIsCoinbase())\n {\n if (sum_of_inputs != spent)\n {\n throw new ValidationException(String.format(\"Transaction took in %d and spent %d\", sum_of_inputs, spent));\n }\n }\n \n return inner.getFee();\n }\n }", "@Test\n public void TxHandlerTestSecond() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the double spending\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(25, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1: one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx 2:Scrooge --> Bob 20coins [*Double-spending*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx0.getHash(), 0);\n tx2.addOutput(25, pkBob.getPublic());\n tx2.signTx(pkScrooge.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n\n }", "String signITRByAssesse(String PAN,String xml, DigitalSignatureWrapper digitalSignatureWrapper) throws MissingPrivateKeyException,InvalidDigitalSignatureException,Exception;", "public boolean processTransaction() {\r\n\t\t\r\n\t\t\tif(verifySignature() == false) {\r\n\t\t\t\tSystem.out.println(\"#Transaction Signature failed to verify\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\ttransactionId = calulateHash();\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "public static boolean isSigned_receivets() {\n return true;\n }", "@Override\n public boolean isValid() {\n final BlockChainInt outputHash = getOutputHash();\n\n return inputs.stream().map(input -> input.verifySignature(outputHash)).reduce(true, (a, b) -> a && b)\n && outputs.stream().map(output -> output.getAmount() >= 0).reduce(true, (a, b) -> a && b)\n && getTransactionFee() >= 0;\n }", "@Override\n public void run() {\n byte[] deviceTxPayload = CoreServices.getOrCreateHardwareWalletService().get().getContext().getSerializedTx().toByteArray();\n\n log.info(\"DeviceTx payload:\\n{}\", Utils.HEX.encode(deviceTxPayload));\n\n // Load deviceTx\n Transaction deviceTx = new Transaction(MainNetParams.get(), deviceTxPayload);\n\n log.info(\"deviceTx:\\n{}\", deviceTx.toString());\n\n // Check the signatures are canonical\n for (TransactionInput txInput : deviceTx.getInputs()) {\n byte[] signature = txInput.getScriptSig().getChunks().get(0).data;\n if (signature != null) {\n log.debug(\n \"Is signature canonical test result '{}' for txInput '{}', signature '{}'\",\n TransactionSignature.isEncodingCanonical(signature),\n txInput.toString(),\n Utils.HEX.encode(signature));\n } else {\n log.warn(\"No signature data\");\n }\n }\n\n log.debug(\"Committing and broadcasting the last tx\");\n\n BitcoinNetworkService bitcoinNetworkService = CoreServices.getOrCreateBitcoinNetworkService();\n\n if (bitcoinNetworkService.getLastSendRequestSummaryOptional().isPresent()\n && bitcoinNetworkService.getLastWalletOptional().isPresent()) {\n\n SendRequestSummary sendRequestSummary = bitcoinNetworkService.getLastSendRequestSummaryOptional().get();\n\n // Check the unsigned and signed tx are essentially the same as a check against malware attacks on the Trezor\n if (TransactionUtils.checkEssentiallyEqual(sendRequestSummary.getSendRequest().get().tx, deviceTx)) {\n // Substitute the signed tx from the trezor\n log.debug(\n \"Substituting the Trezor signed tx '{}' for the unsigned version {}\",\n deviceTx.toString(),\n sendRequestSummary.getSendRequest().get().tx.toString()\n );\n sendRequestSummary.getSendRequest().get().tx = deviceTx;\n log.debug(\"The transaction fee was {}\", sendRequestSummary.getSendRequest().get().fee);\n\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_TRANSACTION_CREATED_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n\n // Get the last wallet\n Wallet wallet = bitcoinNetworkService.getLastWalletOptional().get();\n\n // Commit and broadcast\n bitcoinNetworkService.commitAndBroadcast(sendRequestSummary, wallet, paymentRequestData);\n\n // Ensure the header is switched off whilst the send is in progress\n ViewEvents.fireViewChangedEvent(ViewKey.HEADER, false);\n } else {\n // The signed transaction is essentially different from what was sent to it - abort send\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_FAILURE_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n }\n } else {\n log.debug(\"Cannot commit and broadcast the last send as it is not present in bitcoinNetworkService\");\n }\n // Clear the previous remembered tx\n bitcoinNetworkService.setLastSendRequestSummaryOptional(Optional.<SendRequestSummary>absent());\n bitcoinNetworkService.setLastWalletOptional(Optional.<Wallet>absent());\n }", "@Test\n public void TxHandlerTestForth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid signature\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx1: scrooge to alice 20 coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: alice to bob 20coins[signed by bob]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(20, pkBob.getPublic());\n tx2.signTx(pkBob.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n }", "@Override\n public byte[] createDataToSignInput(\n Transaction transaction,\n int inputIndex,\n long amountInSat,\n PublicKeyTriple publicKeyTriple) {\n\n final byte[] redeemScript = createRedeemScript(publicKeyTriple);\n\n return TransactionHelpers.getDataToSign(\n transaction,\n inputIndex,\n new Script(redeemScript)\n );\n }", "public TransactionResponse processAllTransaction() throws ParseException {\n TransactionResponse response = new TransactionResponse();\n\n //User0\n response.setTransaction(new Transaction(\"user0\",\"0001\", \"type0\",\"user0_Billing\",\"user0_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-00\")));\n\n //User1\n response.setTransaction(new Transaction(\"user1\", \"0101\",\"type0\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user1\", \"0102\", \"type1\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-00\")));\n\n //User2\n response.setTransaction(new Transaction(\"user2\", \"0201\", \"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-01-00\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0202\", \"type2\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0203\",\"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n //User3\n response.setTransaction(new Transaction(\"user3\", \"0301\",\"type0\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user3\", \"0302\",\"type1\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n return response;\n }", "com.dogecoin.protocols.payments.Protos.Output getOutputs(int index);", "@Test\n public void TxHandlerTestFifth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the input not in the UtxoPool\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n //tx1: Scrooge --> Alice 20coins [Pay Coins *NOT added to UTXO pool* due to accidents]\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n utxo = new UTXO(tx1.getHash(),0);\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n utxoPool.removeUTXO(utxo);\n assertTrue(\"tx1:UTXO has been removed.\", utxoPool.getAllUTXO().size() == 0);\n\n\n // tx2: Alice --> Bob 15coins [Pay Coins *Previous Tx NOT in UTXO pool*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(15, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 0);\n\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "private static void createDummyTransactions() {\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 10L, new Transaction(10000d, \"cars\", 0L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 11L, new Transaction(15000d, \"shopping\", 10L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 12L, new Transaction(20000d, \"keys\", 11L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 13L, new Transaction(25000d, \"furniture\", 12L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 14L, new Transaction(30000d, \"keys\", 13L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 15L, new Transaction(40000d, \"cars\", 14L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 16L, new Transaction(50000d, \"cars\", 15L)));\n }", "@Test\n public void TxHandlerTestFirst() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test some basic functions of TxHandler\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n // tx0: Scrooge --> Scrooge 25coins [Create Coins]\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx( pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n\n // tx1: Scrooge --> Scrooge 4coins [Divide Coins]\n //\t Scrooge --> Scrooge 5coins\n //\t Scrooge --> Scrooge 6coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(),0);\n\n tx1.addOutput(4,pkScrooge.getPublic());\n tx1.addOutput(5,pkScrooge.getPublic());\n tx1.addOutput(6,pkScrooge.getPublic());\n\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx2: Scrooge --> Alice 4coins [Pay separately]\n //\t Scrooge --> Alice 5coins\n // Scrooge --> Bob 6coins\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addInput(tx1.getHash(), 1);\n tx2.addInput(tx1.getHash(), 2);\n\n tx2.addOutput(4, pkAlice.getPublic());\n tx2.addOutput(5, pkAlice.getPublic());\n tx2.addOutput(6, pkBob.getPublic());\n\n tx2.signTx(pkScrooge.getPrivate(), 0);\n tx2.signTx(pkScrooge.getPrivate(), 1);\n tx2.signTx(pkScrooge.getPrivate(), 2);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx3:Alice --> Alice 2coins [Divide Coins]\n // Alice --> Alice 2coins\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(),0);\n\n tx3.addOutput(2, pkAlice.getPublic());\n tx3.addOutput(2, pkAlice.getPublic());\n\n tx3.signTx(pkAlice.getPrivate(),0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 4);\n\n // tx4: Alice --> Bob 2coins [Pay jointly]\n // Alice --> Bob 5coins\n Transaction tx4 = new Transaction();\n tx4.addInput(tx3.getHash(),0);\n tx4.addInput(tx2.getHash(),1);\n\n tx4.addOutput(7, pkBob.getPublic());\n\n tx4.signTx(pkAlice.getPrivate(), 0);\n tx4.signTx(pkAlice.getPrivate(),1);\n\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx4) returns: \" + txHandler.isValidTx(tx4));\n assertTrue(\"tx4:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx4}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx4:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n// System.out.println(\"tx4.hashCode returns: \" + tx4.hashCode());\n }", "public ParametricStatement[] createForPaymentTransaction(PaymentTransaction paymentTransaction)\n throws SQLException {\n int multiplier = 1;\n Date date = paymentTransaction.getProcessDate();\n if (paymentTransaction instanceof VoidTransaction) {\n VoidTransaction trans = (VoidTransaction)paymentTransaction;\n ITransaction originalTrans = trans.getOriginalTransaction();\n if (originalTrans instanceof PaymentTransaction) {\n multiplier = -1;\n paymentTransaction = (PaymentTransaction)originalTrans;\n } else {\n // Do nothing if original was not a payment transaction.\n return new ParametricStatement[0];\n }\n }\n ArrayList parametricStatements = new ArrayList();\n String storeId = paymentTransaction.getStore().getId();\n String operatorId = paymentTransaction.getTheOperator().getId();\n // String registerId = paymentTransaction.getId();\n // int registerIdIndex = registerId.indexOf('*') + 1;\n // registerId = registerId.substring(registerIdIndex, registerId.indexOf('*', registerIdIndex));\n String registerId = paymentTransaction.getRegisterId();\n PaymentSummary[] currentPaymentSummaries = this.selectByDateStoreId(date, storeId);\n List newPaymentSummaries = new ArrayList();\n Payment[] payments = paymentTransaction.getPaymentsArray();\n for (int paymentIndex = 0; paymentIndex < payments.length; paymentIndex++) {\n ArmCurrency paymentAmount = payments[paymentIndex].getAmount().multiply(multiplier);\n String paymentType = payments[paymentIndex].getTransactionPaymentName();\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n boolean found = false;\n //to find if this payment type is already in the database\n for (int summaryIndex = 0; summaryIndex < currentPaymentSummaries.length; summaryIndex++) {\n if (currentPaymentSummaries[summaryIndex].getEmployeeId().equals(operatorId)\n && currentPaymentSummaries[summaryIndex].getRegisterId().equals(registerId)\n && currentPaymentSummaries[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n currentPaymentSummaries[summaryIndex].doSetPaymentTotal(paymentAmount.add(\n currentPaymentSummaries[summaryIndex].getPaymentTotal()));\n int mediaCount = ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).\n getMediaCount();\n ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n // work-around for cloudscape date truncation problem.\n currentPaymentSummaries[summaryIndex].doSetDate(date);\n List list = fromObjectToBean(currentPaymentSummaries[summaryIndex]).toList();\n list.add(currentPaymentSummaries[summaryIndex].getId());\n parametricStatements.add(new ParametricStatement(updateSql, list));\n break;\n }\n }\n //to find if it is already in the newPaymentSummaries List\n if (!found) {\n PaymentSummary[] newPaymentSummaryArray = (PaymentSummary[])newPaymentSummaries.toArray(new\n PaymentSummary[0]);\n for (int summaryIndex = 0; summaryIndex < newPaymentSummaryArray.length; summaryIndex++) {\n if (newPaymentSummaryArray[summaryIndex].getEmployeeId().equals(operatorId)\n && newPaymentSummaryArray[summaryIndex].getRegisterId().equals(registerId)\n && newPaymentSummaryArray[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n ArmCurrency newTotal = paymentAmount.add(newPaymentSummaryArray[summaryIndex].\n getPaymentTotal());\n int mediaCount = ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).\n getMediaCount();\n newPaymentSummaryArray[summaryIndex].doSetPaymentTotal(newTotal);\n ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n }\n }\n }\n if (!found) {\n CMSPaymentSummary paymentSummary = new CMSPaymentSummary();\n paymentSummary.doSetDate(date);\n paymentSummary.doSetEmployeeId(operatorId);\n paymentSummary.doSetStoreId(storeId);\n paymentSummary.doSetRegisterId(registerId);\n paymentSummary.doSetPaymentTotal(paymentAmount);\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n paymentSummary.doSetPaymentType(paymentType);\n paymentSummary.doSetId(this.getNextChelseaId());\n paymentSummary.doSetMediaCount(paymentSummary.getMediaCount() + 1);\n newPaymentSummaries.add(paymentSummary);\n }\n }\n for (int i = 0; i < newPaymentSummaries.size(); i++) {\n PaymentSummary paymentSummary = (PaymentSummary)newPaymentSummaries.get(i);\n parametricStatements.add(new ParametricStatement(insertSql\n , fromObjectToBean(paymentSummary).toList()));\n }\n return (ParametricStatement[])parametricStatements.toArray(new ParametricStatement[\n parametricStatements.size()]);\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "@Test\n public void transactionSum() {\n final Transaction transaction1 = new Transaction(\"774cedda\", State.CANCELED, 1000L, new Date());\n final Account account1 = new Account(\"1001\", 0L, Collections.singletonList(transaction1));\n final Transaction transaction2 = new Transaction(\"337868a7\", State.FINISHED, 8000L, new Date());\n final Transaction transaction3 = new Transaction(\"f8047f86\", State.CANCELED, 10000L, new Date());\n final Account account2 = new Account(\"1002\", 8000L, Arrays.asList(transaction2, transaction3));\n\n final long actual = calcSumOfCancelledTransOnNonEmptyAccounts(Arrays.asList(account1, account2));\n\n Assert.assertEquals(actual, 10_000L);\n }", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutputs(int index);", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "public abstract void generateReceipt(Transaction trans);", "public Transaction getDummyTransaction(String action) {\n\n\t\t// Long payerAccountNum = 111l;\n\t\tLong payerRealmNum = 0l;\n\t\tLong payerShardNum = 0l;\n\t\t// Long nodeAccountNum=123l;\n\t\tLong nodeRealmNum = 0l;\n\t\tLong nodeShardNum = 0l;\n\t\tlong transactionFee = 0l;\n\t\tTimestamp startTime =\n\t\t\t\tRequestBuilder.getTimestamp(Instant.now(Clock.systemUTC()).minusSeconds(13));\n\t\tDuration transactionDuration = RequestBuilder.getDuration(100);\n\t\tboolean generateRecord = false;\n\t\tString memo = \"UnitTesting\";\n\t\tint thresholdValue = 10;\n\t\tList<Key> keyList = new ArrayList<>();\n\t\tKeyPair pair = new KeyPairGenerator().generateKeyPair();\n\t\tbyte[] pubKey = ((EdDSAPublicKey) pair.getPublic()).getAbyte();\n\t\tKey akey =\n\t\t\t\tKey.newBuilder().setEd25519(ByteString.copyFromUtf8((MiscUtils.commonsBytesToHex(pubKey)))).build();\n\t\tPrivateKey priv = pair.getPrivate();\n\t\tkeyList.add(akey);\n\t\tlong initBal = 100;\n\t\tlong sendRecordThreshold = 5;\n\t\tlong receiveRecordThreshold = 5;\n\t\tboolean receiverSign = false;\n\t\tDuration autoRenew = RequestBuilder.getDuration(100);\n\t\t;\n\t\tlong proxyAccountNum = 12345l;\n\t\tlong proxyRealmNum = 0l;\n\t\tlong proxyShardNum = 0l;\n\t\tint proxyFraction = 10;\n\t\tint maxReceiveProxyFraction = 10;\n\t\tlong shardID = 0l;\n\t\tlong realmID = 0l;\n\n\t\tTransaction trx = null;\n\t\tSignatureList sigList = SignatureList.getDefaultInstance();\n\t\tTimestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\n\t\t/**\n\t\t * SignatureList sigList = SignatureList.getDefaultInstance(); Transaction transferTx =\n\t\t * RequestBuilder.getCryptoTransferRequest( payer.getAccountNum(), payer.getRealmNum(),\n\t\t * payer.getShardNum(), nodeAccount.getAccountNum(), nodeAccount.getRealmNum(),\n\t\t * nodeAccount.getShardNum(), 800, timestamp, transactionDuration, false, \"test\", sigList,\n\t\t * payer.getAccountNum(), -100l, nodeAccount.getAccountNum(), 100l); transferTx =\n\t\t * TransactionSigner.signTransaction(transferTx, accountKeys.get(payer));\n\t\t */\n\n\t\tif (\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t\ttrx = RequestBuilder.getCryptoTransferRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 800, timestamp,\n\t\t\t\t\ttransactionDuration, false, \"test\", sigList, payerAccountId.getAccountNum(), -100l,\n\t\t\t\t\tnodeAccountId.getAccountNum(), 100l);\n\t\t\t// trx = TransactionSigner.signTransaction(trx, account2keyMap.get(payerAccountId));\n\t\t}\n\n\t\tif (\"createContract\".equalsIgnoreCase(action)) {\n\t\t\tFileID fileID = FileID.newBuilder().setFileNum(9999l).setRealmNum(1l).setShardNum(2l).build();\n\n\t\t\ttrx = RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 50000000000l, timestamp,\n\t\t\t\t\ttransactionDuration, true, \"createContract\", DEFAULT_CONTRACT_OP_GAS, fileID,\n\t\t\t\t\tByteString.EMPTY, 0, transactionDuration,\n\t\t\t\t\tSignatureList.newBuilder().addSigs(\n\t\t\t\t\t\t\tSignature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t\t\t\t\t\t.build(),\n\t\t\t\t\t\"\");\n\t\t}\n\n\t\t// if(\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t// long durationInSeconds = DAY_SEC * 30;\n\t\t// * Duration contractAutoRenew = Duration.newBuilder().setSeconds(durationInSeconds).build();\n\t\t// * Timestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\t\t// * Duration transactionDuration = RequestBuilder.getDuration(30, 0);\n\t\t// * Transaction createContractRequest =\n\t\t// RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t// * payerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t// * nodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 100l, timestamp,\n\t\t// transactionDuration, true, \"createContract\",\n\t\t// * DEFAULT_CONTRACT_OP_GAS, contractFile, ByteString.EMPTY, 0, contractAutoRenew,\n\t\t// * SignatureList.newBuilder()\n\t\t// *\n\t\t// .addSigs(Signature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t// * .build());\n\t\t// }\n\n\t\treturn trx;\n\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public static byte[] secondOutputStep(byte[] S){\n\t\tStringBuffer string = new StringBuffer();\n\t\tfor (int i = 1; i < S.length; i+=2) {\n\t\t\tstring.append(getBit(S[i],7));\n\t\t}\n\t\tbyte[] bval = new BigInteger(string.toString(), 2).toByteArray();\n\t\tif(bval.length > 16){\n\t\t\treturn Arrays.copyOfRange(bval,1,bval.length);\n\t\t}else{\n\t\t\treturn bval;\n\t\t}\n\t\t\n\t}", "public double printOutput() {\r\n return calculateNetPay();\r\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "public boolean doTransaction() {\r\n int nonce = -1;\r\n TransactionOperation transactionOperation = null;\r\n try {\r\n double balance;\r\n \r\n //read the stream for requests from client\r\n byte[] cipherText = (byte [])is.readObject();\r\n \r\n // decrypt the ciphertext to obtain the signed message\r\n ATMSessionMessage atmSessionMessage = (ATMSessionMessage) crypto.decryptRijndael(cipherText, kSession);\r\n if(!(currTimeStamp < atmSessionMessage.getTimeStamp())) error (\"Time stamp does not match\");\r\n \r\n //interpret the transaction operation in the request\r\n SignedMessage signedMessage = atmSessionMessage.getSignedMessage();\r\n \r\n \r\n \t\t//verify signature\r\n \t\ttry {\r\n \t\t\tif(!crypto.verify(signedMessage.msg, signedMessage.signature, currAcct.kPub))\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"Digital signature failed...\");\r\n \t\t\t}\r\n \t\t\tSystem.out.println(\"Message signature valid...\");\r\n \t\t} catch (SignatureException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t} catch (KeyException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\t\r\n TransactionMessage transactionMessage = (TransactionMessage)signedMessage.getObject();\r\n transactionOperation = transactionMessage.getOperation();\r\n \r\n //print the signed message\r\n System.out.println(\"\\n\" + (new Date()).toString());\r\n System.out.println(signedMessage.toString());\r\n \r\n //strip out the parameters embedded \r\n nonce = atmSessionMessage.getNonce();\r\n double value = transactionMessage.getValue();\r\n \r\n //print the timestamp when the transaction takes place\r\n Date now = new Date();\r\n System.out.println(\"\\n\" + now.toString());\r\n \r\n //re-route the request to the appropriate handling function\r\n if(transactionOperation == TransactionOperation.Deposit) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" DEPOSIT: \" + value);\r\n currAcct.deposit(value);\r\n \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Deposit Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.Withdraw) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" WITHDRAW: \" + value);\r\n \t currAcct.withdraw(value);\r\n \t \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Withdrawal Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.EndSession) \r\n \t {\r\n \t \tSystem.out.println(\"\\nTerminating session with ACCT#: \" + currAcct.getNumber());\r\n \t \treturn false;\r\n \t \t\r\n \t }\r\n \r\n accts.save();\r\n //create a successful reply Success and set the balance\r\n balance = currAcct.getBalance(); \r\n transactionMessage = new TransactionMessage(MessageType.ResponseSuccess,transactionOperation,balance);\r\n atmSessionMessage = new ATMSessionMessage(transactionMessage);\r\n \r\n //set the nonce \r\n atmSessionMessage.setNonce(nonce);\r\n currTimeStamp = atmSessionMessage.getTimeStamp();\r\n //encrypt the response and send it\r\n cipherText = crypto.encryptRijndael(atmSessionMessage, kSession);\r\n os.writeObject((Serializable)cipherText);\r\n \r\n //Logging.....\r\n //get the signed message and encrypt it\r\n \r\n signedMessage.encryptMessage(this.kLog);\r\n \r\n //encrypt the action\r\n //archive the signed message for logging and non-repudiation purposes \r\n SignedAction signedAction = new SignedAction(currAcct.getNumber(), atmSessionMessage.getTimeStamp(), signedMessage);\r\n \r\n //flush out transaction record to the audit file\r\n BankServer.log.write(signedAction);\r\n \r\n\t return true;\r\n }\r\n catch(Exception e){\r\n if(e instanceof TransException) replyFailure(transactionOperation,nonce);\r\n System.out.println(\"Terminating session with ACCT#: \" + currAcct.getNumber());\r\n \t//e.printStackTrace();\r\n \r\n return true;\r\n }\r\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutput();", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_3() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return transactions_.get(index);\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "protected void pktsOut(int n) {}", "@Test\n\tpublic void testTransfer() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"acc2\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(02, \"acc1\", 00000, 200.00, \"\"));\n\t\ttransactions.add(2, new Transaction(02, \"acc2\", 00001, 200.00, \"\"));\n\t\ttransactions.add(3, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\t// ArrayList<Account> expected = new ArrayList();\n\t\t// expected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\t\t// expected.add(1, new Account(00001, \"acc2\", true, 1050.00, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Money Transfered\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"money not transfered\", testResult);\n\t}", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputOrBuilder();", "public void calculatePayment() {}", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_4_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString ticketId = roc.createTickets(1, true)[0].get(\"ticketId\").getAsString();\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tuserData, ticketId);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true, ticketId);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void fixedPayerAndReceiverTest() {\n double fixedRate = 0.015;\n GeneratorAttributeIR attribute = new GeneratorAttributeIR(Period.ofYears(7));\n double notional = 1.0e8;\n ZonedDateTime date = DateUtils.getUTCDate(2013, 9, 10);\n SwapFixedIborDefinition def1 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute);\n SwapFixedIborDefinition def2 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, true);\n assertEquals(def1, def2);\n SwapFixedIborDefinition def3 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, false);\n assertFalse(def1.equals(def3));\n int nIbor = def1.getIborLeg().getNumberOfPayments();\n int nFixed = def1.getFixedLeg().getNumberOfPayments();\n assertEquals(nIbor, def3.getIborLeg().getNumberOfPayments());\n assertEquals(nFixed, def3.getFixedLeg().getNumberOfPayments());\n assertEquals(def1.getIborLeg().getIborIndex(), def3.getIborLeg().getIborIndex());\n assertEquals(def1.getIborLeg().getCalendar(), def3.getIborLeg().getCalendar());\n assertEquals(def1.getCurrency(), def3.getIborLeg().getCurrency());\n for (int i = 0; i < nIbor; ++i) {\n CouponIborDefinition ibor1 = def1.getIborLeg().getNthPayment(i);\n CouponIborDefinition ibor3 = def3.getIborLeg().getNthPayment(i);\n assertEquals(ibor1.getNotional(), -ibor3.getNotional());\n assertEquals(ibor1.getAccrualStartDate(), ibor3.getAccrualStartDate());\n assertEquals(ibor1.getAccrualEndDate(), ibor3.getAccrualEndDate());\n assertEquals(ibor1.getFixingDate(), ibor3.getFixingDate());\n assertEquals(ibor1.getPaymentDate(), ibor3.getPaymentDate());\n assertEquals(ibor1.getPaymentYearFraction(), ibor3.getPaymentYearFraction());\n }\n for (int i = 0; i < nFixed; ++i) {\n CouponFixedDefinition fixed1 = def1.getFixedLeg().getNthPayment(i);\n CouponFixedDefinition fixed3 = def3.getFixedLeg().getNthPayment(i);\n assertEquals(fixed1.getNotional(), -fixed3.getNotional());\n assertEquals(fixed1.getAccrualStartDate(), fixed3.getAccrualStartDate());\n assertEquals(fixed1.getAccrualEndDate(), fixed3.getAccrualEndDate());\n assertEquals(fixed1.getPaymentDate(), fixed3.getPaymentDate());\n assertEquals(fixed1.getPaymentYearFraction(), fixed3.getPaymentYearFraction());\n }\n }", "public static Transaction generateSendTransaction(String strPrivateKey, String creatorAddress, String receiverAddress,\n TransactionHistory transactionHistory) {\n List<Creation> creations = new ArrayList<Creation>();\n List<Input> inputs = new ArrayList<Input>();\n List<Output> outputs = new ArrayList<Output>();\n\n // Get sender address from private key\n BigInteger privateKey = Bitcoin.decodePrivateKey(strPrivateKey);\n byte[] publicKey = Bitcoin.generatePublicKey(privateKey);\n String senderAddress = Bitcoin.publicKeyToAddress(publicKey);\n\n // Variable for counting number of coupons in referred transaction outputs\n int couponsInInputs = 0;\n\n // Find previous transaction outputs to refer to\n Iterator<Transaction> transactionIterator = transactionHistory.iterator();\n while (transactionIterator.hasNext() && couponsInInputs < 1) {\n Transaction transaction = transactionIterator.next();\n Iterator<Output> outputIterator = transaction.getOutputs().iterator();\n while (outputIterator.hasNext() && couponsInInputs < 1) {\n Output output = outputIterator.next();\n if (output.getCreatorAddress().equals(creatorAddress) && output.getAddress().equals(senderAddress)\n && output.getInputId() == 0) {\n Input input = new Input(output.getOutputId());\n inputs.add(input);\n couponsInInputs += output.getAmount();\n }\n }\n }\n\n // Check if enough coupons are available\n if (couponsInInputs <= 0) {\n throw new IllegalArgumentException();\n }\n\n // Set that 1 coupon should be sent to receiver address\n Output output = new Output(creatorAddress, 1, receiverAddress);\n outputs.add(output);\n\n // Send remaining coupons in referred transaction outputs back to the user as change\n if (couponsInInputs > 1) {\n Output changeOutput = new Output(creatorAddress, couponsInInputs - 1, senderAddress);\n outputs.add(changeOutput);\n }\n\n // Create transaction, sign it and return it\n Transaction transaction = new Transaction(creations, inputs, outputs);\n transaction.signTransaction(privateKey);\n return transaction;\n\n }", "public int[] getTsumoPayment(boolean isDealer) {\r\n int[] output = new int[2];\r\n if (isDealer) {\r\n output[0] = basicPoints * 2;\r\n output[1] = 0;\r\n } else {\r\n output[0] = basicPoints * 1;\r\n output[1] = basicPoints * 2;\r\n }\r\n output[0] = (int)(100*Math.ceil(output[0]/100.0));\r\n output[1] = (int)(100*Math.ceil(output[1]/100.0));\r\n \r\n return output;\r\n }", "@Test\n\tpublic void validateSignatureBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock newBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE VALID\n\t\tassertEquals(true, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\ttransactionsSignature = new byte[64];\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID GENERATOR SIGNATURE\n\t\tnewBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), newBlock.getTimestamp(), newBlock.getGeneratingBalance(), generator, new byte[32]);\n\t\ttransactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t///CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//VALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = newBlock.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID TRANSACTION SIGNATURE\n\t\tassertEquals(true, newBlock.isSignatureValid());\t\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tpayment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(200).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK INVALID TRANSACTION SIGNATURE\n\t\tassertEquals(false, newBlock.isSignatureValid());\t\n\t}", "public double sumTransactions() {\n\t\treturn checkIfTransactionsExist(true);\n\t}", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "@Override\r\n\tpublic byte[] countersign(final byte[] sign,\r\n final String algorithm,\r\n final CounterSignTarget targetType,\r\n final Object[] targets,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException {\r\n throw new UnsupportedOperationException(\"No es posible realizar contrafirmas de ficheros ODF\"); //$NON-NLS-1$\r\n }", "public void printTransactions() {\n for (int i = 0; i < transactions.size(); i++) {\n\t\t\tint indeks = i+1;\n\t\t\tSystem.out.println(\"Transactions \" + indeks + \": \" + transactions.get(i).getType() + \" \" + transactions.get(i).getAmount());\n\t\t}\n }", "public int updatePayment2(int requestId, int amount);", "private void convertTransactionToBitStream(){\n bitTransactionList = new ArrayList<>();\n itemListMap2 = new HashMap<>();\n \n for(int i=0; i<transactions_set.size(); i++){\n ArrayList curr_tr = transactions_set.get(i);\n \n if(curr_tr.size() >= min_itemset_size_K){ \n int freqItem = 0;\n BitSet bitset = new BitSet(bitsetLen);\n \n for(int j=0; j<curr_tr.size(); j++){\n try{\n int item = (int)curr_tr.get(j);\n bitset.set(itemIndex.get(item), true);\n freqItem++;\n }\n catch(Exception e){}\n }\n if(freqItem >= min_itemset_size_K){\n bitTransactionList.add(bitset);\n// System.out.println(bitset);\n HashSet<BitSet> subset_2 = createSubsetsOfLen2(bitset);\n for(BitSet sub_b : subset_2){\n itemListMap2.put(sub_b, itemListMap2.getOrDefault(sub_b, 0)+1);\n }\n }\n }\n }\n \n itemListMap2.values().removeIf(val -> val<min_sup);\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_5_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t\t\r\n\t\t\t\tHashMap<String,Object> o2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t\t\r\n\t\t\t\to = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\to2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "protected int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws IOException {\n return serializator.write(output, mostSigBits) +\n serializator.write(output, leastSigBits);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return instance.getTransactions(index);\n }", "public void onOutputSpent(MoneroOutputWallet output);", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public static void main(String[] args)\n\t{\n \n\t\tSystem.out.println(\"Enter the size of transaction array\");\n int trSize = sc.nextInt();\n\n // creating an array of provided size\n int[] transactions = new int[trSize];\n \n // get the elements of the array (in a loop)\n System.out.println(\"Enter the values of array\");\n for (int i = 0; i < transactions.length; i++) {\n transactions[i] = sc.nextInt();\n }\n // get the number of targets\n System.out.println(\"Enter the total no of targets that needs to be achieved\");\n int numTargets = sc.nextInt();\n \n // get in target one-by-one (loop)\n for (int i = 0; i < numTargets; i++) {\n \n \t// Get TargetValue\n System.out.println(\"Enter the value of target\");\n int target = sc.nextInt();\n \n int sum =0;\n for ( int j=0; j < transactions.length; j++) {\n \tsum = sum + transactions[j];\n \t\n \tif ( sum >= target) {\n \tSystem.out.println(\"Target achieved after \" + (j+1) + \" transactions\" );\n \tbreak; // break out of the innermost for loop\n \t}\n \t\n \t//we come to the last transactions, yet target is not achieved\n \tif (j == transactions.length - 1) {\n \t\tSystem.out.println( \"Given target is not achieved\");\n \t}\n \t\n }\n \n \n\t}\n\n}", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public double calculatePay() {\n\t\treturn 0;\r\n\t}", "public byte[] signNativeByTransDataDefault(UInt256 uInt256) {\n return new byte[0];\n }", "@Suspendable\n @Override\n protected void checkTransaction(SignedTransaction stx) throws FlowException {\n }", "com.google.protobuf.ByteString\n getOutputBytes();", "com.google.protobuf.ByteString\n getTranCodeBytes();", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_1() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public float getInputsValue() {\n\t\tfloat total = 0;\n\t\tfor (TransactionInput i : inputs) {\n\t\t\tif (i.getUTXO() == null)\n\t\t\t\tcontinue; // if Transaction can't be found skip it\n\t\t\ttotal += i.getUTXO().getValue();\n\t\t}\n\t\treturn total;\n\t}", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }" ]
[ "0.6159733", "0.59689933", "0.589428", "0.5756902", "0.57402194", "0.56859154", "0.56721807", "0.5637813", "0.5592145", "0.5576518", "0.5491765", "0.5470686", "0.5430834", "0.5358753", "0.5358753", "0.5358753", "0.53461564", "0.5307082", "0.52533996", "0.5240322", "0.5190462", "0.51507604", "0.5130814", "0.5129066", "0.5127569", "0.5083162", "0.5064059", "0.50343573", "0.5009548", "0.49968874", "0.49893466", "0.49677435", "0.49677435", "0.49677435", "0.4962916", "0.4948351", "0.49416536", "0.4940025", "0.49287498", "0.49031627", "0.48969245", "0.4892023", "0.48822185", "0.48698023", "0.48688632", "0.48649135", "0.48628554", "0.48256552", "0.47981858", "0.4793885", "0.4793407", "0.4768888", "0.4768888", "0.4768888", "0.47677594", "0.47562104", "0.47514212", "0.47490582", "0.47333866", "0.47300485", "0.47300485", "0.47212848", "0.47189197", "0.47163257", "0.47116205", "0.46987715", "0.46951908", "0.46937752", "0.46896154", "0.46886653", "0.46746448", "0.46724787", "0.46684882", "0.4666781", "0.4666447", "0.46659714", "0.46610832", "0.46557936", "0.46557936", "0.46557936", "0.46529654", "0.4652265", "0.4649212", "0.46420932", "0.46242723", "0.46233037", "0.4616067", "0.4615847", "0.46125874", "0.4607859", "0.46071175", "0.46046627", "0.4604134", "0.45967475", "0.4594377", "0.45860416", "0.4585746", "0.4580786", "0.4577845", "0.45748726", "0.45700264" ]
0.0
-1
Signed transactions that satisfy PaymentDetails.outputs repeated bytes transactions = 2;
private void clearTransactions() { transactions_ = emptyProtobufList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testValidOutputValues() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, -20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(-20, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testNoDoubleSpending() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Alice wants double spending: transfers 10 coins to Bob, 20 to Cal again\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1: input 0\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n\n // Sign for tx1: input 1\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(1).addSignature(sig2);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testHandleTxs() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // Cal transfers 5 coins to Bob, Bob transfers 2 coins to Alice\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0); // index 0 refers to output 1 of tx1\n tx2.addInput(tx1.getHash(), 1); // index 1 refers to output 1 of tx1\n tx2.addOutput(2, kpAlice.getPublic());\n tx2.addOutput(5, kpBob.getPublic());\n\n // Sign for tx2\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx2.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(0).addSignature(sig2);\n\n byte[] sig3 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpCal.getPrivate());\n sig.update(tx2.getRawDataToSign(1));\n sig3 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx2.getInput(1).addSignature(sig3);\n tx2.finalize();\n\n // Alice transfers 3 coins to Cal\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(), 0);\n tx3.addOutput(3, kpCal.getPublic());\n\n // Sign for tx3\n byte[] sig4 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx3.getRawDataToSign(0));\n sig4 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx3.getInput(0).addSignature(sig4);\n tx3.finalize();\n\n Transaction[] acceptedTx = txHandler.handleTxs(new Transaction[] {tx1, tx2, tx3});\n // tx1, tx2 supposed to be valid, tx3 supposed to be invalid\n assertEquals(acceptedTx.length, 2);\n // assertFalse(txHandler.isValidTx(tx3));\n }", "public boolean processTransaction() {\n\n // Checks to see if the signature can be verified.\n if (verifySignature() == false) {\n System.out.println(\"# Transaction signature could not be verified.\");\n return false;\n }\n\n // Gathers all transaction inputs, making sure they are unspent.\n for (TransactionInput i : inputs) {\n i.UTXO = BasicBlockchain.UTXOs.get(i.transactionOutputId);\n }\n\n // Checks if transaction amount is valid.\n if (getInputsValue() < BasicBlockchain.minimumTransaction) {\n System.out.println(\"# Transaction inputs are too small.\");\n return false;\n }\n\n // Generates transaction outputs.\n // Get value of the inputs then the leftover change.\n float leftOver = getInputsValue() - value;\n transactionId = calculateHash();\n // Send value to recipient.\n outputs.add(new TransactionOutput(this.recipient, value, transactionId));\n // Send the leftover \"change\" back to sender.\n outputs.add(new TransactionOutput(this.sender, leftOver, transactionId));\n\n\n // Adds outputs to the unspent list.\n for (TransactionOutput o : outputs) {\n BasicBlockchain.UTXOs.put(o.id, o);\n }\n\n // Removes the transaction inputs from the blockchain's UTXO list as spent.\n for (TransactionInput i : inputs) {\n if (i.UTXO == null) continue;\n BasicBlockchain.UTXOs.remove(i.UTXO.id);\n }\n\n return true;\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutput();", "public static void main(String[] args) throws AddressFormatException {\n\n// generateMultisig();\n String getSignedTransaction = signFirstTime();\n String rawtx = signSecondTime(getSignedTransaction);\n\n System.out.println(\"rawtx ->\"+ rawtx);\n }", "private static String signFirstTime() throws AddressFormatException\n {\n ECKey key1 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n\n\n // Use the redeem script we have saved somewhere to start building the transaction\n Script redeemScript = new Script(hexStringToByteArray(\"5221021ae8964b8529dc3e52955f2cabd967e08c52008dbcca8e054143b668f3998f4a210306be609ef37366ab0f3dd4096ac23a6ee4d561fc469fa60003f799b0121ad1072102199f3d89fa00e6f55dd6ecdd911457d7264415914957db124d53bf0064963f3853ae\"));\n\n // Start building the transaction by adding the unspent inputs we want to use\n // The data is taken from blockchain.info, and can be found here: https://blockchain.info/rawtx/ca1884b8f2e0ba88249a86ec5ddca04f937f12d4fac299af41a9b51643302077\n Transaction spendTx = new Transaction(params);\n ScriptBuilder scriptBuilder = new ScriptBuilder();\n scriptBuilder.data(new String(\"a9145204ad7c5fa5a2491cd91c332e28c87221194ca087\").getBytes()); // Script of this output\n TransactionInput input = spendTx.addInput(new Sha256Hash(\"fed695bf5e2c15286956a7bd3464c5beb97ef064e1f9406eba189ea844733e7c\"), 1, scriptBuilder.build());\n\n // Add outputs to the person receiving bitcoins\n Address receiverAddress = new Address(params, \"n2cWhs5sbWFCwzuuWWsVM9ubPwykGtX75T\");\n Coin charge = Coin.valueOf(1000000); // 0.1 mBTC\n Script outputScript = ScriptBuilder.createOutputScript(receiverAddress);\n spendTx.addOutput(charge, outputScript);\n\n /*8888888888888888888888888888888888888888888888888888888888888*/\n\n // Sign the first part of the transaction using private key #1\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature ecdsaSignature = key1.sign(sighash);\n TransactionSignature transactionSignarture = new TransactionSignature(ecdsaSignature, Transaction.SigHash.ALL, false);\n\n // Create p2sh multisig input script\n Script inputScript = ScriptBuilder.createP2SHMultiSigInputScript(Arrays.asList(transactionSignarture), redeemScript);\n\n // Add the script signature to the input\n input.setScriptSig(inputScript);\n System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "private ArrayList<Long> storeTransactionInputs(long transactionId, ArrayList<TransactionInput> inputs, int isCoinbase){\n \t\tint inputindex = 0;\n \t\tlong previousOutputId;\n \t\tString prevOutputHash;\n \t\tResultSet findOutputResults;\n \t\tResultSet generatedKey;\n \t\tLong addressId;\n \t\tArrayList<Long> addressIdz=new ArrayList<Long>();\n \t\ttry {\n \t\tfor (TransactionInput i : inputs) {\n\t\t\t\n \t\t\tprevOutputHash = HexBin.encode(i.outpoint.hash);\n \t\t\tfindTransactionOutputStatement.setString(1, prevOutputHash);\n \t\t\tfindTransactionOutputStatement.setLong(2, i.outpoint.index);\n \t\t\tfindOutputResults = findTransactionOutputStatement\n \t\t\t\t\t.executeQuery();\n \t\t\tif (findOutputResults.next()) {\n \t\t\t\tpreviousOutputId = findOutputResults.getLong(1);\n\t\t\t\taddressId=findOutputResults.getLong(2);\n \t\t\t} else {\n \t\t\t\tpreviousOutputId = 0;\n\t\t\t\taddressId=null;\n \t\t\t}\n \t\t\tfindOutputResults.close();\n \t\t\tinsertTransactionInputStatement.setLong(1, transactionId);\n \t\t\tinsertTransactionInputStatement.setInt(2, inputindex);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(3, previousOutputId);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setString(4, prevOutputHash);\n \t\t\tinsertTransactionInputStatement\n \t\t\t\t\t.setLong(5, i.outpoint.index);\n \t\t\tinsertTransactionInputStatement.setLong(6,\n \t\t\t\t\ti.scriptBytes.length);\n \t\t\tinsertTransactionInputStatement.setString(7,\n \t\t\t\t\tHexBin.encode(i.scriptBytes));\n \t\t\tinsertTransactionInputStatement.setLong(8, i.sequence);\n \t\t\tinsertTransactionInputStatement.setBoolean(9,\n \t\t\t\t\ti.isCoinBase());\n\t\t\tif(addressId!=null){\n \t\t\t\tinsertTransactionInputStatement.setLong(10,addressId);\n \t\t\t\taddressIdz.add(addressId);\n\t\t\t} else {\n \t\t\t\t// TODO Auto-generated catch block\n \t\t\t\tinsertTransactionInputStatement.setNull(10,\n \t\t\t\t\t\tjava.sql.Types.INTEGER);\n \t\t\t}\n \t\t\tinsertTransactionInputStatement.execute();\n \t\t\t\n \t\t}\n \t\t\n \t\t\n \t} catch (SQLException e1) {\n \t\t// TODO Auto-generated catch block\n \t\te1.printStackTrace();\n \t}\n \t\treturn addressIdz;\n \t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputOrBuilder();", "List<TransactionVO> addPendingTransactions(List<SignedTransaction> transactions);", "@Test\n public void TxHandlerTestThird() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid output number(wrong number of coins to transfer)\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1 scrooge to alice 20coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: Alice --> Bob -5coins [*Invalid output number*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(-5, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n // tx3: Alice --> Bob 90coins [*Invalid output number*]\n Transaction tx3 = new Transaction();\n tx3.addInput(tx1.getHash(), 0);\n tx3.addOutput(90, pkBob.getPublic());\n tx3.signTx(pkAlice.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:one UTXO's remained\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n }", "@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }", "private static String signSecondTime(String transactionString)\n {\n Transaction spendTx = new Transaction(params, hexStringToByteArray(transactionString));\n\n // Get the input chunks\n Script inputScript = spendTx.getInput(0).getScriptSig();\n List<ScriptChunk> scriptChunks = inputScript.getChunks();\n\n // Create a list of all signatures. Start by extracting the existing ones from the list of script schunks.\n // The last signature in the script chunk list is the redeemScript\n List<TransactionSignature> signatureList = new ArrayList<TransactionSignature>();\n Iterator<ScriptChunk> iterator = scriptChunks.iterator();\n Script redeemScript = null;\n\n while (iterator.hasNext())\n {\n ScriptChunk chunk = iterator.next();\n\n if (iterator.hasNext() && chunk.opcode != 0)\n {\n TransactionSignature transactionSignarture = TransactionSignature.decodeFromBitcoin(chunk.data, false);\n signatureList.add(transactionSignarture);\n } else\n {\n redeemScript = new Script(chunk.data);\n }\n }\n\n // Create the sighash using the redeem script\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature secondSignature;\n\n // Take out the key and sign the signhash\n //ECKey key2 = createKeyFromSha256Passphrase(\"Super secret key 2\");\n ECKey key2 = ECKey.fromPrivate(new BigInteger(\"68123968917867656952640885027449260190826636504009580537802764798766700329220\"));\n// ECKey key2 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n secondSignature = key2.sign(sighash);\n\n // Add the second signature to the signature list\n TransactionSignature transactionSignarture = new TransactionSignature(secondSignature, Transaction.SigHash.ALL, false);\n signatureList.add(transactionSignarture);\n\n // Rebuild p2sh multisig input script\n inputScript = ScriptBuilder.createP2SHMultiSigInputScript(signatureList, redeemScript);\n spendTx.getInput(0).setScriptSig(inputScript);\n\n //System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutput getOutputs(int index);", "@Test\n public void testOutputsInUTXOPool() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is NOT put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n // UTXO pool does not contains the UTXO\n assertFalse(txHandler.isValidTx(tx1));\n\n // Put output of createCoinTx to the pool\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler1 = new TxHandler(utxoPool);\n\n // UTXO pool now contains the UTXO\n assertTrue(txHandler1.isValidTx(tx1));\n }", "@Test\n public void testValidBalance() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 100 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(100, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "RequestResult postSignRequests(TriphaseRequest[] requests) throws IOException,\n CertificateEncodingException, SAXException;", "public IBankTransfert payment();", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static boolean isSigned_entries_receiveEst() {\n return false;\n }", "com.google.protobuf.ByteString getTransactions(int index);", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "@Suspendable\n @Override\n public SignedTransaction call() throws FlowException {\n\n Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);\n//\n\n // Source\n AccountInfo issuerOwner = subFlow(new AccountInfoByName(acctNameSource)).get(0).getState().getData();\n PublicKey issuerOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty issuerOwnerAnonParty = new AnonymousParty(issuerOwnerKey);\n\n AccountInfo targetOwner = subFlow(new AccountInfoByName(acctNameTarget)).get(0).getState().getData();\n PublicKey targetOwnerKey = getServiceHub().getKeyManagementService().freshKey(issuerOwner.getIdentifier().getId());\n AnonymousParty targetOwnerAnonParty = new AnonymousParty(targetOwnerKey);\n\n\n AssetForAccountState outputAsset = new AssetForAccountState(issuerOwnerAnonParty, targetOwnerAnonParty,\n asset.getState().getData().getName(), asset.getState().getData().getValue());\n\n\n TransactionBuilder txBuilder = new TransactionBuilder(notary)\n .addInputState(asset)\n .addOutputState(outputAsset, AssetForAccountContract.ID)\n .addCommand(new AssetForAccountContract.Commands.Transfer(), issuerOwnerKey);\n\n txBuilder.verify(getServiceHub());\n\n SignedTransaction fullySignedTransaction = getServiceHub().signInitialTransaction(txBuilder, issuerOwnerKey);\n\n //return fullySignedTransaction;\n return subFlow(new FinalityFlow(fullySignedTransaction, Collections.emptyList()));\n }", "private boolean areOutputsSpent(Transaction tx){\n // Need to see if tx inputs are contained in the blockchain UTXOs\n for(TransactionInput i : tx.inputs){\n if(!currentBlockchain.UTXOs.containsKey(i.previousOutId)){\n return true;\n }\n }\n return false;\n }", "BigInteger getDigitalSignature();", "public static long deepTransactionCheck(Transaction tx, UtxoUpdateBuffer utxo_buffer, BlockHeader block_header, NetworkParams params)\n throws ValidationException\n {\n try(TimeRecordAuto tra_blk = TimeRecord.openAuto(\"Validation.deepTransactionCheck\"))\n {\n TransactionInner inner = null;\n\n try\n {\n inner = TransactionInner.parseFrom(tx.getInnerData());\n }\n catch(java.io.IOException e)\n {\n throw new ValidationException(\"error parsing tx on second pass somehow\", e);\n }\n\n long sum_of_inputs = 0L;\n // Make sure all inputs exist\n for(TransactionInput in : inner.getInputsList())\n {\n TransactionOutput matching_out = utxo_buffer.getOutputMatching(in);\n if (matching_out == null)\n {\n throw new ValidationException(String.format(\"No matching output for input %s\", new ChainHash(in.getSrcTxId())));\n }\n validateSpendable(matching_out, block_header, params);\n sum_of_inputs += matching_out.getValue();\n\n // SIP-4 check\n if (block_header.getBlockHeight() >= params.getActivationHeightTxInValue())\n {\n if (in.getValue() != 0L)\n {\n if (in.getValue() != matching_out.getValue())\n {\n throw new ValidationException(String.format(\"Input value does not match: %d %d\", matching_out.getValue(), in.getValue()));\n }\n }\n }\n utxo_buffer.useOutput(matching_out, new ChainHash(in.getSrcTxId()), in.getSrcTxOutIdx());\n }\n\n long spent = 0L;\n // Sum up all outputs\n int out_idx =0;\n ArrayList<ByteString> raw_output_list = TransactionUtil.extractWireFormatTxOut(tx);\n\n for(TransactionOutput out : inner.getOutputsList())\n {\n validateTransactionOutput(out, block_header, params);\n spent+=out.getValue();\n utxo_buffer.addOutput(raw_output_list, out, new ChainHash(tx.getTxHash()), out_idx);\n out_idx++;\n\n }\n\n spent+=inner.getFee();\n\n if (!inner.getIsCoinbase())\n {\n if (sum_of_inputs != spent)\n {\n throw new ValidationException(String.format(\"Transaction took in %d and spent %d\", sum_of_inputs, spent));\n }\n }\n \n return inner.getFee();\n }\n }", "@Test\n public void TxHandlerTestSecond() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the double spending\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(25, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1: one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx 2:Scrooge --> Bob 20coins [*Double-spending*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx0.getHash(), 0);\n tx2.addOutput(25, pkBob.getPublic());\n tx2.signTx(pkScrooge.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n\n }", "String signITRByAssesse(String PAN,String xml, DigitalSignatureWrapper digitalSignatureWrapper) throws MissingPrivateKeyException,InvalidDigitalSignatureException,Exception;", "public boolean processTransaction() {\r\n\t\t\r\n\t\t\tif(verifySignature() == false) {\r\n\t\t\t\tSystem.out.println(\"#Transaction Signature failed to verify\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\ttransactionId = calulateHash();\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder getOutputsOrBuilder(\n int index);", "public static boolean isSigned_receivets() {\n return true;\n }", "@Override\n public boolean isValid() {\n final BlockChainInt outputHash = getOutputHash();\n\n return inputs.stream().map(input -> input.verifySignature(outputHash)).reduce(true, (a, b) -> a && b)\n && outputs.stream().map(output -> output.getAmount() >= 0).reduce(true, (a, b) -> a && b)\n && getTransactionFee() >= 0;\n }", "@Override\n public void run() {\n byte[] deviceTxPayload = CoreServices.getOrCreateHardwareWalletService().get().getContext().getSerializedTx().toByteArray();\n\n log.info(\"DeviceTx payload:\\n{}\", Utils.HEX.encode(deviceTxPayload));\n\n // Load deviceTx\n Transaction deviceTx = new Transaction(MainNetParams.get(), deviceTxPayload);\n\n log.info(\"deviceTx:\\n{}\", deviceTx.toString());\n\n // Check the signatures are canonical\n for (TransactionInput txInput : deviceTx.getInputs()) {\n byte[] signature = txInput.getScriptSig().getChunks().get(0).data;\n if (signature != null) {\n log.debug(\n \"Is signature canonical test result '{}' for txInput '{}', signature '{}'\",\n TransactionSignature.isEncodingCanonical(signature),\n txInput.toString(),\n Utils.HEX.encode(signature));\n } else {\n log.warn(\"No signature data\");\n }\n }\n\n log.debug(\"Committing and broadcasting the last tx\");\n\n BitcoinNetworkService bitcoinNetworkService = CoreServices.getOrCreateBitcoinNetworkService();\n\n if (bitcoinNetworkService.getLastSendRequestSummaryOptional().isPresent()\n && bitcoinNetworkService.getLastWalletOptional().isPresent()) {\n\n SendRequestSummary sendRequestSummary = bitcoinNetworkService.getLastSendRequestSummaryOptional().get();\n\n // Check the unsigned and signed tx are essentially the same as a check against malware attacks on the Trezor\n if (TransactionUtils.checkEssentiallyEqual(sendRequestSummary.getSendRequest().get().tx, deviceTx)) {\n // Substitute the signed tx from the trezor\n log.debug(\n \"Substituting the Trezor signed tx '{}' for the unsigned version {}\",\n deviceTx.toString(),\n sendRequestSummary.getSendRequest().get().tx.toString()\n );\n sendRequestSummary.getSendRequest().get().tx = deviceTx;\n log.debug(\"The transaction fee was {}\", sendRequestSummary.getSendRequest().get().fee);\n\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_TRANSACTION_CREATED_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n\n // Get the last wallet\n Wallet wallet = bitcoinNetworkService.getLastWalletOptional().get();\n\n // Commit and broadcast\n bitcoinNetworkService.commitAndBroadcast(sendRequestSummary, wallet, paymentRequestData);\n\n // Ensure the header is switched off whilst the send is in progress\n ViewEvents.fireViewChangedEvent(ViewKey.HEADER, false);\n } else {\n // The signed transaction is essentially different from what was sent to it - abort send\n sendBitcoinConfirmTrezorPanelView.setOperationText(MessageKey.TREZOR_FAILURE_OPERATION);\n sendBitcoinConfirmTrezorPanelView.setRecoveryText(MessageKey.CLICK_NEXT_TO_CONTINUE);\n sendBitcoinConfirmTrezorPanelView.setDisplayVisible(false);\n }\n } else {\n log.debug(\"Cannot commit and broadcast the last send as it is not present in bitcoinNetworkService\");\n }\n // Clear the previous remembered tx\n bitcoinNetworkService.setLastSendRequestSummaryOptional(Optional.<SendRequestSummary>absent());\n bitcoinNetworkService.setLastWalletOptional(Optional.<Wallet>absent());\n }", "@Test\n public void TxHandlerTestForth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject invalid signature\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx1: scrooge to alice 20 coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:add one valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx2: alice to bob 20coins[signed by bob]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(20, pkBob.getPublic());\n tx2.signTx(pkBob.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:add one invalid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:one UTXO's remained.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n }", "@Override\n public byte[] createDataToSignInput(\n Transaction transaction,\n int inputIndex,\n long amountInSat,\n PublicKeyTriple publicKeyTriple) {\n\n final byte[] redeemScript = createRedeemScript(publicKeyTriple);\n\n return TransactionHelpers.getDataToSign(\n transaction,\n inputIndex,\n new Script(redeemScript)\n );\n }", "public TransactionResponse processAllTransaction() throws ParseException {\n TransactionResponse response = new TransactionResponse();\n\n //User0\n response.setTransaction(new Transaction(\"user0\",\"0001\", \"type0\",\"user0_Billing\",\"user0_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-00\")));\n\n //User1\n response.setTransaction(new Transaction(\"user1\", \"0101\",\"type0\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user1\", \"0102\", \"type1\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-00\")));\n\n //User2\n response.setTransaction(new Transaction(\"user2\", \"0201\", \"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-01-00\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0202\", \"type2\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0203\",\"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n //User3\n response.setTransaction(new Transaction(\"user3\", \"0301\",\"type0\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user3\", \"0302\",\"type1\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n return response;\n }", "com.dogecoin.protocols.payments.Protos.Output getOutputs(int index);", "@Test\n public void TxHandlerTestFifth() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the input not in the UtxoPool\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n //tx1: Scrooge --> Alice 20coins [Pay Coins *NOT added to UTXO pool* due to accidents]\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(20, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n utxo = new UTXO(tx1.getHash(),0);\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n utxoPool.removeUTXO(utxo);\n assertTrue(\"tx1:UTXO has been removed.\", utxoPool.getAllUTXO().size() == 0);\n\n\n // tx2: Alice --> Bob 15coins [Pay Coins *Previous Tx NOT in UTXO pool*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addOutput(15, pkBob.getPublic());\n tx2.signTx(pkAlice.getPrivate(), 0);\n\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 0);\n\n }", "Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);", "private static void createDummyTransactions() {\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 10L, new Transaction(10000d, \"cars\", 0L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 11L, new Transaction(15000d, \"shopping\", 10L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 12L, new Transaction(20000d, \"keys\", 11L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 13L, new Transaction(25000d, \"furniture\", 12L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 14L, new Transaction(30000d, \"keys\", 13L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 15L, new Transaction(40000d, \"cars\", 14L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 16L, new Transaction(50000d, \"cars\", 15L)));\n }", "@Test\n public void TxHandlerTestFirst() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test some basic functions of TxHandler\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n // tx0: Scrooge --> Scrooge 25coins [Create Coins]\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx( pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n\n // tx1: Scrooge --> Scrooge 4coins [Divide Coins]\n //\t Scrooge --> Scrooge 5coins\n //\t Scrooge --> Scrooge 6coins\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(),0);\n\n tx1.addOutput(4,pkScrooge.getPublic());\n tx1.addOutput(5,pkScrooge.getPublic());\n tx1.addOutput(6,pkScrooge.getPublic());\n\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx2: Scrooge --> Alice 4coins [Pay separately]\n //\t Scrooge --> Alice 5coins\n // Scrooge --> Bob 6coins\n Transaction tx2 = new Transaction();\n tx2.addInput(tx1.getHash(), 0);\n tx2.addInput(tx1.getHash(), 1);\n tx2.addInput(tx1.getHash(), 2);\n\n tx2.addOutput(4, pkAlice.getPublic());\n tx2.addOutput(5, pkAlice.getPublic());\n tx2.addOutput(6, pkBob.getPublic());\n\n tx2.signTx(pkScrooge.getPrivate(), 0);\n tx2.signTx(pkScrooge.getPrivate(), 1);\n tx2.signTx(pkScrooge.getPrivate(), 2);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:Three UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n\n // tx3:Alice --> Alice 2coins [Divide Coins]\n // Alice --> Alice 2coins\n Transaction tx3 = new Transaction();\n tx3.addInput(tx2.getHash(),0);\n\n tx3.addOutput(2, pkAlice.getPublic());\n tx3.addOutput(2, pkAlice.getPublic());\n\n tx3.signTx(pkAlice.getPrivate(),0);\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx3) returns: \" + txHandler.isValidTx(tx3));\n assertTrue(\"tx3:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx3}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx3:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 4);\n\n // tx4: Alice --> Bob 2coins [Pay jointly]\n // Alice --> Bob 5coins\n Transaction tx4 = new Transaction();\n tx4.addInput(tx3.getHash(),0);\n tx4.addInput(tx2.getHash(),1);\n\n tx4.addOutput(7, pkBob.getPublic());\n\n tx4.signTx(pkAlice.getPrivate(), 0);\n tx4.signTx(pkAlice.getPrivate(),1);\n\n\n txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx4) returns: \" + txHandler.isValidTx(tx4));\n assertTrue(\"tx4:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx4}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx4:Two UTXO's are created\", utxoPool.getAllUTXO().size() == 3);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n// System.out.println(\"tx3.hashCode returns: \" + tx3.hashCode());\n// System.out.println(\"tx4.hashCode returns: \" + tx4.hashCode());\n }", "public ParametricStatement[] createForPaymentTransaction(PaymentTransaction paymentTransaction)\n throws SQLException {\n int multiplier = 1;\n Date date = paymentTransaction.getProcessDate();\n if (paymentTransaction instanceof VoidTransaction) {\n VoidTransaction trans = (VoidTransaction)paymentTransaction;\n ITransaction originalTrans = trans.getOriginalTransaction();\n if (originalTrans instanceof PaymentTransaction) {\n multiplier = -1;\n paymentTransaction = (PaymentTransaction)originalTrans;\n } else {\n // Do nothing if original was not a payment transaction.\n return new ParametricStatement[0];\n }\n }\n ArrayList parametricStatements = new ArrayList();\n String storeId = paymentTransaction.getStore().getId();\n String operatorId = paymentTransaction.getTheOperator().getId();\n // String registerId = paymentTransaction.getId();\n // int registerIdIndex = registerId.indexOf('*') + 1;\n // registerId = registerId.substring(registerIdIndex, registerId.indexOf('*', registerIdIndex));\n String registerId = paymentTransaction.getRegisterId();\n PaymentSummary[] currentPaymentSummaries = this.selectByDateStoreId(date, storeId);\n List newPaymentSummaries = new ArrayList();\n Payment[] payments = paymentTransaction.getPaymentsArray();\n for (int paymentIndex = 0; paymentIndex < payments.length; paymentIndex++) {\n ArmCurrency paymentAmount = payments[paymentIndex].getAmount().multiply(multiplier);\n String paymentType = payments[paymentIndex].getTransactionPaymentName();\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n boolean found = false;\n //to find if this payment type is already in the database\n for (int summaryIndex = 0; summaryIndex < currentPaymentSummaries.length; summaryIndex++) {\n if (currentPaymentSummaries[summaryIndex].getEmployeeId().equals(operatorId)\n && currentPaymentSummaries[summaryIndex].getRegisterId().equals(registerId)\n && currentPaymentSummaries[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n currentPaymentSummaries[summaryIndex].doSetPaymentTotal(paymentAmount.add(\n currentPaymentSummaries[summaryIndex].getPaymentTotal()));\n int mediaCount = ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).\n getMediaCount();\n ((CMSPaymentSummary)currentPaymentSummaries[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n // work-around for cloudscape date truncation problem.\n currentPaymentSummaries[summaryIndex].doSetDate(date);\n List list = fromObjectToBean(currentPaymentSummaries[summaryIndex]).toList();\n list.add(currentPaymentSummaries[summaryIndex].getId());\n parametricStatements.add(new ParametricStatement(updateSql, list));\n break;\n }\n }\n //to find if it is already in the newPaymentSummaries List\n if (!found) {\n PaymentSummary[] newPaymentSummaryArray = (PaymentSummary[])newPaymentSummaries.toArray(new\n PaymentSummary[0]);\n for (int summaryIndex = 0; summaryIndex < newPaymentSummaryArray.length; summaryIndex++) {\n if (newPaymentSummaryArray[summaryIndex].getEmployeeId().equals(operatorId)\n && newPaymentSummaryArray[summaryIndex].getRegisterId().equals(registerId)\n && newPaymentSummaryArray[summaryIndex].getPaymentType().equals(paymentType)) {\n found = true;\n try {\n ArmCurrency newTotal = paymentAmount.add(newPaymentSummaryArray[summaryIndex].\n getPaymentTotal());\n int mediaCount = ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).\n getMediaCount();\n newPaymentSummaryArray[summaryIndex].doSetPaymentTotal(newTotal);\n ((CMSPaymentSummary)newPaymentSummaryArray[summaryIndex]).doSetMediaCount(mediaCount\n + 1);\n } catch (Exception ex) {\n // ignore??\n }\n }\n }\n }\n if (!found) {\n CMSPaymentSummary paymentSummary = new CMSPaymentSummary();\n paymentSummary.doSetDate(date);\n paymentSummary.doSetEmployeeId(operatorId);\n paymentSummary.doSetStoreId(storeId);\n paymentSummary.doSetRegisterId(registerId);\n paymentSummary.doSetPaymentTotal(paymentAmount);\n if (payments[paymentIndex] instanceof CMSForeignCash)\n paymentType = ((CMSForeignCash)payments[paymentIndex]).getEODTenderType();\n paymentSummary.doSetPaymentType(paymentType);\n paymentSummary.doSetId(this.getNextChelseaId());\n paymentSummary.doSetMediaCount(paymentSummary.getMediaCount() + 1);\n newPaymentSummaries.add(paymentSummary);\n }\n }\n for (int i = 0; i < newPaymentSummaries.size(); i++) {\n PaymentSummary paymentSummary = (PaymentSummary)newPaymentSummaries.get(i);\n parametricStatements.add(new ParametricStatement(insertSql\n , fromObjectToBean(paymentSummary).toList()));\n }\n return (ParametricStatement[])parametricStatements.toArray(new ParametricStatement[\n parametricStatements.size()]);\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "@Test\n public void transactionSum() {\n final Transaction transaction1 = new Transaction(\"774cedda\", State.CANCELED, 1000L, new Date());\n final Account account1 = new Account(\"1001\", 0L, Collections.singletonList(transaction1));\n final Transaction transaction2 = new Transaction(\"337868a7\", State.FINISHED, 8000L, new Date());\n final Transaction transaction3 = new Transaction(\"f8047f86\", State.CANCELED, 10000L, new Date());\n final Account account2 = new Account(\"1002\", 8000L, Arrays.asList(transaction2, transaction3));\n\n final long actual = calcSumOfCancelledTransOnNonEmptyAccounts(Arrays.asList(account1, account2));\n\n Assert.assertEquals(actual, 10_000L);\n }", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutputs(int index);", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public abstract void generateReceipt(Transaction trans);", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "java.util.List<? extends org.hyperledger.fabric.protos.token.Transaction.PlainOutputOrBuilder> \n getOutputsOrBuilderList();", "public Transaction getDummyTransaction(String action) {\n\n\t\t// Long payerAccountNum = 111l;\n\t\tLong payerRealmNum = 0l;\n\t\tLong payerShardNum = 0l;\n\t\t// Long nodeAccountNum=123l;\n\t\tLong nodeRealmNum = 0l;\n\t\tLong nodeShardNum = 0l;\n\t\tlong transactionFee = 0l;\n\t\tTimestamp startTime =\n\t\t\t\tRequestBuilder.getTimestamp(Instant.now(Clock.systemUTC()).minusSeconds(13));\n\t\tDuration transactionDuration = RequestBuilder.getDuration(100);\n\t\tboolean generateRecord = false;\n\t\tString memo = \"UnitTesting\";\n\t\tint thresholdValue = 10;\n\t\tList<Key> keyList = new ArrayList<>();\n\t\tKeyPair pair = new KeyPairGenerator().generateKeyPair();\n\t\tbyte[] pubKey = ((EdDSAPublicKey) pair.getPublic()).getAbyte();\n\t\tKey akey =\n\t\t\t\tKey.newBuilder().setEd25519(ByteString.copyFromUtf8((MiscUtils.commonsBytesToHex(pubKey)))).build();\n\t\tPrivateKey priv = pair.getPrivate();\n\t\tkeyList.add(akey);\n\t\tlong initBal = 100;\n\t\tlong sendRecordThreshold = 5;\n\t\tlong receiveRecordThreshold = 5;\n\t\tboolean receiverSign = false;\n\t\tDuration autoRenew = RequestBuilder.getDuration(100);\n\t\t;\n\t\tlong proxyAccountNum = 12345l;\n\t\tlong proxyRealmNum = 0l;\n\t\tlong proxyShardNum = 0l;\n\t\tint proxyFraction = 10;\n\t\tint maxReceiveProxyFraction = 10;\n\t\tlong shardID = 0l;\n\t\tlong realmID = 0l;\n\n\t\tTransaction trx = null;\n\t\tSignatureList sigList = SignatureList.getDefaultInstance();\n\t\tTimestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\n\t\t/**\n\t\t * SignatureList sigList = SignatureList.getDefaultInstance(); Transaction transferTx =\n\t\t * RequestBuilder.getCryptoTransferRequest( payer.getAccountNum(), payer.getRealmNum(),\n\t\t * payer.getShardNum(), nodeAccount.getAccountNum(), nodeAccount.getRealmNum(),\n\t\t * nodeAccount.getShardNum(), 800, timestamp, transactionDuration, false, \"test\", sigList,\n\t\t * payer.getAccountNum(), -100l, nodeAccount.getAccountNum(), 100l); transferTx =\n\t\t * TransactionSigner.signTransaction(transferTx, accountKeys.get(payer));\n\t\t */\n\n\t\tif (\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t\ttrx = RequestBuilder.getCryptoTransferRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 800, timestamp,\n\t\t\t\t\ttransactionDuration, false, \"test\", sigList, payerAccountId.getAccountNum(), -100l,\n\t\t\t\t\tnodeAccountId.getAccountNum(), 100l);\n\t\t\t// trx = TransactionSigner.signTransaction(trx, account2keyMap.get(payerAccountId));\n\t\t}\n\n\t\tif (\"createContract\".equalsIgnoreCase(action)) {\n\t\t\tFileID fileID = FileID.newBuilder().setFileNum(9999l).setRealmNum(1l).setShardNum(2l).build();\n\n\t\t\ttrx = RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 50000000000l, timestamp,\n\t\t\t\t\ttransactionDuration, true, \"createContract\", DEFAULT_CONTRACT_OP_GAS, fileID,\n\t\t\t\t\tByteString.EMPTY, 0, transactionDuration,\n\t\t\t\t\tSignatureList.newBuilder().addSigs(\n\t\t\t\t\t\t\tSignature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t\t\t\t\t\t.build(),\n\t\t\t\t\t\"\");\n\t\t}\n\n\t\t// if(\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t// long durationInSeconds = DAY_SEC * 30;\n\t\t// * Duration contractAutoRenew = Duration.newBuilder().setSeconds(durationInSeconds).build();\n\t\t// * Timestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\t\t// * Duration transactionDuration = RequestBuilder.getDuration(30, 0);\n\t\t// * Transaction createContractRequest =\n\t\t// RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t// * payerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t// * nodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 100l, timestamp,\n\t\t// transactionDuration, true, \"createContract\",\n\t\t// * DEFAULT_CONTRACT_OP_GAS, contractFile, ByteString.EMPTY, 0, contractAutoRenew,\n\t\t// * SignatureList.newBuilder()\n\t\t// *\n\t\t// .addSigs(Signature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t// * .build());\n\t\t// }\n\n\t\treturn trx;\n\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public static byte[] secondOutputStep(byte[] S){\n\t\tStringBuffer string = new StringBuffer();\n\t\tfor (int i = 1; i < S.length; i+=2) {\n\t\t\tstring.append(getBit(S[i],7));\n\t\t}\n\t\tbyte[] bval = new BigInteger(string.toString(), 2).toByteArray();\n\t\tif(bval.length > 16){\n\t\t\treturn Arrays.copyOfRange(bval,1,bval.length);\n\t\t}else{\n\t\t\treturn bval;\n\t\t}\n\t\t\n\t}", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "public double printOutput() {\r\n return calculateNetPay();\r\n }", "public boolean doTransaction() {\r\n int nonce = -1;\r\n TransactionOperation transactionOperation = null;\r\n try {\r\n double balance;\r\n \r\n //read the stream for requests from client\r\n byte[] cipherText = (byte [])is.readObject();\r\n \r\n // decrypt the ciphertext to obtain the signed message\r\n ATMSessionMessage atmSessionMessage = (ATMSessionMessage) crypto.decryptRijndael(cipherText, kSession);\r\n if(!(currTimeStamp < atmSessionMessage.getTimeStamp())) error (\"Time stamp does not match\");\r\n \r\n //interpret the transaction operation in the request\r\n SignedMessage signedMessage = atmSessionMessage.getSignedMessage();\r\n \r\n \r\n \t\t//verify signature\r\n \t\ttry {\r\n \t\t\tif(!crypto.verify(signedMessage.msg, signedMessage.signature, currAcct.kPub))\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"Digital signature failed...\");\r\n \t\t\t}\r\n \t\t\tSystem.out.println(\"Message signature valid...\");\r\n \t\t} catch (SignatureException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t} catch (KeyException e2) {\r\n \t\t\te2.printStackTrace();\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\t\r\n TransactionMessage transactionMessage = (TransactionMessage)signedMessage.getObject();\r\n transactionOperation = transactionMessage.getOperation();\r\n \r\n //print the signed message\r\n System.out.println(\"\\n\" + (new Date()).toString());\r\n System.out.println(signedMessage.toString());\r\n \r\n //strip out the parameters embedded \r\n nonce = atmSessionMessage.getNonce();\r\n double value = transactionMessage.getValue();\r\n \r\n //print the timestamp when the transaction takes place\r\n Date now = new Date();\r\n System.out.println(\"\\n\" + now.toString());\r\n \r\n //re-route the request to the appropriate handling function\r\n if(transactionOperation == TransactionOperation.Deposit) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" DEPOSIT: \" + value);\r\n currAcct.deposit(value);\r\n \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Deposit Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.Withdraw) {\r\n \t System.out.println(\"ACCT #:\" + currAcct.getNumber() + \" WITHDRAW: \" + value);\r\n \t currAcct.withdraw(value);\r\n \t \r\n System.out.println(\"\\n\" + (now).toString());\r\n System.out.println(\"Withdrawal Complete. BALANCE:\" + currAcct.getBalance());\r\n }\r\n else if(transactionOperation == TransactionOperation.EndSession) \r\n \t {\r\n \t \tSystem.out.println(\"\\nTerminating session with ACCT#: \" + currAcct.getNumber());\r\n \t \treturn false;\r\n \t \t\r\n \t }\r\n \r\n accts.save();\r\n //create a successful reply Success and set the balance\r\n balance = currAcct.getBalance(); \r\n transactionMessage = new TransactionMessage(MessageType.ResponseSuccess,transactionOperation,balance);\r\n atmSessionMessage = new ATMSessionMessage(transactionMessage);\r\n \r\n //set the nonce \r\n atmSessionMessage.setNonce(nonce);\r\n currTimeStamp = atmSessionMessage.getTimeStamp();\r\n //encrypt the response and send it\r\n cipherText = crypto.encryptRijndael(atmSessionMessage, kSession);\r\n os.writeObject((Serializable)cipherText);\r\n \r\n //Logging.....\r\n //get the signed message and encrypt it\r\n \r\n signedMessage.encryptMessage(this.kLog);\r\n \r\n //encrypt the action\r\n //archive the signed message for logging and non-repudiation purposes \r\n SignedAction signedAction = new SignedAction(currAcct.getNumber(), atmSessionMessage.getTimeStamp(), signedMessage);\r\n \r\n //flush out transaction record to the audit file\r\n BankServer.log.write(signedAction);\r\n \r\n\t return true;\r\n }\r\n catch(Exception e){\r\n if(e instanceof TransException) replyFailure(transactionOperation,nonce);\r\n System.out.println(\"Terminating session with ACCT#: \" + currAcct.getNumber());\r\n \t//e.printStackTrace();\r\n \r\n return true;\r\n }\r\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return transactions_.get(index);\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput getDelegatedOutput();", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_3() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16, RandomOrgClient.BLOB_FORMAT_HEX, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "@Test\n\tpublic void testTransfer() {\n\t\tAccount acc1 = new Account(00000, \"acc1\", true, 1000.00, 0, false);\n\t\tAccount acc2 = new Account(00001, \"acc2\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\t\taccounts.add(acc2);\n\n\t\ttransactions.add(0, new Transaction(10, \"acc1\", 00000, 0, \"\"));\n\t\ttransactions.add(1, new Transaction(02, \"acc1\", 00000, 200.00, \"\"));\n\t\ttransactions.add(2, new Transaction(02, \"acc2\", 00001, 200.00, \"\"));\n\t\ttransactions.add(3, new Transaction(00, \"acc1\", 00000, 0, \"\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\t// ArrayList<Account> expected = new ArrayList();\n\t\t// expected.add(0, new Account(00000, \"acc1\", true, 949.90, 0002, false));\n\t\t// expected.add(1, new Account(00001, \"acc2\", true, 1050.00, 0002, false));\n\n\t\tif (outContent.toString().contains(\"Money Transfered\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"money not transfered\", testResult);\n\t}", "public com.zenithbank.mtn.fleet.Transaction[] getCardTrans(boolean includeOpeningBalance) throws java.rmi.RemoteException;", "protected void pktsOut(int n) {}", "org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutputOrBuilder getDelegatedOutputOrBuilder();", "public void calculatePayment() {}", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_4_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString ticketId = roc.createTickets(1, true)[0].get(\"ticketId\").getAsString();\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tuserData, ticketId);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true, ticketId);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@Test\n public void fixedPayerAndReceiverTest() {\n double fixedRate = 0.015;\n GeneratorAttributeIR attribute = new GeneratorAttributeIR(Period.ofYears(7));\n double notional = 1.0e8;\n ZonedDateTime date = DateUtils.getUTCDate(2013, 9, 10);\n SwapFixedIborDefinition def1 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute);\n SwapFixedIborDefinition def2 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, true);\n assertEquals(def1, def2);\n SwapFixedIborDefinition def3 = GENERATOR_FROM_INDEX.generateInstrument(date, fixedRate, notional, attribute, false);\n assertFalse(def1.equals(def3));\n int nIbor = def1.getIborLeg().getNumberOfPayments();\n int nFixed = def1.getFixedLeg().getNumberOfPayments();\n assertEquals(nIbor, def3.getIborLeg().getNumberOfPayments());\n assertEquals(nFixed, def3.getFixedLeg().getNumberOfPayments());\n assertEquals(def1.getIborLeg().getIborIndex(), def3.getIborLeg().getIborIndex());\n assertEquals(def1.getIborLeg().getCalendar(), def3.getIborLeg().getCalendar());\n assertEquals(def1.getCurrency(), def3.getIborLeg().getCurrency());\n for (int i = 0; i < nIbor; ++i) {\n CouponIborDefinition ibor1 = def1.getIborLeg().getNthPayment(i);\n CouponIborDefinition ibor3 = def3.getIborLeg().getNthPayment(i);\n assertEquals(ibor1.getNotional(), -ibor3.getNotional());\n assertEquals(ibor1.getAccrualStartDate(), ibor3.getAccrualStartDate());\n assertEquals(ibor1.getAccrualEndDate(), ibor3.getAccrualEndDate());\n assertEquals(ibor1.getFixingDate(), ibor3.getFixingDate());\n assertEquals(ibor1.getPaymentDate(), ibor3.getPaymentDate());\n assertEquals(ibor1.getPaymentYearFraction(), ibor3.getPaymentYearFraction());\n }\n for (int i = 0; i < nFixed; ++i) {\n CouponFixedDefinition fixed1 = def1.getFixedLeg().getNthPayment(i);\n CouponFixedDefinition fixed3 = def3.getFixedLeg().getNthPayment(i);\n assertEquals(fixed1.getNotional(), -fixed3.getNotional());\n assertEquals(fixed1.getAccrualStartDate(), fixed3.getAccrualStartDate());\n assertEquals(fixed1.getAccrualEndDate(), fixed3.getAccrualEndDate());\n assertEquals(fixed1.getPaymentDate(), fixed3.getPaymentDate());\n assertEquals(fixed1.getPaymentYearFraction(), fixed3.getPaymentYearFraction());\n }\n }", "public static Transaction generateSendTransaction(String strPrivateKey, String creatorAddress, String receiverAddress,\n TransactionHistory transactionHistory) {\n List<Creation> creations = new ArrayList<Creation>();\n List<Input> inputs = new ArrayList<Input>();\n List<Output> outputs = new ArrayList<Output>();\n\n // Get sender address from private key\n BigInteger privateKey = Bitcoin.decodePrivateKey(strPrivateKey);\n byte[] publicKey = Bitcoin.generatePublicKey(privateKey);\n String senderAddress = Bitcoin.publicKeyToAddress(publicKey);\n\n // Variable for counting number of coupons in referred transaction outputs\n int couponsInInputs = 0;\n\n // Find previous transaction outputs to refer to\n Iterator<Transaction> transactionIterator = transactionHistory.iterator();\n while (transactionIterator.hasNext() && couponsInInputs < 1) {\n Transaction transaction = transactionIterator.next();\n Iterator<Output> outputIterator = transaction.getOutputs().iterator();\n while (outputIterator.hasNext() && couponsInInputs < 1) {\n Output output = outputIterator.next();\n if (output.getCreatorAddress().equals(creatorAddress) && output.getAddress().equals(senderAddress)\n && output.getInputId() == 0) {\n Input input = new Input(output.getOutputId());\n inputs.add(input);\n couponsInInputs += output.getAmount();\n }\n }\n }\n\n // Check if enough coupons are available\n if (couponsInInputs <= 0) {\n throw new IllegalArgumentException();\n }\n\n // Set that 1 coupon should be sent to receiver address\n Output output = new Output(creatorAddress, 1, receiverAddress);\n outputs.add(output);\n\n // Send remaining coupons in referred transaction outputs back to the user as change\n if (couponsInInputs > 1) {\n Output changeOutput = new Output(creatorAddress, couponsInInputs - 1, senderAddress);\n outputs.add(changeOutput);\n }\n\n // Create transaction, sign it and return it\n Transaction transaction = new Transaction(creations, inputs, outputs);\n transaction.signTransaction(privateKey);\n return transaction;\n\n }", "public int[] getTsumoPayment(boolean isDealer) {\r\n int[] output = new int[2];\r\n if (isDealer) {\r\n output[0] = basicPoints * 2;\r\n output[1] = 0;\r\n } else {\r\n output[0] = basicPoints * 1;\r\n output[1] = basicPoints * 2;\r\n }\r\n output[0] = (int)(100*Math.ceil(output[0]/100.0));\r\n output[1] = (int)(100*Math.ceil(output[1]/100.0));\r\n \r\n return output;\r\n }", "@Test\n\tpublic void validateSignatureBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock newBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE VALID\n\t\tassertEquals(true, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\ttransactionsSignature = new byte[64];\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID GENERATOR SIGNATURE\n\t\tnewBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), newBlock.getTimestamp(), newBlock.getGeneratingBalance(), generator, new byte[32]);\n\t\ttransactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t///CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//VALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = newBlock.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID TRANSACTION SIGNATURE\n\t\tassertEquals(true, newBlock.isSignatureValid());\t\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tpayment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(200).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK INVALID TRANSACTION SIGNATURE\n\t\tassertEquals(false, newBlock.isSignatureValid());\t\n\t}", "public double sumTransactions() {\n\t\treturn checkIfTransactionsExist(true);\n\t}", "public void printTransactions() {\n for (int i = 0; i < transactions.size(); i++) {\n\t\t\tint indeks = i+1;\n\t\t\tSystem.out.println(\"Transactions \" + indeks + \": \" + transactions.get(i).getType() + \" \" + transactions.get(i).getAmount());\n\t\t}\n }", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "java.util.List<org.hyperledger.fabric.protos.token.Transaction.PlainOutput> \n getOutputsList();", "@Override\r\n\tpublic byte[] countersign(final byte[] sign,\r\n final String algorithm,\r\n final CounterSignTarget targetType,\r\n final Object[] targets,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException {\r\n throw new UnsupportedOperationException(\"No es posible realizar contrafirmas de ficheros ODF\"); //$NON-NLS-1$\r\n }", "public int updatePayment2(int requestId, int amount);", "private void convertTransactionToBitStream(){\n bitTransactionList = new ArrayList<>();\n itemListMap2 = new HashMap<>();\n \n for(int i=0; i<transactions_set.size(); i++){\n ArrayList curr_tr = transactions_set.get(i);\n \n if(curr_tr.size() >= min_itemset_size_K){ \n int freqItem = 0;\n BitSet bitset = new BitSet(bitsetLen);\n \n for(int j=0; j<curr_tr.size(); j++){\n try{\n int item = (int)curr_tr.get(j);\n bitset.set(itemIndex.get(item), true);\n freqItem++;\n }\n catch(Exception e){}\n }\n if(freqItem >= min_itemset_size_K){\n bitTransactionList.add(bitset);\n// System.out.println(bitset);\n HashSet<BitSet> subset_2 = createSubsetsOfLen2(bitset);\n for(BitSet sub_b : subset_2){\n itemListMap2.put(sub_b, itemListMap2.getOrDefault(sub_b, 0)+1);\n }\n }\n }\n }\n \n itemListMap2.values().removeIf(val -> val<min_sup);\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_5_decimal() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t\t\r\n\t\t\t\tHashMap<String,Object> o2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, \r\n\t\t\t\t\t\tidentifier, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t\t\r\n\t\t\t\to = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\to2 = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, date, null, userData, null);\r\n\t\t\t\tcollector.checkThat(o.get(\"data\"), equalTo(o2.get(\"data\")));\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "@java.lang.Override\n public boolean hasPayment() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getTransactions(int index) {\n return instance.getTransactions(index);\n }", "protected int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws IOException {\n return serializator.write(output, mostSigBits) +\n serializator.write(output, leastSigBits);\n }", "public static void main(String[] args)\n\t{\n \n\t\tSystem.out.println(\"Enter the size of transaction array\");\n int trSize = sc.nextInt();\n\n // creating an array of provided size\n int[] transactions = new int[trSize];\n \n // get the elements of the array (in a loop)\n System.out.println(\"Enter the values of array\");\n for (int i = 0; i < transactions.length; i++) {\n transactions[i] = sc.nextInt();\n }\n // get the number of targets\n System.out.println(\"Enter the total no of targets that needs to be achieved\");\n int numTargets = sc.nextInt();\n \n // get in target one-by-one (loop)\n for (int i = 0; i < numTargets; i++) {\n \n \t// Get TargetValue\n System.out.println(\"Enter the value of target\");\n int target = sc.nextInt();\n \n int sum =0;\n for ( int j=0; j < transactions.length; j++) {\n \tsum = sum + transactions[j];\n \t\n \tif ( sum >= target) {\n \tSystem.out.println(\"Target achieved after \" + (j+1) + \" transactions\" );\n \tbreak; // break out of the innermost for loop\n \t}\n \t\n \t//we come to the last transactions, yet target is not achieved\n \tif (j == transactions.length - 1) {\n \t\tSystem.out.println( \"Given target is not achieved\");\n \t}\n \t\n }\n \n \n\t}\n\n}", "public void onOutputSpent(MoneroOutputWallet output);", "@Test\r\n\tpublic void testPositiveGenerateSignedIntegerSequences_2() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedIntegerSequences(3, 5, 0, 10, false, 10, userData);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, int[][].class, true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public double calculatePay() {\n\t\treturn 0;\r\n\t}", "public byte[] signNativeByTransDataDefault(UInt256 uInt256) {\n return new byte[0];\n }", "@Suspendable\n @Override\n protected void checkTransaction(SignedTransaction stx) throws FlowException {\n }", "com.google.protobuf.ByteString\n getTranCodeBytes();", "com.google.protobuf.ByteString\n getOutputBytes();", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedBlobs_1() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedBlobs(10, 16);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, String[].class);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public float getInputsValue() {\n\t\tfloat total = 0;\n\t\tfor (TransactionInput i : inputs) {\n\t\t\tif (i.getUTXO() == null)\n\t\t\t\tcontinue; // if Transaction can't be found skip it\n\t\t\ttotal += i.getUTXO().getValue();\n\t\t}\n\t\treturn total;\n\t}", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }" ]
[ "0.6157669", "0.5968836", "0.5894512", "0.575845", "0.57379013", "0.56862354", "0.5671643", "0.5638562", "0.55891097", "0.55805844", "0.5491049", "0.547115", "0.5430694", "0.535867", "0.535867", "0.535867", "0.5344417", "0.5307626", "0.5253172", "0.524015", "0.5189739", "0.51506877", "0.5134411", "0.51289254", "0.5127413", "0.50831395", "0.50639427", "0.5035688", "0.50094956", "0.49972042", "0.4990747", "0.4967469", "0.4967469", "0.4967469", "0.49642414", "0.4948274", "0.49423918", "0.49403173", "0.49305025", "0.49055907", "0.48962563", "0.48919266", "0.48815575", "0.48727128", "0.48690858", "0.48671517", "0.4864887", "0.48293087", "0.4796929", "0.47936854", "0.4792538", "0.47683463", "0.47675353", "0.47675353", "0.47675353", "0.47565505", "0.47514316", "0.47473222", "0.47313264", "0.47313264", "0.4730076", "0.47218332", "0.47160283", "0.47159252", "0.47158366", "0.4699172", "0.46933794", "0.46929714", "0.4690595", "0.4686018", "0.4673744", "0.4672201", "0.46678242", "0.46676886", "0.4667487", "0.46660423", "0.46638095", "0.46557528", "0.46553993", "0.46553993", "0.46553993", "0.46531892", "0.46475676", "0.46449953", "0.4624059", "0.46231604", "0.46201655", "0.46124235", "0.46085235", "0.46082187", "0.46068537", "0.46033576", "0.4602587", "0.45972705", "0.45952573", "0.4587196", "0.4582048", "0.4580939", "0.45772147", "0.45763913", "0.4568933" ]
0.0
-1
Where to send refunds, if a refund is necessary repeated .payments.Output refund_to = 3;
@java.lang.Override public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() { return refundTo_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public Integer getRefund() {\n return refund;\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public int getRefundId() {\n return refundId;\n }", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "private void addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureRefundToIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, refundTo_);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public String getRefundId() {\n return refundId;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //[email protected]\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public String getRefundReason() {\n return refundReason;\n }", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "int getRefundToCount();", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "private void removeRefundTo(int index) {\n ensureRefundToIsMutable();\n refundTo_.remove(index);\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "@Override\n\tpublic ResultBO<?> refundQuery(PayQueryParamVO payQueryParamVO) {\n\t\treturn super.refundQuery(payQueryParamVO);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public void refundConfirmation(String fName, String customerEmail, double price, int numOfTicket, int bookingNo){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"[email protected]\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"Refund Confirmation - Receipt\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \\t\"+fName + \"!\\n\\n\"\r\n\t + \"You requested on booking #\" +bookingNo+\".\"\r\n\t + \"Your \"+numOfTicket+\" ticket(s)\"\r\n\t + \" will be refunded within few days.\\n\"\r\n\t + \"Total refund price: $\"+price+\"\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "int updateByPrimaryKeySelective(TRefundOrder record);", "public void requestRefundResponse(Message message, JsonObject payload){\n System.out.println(\"Response Status Message:\" + message.getStatusMessage());\n AsyncResponse response = this.responseHandler.getRestResponseObject(message.getRequestId());\n response.resume(Response.status(message.getStatus()).entity(message.getStatusMessage()).build());\n }", "int updateByPrimaryKey(TRefundOrder record);", "@Test\n public void refundTicket() {\n Ticket ticket = givenTicketInOrderedBilled();\n\n // when\n boolean refundTicket = ticket.refundTicket();\n\n // then\n assertTrue(refundTicket);\n assertTicketInState(ticket, TicketStateType.TICKET_RETURNED, TransactionStateType.TRANSACTION_BILLED, 6);\n }", "int deleteByPrimaryKey(String refundorderid);", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "private void refundSeats() {\n\t\tint numSeats;\n\n\t\tSystem.out.print(\"Please enter the number of seats to refund: \");\n\t\tnumSeats = Integer.parseInt(sc.nextLine());\n\t\t\n\t\t// Reject attempt to refund more seats than are available\n\t\tif (numSeats > coach.numSeatsBooked()) {\n\t\t\tSystem.out.printf(\"Unable to refund %d seats. Only %d booked\\n\", \n\t\t\t\t\tnumSeats, coach.numSeatsBooked());\n\t\t\treturn;\n\t\t}\n\t\t// Refund each of the requested seats\n\t\tfor (int i = 0; i < numSeats; i++) {\n\t\t\tint seatPos;\n\t\t\tboolean refundResult;\n\t\t\tSystem.out.println(\"Seats refunded: \" + i);\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Please enter the seat position to refund: \");\n\t\t\t\tseatPos = Integer.parseInt(sc.nextLine());\n\t\t\t\t// Attempt to refund seat\n\t\t\t\trefundResult = coach.refundSeat(seatPos);\n\t\t\t\tif (refundResult == false)\n\t\t\t\t\tSystem.out.println(\"Seat position wasn't booked. Please try again\");\n\t\t\t} while (refundResult == false);\n\t\t}\n\t\tcoach.printReceipt();\n\t}", "@Test\n public void create() throws RazorpayException{\n JSONObject request = new JSONObject(\"{\" +\n \"\\\"amount\\\":\\\"100\\\",\" +\n \"\\\"speed\\\":\\\"normal\\\",\" +\n \"\\\"notes\\\":{\\\"notes_key_1\\\":\\\"BeammeupScotty.\\\",\" +\n \"\\\"notes_key_2\\\":\\\"Engage\\\"},\" +\n \"\\\"receipt\\\":\\\"ReceiptNo.31\\\"}\");\n\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 500100,\\n\" +\n \" \\\"receipt\\\": \\\"Receipt No. 31\\\",\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FCXKPFtYfPXJPy\\\",\\n\" +\n \" \\\"notes\\\": [],\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": null\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078866,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\"\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.create(request);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n assertEquals(\"refund\",fetch.get(\"entity\"));\n assertEquals(500100,(int)fetch.get(\"amount\"));\n assertEquals(\"INR\",fetch.get(\"currency\"));\n String createRequest = getHost(Constants.REFUNDS);\n verifySentRequest(true, request.toString(), createRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void refill(int amount) {\n myAmount = myAmount + amount;\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "public int updatePayment2(int requestId, int amount);", "abstract void updateRecurringTransactions(Ui ui) throws BankException;", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) {\n copyOnWrite();\n instance.setRefundTo(index,\n builderForValue.build());\n return this;\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@Override\n\tpublic void updateRefundExpressNo(WxAddress address) {\n\t\torderMapper.updateRefundExpressNo(address);\n\t}", "void savingListRecurringExpenditure(Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {\n // Testing redo loan\n RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();\n paramsPastDate.setDisbursalDateDD(\"25\");\n paramsPastDate.setDisbursalDateMM(\"02\");\n paramsPastDate.setDisbursalDateYYYY(\"2011\");\n paramsPastDate.setLoanAmount(\"3000.0\");\n paramsPastDate.setInterestRate(\"10\");\n paramsPastDate.setNumberOfInstallments(\"52\");\n RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();\n paramsCurrentDate.setDisbursalDateDD(\"22\");\n paramsCurrentDate.setDisbursalDateMM(\"2\");\n paramsCurrentDate.setDisbursalDateYYYY(\"2012\");\n LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal(\"Default Group\", \"WeeklyGroupFlatLoanWithOnetimeFee\", paramsPastDate, paramsCurrentDate, 0, true);\n loanAccountPage.verifyStatus(\"Active in Good Standing\");\n loanAccountPage.verifyPerformanceHistory(\"51\", \"0\");\n // Testing multiple reverse payments\n String payAmount = \"63\";\n String reverseNote = \"Reversed \";\n int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);\n for (int i = 0; i < 3; i++) {\n ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();\n applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));\n }\n verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);\n }" ]
[ "0.68370944", "0.6681329", "0.6634763", "0.64901006", "0.64587116", "0.63995904", "0.6312238", "0.6293596", "0.6288418", "0.6279265", "0.6277259", "0.6270693", "0.6268615", "0.6222925", "0.6180539", "0.6170511", "0.61689126", "0.6164209", "0.61356705", "0.6109727", "0.6103068", "0.6092381", "0.60068417", "0.59968257", "0.5988425", "0.5978771", "0.5945487", "0.5930432", "0.5899949", "0.5896912", "0.5889083", "0.58662415", "0.58019036", "0.5762031", "0.57353044", "0.57242036", "0.5693331", "0.56340647", "0.56234425", "0.5620447", "0.55960333", "0.559603", "0.5592814", "0.5533532", "0.551844", "0.54760706", "0.54592615", "0.5424499", "0.54047036", "0.5378222", "0.53679264", "0.53568435", "0.5329663", "0.5321128", "0.52991027", "0.52812773", "0.52741176", "0.5241854", "0.52357745", "0.52319705", "0.5229508", "0.52169293", "0.52099484", "0.51905406", "0.5120019", "0.50832796", "0.50649965", "0.5040515", "0.50067997", "0.49981776", "0.49972928", "0.4976616", "0.49266282", "0.4925381", "0.49243638", "0.49239317", "0.4896078", "0.4891509", "0.48818544", "0.48640975", "0.48607588", "0.48458338", "0.48438704", "0.48244044", "0.47945988", "0.4778403", "0.47762603", "0.47572893", "0.47532403", "0.4739214", "0.4737618", "0.47262642", "0.4725167", "0.47088572", "0.4705267", "0.47044212", "0.46677262", "0.46615815", "0.46509013", "0.46304008" ]
0.6498553
3
Where to send refunds, if a refund is necessary repeated .payments.Output refund_to = 3;
public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> getRefundToOrBuilderList() { return refundTo_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public Integer getRefund() {\n return refund;\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public int getRefundId() {\n return refundId;\n }", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "private void addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureRefundToIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, refundTo_);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public String getRefundId() {\n return refundId;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //[email protected]\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public String getRefundReason() {\n return refundReason;\n }", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "int getRefundToCount();", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "private void removeRefundTo(int index) {\n ensureRefundToIsMutable();\n refundTo_.remove(index);\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "@Override\n\tpublic ResultBO<?> refundQuery(PayQueryParamVO payQueryParamVO) {\n\t\treturn super.refundQuery(payQueryParamVO);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public void refundConfirmation(String fName, String customerEmail, double price, int numOfTicket, int bookingNo){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"[email protected]\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"Refund Confirmation - Receipt\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \\t\"+fName + \"!\\n\\n\"\r\n\t + \"You requested on booking #\" +bookingNo+\".\"\r\n\t + \"Your \"+numOfTicket+\" ticket(s)\"\r\n\t + \" will be refunded within few days.\\n\"\r\n\t + \"Total refund price: $\"+price+\"\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "int updateByPrimaryKeySelective(TRefundOrder record);", "public void requestRefundResponse(Message message, JsonObject payload){\n System.out.println(\"Response Status Message:\" + message.getStatusMessage());\n AsyncResponse response = this.responseHandler.getRestResponseObject(message.getRequestId());\n response.resume(Response.status(message.getStatus()).entity(message.getStatusMessage()).build());\n }", "int updateByPrimaryKey(TRefundOrder record);", "@Test\n public void refundTicket() {\n Ticket ticket = givenTicketInOrderedBilled();\n\n // when\n boolean refundTicket = ticket.refundTicket();\n\n // then\n assertTrue(refundTicket);\n assertTicketInState(ticket, TicketStateType.TICKET_RETURNED, TransactionStateType.TRANSACTION_BILLED, 6);\n }", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "int deleteByPrimaryKey(String refundorderid);", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "private void refundSeats() {\n\t\tint numSeats;\n\n\t\tSystem.out.print(\"Please enter the number of seats to refund: \");\n\t\tnumSeats = Integer.parseInt(sc.nextLine());\n\t\t\n\t\t// Reject attempt to refund more seats than are available\n\t\tif (numSeats > coach.numSeatsBooked()) {\n\t\t\tSystem.out.printf(\"Unable to refund %d seats. Only %d booked\\n\", \n\t\t\t\t\tnumSeats, coach.numSeatsBooked());\n\t\t\treturn;\n\t\t}\n\t\t// Refund each of the requested seats\n\t\tfor (int i = 0; i < numSeats; i++) {\n\t\t\tint seatPos;\n\t\t\tboolean refundResult;\n\t\t\tSystem.out.println(\"Seats refunded: \" + i);\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Please enter the seat position to refund: \");\n\t\t\t\tseatPos = Integer.parseInt(sc.nextLine());\n\t\t\t\t// Attempt to refund seat\n\t\t\t\trefundResult = coach.refundSeat(seatPos);\n\t\t\t\tif (refundResult == false)\n\t\t\t\t\tSystem.out.println(\"Seat position wasn't booked. Please try again\");\n\t\t\t} while (refundResult == false);\n\t\t}\n\t\tcoach.printReceipt();\n\t}", "@Test\n public void create() throws RazorpayException{\n JSONObject request = new JSONObject(\"{\" +\n \"\\\"amount\\\":\\\"100\\\",\" +\n \"\\\"speed\\\":\\\"normal\\\",\" +\n \"\\\"notes\\\":{\\\"notes_key_1\\\":\\\"BeammeupScotty.\\\",\" +\n \"\\\"notes_key_2\\\":\\\"Engage\\\"},\" +\n \"\\\"receipt\\\":\\\"ReceiptNo.31\\\"}\");\n\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 500100,\\n\" +\n \" \\\"receipt\\\": \\\"Receipt No. 31\\\",\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FCXKPFtYfPXJPy\\\",\\n\" +\n \" \\\"notes\\\": [],\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": null\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078866,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\"\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.create(request);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n assertEquals(\"refund\",fetch.get(\"entity\"));\n assertEquals(500100,(int)fetch.get(\"amount\"));\n assertEquals(\"INR\",fetch.get(\"currency\"));\n String createRequest = getHost(Constants.REFUNDS);\n verifySentRequest(true, request.toString(), createRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void refill(int amount) {\n myAmount = myAmount + amount;\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "public int updatePayment2(int requestId, int amount);", "abstract void updateRecurringTransactions(Ui ui) throws BankException;", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) {\n copyOnWrite();\n instance.setRefundTo(index,\n builderForValue.build());\n return this;\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@Override\n\tpublic void updateRefundExpressNo(WxAddress address) {\n\t\torderMapper.updateRefundExpressNo(address);\n\t}", "void savingListRecurringExpenditure(Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {\n // Testing redo loan\n RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();\n paramsPastDate.setDisbursalDateDD(\"25\");\n paramsPastDate.setDisbursalDateMM(\"02\");\n paramsPastDate.setDisbursalDateYYYY(\"2011\");\n paramsPastDate.setLoanAmount(\"3000.0\");\n paramsPastDate.setInterestRate(\"10\");\n paramsPastDate.setNumberOfInstallments(\"52\");\n RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();\n paramsCurrentDate.setDisbursalDateDD(\"22\");\n paramsCurrentDate.setDisbursalDateMM(\"2\");\n paramsCurrentDate.setDisbursalDateYYYY(\"2012\");\n LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal(\"Default Group\", \"WeeklyGroupFlatLoanWithOnetimeFee\", paramsPastDate, paramsCurrentDate, 0, true);\n loanAccountPage.verifyStatus(\"Active in Good Standing\");\n loanAccountPage.verifyPerformanceHistory(\"51\", \"0\");\n // Testing multiple reverse payments\n String payAmount = \"63\";\n String reverseNote = \"Reversed \";\n int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);\n for (int i = 0; i < 3; i++) {\n ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();\n applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));\n }\n verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);\n }" ]
[ "0.68360114", "0.6679548", "0.6636148", "0.64972943", "0.6489704", "0.6400954", "0.63106453", "0.62928164", "0.62868726", "0.62789595", "0.6276871", "0.62697357", "0.6269048", "0.6221172", "0.61808693", "0.6169364", "0.61678493", "0.6164", "0.61343324", "0.61085606", "0.61028427", "0.60915077", "0.6004669", "0.5998025", "0.5987001", "0.5980783", "0.5945281", "0.5929114", "0.58991045", "0.5897043", "0.5888135", "0.5869045", "0.5802867", "0.57613575", "0.5734901", "0.5724553", "0.5692248", "0.56333226", "0.562193", "0.5620339", "0.55948776", "0.55938464", "0.5591977", "0.55320287", "0.5518626", "0.5476253", "0.54583144", "0.54244095", "0.5404604", "0.53778553", "0.5367501", "0.53568405", "0.5329338", "0.5321334", "0.52995294", "0.5279812", "0.52729315", "0.5241934", "0.5237215", "0.52315784", "0.52289134", "0.5216264", "0.52098674", "0.51898277", "0.51189667", "0.50826937", "0.5065194", "0.50399506", "0.50068235", "0.49981308", "0.4997383", "0.49759045", "0.4927424", "0.49246466", "0.49245727", "0.49223724", "0.48961973", "0.48887706", "0.48819163", "0.48657683", "0.4859479", "0.48444656", "0.48432097", "0.48264188", "0.4795589", "0.47791338", "0.47773278", "0.47566816", "0.47538295", "0.47388142", "0.47366804", "0.4725859", "0.47243515", "0.47092706", "0.47049552", "0.47047704", "0.4668362", "0.46616542", "0.46512684", "0.4631796" ]
0.64574003
5
Where to send refunds, if a refund is necessary repeated .payments.Output refund_to = 3;
@java.lang.Override public int getRefundToCount() { return refundTo_.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public Integer getRefund() {\n return refund;\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public int getRefundId() {\n return refundId;\n }", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "private void addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureRefundToIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, refundTo_);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public String getRefundId() {\n return refundId;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //[email protected]\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public String getRefundReason() {\n return refundReason;\n }", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "int getRefundToCount();", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "private void removeRefundTo(int index) {\n ensureRefundToIsMutable();\n refundTo_.remove(index);\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "@Override\n\tpublic ResultBO<?> refundQuery(PayQueryParamVO payQueryParamVO) {\n\t\treturn super.refundQuery(payQueryParamVO);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public void refundConfirmation(String fName, String customerEmail, double price, int numOfTicket, int bookingNo){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"[email protected]\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"Refund Confirmation - Receipt\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \\t\"+fName + \"!\\n\\n\"\r\n\t + \"You requested on booking #\" +bookingNo+\".\"\r\n\t + \"Your \"+numOfTicket+\" ticket(s)\"\r\n\t + \" will be refunded within few days.\\n\"\r\n\t + \"Total refund price: $\"+price+\"\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "public void requestRefundResponse(Message message, JsonObject payload){\n System.out.println(\"Response Status Message:\" + message.getStatusMessage());\n AsyncResponse response = this.responseHandler.getRestResponseObject(message.getRequestId());\n response.resume(Response.status(message.getStatus()).entity(message.getStatusMessage()).build());\n }", "int updateByPrimaryKeySelective(TRefundOrder record);", "int updateByPrimaryKey(TRefundOrder record);", "@Test\n public void refundTicket() {\n Ticket ticket = givenTicketInOrderedBilled();\n\n // when\n boolean refundTicket = ticket.refundTicket();\n\n // then\n assertTrue(refundTicket);\n assertTicketInState(ticket, TicketStateType.TICKET_RETURNED, TransactionStateType.TRANSACTION_BILLED, 6);\n }", "int deleteByPrimaryKey(String refundorderid);", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "private void refundSeats() {\n\t\tint numSeats;\n\n\t\tSystem.out.print(\"Please enter the number of seats to refund: \");\n\t\tnumSeats = Integer.parseInt(sc.nextLine());\n\t\t\n\t\t// Reject attempt to refund more seats than are available\n\t\tif (numSeats > coach.numSeatsBooked()) {\n\t\t\tSystem.out.printf(\"Unable to refund %d seats. Only %d booked\\n\", \n\t\t\t\t\tnumSeats, coach.numSeatsBooked());\n\t\t\treturn;\n\t\t}\n\t\t// Refund each of the requested seats\n\t\tfor (int i = 0; i < numSeats; i++) {\n\t\t\tint seatPos;\n\t\t\tboolean refundResult;\n\t\t\tSystem.out.println(\"Seats refunded: \" + i);\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Please enter the seat position to refund: \");\n\t\t\t\tseatPos = Integer.parseInt(sc.nextLine());\n\t\t\t\t// Attempt to refund seat\n\t\t\t\trefundResult = coach.refundSeat(seatPos);\n\t\t\t\tif (refundResult == false)\n\t\t\t\t\tSystem.out.println(\"Seat position wasn't booked. Please try again\");\n\t\t\t} while (refundResult == false);\n\t\t}\n\t\tcoach.printReceipt();\n\t}", "@Test\n public void create() throws RazorpayException{\n JSONObject request = new JSONObject(\"{\" +\n \"\\\"amount\\\":\\\"100\\\",\" +\n \"\\\"speed\\\":\\\"normal\\\",\" +\n \"\\\"notes\\\":{\\\"notes_key_1\\\":\\\"BeammeupScotty.\\\",\" +\n \"\\\"notes_key_2\\\":\\\"Engage\\\"},\" +\n \"\\\"receipt\\\":\\\"ReceiptNo.31\\\"}\");\n\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 500100,\\n\" +\n \" \\\"receipt\\\": \\\"Receipt No. 31\\\",\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FCXKPFtYfPXJPy\\\",\\n\" +\n \" \\\"notes\\\": [],\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": null\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078866,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\"\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.create(request);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n assertEquals(\"refund\",fetch.get(\"entity\"));\n assertEquals(500100,(int)fetch.get(\"amount\"));\n assertEquals(\"INR\",fetch.get(\"currency\"));\n String createRequest = getHost(Constants.REFUNDS);\n verifySentRequest(true, request.toString(), createRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void refill(int amount) {\n myAmount = myAmount + amount;\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "public int updatePayment2(int requestId, int amount);", "abstract void updateRecurringTransactions(Ui ui) throws BankException;", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) {\n copyOnWrite();\n instance.setRefundTo(index,\n builderForValue.build());\n return this;\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@Override\n\tpublic void updateRefundExpressNo(WxAddress address) {\n\t\torderMapper.updateRefundExpressNo(address);\n\t}", "void savingListRecurringExpenditure(Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {\n // Testing redo loan\n RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();\n paramsPastDate.setDisbursalDateDD(\"25\");\n paramsPastDate.setDisbursalDateMM(\"02\");\n paramsPastDate.setDisbursalDateYYYY(\"2011\");\n paramsPastDate.setLoanAmount(\"3000.0\");\n paramsPastDate.setInterestRate(\"10\");\n paramsPastDate.setNumberOfInstallments(\"52\");\n RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();\n paramsCurrentDate.setDisbursalDateDD(\"22\");\n paramsCurrentDate.setDisbursalDateMM(\"2\");\n paramsCurrentDate.setDisbursalDateYYYY(\"2012\");\n LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal(\"Default Group\", \"WeeklyGroupFlatLoanWithOnetimeFee\", paramsPastDate, paramsCurrentDate, 0, true);\n loanAccountPage.verifyStatus(\"Active in Good Standing\");\n loanAccountPage.verifyPerformanceHistory(\"51\", \"0\");\n // Testing multiple reverse payments\n String payAmount = \"63\";\n String reverseNote = \"Reversed \";\n int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);\n for (int i = 0; i < 3; i++) {\n ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();\n applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));\n }\n verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);\n }" ]
[ "0.6839437", "0.6680613", "0.6635975", "0.6499321", "0.6490457", "0.6458926", "0.6402365", "0.63139385", "0.6293622", "0.62899035", "0.6281748", "0.62771493", "0.62715375", "0.6268417", "0.61813486", "0.61708945", "0.61694634", "0.6164383", "0.61377704", "0.61103094", "0.61031145", "0.609213", "0.60063714", "0.59991556", "0.5988771", "0.59807664", "0.59465134", "0.5931437", "0.5900396", "0.58982795", "0.58896095", "0.5869117", "0.58028674", "0.576247", "0.57359356", "0.5725726", "0.5694037", "0.5634923", "0.56233376", "0.5620061", "0.5596893", "0.55963147", "0.5593871", "0.55328155", "0.5519335", "0.5476796", "0.5459802", "0.5426127", "0.5405249", "0.5378597", "0.5369603", "0.53564173", "0.53299564", "0.5321421", "0.5299131", "0.5282377", "0.5275254", "0.52432394", "0.52383363", "0.5233235", "0.52299875", "0.5217916", "0.52113557", "0.5192442", "0.51205564", "0.508358", "0.506602", "0.50424784", "0.5007859", "0.49986988", "0.4997976", "0.497639", "0.49282253", "0.49257588", "0.49248254", "0.49246997", "0.48979342", "0.48907825", "0.4883142", "0.48660448", "0.48620477", "0.48459655", "0.48436323", "0.4825813", "0.4795157", "0.47787637", "0.47775146", "0.47583207", "0.47550797", "0.4740997", "0.4738704", "0.4726203", "0.47261393", "0.47093827", "0.47056523", "0.47047403", "0.4669512", "0.46636617", "0.46514887", "0.46316347" ]
0.62216836
14
Where to send refunds, if a refund is necessary repeated .payments.Output refund_to = 3;
@java.lang.Override public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) { return refundTo_.get(index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public Integer getRefund() {\n return refund;\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public int getRefundId() {\n return refundId;\n }", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "private void addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureRefundToIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, refundTo_);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public String getRefundId() {\n return refundId;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //[email protected]\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public String getRefundReason() {\n return refundReason;\n }", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "int getRefundToCount();", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "private void removeRefundTo(int index) {\n ensureRefundToIsMutable();\n refundTo_.remove(index);\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "@Override\n\tpublic ResultBO<?> refundQuery(PayQueryParamVO payQueryParamVO) {\n\t\treturn super.refundQuery(payQueryParamVO);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public void refundConfirmation(String fName, String customerEmail, double price, int numOfTicket, int bookingNo){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"[email protected]\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"Refund Confirmation - Receipt\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \\t\"+fName + \"!\\n\\n\"\r\n\t + \"You requested on booking #\" +bookingNo+\".\"\r\n\t + \"Your \"+numOfTicket+\" ticket(s)\"\r\n\t + \" will be refunded within few days.\\n\"\r\n\t + \"Total refund price: $\"+price+\"\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "int updateByPrimaryKeySelective(TRefundOrder record);", "public void requestRefundResponse(Message message, JsonObject payload){\n System.out.println(\"Response Status Message:\" + message.getStatusMessage());\n AsyncResponse response = this.responseHandler.getRestResponseObject(message.getRequestId());\n response.resume(Response.status(message.getStatus()).entity(message.getStatusMessage()).build());\n }", "int updateByPrimaryKey(TRefundOrder record);", "@Test\n public void refundTicket() {\n Ticket ticket = givenTicketInOrderedBilled();\n\n // when\n boolean refundTicket = ticket.refundTicket();\n\n // then\n assertTrue(refundTicket);\n assertTicketInState(ticket, TicketStateType.TICKET_RETURNED, TransactionStateType.TRANSACTION_BILLED, 6);\n }", "int deleteByPrimaryKey(String refundorderid);", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "private void refundSeats() {\n\t\tint numSeats;\n\n\t\tSystem.out.print(\"Please enter the number of seats to refund: \");\n\t\tnumSeats = Integer.parseInt(sc.nextLine());\n\t\t\n\t\t// Reject attempt to refund more seats than are available\n\t\tif (numSeats > coach.numSeatsBooked()) {\n\t\t\tSystem.out.printf(\"Unable to refund %d seats. Only %d booked\\n\", \n\t\t\t\t\tnumSeats, coach.numSeatsBooked());\n\t\t\treturn;\n\t\t}\n\t\t// Refund each of the requested seats\n\t\tfor (int i = 0; i < numSeats; i++) {\n\t\t\tint seatPos;\n\t\t\tboolean refundResult;\n\t\t\tSystem.out.println(\"Seats refunded: \" + i);\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Please enter the seat position to refund: \");\n\t\t\t\tseatPos = Integer.parseInt(sc.nextLine());\n\t\t\t\t// Attempt to refund seat\n\t\t\t\trefundResult = coach.refundSeat(seatPos);\n\t\t\t\tif (refundResult == false)\n\t\t\t\t\tSystem.out.println(\"Seat position wasn't booked. Please try again\");\n\t\t\t} while (refundResult == false);\n\t\t}\n\t\tcoach.printReceipt();\n\t}", "@Test\n public void create() throws RazorpayException{\n JSONObject request = new JSONObject(\"{\" +\n \"\\\"amount\\\":\\\"100\\\",\" +\n \"\\\"speed\\\":\\\"normal\\\",\" +\n \"\\\"notes\\\":{\\\"notes_key_1\\\":\\\"BeammeupScotty.\\\",\" +\n \"\\\"notes_key_2\\\":\\\"Engage\\\"},\" +\n \"\\\"receipt\\\":\\\"ReceiptNo.31\\\"}\");\n\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 500100,\\n\" +\n \" \\\"receipt\\\": \\\"Receipt No. 31\\\",\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FCXKPFtYfPXJPy\\\",\\n\" +\n \" \\\"notes\\\": [],\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": null\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078866,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\"\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.create(request);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n assertEquals(\"refund\",fetch.get(\"entity\"));\n assertEquals(500100,(int)fetch.get(\"amount\"));\n assertEquals(\"INR\",fetch.get(\"currency\"));\n String createRequest = getHost(Constants.REFUNDS);\n verifySentRequest(true, request.toString(), createRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void refill(int amount) {\n myAmount = myAmount + amount;\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "public int updatePayment2(int requestId, int amount);", "abstract void updateRecurringTransactions(Ui ui) throws BankException;", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) {\n copyOnWrite();\n instance.setRefundTo(index,\n builderForValue.build());\n return this;\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@Override\n\tpublic void updateRefundExpressNo(WxAddress address) {\n\t\torderMapper.updateRefundExpressNo(address);\n\t}", "void savingListRecurringExpenditure(Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {\n // Testing redo loan\n RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();\n paramsPastDate.setDisbursalDateDD(\"25\");\n paramsPastDate.setDisbursalDateMM(\"02\");\n paramsPastDate.setDisbursalDateYYYY(\"2011\");\n paramsPastDate.setLoanAmount(\"3000.0\");\n paramsPastDate.setInterestRate(\"10\");\n paramsPastDate.setNumberOfInstallments(\"52\");\n RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();\n paramsCurrentDate.setDisbursalDateDD(\"22\");\n paramsCurrentDate.setDisbursalDateMM(\"2\");\n paramsCurrentDate.setDisbursalDateYYYY(\"2012\");\n LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal(\"Default Group\", \"WeeklyGroupFlatLoanWithOnetimeFee\", paramsPastDate, paramsCurrentDate, 0, true);\n loanAccountPage.verifyStatus(\"Active in Good Standing\");\n loanAccountPage.verifyPerformanceHistory(\"51\", \"0\");\n // Testing multiple reverse payments\n String payAmount = \"63\";\n String reverseNote = \"Reversed \";\n int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);\n for (int i = 0; i < 3; i++) {\n ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();\n applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));\n }\n verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);\n }" ]
[ "0.6837944", "0.6680033", "0.6635527", "0.64984614", "0.6490293", "0.6458677", "0.640111", "0.6292688", "0.6289198", "0.62800956", "0.62770647", "0.62703866", "0.6268327", "0.62219656", "0.61801535", "0.61697423", "0.6169161", "0.6164256", "0.61364824", "0.6108931", "0.6102661", "0.6092728", "0.60053396", "0.5997363", "0.5988169", "0.59800667", "0.5945139", "0.59295446", "0.5900006", "0.5897482", "0.5889186", "0.58681554", "0.5802513", "0.57614625", "0.5735428", "0.5724823", "0.56932974", "0.5633742", "0.5622858", "0.56198025", "0.5595889", "0.5595132", "0.5592855", "0.55329424", "0.5518848", "0.54763395", "0.5459372", "0.54249287", "0.54048276", "0.53774804", "0.536774", "0.53553265", "0.53296226", "0.5320603", "0.5298545", "0.52805144", "0.5273551", "0.5242453", "0.52363044", "0.5232598", "0.5228981", "0.52167726", "0.5210289", "0.5191241", "0.511909", "0.5082907", "0.5064823", "0.50403845", "0.5006747", "0.49981862", "0.4996693", "0.49768206", "0.4927039", "0.49256676", "0.49243656", "0.49225584", "0.48957184", "0.4890607", "0.48827323", "0.4865215", "0.4860659", "0.4845886", "0.48433134", "0.4826012", "0.47943598", "0.47792602", "0.4777408", "0.4758452", "0.47537193", "0.47391224", "0.47372243", "0.47263432", "0.4724899", "0.47087073", "0.47056893", "0.47038674", "0.46679506", "0.46627954", "0.46511096", "0.46307105" ]
0.6312843
7
Where to send refunds, if a refund is necessary repeated .payments.Output refund_to = 3;
public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder( int index) { return refundTo_.get(index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public Integer getRefund() {\n return refund;\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public int getRefundId() {\n return refundId;\n }", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "private void addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureRefundToIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, refundTo_);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public String getRefundId() {\n return refundId;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //[email protected]\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public String getRefundReason() {\n return refundReason;\n }", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "int getRefundToCount();", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "private void removeRefundTo(int index) {\n ensureRefundToIsMutable();\n refundTo_.remove(index);\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "@Override\n\tpublic ResultBO<?> refundQuery(PayQueryParamVO payQueryParamVO) {\n\t\treturn super.refundQuery(payQueryParamVO);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public void refundConfirmation(String fName, String customerEmail, double price, int numOfTicket, int bookingNo){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"[email protected]\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"Refund Confirmation - Receipt\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \\t\"+fName + \"!\\n\\n\"\r\n\t + \"You requested on booking #\" +bookingNo+\".\"\r\n\t + \"Your \"+numOfTicket+\" ticket(s)\"\r\n\t + \" will be refunded within few days.\\n\"\r\n\t + \"Total refund price: $\"+price+\"\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "int updateByPrimaryKeySelective(TRefundOrder record);", "public void requestRefundResponse(Message message, JsonObject payload){\n System.out.println(\"Response Status Message:\" + message.getStatusMessage());\n AsyncResponse response = this.responseHandler.getRestResponseObject(message.getRequestId());\n response.resume(Response.status(message.getStatus()).entity(message.getStatusMessage()).build());\n }", "int updateByPrimaryKey(TRefundOrder record);", "@Test\n public void refundTicket() {\n Ticket ticket = givenTicketInOrderedBilled();\n\n // when\n boolean refundTicket = ticket.refundTicket();\n\n // then\n assertTrue(refundTicket);\n assertTicketInState(ticket, TicketStateType.TICKET_RETURNED, TransactionStateType.TRANSACTION_BILLED, 6);\n }", "int deleteByPrimaryKey(String refundorderid);", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "private void refundSeats() {\n\t\tint numSeats;\n\n\t\tSystem.out.print(\"Please enter the number of seats to refund: \");\n\t\tnumSeats = Integer.parseInt(sc.nextLine());\n\t\t\n\t\t// Reject attempt to refund more seats than are available\n\t\tif (numSeats > coach.numSeatsBooked()) {\n\t\t\tSystem.out.printf(\"Unable to refund %d seats. Only %d booked\\n\", \n\t\t\t\t\tnumSeats, coach.numSeatsBooked());\n\t\t\treturn;\n\t\t}\n\t\t// Refund each of the requested seats\n\t\tfor (int i = 0; i < numSeats; i++) {\n\t\t\tint seatPos;\n\t\t\tboolean refundResult;\n\t\t\tSystem.out.println(\"Seats refunded: \" + i);\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Please enter the seat position to refund: \");\n\t\t\t\tseatPos = Integer.parseInt(sc.nextLine());\n\t\t\t\t// Attempt to refund seat\n\t\t\t\trefundResult = coach.refundSeat(seatPos);\n\t\t\t\tif (refundResult == false)\n\t\t\t\t\tSystem.out.println(\"Seat position wasn't booked. Please try again\");\n\t\t\t} while (refundResult == false);\n\t\t}\n\t\tcoach.printReceipt();\n\t}", "@Test\n public void create() throws RazorpayException{\n JSONObject request = new JSONObject(\"{\" +\n \"\\\"amount\\\":\\\"100\\\",\" +\n \"\\\"speed\\\":\\\"normal\\\",\" +\n \"\\\"notes\\\":{\\\"notes_key_1\\\":\\\"BeammeupScotty.\\\",\" +\n \"\\\"notes_key_2\\\":\\\"Engage\\\"},\" +\n \"\\\"receipt\\\":\\\"ReceiptNo.31\\\"}\");\n\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 500100,\\n\" +\n \" \\\"receipt\\\": \\\"Receipt No. 31\\\",\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FCXKPFtYfPXJPy\\\",\\n\" +\n \" \\\"notes\\\": [],\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": null\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078866,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\"\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.create(request);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n assertEquals(\"refund\",fetch.get(\"entity\"));\n assertEquals(500100,(int)fetch.get(\"amount\"));\n assertEquals(\"INR\",fetch.get(\"currency\"));\n String createRequest = getHost(Constants.REFUNDS);\n verifySentRequest(true, request.toString(), createRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void refill(int amount) {\n myAmount = myAmount + amount;\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "public int updatePayment2(int requestId, int amount);", "abstract void updateRecurringTransactions(Ui ui) throws BankException;", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) {\n copyOnWrite();\n instance.setRefundTo(index,\n builderForValue.build());\n return this;\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@Override\n\tpublic void updateRefundExpressNo(WxAddress address) {\n\t\torderMapper.updateRefundExpressNo(address);\n\t}", "void savingListRecurringExpenditure(Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {\n // Testing redo loan\n RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();\n paramsPastDate.setDisbursalDateDD(\"25\");\n paramsPastDate.setDisbursalDateMM(\"02\");\n paramsPastDate.setDisbursalDateYYYY(\"2011\");\n paramsPastDate.setLoanAmount(\"3000.0\");\n paramsPastDate.setInterestRate(\"10\");\n paramsPastDate.setNumberOfInstallments(\"52\");\n RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();\n paramsCurrentDate.setDisbursalDateDD(\"22\");\n paramsCurrentDate.setDisbursalDateMM(\"2\");\n paramsCurrentDate.setDisbursalDateYYYY(\"2012\");\n LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal(\"Default Group\", \"WeeklyGroupFlatLoanWithOnetimeFee\", paramsPastDate, paramsCurrentDate, 0, true);\n loanAccountPage.verifyStatus(\"Active in Good Standing\");\n loanAccountPage.verifyPerformanceHistory(\"51\", \"0\");\n // Testing multiple reverse payments\n String payAmount = \"63\";\n String reverseNote = \"Reversed \";\n int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);\n for (int i = 0; i < 3; i++) {\n ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();\n applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));\n }\n verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);\n }" ]
[ "0.68370944", "0.6681329", "0.6634763", "0.6498553", "0.64901006", "0.64587116", "0.63995904", "0.6312238", "0.6293596", "0.6279265", "0.6277259", "0.6270693", "0.6268615", "0.6222925", "0.6180539", "0.6170511", "0.61689126", "0.6164209", "0.61356705", "0.6109727", "0.6103068", "0.6092381", "0.60068417", "0.59968257", "0.5988425", "0.5978771", "0.5945487", "0.5930432", "0.5899949", "0.5896912", "0.5889083", "0.58662415", "0.58019036", "0.5762031", "0.57353044", "0.57242036", "0.5693331", "0.56340647", "0.56234425", "0.5620447", "0.55960333", "0.559603", "0.5592814", "0.5533532", "0.551844", "0.54760706", "0.54592615", "0.5424499", "0.54047036", "0.5378222", "0.53679264", "0.53568435", "0.5329663", "0.5321128", "0.52991027", "0.52812773", "0.52741176", "0.5241854", "0.52357745", "0.52319705", "0.5229508", "0.52169293", "0.52099484", "0.51905406", "0.5120019", "0.50832796", "0.50649965", "0.5040515", "0.50067997", "0.49981776", "0.49972928", "0.4976616", "0.49266282", "0.4925381", "0.49243638", "0.49239317", "0.4896078", "0.4891509", "0.48818544", "0.48640975", "0.48607588", "0.48458338", "0.48438704", "0.48244044", "0.47945988", "0.4778403", "0.47762603", "0.47572893", "0.47532403", "0.4739214", "0.4737618", "0.47262642", "0.4725167", "0.47088572", "0.4705267", "0.47044212", "0.46677262", "0.46615815", "0.46509013", "0.46304008" ]
0.6288418
9
Where to send refunds, if a refund is necessary repeated .payments.Output refund_to = 3;
private void setRefundTo( int index, com.dogecoin.protocols.payments.Protos.Output value) { value.getClass(); ensureRefundToIsMutable(); refundTo_.set(index, value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public Integer getRefund() {\n return refund;\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public int getRefundId() {\n return refundId;\n }", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "private void addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureRefundToIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, refundTo_);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public String getRefundId() {\n return refundId;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //[email protected]\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public String getRefundReason() {\n return refundReason;\n }", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "int getRefundToCount();", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "private void removeRefundTo(int index) {\n ensureRefundToIsMutable();\n refundTo_.remove(index);\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "@Override\n\tpublic ResultBO<?> refundQuery(PayQueryParamVO payQueryParamVO) {\n\t\treturn super.refundQuery(payQueryParamVO);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public void refundConfirmation(String fName, String customerEmail, double price, int numOfTicket, int bookingNo){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"[email protected]\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"Refund Confirmation - Receipt\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \\t\"+fName + \"!\\n\\n\"\r\n\t + \"You requested on booking #\" +bookingNo+\".\"\r\n\t + \"Your \"+numOfTicket+\" ticket(s)\"\r\n\t + \" will be refunded within few days.\\n\"\r\n\t + \"Total refund price: $\"+price+\"\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "int updateByPrimaryKeySelective(TRefundOrder record);", "public void requestRefundResponse(Message message, JsonObject payload){\n System.out.println(\"Response Status Message:\" + message.getStatusMessage());\n AsyncResponse response = this.responseHandler.getRestResponseObject(message.getRequestId());\n response.resume(Response.status(message.getStatus()).entity(message.getStatusMessage()).build());\n }", "int updateByPrimaryKey(TRefundOrder record);", "@Test\n public void refundTicket() {\n Ticket ticket = givenTicketInOrderedBilled();\n\n // when\n boolean refundTicket = ticket.refundTicket();\n\n // then\n assertTrue(refundTicket);\n assertTicketInState(ticket, TicketStateType.TICKET_RETURNED, TransactionStateType.TRANSACTION_BILLED, 6);\n }", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "int deleteByPrimaryKey(String refundorderid);", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "private void refundSeats() {\n\t\tint numSeats;\n\n\t\tSystem.out.print(\"Please enter the number of seats to refund: \");\n\t\tnumSeats = Integer.parseInt(sc.nextLine());\n\t\t\n\t\t// Reject attempt to refund more seats than are available\n\t\tif (numSeats > coach.numSeatsBooked()) {\n\t\t\tSystem.out.printf(\"Unable to refund %d seats. Only %d booked\\n\", \n\t\t\t\t\tnumSeats, coach.numSeatsBooked());\n\t\t\treturn;\n\t\t}\n\t\t// Refund each of the requested seats\n\t\tfor (int i = 0; i < numSeats; i++) {\n\t\t\tint seatPos;\n\t\t\tboolean refundResult;\n\t\t\tSystem.out.println(\"Seats refunded: \" + i);\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Please enter the seat position to refund: \");\n\t\t\t\tseatPos = Integer.parseInt(sc.nextLine());\n\t\t\t\t// Attempt to refund seat\n\t\t\t\trefundResult = coach.refundSeat(seatPos);\n\t\t\t\tif (refundResult == false)\n\t\t\t\t\tSystem.out.println(\"Seat position wasn't booked. Please try again\");\n\t\t\t} while (refundResult == false);\n\t\t}\n\t\tcoach.printReceipt();\n\t}", "@Test\n public void create() throws RazorpayException{\n JSONObject request = new JSONObject(\"{\" +\n \"\\\"amount\\\":\\\"100\\\",\" +\n \"\\\"speed\\\":\\\"normal\\\",\" +\n \"\\\"notes\\\":{\\\"notes_key_1\\\":\\\"BeammeupScotty.\\\",\" +\n \"\\\"notes_key_2\\\":\\\"Engage\\\"},\" +\n \"\\\"receipt\\\":\\\"ReceiptNo.31\\\"}\");\n\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 500100,\\n\" +\n \" \\\"receipt\\\": \\\"Receipt No. 31\\\",\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FCXKPFtYfPXJPy\\\",\\n\" +\n \" \\\"notes\\\": [],\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": null\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078866,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\"\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.create(request);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n assertEquals(\"refund\",fetch.get(\"entity\"));\n assertEquals(500100,(int)fetch.get(\"amount\"));\n assertEquals(\"INR\",fetch.get(\"currency\"));\n String createRequest = getHost(Constants.REFUNDS);\n verifySentRequest(true, request.toString(), createRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void refill(int amount) {\n myAmount = myAmount + amount;\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "public int updatePayment2(int requestId, int amount);", "abstract void updateRecurringTransactions(Ui ui) throws BankException;", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) {\n copyOnWrite();\n instance.setRefundTo(index,\n builderForValue.build());\n return this;\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@Override\n\tpublic void updateRefundExpressNo(WxAddress address) {\n\t\torderMapper.updateRefundExpressNo(address);\n\t}", "void savingListRecurringExpenditure(Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {\n // Testing redo loan\n RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();\n paramsPastDate.setDisbursalDateDD(\"25\");\n paramsPastDate.setDisbursalDateMM(\"02\");\n paramsPastDate.setDisbursalDateYYYY(\"2011\");\n paramsPastDate.setLoanAmount(\"3000.0\");\n paramsPastDate.setInterestRate(\"10\");\n paramsPastDate.setNumberOfInstallments(\"52\");\n RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();\n paramsCurrentDate.setDisbursalDateDD(\"22\");\n paramsCurrentDate.setDisbursalDateMM(\"2\");\n paramsCurrentDate.setDisbursalDateYYYY(\"2012\");\n LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal(\"Default Group\", \"WeeklyGroupFlatLoanWithOnetimeFee\", paramsPastDate, paramsCurrentDate, 0, true);\n loanAccountPage.verifyStatus(\"Active in Good Standing\");\n loanAccountPage.verifyPerformanceHistory(\"51\", \"0\");\n // Testing multiple reverse payments\n String payAmount = \"63\";\n String reverseNote = \"Reversed \";\n int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);\n for (int i = 0; i < 3; i++) {\n ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();\n applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));\n }\n verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);\n }" ]
[ "0.68360114", "0.6679548", "0.6636148", "0.64972943", "0.6489704", "0.64574003", "0.6400954", "0.63106453", "0.62928164", "0.62868726", "0.62789595", "0.6276871", "0.62697357", "0.6269048", "0.6221172", "0.61808693", "0.6169364", "0.61678493", "0.6164", "0.61343324", "0.61085606", "0.61028427", "0.6004669", "0.5998025", "0.5987001", "0.5980783", "0.5945281", "0.5929114", "0.58991045", "0.5897043", "0.5888135", "0.5869045", "0.5802867", "0.57613575", "0.5734901", "0.5724553", "0.5692248", "0.56333226", "0.562193", "0.5620339", "0.55948776", "0.55938464", "0.5591977", "0.55320287", "0.5518626", "0.5476253", "0.54583144", "0.54244095", "0.5404604", "0.53778553", "0.5367501", "0.53568405", "0.5329338", "0.5321334", "0.52995294", "0.5279812", "0.52729315", "0.5241934", "0.5237215", "0.52315784", "0.52289134", "0.5216264", "0.52098674", "0.51898277", "0.51189667", "0.50826937", "0.5065194", "0.50399506", "0.50068235", "0.49981308", "0.4997383", "0.49759045", "0.4927424", "0.49246466", "0.49245727", "0.49223724", "0.48961973", "0.48887706", "0.48819163", "0.48657683", "0.4859479", "0.48444656", "0.48432097", "0.48264188", "0.4795589", "0.47791338", "0.47773278", "0.47566816", "0.47538295", "0.47388142", "0.47366804", "0.4725859", "0.47243515", "0.47092706", "0.47049552", "0.47047704", "0.4668362", "0.46616542", "0.46512684", "0.4631796" ]
0.60915077
22
Where to send refunds, if a refund is necessary repeated .payments.Output refund_to = 3;
private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) { value.getClass(); ensureRefundToIsMutable(); refundTo_.add(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public Integer getRefund() {\n return refund;\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public int getRefundId() {\n return refundId;\n }", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "private void addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureRefundToIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, refundTo_);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public String getRefundId() {\n return refundId;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //[email protected]\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public String getRefundReason() {\n return refundReason;\n }", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "int getRefundToCount();", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "private void removeRefundTo(int index) {\n ensureRefundToIsMutable();\n refundTo_.remove(index);\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "@Override\n\tpublic ResultBO<?> refundQuery(PayQueryParamVO payQueryParamVO) {\n\t\treturn super.refundQuery(payQueryParamVO);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public void refundConfirmation(String fName, String customerEmail, double price, int numOfTicket, int bookingNo){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"[email protected]\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"Refund Confirmation - Receipt\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \\t\"+fName + \"!\\n\\n\"\r\n\t + \"You requested on booking #\" +bookingNo+\".\"\r\n\t + \"Your \"+numOfTicket+\" ticket(s)\"\r\n\t + \" will be refunded within few days.\\n\"\r\n\t + \"Total refund price: $\"+price+\"\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "public void requestRefundResponse(Message message, JsonObject payload){\n System.out.println(\"Response Status Message:\" + message.getStatusMessage());\n AsyncResponse response = this.responseHandler.getRestResponseObject(message.getRequestId());\n response.resume(Response.status(message.getStatus()).entity(message.getStatusMessage()).build());\n }", "int updateByPrimaryKeySelective(TRefundOrder record);", "int updateByPrimaryKey(TRefundOrder record);", "@Test\n public void refundTicket() {\n Ticket ticket = givenTicketInOrderedBilled();\n\n // when\n boolean refundTicket = ticket.refundTicket();\n\n // then\n assertTrue(refundTicket);\n assertTicketInState(ticket, TicketStateType.TICKET_RETURNED, TransactionStateType.TRANSACTION_BILLED, 6);\n }", "int deleteByPrimaryKey(String refundorderid);", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "private void refundSeats() {\n\t\tint numSeats;\n\n\t\tSystem.out.print(\"Please enter the number of seats to refund: \");\n\t\tnumSeats = Integer.parseInt(sc.nextLine());\n\t\t\n\t\t// Reject attempt to refund more seats than are available\n\t\tif (numSeats > coach.numSeatsBooked()) {\n\t\t\tSystem.out.printf(\"Unable to refund %d seats. Only %d booked\\n\", \n\t\t\t\t\tnumSeats, coach.numSeatsBooked());\n\t\t\treturn;\n\t\t}\n\t\t// Refund each of the requested seats\n\t\tfor (int i = 0; i < numSeats; i++) {\n\t\t\tint seatPos;\n\t\t\tboolean refundResult;\n\t\t\tSystem.out.println(\"Seats refunded: \" + i);\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Please enter the seat position to refund: \");\n\t\t\t\tseatPos = Integer.parseInt(sc.nextLine());\n\t\t\t\t// Attempt to refund seat\n\t\t\t\trefundResult = coach.refundSeat(seatPos);\n\t\t\t\tif (refundResult == false)\n\t\t\t\t\tSystem.out.println(\"Seat position wasn't booked. Please try again\");\n\t\t\t} while (refundResult == false);\n\t\t}\n\t\tcoach.printReceipt();\n\t}", "@Test\n public void create() throws RazorpayException{\n JSONObject request = new JSONObject(\"{\" +\n \"\\\"amount\\\":\\\"100\\\",\" +\n \"\\\"speed\\\":\\\"normal\\\",\" +\n \"\\\"notes\\\":{\\\"notes_key_1\\\":\\\"BeammeupScotty.\\\",\" +\n \"\\\"notes_key_2\\\":\\\"Engage\\\"},\" +\n \"\\\"receipt\\\":\\\"ReceiptNo.31\\\"}\");\n\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 500100,\\n\" +\n \" \\\"receipt\\\": \\\"Receipt No. 31\\\",\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FCXKPFtYfPXJPy\\\",\\n\" +\n \" \\\"notes\\\": [],\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": null\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078866,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\"\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.create(request);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n assertEquals(\"refund\",fetch.get(\"entity\"));\n assertEquals(500100,(int)fetch.get(\"amount\"));\n assertEquals(\"INR\",fetch.get(\"currency\"));\n String createRequest = getHost(Constants.REFUNDS);\n verifySentRequest(true, request.toString(), createRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void refill(int amount) {\n myAmount = myAmount + amount;\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "public int updatePayment2(int requestId, int amount);", "abstract void updateRecurringTransactions(Ui ui) throws BankException;", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) {\n copyOnWrite();\n instance.setRefundTo(index,\n builderForValue.build());\n return this;\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@Override\n\tpublic void updateRefundExpressNo(WxAddress address) {\n\t\torderMapper.updateRefundExpressNo(address);\n\t}", "void savingListRecurringExpenditure(Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {\n // Testing redo loan\n RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();\n paramsPastDate.setDisbursalDateDD(\"25\");\n paramsPastDate.setDisbursalDateMM(\"02\");\n paramsPastDate.setDisbursalDateYYYY(\"2011\");\n paramsPastDate.setLoanAmount(\"3000.0\");\n paramsPastDate.setInterestRate(\"10\");\n paramsPastDate.setNumberOfInstallments(\"52\");\n RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();\n paramsCurrentDate.setDisbursalDateDD(\"22\");\n paramsCurrentDate.setDisbursalDateMM(\"2\");\n paramsCurrentDate.setDisbursalDateYYYY(\"2012\");\n LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal(\"Default Group\", \"WeeklyGroupFlatLoanWithOnetimeFee\", paramsPastDate, paramsCurrentDate, 0, true);\n loanAccountPage.verifyStatus(\"Active in Good Standing\");\n loanAccountPage.verifyPerformanceHistory(\"51\", \"0\");\n // Testing multiple reverse payments\n String payAmount = \"63\";\n String reverseNote = \"Reversed \";\n int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);\n for (int i = 0; i < 3; i++) {\n ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();\n applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));\n }\n verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);\n }" ]
[ "0.6839437", "0.6680613", "0.6635975", "0.6499321", "0.6458926", "0.6402365", "0.63139385", "0.6293622", "0.62899035", "0.6281748", "0.62771493", "0.62715375", "0.6268417", "0.62216836", "0.61813486", "0.61708945", "0.61694634", "0.6164383", "0.61377704", "0.61103094", "0.61031145", "0.609213", "0.60063714", "0.59991556", "0.5988771", "0.59807664", "0.59465134", "0.5931437", "0.5900396", "0.58982795", "0.58896095", "0.5869117", "0.58028674", "0.576247", "0.57359356", "0.5725726", "0.5694037", "0.5634923", "0.56233376", "0.5620061", "0.5596893", "0.55963147", "0.5593871", "0.55328155", "0.5519335", "0.5476796", "0.5459802", "0.5426127", "0.5405249", "0.5378597", "0.5369603", "0.53564173", "0.53299564", "0.5321421", "0.5299131", "0.5282377", "0.5275254", "0.52432394", "0.52383363", "0.5233235", "0.52299875", "0.5217916", "0.52113557", "0.5192442", "0.51205564", "0.508358", "0.506602", "0.50424784", "0.5007859", "0.49986988", "0.4997976", "0.497639", "0.49282253", "0.49257588", "0.49248254", "0.49246997", "0.48979342", "0.48907825", "0.4883142", "0.48660448", "0.48620477", "0.48459655", "0.48436323", "0.4825813", "0.4795157", "0.47787637", "0.47775146", "0.47583207", "0.47550797", "0.4740997", "0.4738704", "0.4726203", "0.47261393", "0.47093827", "0.47056523", "0.47047403", "0.4669512", "0.46636617", "0.46514887", "0.46316347" ]
0.6490457
4
Where to send refunds, if a refund is necessary repeated .payments.Output refund_to = 3;
private void addRefundTo( int index, com.dogecoin.protocols.payments.Protos.Output value) { value.getClass(); ensureRefundToIsMutable(); refundTo_.add(index, value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public Integer getRefund() {\n return refund;\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public int getRefundId() {\n return refundId;\n }", "private void addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureRefundToIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, refundTo_);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public String getRefundId() {\n return refundId;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //[email protected]\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public String getRefundReason() {\n return refundReason;\n }", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "int getRefundToCount();", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "private void removeRefundTo(int index) {\n ensureRefundToIsMutable();\n refundTo_.remove(index);\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "@Override\n\tpublic ResultBO<?> refundQuery(PayQueryParamVO payQueryParamVO) {\n\t\treturn super.refundQuery(payQueryParamVO);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public void refundConfirmation(String fName, String customerEmail, double price, int numOfTicket, int bookingNo){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"[email protected]\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"Refund Confirmation - Receipt\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \\t\"+fName + \"!\\n\\n\"\r\n\t + \"You requested on booking #\" +bookingNo+\".\"\r\n\t + \"Your \"+numOfTicket+\" ticket(s)\"\r\n\t + \" will be refunded within few days.\\n\"\r\n\t + \"Total refund price: $\"+price+\"\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "int updateByPrimaryKeySelective(TRefundOrder record);", "public void requestRefundResponse(Message message, JsonObject payload){\n System.out.println(\"Response Status Message:\" + message.getStatusMessage());\n AsyncResponse response = this.responseHandler.getRestResponseObject(message.getRequestId());\n response.resume(Response.status(message.getStatus()).entity(message.getStatusMessage()).build());\n }", "int updateByPrimaryKey(TRefundOrder record);", "@Test\n public void refundTicket() {\n Ticket ticket = givenTicketInOrderedBilled();\n\n // when\n boolean refundTicket = ticket.refundTicket();\n\n // then\n assertTrue(refundTicket);\n assertTicketInState(ticket, TicketStateType.TICKET_RETURNED, TransactionStateType.TRANSACTION_BILLED, 6);\n }", "int deleteByPrimaryKey(String refundorderid);", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "private void refundSeats() {\n\t\tint numSeats;\n\n\t\tSystem.out.print(\"Please enter the number of seats to refund: \");\n\t\tnumSeats = Integer.parseInt(sc.nextLine());\n\t\t\n\t\t// Reject attempt to refund more seats than are available\n\t\tif (numSeats > coach.numSeatsBooked()) {\n\t\t\tSystem.out.printf(\"Unable to refund %d seats. Only %d booked\\n\", \n\t\t\t\t\tnumSeats, coach.numSeatsBooked());\n\t\t\treturn;\n\t\t}\n\t\t// Refund each of the requested seats\n\t\tfor (int i = 0; i < numSeats; i++) {\n\t\t\tint seatPos;\n\t\t\tboolean refundResult;\n\t\t\tSystem.out.println(\"Seats refunded: \" + i);\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Please enter the seat position to refund: \");\n\t\t\t\tseatPos = Integer.parseInt(sc.nextLine());\n\t\t\t\t// Attempt to refund seat\n\t\t\t\trefundResult = coach.refundSeat(seatPos);\n\t\t\t\tif (refundResult == false)\n\t\t\t\t\tSystem.out.println(\"Seat position wasn't booked. Please try again\");\n\t\t\t} while (refundResult == false);\n\t\t}\n\t\tcoach.printReceipt();\n\t}", "@Test\n public void create() throws RazorpayException{\n JSONObject request = new JSONObject(\"{\" +\n \"\\\"amount\\\":\\\"100\\\",\" +\n \"\\\"speed\\\":\\\"normal\\\",\" +\n \"\\\"notes\\\":{\\\"notes_key_1\\\":\\\"BeammeupScotty.\\\",\" +\n \"\\\"notes_key_2\\\":\\\"Engage\\\"},\" +\n \"\\\"receipt\\\":\\\"ReceiptNo.31\\\"}\");\n\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 500100,\\n\" +\n \" \\\"receipt\\\": \\\"Receipt No. 31\\\",\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FCXKPFtYfPXJPy\\\",\\n\" +\n \" \\\"notes\\\": [],\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": null\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078866,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\"\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.create(request);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n assertEquals(\"refund\",fetch.get(\"entity\"));\n assertEquals(500100,(int)fetch.get(\"amount\"));\n assertEquals(\"INR\",fetch.get(\"currency\"));\n String createRequest = getHost(Constants.REFUNDS);\n verifySentRequest(true, request.toString(), createRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void refill(int amount) {\n myAmount = myAmount + amount;\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "public int updatePayment2(int requestId, int amount);", "abstract void updateRecurringTransactions(Ui ui) throws BankException;", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) {\n copyOnWrite();\n instance.setRefundTo(index,\n builderForValue.build());\n return this;\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@Override\n\tpublic void updateRefundExpressNo(WxAddress address) {\n\t\torderMapper.updateRefundExpressNo(address);\n\t}", "void savingListRecurringExpenditure(Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {\n // Testing redo loan\n RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();\n paramsPastDate.setDisbursalDateDD(\"25\");\n paramsPastDate.setDisbursalDateMM(\"02\");\n paramsPastDate.setDisbursalDateYYYY(\"2011\");\n paramsPastDate.setLoanAmount(\"3000.0\");\n paramsPastDate.setInterestRate(\"10\");\n paramsPastDate.setNumberOfInstallments(\"52\");\n RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();\n paramsCurrentDate.setDisbursalDateDD(\"22\");\n paramsCurrentDate.setDisbursalDateMM(\"2\");\n paramsCurrentDate.setDisbursalDateYYYY(\"2012\");\n LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal(\"Default Group\", \"WeeklyGroupFlatLoanWithOnetimeFee\", paramsPastDate, paramsCurrentDate, 0, true);\n loanAccountPage.verifyStatus(\"Active in Good Standing\");\n loanAccountPage.verifyPerformanceHistory(\"51\", \"0\");\n // Testing multiple reverse payments\n String payAmount = \"63\";\n String reverseNote = \"Reversed \";\n int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);\n for (int i = 0; i < 3; i++) {\n ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();\n applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));\n }\n verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);\n }" ]
[ "0.6837944", "0.6680033", "0.6635527", "0.64984614", "0.6490293", "0.6458677", "0.640111", "0.6312843", "0.6292688", "0.6289198", "0.62800956", "0.62770647", "0.62703866", "0.6268327", "0.62219656", "0.61801535", "0.61697423", "0.6164256", "0.61364824", "0.6108931", "0.6102661", "0.6092728", "0.60053396", "0.5997363", "0.5988169", "0.59800667", "0.5945139", "0.59295446", "0.5900006", "0.5897482", "0.5889186", "0.58681554", "0.5802513", "0.57614625", "0.5735428", "0.5724823", "0.56932974", "0.5633742", "0.5622858", "0.56198025", "0.5595889", "0.5595132", "0.5592855", "0.55329424", "0.5518848", "0.54763395", "0.5459372", "0.54249287", "0.54048276", "0.53774804", "0.536774", "0.53553265", "0.53296226", "0.5320603", "0.5298545", "0.52805144", "0.5273551", "0.5242453", "0.52363044", "0.5232598", "0.5228981", "0.52167726", "0.5210289", "0.5191241", "0.511909", "0.5082907", "0.5064823", "0.50403845", "0.5006747", "0.49981862", "0.4996693", "0.49768206", "0.4927039", "0.49256676", "0.49243656", "0.49225584", "0.48957184", "0.4890607", "0.48827323", "0.4865215", "0.4860659", "0.4845886", "0.48433134", "0.4826012", "0.47943598", "0.47792602", "0.4777408", "0.4758452", "0.47537193", "0.47391224", "0.47372243", "0.47263432", "0.4724899", "0.47087073", "0.47056893", "0.47038674", "0.46679506", "0.46627954", "0.46511096", "0.46307105" ]
0.6169161
17
Where to send refunds, if a refund is necessary repeated .payments.Output refund_to = 3;
private void addAllRefundTo( java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) { ensureRefundToIsMutable(); com.google.protobuf.AbstractMessageLite.addAll( values, refundTo_); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public Integer getRefund() {\n return refund;\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public int getRefundId() {\n return refundId;\n }", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public String getRefundId() {\n return refundId;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //[email protected]\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public String getRefundReason() {\n return refundReason;\n }", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "int getRefundToCount();", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "private void removeRefundTo(int index) {\n ensureRefundToIsMutable();\n refundTo_.remove(index);\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "@Override\n\tpublic ResultBO<?> refundQuery(PayQueryParamVO payQueryParamVO) {\n\t\treturn super.refundQuery(payQueryParamVO);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public void refundConfirmation(String fName, String customerEmail, double price, int numOfTicket, int bookingNo){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"[email protected]\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"Refund Confirmation - Receipt\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \\t\"+fName + \"!\\n\\n\"\r\n\t + \"You requested on booking #\" +bookingNo+\".\"\r\n\t + \"Your \"+numOfTicket+\" ticket(s)\"\r\n\t + \" will be refunded within few days.\\n\"\r\n\t + \"Total refund price: $\"+price+\"\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "int updateByPrimaryKeySelective(TRefundOrder record);", "public void requestRefundResponse(Message message, JsonObject payload){\n System.out.println(\"Response Status Message:\" + message.getStatusMessage());\n AsyncResponse response = this.responseHandler.getRestResponseObject(message.getRequestId());\n response.resume(Response.status(message.getStatus()).entity(message.getStatusMessage()).build());\n }", "int updateByPrimaryKey(TRefundOrder record);", "@Test\n public void refundTicket() {\n Ticket ticket = givenTicketInOrderedBilled();\n\n // when\n boolean refundTicket = ticket.refundTicket();\n\n // then\n assertTrue(refundTicket);\n assertTicketInState(ticket, TicketStateType.TICKET_RETURNED, TransactionStateType.TRANSACTION_BILLED, 6);\n }", "int deleteByPrimaryKey(String refundorderid);", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "private void refundSeats() {\n\t\tint numSeats;\n\n\t\tSystem.out.print(\"Please enter the number of seats to refund: \");\n\t\tnumSeats = Integer.parseInt(sc.nextLine());\n\t\t\n\t\t// Reject attempt to refund more seats than are available\n\t\tif (numSeats > coach.numSeatsBooked()) {\n\t\t\tSystem.out.printf(\"Unable to refund %d seats. Only %d booked\\n\", \n\t\t\t\t\tnumSeats, coach.numSeatsBooked());\n\t\t\treturn;\n\t\t}\n\t\t// Refund each of the requested seats\n\t\tfor (int i = 0; i < numSeats; i++) {\n\t\t\tint seatPos;\n\t\t\tboolean refundResult;\n\t\t\tSystem.out.println(\"Seats refunded: \" + i);\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Please enter the seat position to refund: \");\n\t\t\t\tseatPos = Integer.parseInt(sc.nextLine());\n\t\t\t\t// Attempt to refund seat\n\t\t\t\trefundResult = coach.refundSeat(seatPos);\n\t\t\t\tif (refundResult == false)\n\t\t\t\t\tSystem.out.println(\"Seat position wasn't booked. Please try again\");\n\t\t\t} while (refundResult == false);\n\t\t}\n\t\tcoach.printReceipt();\n\t}", "@Test\n public void create() throws RazorpayException{\n JSONObject request = new JSONObject(\"{\" +\n \"\\\"amount\\\":\\\"100\\\",\" +\n \"\\\"speed\\\":\\\"normal\\\",\" +\n \"\\\"notes\\\":{\\\"notes_key_1\\\":\\\"BeammeupScotty.\\\",\" +\n \"\\\"notes_key_2\\\":\\\"Engage\\\"},\" +\n \"\\\"receipt\\\":\\\"ReceiptNo.31\\\"}\");\n\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 500100,\\n\" +\n \" \\\"receipt\\\": \\\"Receipt No. 31\\\",\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FCXKPFtYfPXJPy\\\",\\n\" +\n \" \\\"notes\\\": [],\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": null\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078866,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\"\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.create(request);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n assertEquals(\"refund\",fetch.get(\"entity\"));\n assertEquals(500100,(int)fetch.get(\"amount\"));\n assertEquals(\"INR\",fetch.get(\"currency\"));\n String createRequest = getHost(Constants.REFUNDS);\n verifySentRequest(true, request.toString(), createRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void refill(int amount) {\n myAmount = myAmount + amount;\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "public int updatePayment2(int requestId, int amount);", "abstract void updateRecurringTransactions(Ui ui) throws BankException;", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) {\n copyOnWrite();\n instance.setRefundTo(index,\n builderForValue.build());\n return this;\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@Override\n\tpublic void updateRefundExpressNo(WxAddress address) {\n\t\torderMapper.updateRefundExpressNo(address);\n\t}", "void savingListRecurringExpenditure(Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {\n // Testing redo loan\n RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();\n paramsPastDate.setDisbursalDateDD(\"25\");\n paramsPastDate.setDisbursalDateMM(\"02\");\n paramsPastDate.setDisbursalDateYYYY(\"2011\");\n paramsPastDate.setLoanAmount(\"3000.0\");\n paramsPastDate.setInterestRate(\"10\");\n paramsPastDate.setNumberOfInstallments(\"52\");\n RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();\n paramsCurrentDate.setDisbursalDateDD(\"22\");\n paramsCurrentDate.setDisbursalDateMM(\"2\");\n paramsCurrentDate.setDisbursalDateYYYY(\"2012\");\n LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal(\"Default Group\", \"WeeklyGroupFlatLoanWithOnetimeFee\", paramsPastDate, paramsCurrentDate, 0, true);\n loanAccountPage.verifyStatus(\"Active in Good Standing\");\n loanAccountPage.verifyPerformanceHistory(\"51\", \"0\");\n // Testing multiple reverse payments\n String payAmount = \"63\";\n String reverseNote = \"Reversed \";\n int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);\n for (int i = 0; i < 3; i++) {\n ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();\n applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));\n }\n verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);\n }" ]
[ "0.68370944", "0.6681329", "0.6634763", "0.6498553", "0.64901006", "0.64587116", "0.63995904", "0.6312238", "0.6293596", "0.6288418", "0.6279265", "0.6277259", "0.6270693", "0.6268615", "0.6222925", "0.6180539", "0.6170511", "0.61689126", "0.61356705", "0.6109727", "0.6103068", "0.6092381", "0.60068417", "0.59968257", "0.5988425", "0.5978771", "0.5945487", "0.5930432", "0.5899949", "0.5896912", "0.5889083", "0.58662415", "0.58019036", "0.5762031", "0.57353044", "0.57242036", "0.5693331", "0.56340647", "0.56234425", "0.5620447", "0.55960333", "0.559603", "0.5592814", "0.5533532", "0.551844", "0.54760706", "0.54592615", "0.5424499", "0.54047036", "0.5378222", "0.53679264", "0.53568435", "0.5329663", "0.5321128", "0.52991027", "0.52812773", "0.52741176", "0.5241854", "0.52357745", "0.52319705", "0.5229508", "0.52169293", "0.52099484", "0.51905406", "0.5120019", "0.50832796", "0.50649965", "0.5040515", "0.50067997", "0.49981776", "0.49972928", "0.4976616", "0.49266282", "0.4925381", "0.49243638", "0.49239317", "0.4896078", "0.4891509", "0.48818544", "0.48640975", "0.48607588", "0.48458338", "0.48438704", "0.48244044", "0.47945988", "0.4778403", "0.47762603", "0.47572893", "0.47532403", "0.4739214", "0.4737618", "0.47262642", "0.4725167", "0.47088572", "0.4705267", "0.47044212", "0.46677262", "0.46615815", "0.46509013", "0.46304008" ]
0.6164209
18
Where to send refunds, if a refund is necessary repeated .payments.Output refund_to = 3;
private void clearRefundTo() { refundTo_ = emptyProtobufList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public Integer getRefund() {\n return refund;\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public int getRefundId() {\n return refundId;\n }", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "private void addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureRefundToIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, refundTo_);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public String getRefundId() {\n return refundId;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //[email protected]\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public String getRefundReason() {\n return refundReason;\n }", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "int getRefundToCount();", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "private void removeRefundTo(int index) {\n ensureRefundToIsMutable();\n refundTo_.remove(index);\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "@Override\n\tpublic ResultBO<?> refundQuery(PayQueryParamVO payQueryParamVO) {\n\t\treturn super.refundQuery(payQueryParamVO);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public void refundConfirmation(String fName, String customerEmail, double price, int numOfTicket, int bookingNo){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"[email protected]\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"Refund Confirmation - Receipt\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \\t\"+fName + \"!\\n\\n\"\r\n\t + \"You requested on booking #\" +bookingNo+\".\"\r\n\t + \"Your \"+numOfTicket+\" ticket(s)\"\r\n\t + \" will be refunded within few days.\\n\"\r\n\t + \"Total refund price: $\"+price+\"\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "int updateByPrimaryKeySelective(TRefundOrder record);", "public void requestRefundResponse(Message message, JsonObject payload){\n System.out.println(\"Response Status Message:\" + message.getStatusMessage());\n AsyncResponse response = this.responseHandler.getRestResponseObject(message.getRequestId());\n response.resume(Response.status(message.getStatus()).entity(message.getStatusMessage()).build());\n }", "int updateByPrimaryKey(TRefundOrder record);", "@Test\n public void refundTicket() {\n Ticket ticket = givenTicketInOrderedBilled();\n\n // when\n boolean refundTicket = ticket.refundTicket();\n\n // then\n assertTrue(refundTicket);\n assertTicketInState(ticket, TicketStateType.TICKET_RETURNED, TransactionStateType.TRANSACTION_BILLED, 6);\n }", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "int deleteByPrimaryKey(String refundorderid);", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "private void refundSeats() {\n\t\tint numSeats;\n\n\t\tSystem.out.print(\"Please enter the number of seats to refund: \");\n\t\tnumSeats = Integer.parseInt(sc.nextLine());\n\t\t\n\t\t// Reject attempt to refund more seats than are available\n\t\tif (numSeats > coach.numSeatsBooked()) {\n\t\t\tSystem.out.printf(\"Unable to refund %d seats. Only %d booked\\n\", \n\t\t\t\t\tnumSeats, coach.numSeatsBooked());\n\t\t\treturn;\n\t\t}\n\t\t// Refund each of the requested seats\n\t\tfor (int i = 0; i < numSeats; i++) {\n\t\t\tint seatPos;\n\t\t\tboolean refundResult;\n\t\t\tSystem.out.println(\"Seats refunded: \" + i);\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Please enter the seat position to refund: \");\n\t\t\t\tseatPos = Integer.parseInt(sc.nextLine());\n\t\t\t\t// Attempt to refund seat\n\t\t\t\trefundResult = coach.refundSeat(seatPos);\n\t\t\t\tif (refundResult == false)\n\t\t\t\t\tSystem.out.println(\"Seat position wasn't booked. Please try again\");\n\t\t\t} while (refundResult == false);\n\t\t}\n\t\tcoach.printReceipt();\n\t}", "@Test\n public void create() throws RazorpayException{\n JSONObject request = new JSONObject(\"{\" +\n \"\\\"amount\\\":\\\"100\\\",\" +\n \"\\\"speed\\\":\\\"normal\\\",\" +\n \"\\\"notes\\\":{\\\"notes_key_1\\\":\\\"BeammeupScotty.\\\",\" +\n \"\\\"notes_key_2\\\":\\\"Engage\\\"},\" +\n \"\\\"receipt\\\":\\\"ReceiptNo.31\\\"}\");\n\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 500100,\\n\" +\n \" \\\"receipt\\\": \\\"Receipt No. 31\\\",\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FCXKPFtYfPXJPy\\\",\\n\" +\n \" \\\"notes\\\": [],\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": null\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078866,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\"\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.create(request);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n assertEquals(\"refund\",fetch.get(\"entity\"));\n assertEquals(500100,(int)fetch.get(\"amount\"));\n assertEquals(\"INR\",fetch.get(\"currency\"));\n String createRequest = getHost(Constants.REFUNDS);\n verifySentRequest(true, request.toString(), createRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void refill(int amount) {\n myAmount = myAmount + amount;\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "public int updatePayment2(int requestId, int amount);", "abstract void updateRecurringTransactions(Ui ui) throws BankException;", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) {\n copyOnWrite();\n instance.setRefundTo(index,\n builderForValue.build());\n return this;\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@Override\n\tpublic void updateRefundExpressNo(WxAddress address) {\n\t\torderMapper.updateRefundExpressNo(address);\n\t}", "void savingListRecurringExpenditure(Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {\n // Testing redo loan\n RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();\n paramsPastDate.setDisbursalDateDD(\"25\");\n paramsPastDate.setDisbursalDateMM(\"02\");\n paramsPastDate.setDisbursalDateYYYY(\"2011\");\n paramsPastDate.setLoanAmount(\"3000.0\");\n paramsPastDate.setInterestRate(\"10\");\n paramsPastDate.setNumberOfInstallments(\"52\");\n RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();\n paramsCurrentDate.setDisbursalDateDD(\"22\");\n paramsCurrentDate.setDisbursalDateMM(\"2\");\n paramsCurrentDate.setDisbursalDateYYYY(\"2012\");\n LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal(\"Default Group\", \"WeeklyGroupFlatLoanWithOnetimeFee\", paramsPastDate, paramsCurrentDate, 0, true);\n loanAccountPage.verifyStatus(\"Active in Good Standing\");\n loanAccountPage.verifyPerformanceHistory(\"51\", \"0\");\n // Testing multiple reverse payments\n String payAmount = \"63\";\n String reverseNote = \"Reversed \";\n int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);\n for (int i = 0; i < 3; i++) {\n ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();\n applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));\n }\n verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);\n }" ]
[ "0.68360114", "0.6679548", "0.6636148", "0.64972943", "0.6489704", "0.64574003", "0.6400954", "0.63106453", "0.62928164", "0.62868726", "0.62789595", "0.6276871", "0.62697357", "0.6221172", "0.61808693", "0.6169364", "0.61678493", "0.6164", "0.61343324", "0.61085606", "0.61028427", "0.60915077", "0.6004669", "0.5998025", "0.5987001", "0.5980783", "0.5945281", "0.5929114", "0.58991045", "0.5897043", "0.5888135", "0.5869045", "0.5802867", "0.57613575", "0.5734901", "0.5724553", "0.5692248", "0.56333226", "0.562193", "0.5620339", "0.55948776", "0.55938464", "0.5591977", "0.55320287", "0.5518626", "0.5476253", "0.54583144", "0.54244095", "0.5404604", "0.53778553", "0.5367501", "0.53568405", "0.5329338", "0.5321334", "0.52995294", "0.5279812", "0.52729315", "0.5241934", "0.5237215", "0.52315784", "0.52289134", "0.5216264", "0.52098674", "0.51898277", "0.51189667", "0.50826937", "0.5065194", "0.50399506", "0.50068235", "0.49981308", "0.4997383", "0.49759045", "0.4927424", "0.49246466", "0.49245727", "0.49223724", "0.48961973", "0.48887706", "0.48819163", "0.48657683", "0.4859479", "0.48444656", "0.48432097", "0.48264188", "0.4795589", "0.47791338", "0.47773278", "0.47566816", "0.47538295", "0.47388142", "0.47366804", "0.4725859", "0.47243515", "0.47092706", "0.47049552", "0.47047704", "0.4668362", "0.46616542", "0.46512684", "0.4631796" ]
0.6269048
13
Where to send refunds, if a refund is necessary repeated .payments.Output refund_to = 3;
private void removeRefundTo(int index) { ensureRefundToIsMutable(); refundTo_.remove(index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index);", "public void setRefund(Integer refund) {\n this.refund = refund;\n }", "@Override\r\n public void refund() {\r\n vend.setCurrState(\"Refunding\");\r\n vend.refund();\r\n\r\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return refundTo_;\n }", "private void addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(value);\n }", "public java.util.List<? extends com.dogecoin.protocols.payments.Protos.OutputOrBuilder> \n getRefundToOrBuilderList() {\n return refundTo_;\n }", "BrainTreeRefundTransactionResult refundTransaction(BrainTreeRefundTransactionRequest request);", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return refundTo_.get(index);\n }", "public void setRefundId(int value) {\n this.refundId = value;\n }", "public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder(\n int index) {\n return refundTo_.get(index);\n }", "java.util.List<com.dogecoin.protocols.payments.Protos.Output> \n getRefundToList();", "public void setRefundQuantity(int value) {\n this.refundQuantity = value;\n }", "public Integer getRefund() {\n return refund;\n }", "private void clearRefundTo() {\n refundTo_ = emptyProtobufList();\n }", "@java.lang.Override\n public int getRefundToCount() {\n return refundTo_.size();\n }", "@Override\n\tpublic ResultBO<?> refund(RefundParamVO refundParam) {\n\t\treturn super.refund(refundParam);\n\t}", "public int getRefundId() {\n return refundId;\n }", "private void addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.add(index, value);\n }", "private void addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n ensureRefundToIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, refundTo_);\n }", "@java.lang.Override\n public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) {\n return instance.getRefundTo(index);\n }", "public String getRefundId() {\n return refundId;\n }", "public void setRefundMoney(Integer refundMoney) {\n this.refundMoney = refundMoney;\n }", "private void setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n value.getClass();\n ensureRefundToIsMutable();\n refundTo_.set(index, value);\n }", "@Override\r\n\tpublic void addRefund(Refund refund) throws Exception {\n\t}", "@Test\n\tpublic void freezeRefundTest() throws Exception {\n AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306436\",\n \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n \"json\", \"GBK\",\n \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n \"RSA\");\n\n //[email protected]\n// AlipayClient alipayClient = new DefaultAlipayClient(\"https://openapi.alipay.com/gateway.do\", \"2017082108306200\",\n// \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCtyKGAX+U7kfPcw2kS7Cku3d3kNOxjG37T1Ckt43tH/F41QQ/x0HuJs5QoeRkW1Y3UZ0AR2H/Oq4GkkI+tZnxFONx3Pkl/qhuNu/0fv3QEbAcFF7meKY6/9gbRs+ZwmMfazR6U1f4S6ML3+Ee/1NVYuiqKQF2uViXJ0keMS5pPZfQTM2SL+/TgH4YD5ha1iRFgOsLasjonV6PmSfrkpltcHlWdkN+CpSWOCGmDGvzcw6Z91PHVvmGGErFUV6ybJywXtGrf4VG5ijVQOA9FDFf4q0IyG5mlYrurMx09KysfqSkshAequLmU390md9tKWWTjZMgMVXwQz9GG8MAJg8FnAgMBAAECggEAcxNIxl45yDGEnuoS+QHC35LxLP1SjuoVGKYDwqxA5VEa/P6hVUntlCiC8i4GTBWLflwElAydzTfKeDN1wKf9oETf0GJBfzUgW8FhAxXe+FKkb13ffvkb2sdKirAq5uJ0bNGo73uoa9MPz+3rbP69a6yTIMswfZH0IemJkUA65VmRUw2rFuxmbrWuGgL7ZoUm7cIxXiX+TZGhf9+kp71icDoEtJiC8ZFdjapBZmcqsoXm0YGRmY8+tSt2rY3aDDIXEZTWwk4RA3NQ/pHrJ+h3yr+sWXdrIFLRLQm3Oy53zNrkt+eisHl62ACwG2qg2GeUZuHEYBaNpVz8Zp4flDyqAQKBgQDYDPLN3rGtrPGNJVFyYpwSGhhqLwy6PqaPU4pPup3XYY9UtkZIf4WiX+u/8KV2vLoArXhdp9tDztqatzidUHhDQbffYIANecbAsoOP/dnjJJmLOGQrGX7pV9YqExk91AGM+u3BJMTwMA1dgn/urf81LC5EtWbxfDmqPih3oE30ZwKBgQDN6uwSiQakyY0MP+P1L09iZVPWpGT6tie4ncLncCwlBL5X9qy8FMnyQ7Wcp77NEBDEDMb0kAq+gMOhc/8AOa/1PlQ53DC6QAhsn59tb0DyNf2Cj9GPni7iPHUy/IsKOPHgH0Y754Po6NPXyf0+Xvz1lwDWF4qSdkYLzBRroEOrAQKBgENt1yHVjRKtVT4+FWtjx14G8vPA93HxN76nzhUQI08jTb6cnNbnpeeFlGh1TM8AG/U2LsjcKJzDJIsBABRpFv+2tRJsZcrO5O8jR9ha2/P+akV/NhQVgvyEw3yiNVCMqGc9sZKETUrBVIqIvjDZ8TrBLTeYfiaEJOMzPyIG0A2lAoGAC4pkCrHlTm0BW7Nk+kPZhiE5rqjuA+MbnMwytTfjMXvvkwx/J9debhZ/YjVAi0ugNOymZeSAxaZ/0Feo7gFNrEf+/nMpw/Z8wmG71K1MjYabG6slyo/J/uH2i5H91OfWHoKCNC9IhFAwN0LZz5oRQU5iPJ17JbQ9PsIETvffcwECgYAEZ7H5gw+zzgYQUSRexgPCc5lscJGL/kQ3KGx4nwAl8WsvF77nfccd+BpQRqrLaRzAgyATEPuEoclKtdFIWVRzZtIxi3wh21M/te6NMfd59u1duRAWSdF4D0fAt4Q+u/Es9SK0h9Bi5fj1+hwnbMO0+Bv7Fx7gvS2eylYgjZLFsw==\",\n// \"json\", \"GBK\",\n// \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB\",\n// \"RSA\");\n// 133290965116141568\t2018032302432256\t853.33\n//// 133870511490088960\t2018032302432256\t853.33\n//// 134281662728257536\t2018032302432256\t1493.33\n//// 134627684222521344\t2018032302432256\t853.33\n\t\tAlipayTradeRefundRequest request = new AlipayTradeRefundRequest();\n\t\trequest.setBizContent(\"{\" +\n\t\t\t\t\" \\\"refund_reason\\\":\\\"正常退款\\\",\" +\n\t\t\t\t\" \\\"trade_no\\\":\\\"2019010322001494210558889685\\\",\" +\n\t\t\t\t\" \\\"refund_amount\\\":\\\"1\\\"\" +\n\t\t\t\t\"}\");\n\t\tAlipayTradeRefundResponse response = alipayClient.execute(request);\n\t\tSystem.out.println(JSON.toJSONString(response));\n\t\tif (response.isSuccess()) {\n\n\t\t\tSystem.out.println(\"调用成功\");\n\t\t} else {\n\t\t\tSystem.out.println(\"调用失败\");\n\t\t}\n\t}", "@Override\r\n\tpublic void updateRefund(Refund refund) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void refundPoint(String id, int balance) throws Exception {\n\t\t\n\t}", "public String getRefundReason() {\n return refundReason;\n }", "public void requestRefund(RefundDTO refund, AsyncResponse response){\n\n Message message = new Message();\n message.setEvent(\"getRefund\");\n message.setService(\"payment_service\");\n message.setPayload(refund);\n message.setCallback(new Callback(\"customer_service\", \"requestRefundResponse\"));\n\n UUID requestId = responseHandler.saveRestResponseObject(response);\n message.setRequestId(requestId);\n\n this.sendMessage(message);\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.setRefundTo(index, value);\n return this;\n }", "public Integer getRefundMoney() {\n return refundMoney;\n }", "public int getRefundQuantity() {\n return refundQuantity;\n }", "public void refund(HashMap<String, String> params) {\n\t\tTRANSACTION_TYPE = \"REFUND\";\n\t\tRRNO = params.get(\"transactionID\");\n\t\tAMOUNT = params.get(\"amount\");\n\t\tAPI = \"bp10emu\";\n\t}", "public void refund(Trooper t) {\n if(t.hasTurned()) {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (1.25 *\n Translator.teleporterPrice));\n }\n } else {\n if(ArmoredTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.armoredTrooperPrice));\n } else if(PitifulTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.pitifullPrice));\n } else if(TeleportTrooper.class.isInstance(t)) {\n noOfCredits = (long) (noOfCredits + (0.75 *\n Translator.teleporterPrice));\n }\n }\n }", "public void setRefundReason(String refundReason) {\n this.refundReason = refundReason;\n }", "public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(value);\n return this;\n }", "@Override\n public String getDescription() {\n return \"Digital goods refund\";\n }", "public Builder addRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output value) {\n copyOnWrite();\n instance.addRefundTo(index, value);\n return this;\n }", "public void setRefundDate( Date refundDate ) {\n this.refundDate = refundDate;\n }", "int getRefundToCount();", "public Builder clearRefundTo() {\n copyOnWrite();\n instance.clearRefundTo();\n return this;\n }", "@Override\n\tpublic int getRefund(Refund refund) {\n\t\treturn paydao.doRefund(refund);\n\t}", "public Refund() {\n this(DSL.name(\"refund\"), null);\n }", "@java.lang.Override\n public java.util.List<com.dogecoin.protocols.payments.Protos.Output> getRefundToList() {\n return java.util.Collections.unmodifiableList(\n instance.getRefundToList());\n }", "@java.lang.Override\n public int getRefundToCount() {\n return instance.getRefundToCount();\n }", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "public void setRefundState(Integer refundState) {\n this.refundState = refundState;\n }", "public interface IRefundController {\n void transactionRefunded(long transactionId);\n}", "public void setRefundPrice(BigDecimal refundPrice) {\n this.refundPrice = refundPrice;\n }", "public void issueScheduledTransactionForRefund(Bid bid, BidsRepository bidsRepository, String memo) {\n // Create a transfer transaction for the refund\n // check the status of the bid isn't already refunded, issued or in error\n try {\n Bid testBid = bidsRepository.getBidForTimestamp(bid.getTimestamp());\n if ((testBid != null) && ! testBid.isRefunded() && ! testBid.isRefundIssued() && ! testBid.isRefundError()) {\n this.transactionId = TransactionId.generate(AccountId.fromString(Objects.requireNonNull(env.get(\"OPERATOR_ID\"))));\n this.transactionId.setScheduled(true);\n String shortTransactionId = this.transactionId.toString().replace(\"?scheduled\", \"\");\n\n TransferTransaction transferTransaction = new TransferTransaction();\n transferTransaction.setTransactionMemo(memo);\n transferTransaction.addHbarTransfer(this.auctionAccountId, Hbar.fromTinybars(-bid.getBidamount()));\n transferTransaction.addHbarTransfer(AccountId.fromString(bid.getBidderaccountid()), Hbar.fromTinybars(bid.getBidamount()));\n\n this.transaction = transferTransaction;\n\n @Var TransactionSchedulerResult transactionSchedulerResult = null;\n try {\n transactionSchedulerResult = issueScheduledTransaction(\"Scheduled Auction Refund\");\n if (transactionSchedulerResult.success\n || transactionSchedulerResult.status == Status.NO_NEW_VALID_SIGNATURES\n || transactionSchedulerResult.status == Status.DUPLICATE_TRANSACTION) {\n log.info(\"Refund transaction successfully scheduled (scheduleId {}, transactionId {})\", transactionSchedulerResult.getScheduleId(), shortTransactionId);\n log.info(\"setting bid to refund issued (timestamp = {})\", bid.getTimestamp());\n try {\n if (StringUtils.isEmpty(transactionSchedulerResult.getScheduleId())) {\n log.error(\"empty schedule id for bid transaction id {}\", bid.getTransactionid());\n bidsRepository.setRefundError(bid.getTransactionid());\n } else {\n bidsRepository.setRefundIssued(bid.getTimestamp(), shortTransactionId, transactionSchedulerResult.getScheduleId());\n }\n } catch (SQLException e) {\n log.error(\"Failed to set bid refund issued (bid timestamp {})\",bid.getTimestamp(), e);\n }\n } else {\n log.error(\"Error issuing refund to bid - timestamp = {} status {}\", bid.getTimestamp(), transactionSchedulerResult.status);\n bidsRepository.setRefundError(bid.getTransactionid());\n }\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n } catch (SQLException e) {\n log.error(e, e);\n }\n }", "@Override\r\n\tpublic Refund getRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public ResultMessage addRefunds(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().addPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public Builder addAllRefundTo(\n java.lang.Iterable<? extends com.dogecoin.protocols.payments.Protos.Output> values) {\n copyOnWrite();\n instance.addAllRefundTo(values);\n return this;\n }", "@ApiModelProperty(value = \"A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders.\")\n public String getPaymentId() {\n return paymentId;\n }", "@Override\n\tpublic ResultBO<?> refundQuery(PayQueryParamVO payQueryParamVO) {\n\t\treturn super.refundQuery(payQueryParamVO);\n\t}", "@Test\n public void fetchMultipleRefund() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"entity\\\": \\\"collection\\\",\\n\" +\n \" \\\"count\\\": 1,\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": \\\"rfnd_FP8DDKxqJif6ca\\\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n List<Refund> fetch = refundClient.fetchMultipleRefund(REFUND_ID);\n assertNotNull(fetch);\n assertTrue(fetch.get(0).has(\"id\"));\n assertTrue(fetch.get(0).has(\"entity\"));\n assertTrue(fetch.get(0).has(\"amount\"));\n assertTrue(fetch.get(0).has(\"currency\"));\n assertTrue(fetch.get(0).has(\"payment_id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND_MULTIPLE,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\r\n\tpublic Map<String, Object> listRefund(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public BigDecimal getRefundPrice() {\n return refundPrice;\n }", "@RequestMapping(value =\"/refund_order\", method = RequestMethod.GET)\n public String refundOrder(ModelMap model, @RequestParam(\"id\") String orderId, RedirectAttributes redirectAttributes){\n logger.info(\"*** OrderController - refundOrder ***\");\n Order order = orderService.getOrder(orderId);\n boolean isRefunded = orderService.processRefund(order);\n if(isRefunded) {\n redirectAttributes.addFlashAttribute(\"message\", \"Refund initiated successfully\");\n return \"redirect:/order_status\";\n }\n\n redirectAttributes.addFlashAttribute(\"message\", \"Order cannot be refunded !!\");\n return \"redirect:/order_status\";\n }", "public Integer getRefundState() {\n return refundState;\n }", "@Override\n\tpublic List<WxOrder> queryOrderRefundList(PagingDto dto) {\n\t\treturn orderMapper.queryOrderRefundList(dto);\n\t}", "public void setRefundId(String refundId) {\n this.refundId = refundId == null ? null : refundId.trim();\n }", "@Override\n\tpublic List<PageData> getRefund(PageData pd) throws Exception {\n\t\treturn (List<PageData>) dao.findForList(\"SummaryStatMapper.getRefund\",\n\t\t\t\tpd);\n\n\t}", "@Override\n\tpublic WxAddress queryOrderRefundAddress(Integer refundId) {\n\t\treturn orderMapper.queryOrderRefundAddress(refundId);\n\t}", "@Override\r\n\tpublic List<Refund> listRefundAdmin(int refundNo) throws Exception {\n\t\treturn null;\r\n\t}", "public Builder removeRefundTo(int index) {\n copyOnWrite();\n instance.removeRefundTo(index);\n return this;\n }", "@Override\r\n public String toString() {\r\n return \"GiftCardActivityRefund [\" + \"redeemActivityId=\" + redeemActivityId\r\n + \", amountMoney=\" + amountMoney + \", referenceId=\" + referenceId + \", paymentId=\"\r\n + paymentId + \"]\";\r\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "public void refundConfirmation(String fName, String customerEmail, double price, int numOfTicket, int bookingNo){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"[email protected]\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"Refund Confirmation - Receipt\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \\t\"+fName + \"!\\n\\n\"\r\n\t + \"You requested on booking #\" +bookingNo+\".\"\r\n\t + \"Your \"+numOfTicket+\" ticket(s)\"\r\n\t + \" will be refunded within few days.\\n\"\r\n\t + \"Total refund price: $\"+price+\"\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "public void requestRefundResponse(Message message, JsonObject payload){\n System.out.println(\"Response Status Message:\" + message.getStatusMessage());\n AsyncResponse response = this.responseHandler.getRestResponseObject(message.getRequestId());\n response.resume(Response.status(message.getStatus()).entity(message.getStatusMessage()).build());\n }", "int updateByPrimaryKeySelective(TRefundOrder record);", "int updateByPrimaryKey(TRefundOrder record);", "@Test\n public void refundTicket() {\n Ticket ticket = givenTicketInOrderedBilled();\n\n // when\n boolean refundTicket = ticket.refundTicket();\n\n // then\n assertTrue(refundTicket);\n assertTicketInState(ticket, TicketStateType.TICKET_RETURNED, TransactionStateType.TRANSACTION_BILLED, 6);\n }", "int deleteByPrimaryKey(String refundorderid);", "@Schema(example = \"abcdzr8hnVWTgXXcFRLUMc\", description = \"Unique token identifying this refund.\")\n public String getRefundToken() {\n return refundToken;\n }", "@Override\n\tpublic int updateRefundStatus(long transactionid) {\n\t\treturn paydao.modifyRefundStatus(transactionid);\n\t}", "public void refundGiftActions(WebDriver driver) throws InterruptedException \r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t\t\r\n\t\t\t//Clicking on Change Credit Button\r\n\t\t\tdriver.findElement(By.xpath(\"//a[contains(text(),'Refund Gift')]\")).click();\t\t\t\r\n\t\t\t//driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\tdriver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Before Refund total cash\");\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Refund Total Cash')]\")).click();\t\r\n\t\t\t\tSystem.out.println(\"After Refund total cash\");\r\n\t\t\t\tdriver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);\r\n\t\t\t}catch(TimeoutException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tThread.sleep(10000);\r\n\t\t\tSystem.out.println(\"Before pop up\");\r\n\t\t\tverifyRefundStatus = driver.findElement(By.xpath(\"//div[contains(text(),'Refund was successful')]\")).isDisplayed();\r\n\t\t\tSystem.out.println(\"verifyRefundStatus:\"+verifyRefundStatus);\r\n\t\t\tSystem.out.println(\"After pop up\");\r\n\t\t\t\r\n\t\t\tif(verifyRefundStatus)\r\n\t\t\t{\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\tdriver.findElement(By.xpath(\"//button[contains(text(),'Close')]\")).click();\r\n\t\t\t\t\r\n\t\t\t\tFloat creditValue = Float.parseFloat(creditsOnGifts); \r\n\t\t\t\tThread.sleep(5000);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tverifyCreditsRefundID = driver.findElement(By.xpath(\"//td[contains(text(),'Credit Modification')]\")).isDisplayed();\r\n\t\t\t\t\tSystem.out.println(\"verifyCreditsRefundID:\"+verifyCreditsRefundID);\r\n\t\t\t\t}catch(Exception wde)\r\n\t\t\t\t{\r\n\t\t\t\t\twde.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(creditValue == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}else if(verifyCreditsRefundID)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(verifyCreditsRefundID)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\t\tcreditsRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Credit Modification')]]/td[9]\")).getText();\r\n\t\t\t\t\t System.out.println(\"creditsRefundID:\"+creditsRefundID);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\r\n\t\t\t\t\tmembershipRefundID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[9]\")).getText();\r\n\t\t\t\t System.out.println(\"membershipRefundID:\"+membershipRefundID);\r\n\t\t\t\t \r\n\t\t\t\t chargeID = driver.findElement(By.xpath(\"//tr[td[contains(text(),'Membership')]]/td[8]\")).getText();\r\n\t\t\t\t System.out.println(\"chargeID:\"+chargeID);\r\n\t\t\t\t \r\n\t\t\t\t totalCashToRefund = driver.findElement(By.xpath(\"//tr[td[strong[contains(text(),'Total cash to refund:')]]]/td[4]\")).getText();\r\n\t\t\t\t System.out.println(\"totalCashToRefund:\"+totalCashToRefund); \r\n\t\t\t\t driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception wde)\r\n\t\t{\r\n\t\t\twde.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void insertOrderRefund(WxOrderRefund refund) {\n\t\torderMapper.insertOrderRefund(refund);\n\t}", "public MigrateOrderRefundQueryRequest(MigrateOrderRefundQueryRequest source) {\n if (source.MerchantId != null) {\n this.MerchantId = new String(source.MerchantId);\n }\n if (source.PayChannel != null) {\n this.PayChannel = new String(source.PayChannel);\n }\n if (source.RefundOrderId != null) {\n this.RefundOrderId = new String(source.RefundOrderId);\n }\n if (source.TradeSerialNo != null) {\n this.TradeSerialNo = new String(source.TradeSerialNo);\n }\n if (source.Profile != null) {\n this.Profile = new String(source.Profile);\n }\n }", "private void refundSeats() {\n\t\tint numSeats;\n\n\t\tSystem.out.print(\"Please enter the number of seats to refund: \");\n\t\tnumSeats = Integer.parseInt(sc.nextLine());\n\t\t\n\t\t// Reject attempt to refund more seats than are available\n\t\tif (numSeats > coach.numSeatsBooked()) {\n\t\t\tSystem.out.printf(\"Unable to refund %d seats. Only %d booked\\n\", \n\t\t\t\t\tnumSeats, coach.numSeatsBooked());\n\t\t\treturn;\n\t\t}\n\t\t// Refund each of the requested seats\n\t\tfor (int i = 0; i < numSeats; i++) {\n\t\t\tint seatPos;\n\t\t\tboolean refundResult;\n\t\t\tSystem.out.println(\"Seats refunded: \" + i);\n\t\t\tdo {\n\t\t\t\tSystem.out.print(\"Please enter the seat position to refund: \");\n\t\t\t\tseatPos = Integer.parseInt(sc.nextLine());\n\t\t\t\t// Attempt to refund seat\n\t\t\t\trefundResult = coach.refundSeat(seatPos);\n\t\t\t\tif (refundResult == false)\n\t\t\t\t\tSystem.out.println(\"Seat position wasn't booked. Please try again\");\n\t\t\t} while (refundResult == false);\n\t\t}\n\t\tcoach.printReceipt();\n\t}", "@Test\n public void create() throws RazorpayException{\n JSONObject request = new JSONObject(\"{\" +\n \"\\\"amount\\\":\\\"100\\\",\" +\n \"\\\"speed\\\":\\\"normal\\\",\" +\n \"\\\"notes\\\":{\\\"notes_key_1\\\":\\\"BeammeupScotty.\\\",\" +\n \"\\\"notes_key_2\\\":\\\"Engage\\\"},\" +\n \"\\\"receipt\\\":\\\"ReceiptNo.31\\\"}\");\n\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 500100,\\n\" +\n \" \\\"receipt\\\": \\\"Receipt No. 31\\\",\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FCXKPFtYfPXJPy\\\",\\n\" +\n \" \\\"notes\\\": [],\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": null\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078866,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\"\\n\" +\n \"}\";\n\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.create(request);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n assertEquals(\"refund\",fetch.get(\"entity\"));\n assertEquals(500100,(int)fetch.get(\"amount\"));\n assertEquals(\"INR\",fetch.get(\"currency\"));\n String createRequest = getHost(Constants.REFUNDS);\n verifySentRequest(true, request.toString(), createRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "@Override\n public Class<RefundRecord> getRecordType() {\n return RefundRecord.class;\n }", "public void setRefundPaymentTransactionId(String refundPaymentTransactionId )\t{\n\t\tmRefundPaymentTransactionId = refundPaymentTransactionId;\n\t}", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "public void refill(int amount) {\n myAmount = myAmount + amount;\n }", "private void rewardTransaction (PublicKey recipient, ArrayList<Transfer> transfers) {\n int rewardTransferId = 0;\n if (!transfers.isEmpty()) {\n Transfer latestTransfer = this.transfers.get(this.transfers.size() - 1);\n rewardTransferId = latestTransfer.transferId + 1;\n }\n\n transfers.add(new Transfer(100, recipient, rewardTransferId));\n }", "public int updatePayment2(int requestId, int amount);", "abstract void updateRecurringTransactions(Ui ui) throws BankException;", "@Test\n public void testLoanRefundByCashCashBasedAccounting() {\n\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, CASH_BASED, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = {\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"50\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4000\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"480\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic List<WxOrderDetail> queryOrderRefundGiftList(Integer id) {\n\t\treturn orderMapper.queryOrderRefundGiftList(id);\n\t}", "@RequestMapping(value = \"/customer_refund/delete/{customer_refund_id}\",\n method = RequestMethod.DELETE, produces = \"application/json;charset=UTF-8\")\n public ResponseEntity<String> deleteCustomerRefund(@PathVariable int customer_refund_id) {\n try {\n int affectedRow = refundRepositoryImpl.deleteCustomerRefund(customer_refund_id);\n\n if (affectedRow == Integer.MIN_VALUE) {\n // Didn't find this event by event_id\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Organizer refund not found\\\"}\",\n HttpStatus.OK);\n } else {\n return new ResponseEntity<>(\n \"{\\\"message\\\" : \\\"Organizer refund successfully deleted\\\"}\", HttpStatus.OK);\n }\n } catch (Exception e) {\n return new ResponseEntity<>(\"{\\\"message\\\" : \\\"Unknown error\\\"}\",\n HttpStatus.INTERNAL_SERVER_ERROR);\n }\n }", "public Builder setRefundTo(\n int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) {\n copyOnWrite();\n instance.setRefundTo(index,\n builderForValue.build());\n return this;\n }", "@ApiModelProperty(value = \"The type of refund See [V1RefundType](#type-v1refundtype) for possible values\")\n public String getType() {\n return type;\n }", "@Override\n\tpublic void updateRefundExpressNo(WxAddress address) {\n\t\torderMapper.updateRefundExpressNo(address);\n\t}", "void savingListRecurringExpenditure(Ui ui) throws BankException, TransactionException {\n throw new BankException(\"This account does not support this feature\");\n }", "@ApiModelProperty(value = \"The merchant-specified reason for the refund.\")\n public String getReason() {\n return reason;\n }", "@Test\n public void testLoanRefundByCashAccrualBasedAccounting() {\n Calendar fourMonthsfromNowCalendar = Calendar.getInstance(Utils.getTimeZoneOfTenant());\n fourMonthsfromNowCalendar.add(Calendar.MONTH, -4);\n\n // FINERACT-885: If the loan starts on day 27-31th of month and not all months have that\n // many days, then loan payment will get reset to a day of month less than today's day\n // and 4th payment will be in the past. In such case, start the loan a few days later,\n // so that 4th payment is guaranteed to be in the future.\n if (fourMonthsfromNowCalendar.get(Calendar.DAY_OF_MONTH) > 27) {\n fourMonthsfromNowCalendar.add(Calendar.DAY_OF_MONTH, 4);\n }\n\n String fourMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n /***\n * Create loan product with Default STYLE strategy\n */\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n final Integer loanProductID = createLoanProduct(\"0\", \"0\", LoanProductTestBuilder.DEFAULT_STRATEGY, ACCRUAL_UPFRONT, assetAccount,\n incomeAccount, expenseAccount, overpaymentAccount);// ,\n // LoanProductTestBuilder.EQUAL_INSTALLMENTS,\n // LoanProductTestBuilder.FLAT_BALANCE);\n Assertions.assertNotNull(loanProductID);\n\n /***\n * Apply for loan application and verify loan status\n */\n final String savingsId = null;\n final String principal = \"12,000.00\";\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanID = applyForLoanApplicationWithPaymentStrategyAndPastMonth(clientID, loanProductID, charges, savingsId,\n principal, LoanApplicationTestBuilder.DEFAULT_STRATEGY, -4, collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(fourMonthsfromNow, loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(fourMonthsfromNow, loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"1440\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"300.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"2290\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #1\n\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(threeMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"0.00\", String.valueOf(firstInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #2\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(twoMonthsfromNow, Float.parseFloat(\"2290\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow,\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2290\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n Map secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0.00\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make payment for installment #3\n // Pay 2290 more than expected\n fourMonthsfromNowCalendar.add(Calendar.MONTH, 1);\n\n final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRepayment(oneMonthfromNow, Float.parseFloat(\"4580\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow,\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"4580\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"0.00\", String.valueOf(thirdInstallment.get(\"totalOutstandingForPeriod\")));\n\n // Make refund of 20\n // max 2290 to refund. Pay 20 means only principal\n // Default style refund order(principal, interest, fees and penalties\n // paid: principal 2000, interest 240, fees 50, penalty 0\n // refund 20 means paid: principal 1980, interest 240, fees 50, penalty\n // 0\n\n // FINERACT-885: As loan may not have started exactly four months ago,\n // make final payment today and not four months from start (as that may be in the future)\n fourMonthsfromNowCalendar.setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(Utils.getZoneIdOfTenant()).toInstant()));\n final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar);\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"20\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n // Make refund of 2000\n // max 2270 to refund. Pay 2000 means only principal\n // paid: principal 1980, interest 240, fees 50, penalty 0\n // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0\n\n LOAN_TRANSACTION_HELPER.makeRefundByCash(now, Float.parseFloat(\"2000\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, now,\n new JournalEntry(Float.parseFloat(\"2000\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"1980\"), JournalEntry.TransactionType.DEBIT));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, now,\n new JournalEntry(Float.parseFloat(\"20\"), JournalEntry.TransactionType.DEBIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"2020.00\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n validateNumberForEqual(\"2000.00\", String.valueOf(fourthInstallment.get(\"principalOutstanding\")));\n validateNumberForEqual(\"20.00\", String.valueOf(fourthInstallment.get(\"interestOutstanding\")));\n validateNumberForEqual(\"0.00\", String.valueOf(fourthInstallment.get(\"feeChargesOutstanding\")));\n\n }", "@Override\n\tpublic Integer getRefundTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public static void updateRefund(String data, ArrayList<String> usersData) {\n\n }", "@SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {\n // Testing redo loan\n RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();\n paramsPastDate.setDisbursalDateDD(\"25\");\n paramsPastDate.setDisbursalDateMM(\"02\");\n paramsPastDate.setDisbursalDateYYYY(\"2011\");\n paramsPastDate.setLoanAmount(\"3000.0\");\n paramsPastDate.setInterestRate(\"10\");\n paramsPastDate.setNumberOfInstallments(\"52\");\n RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();\n paramsCurrentDate.setDisbursalDateDD(\"22\");\n paramsCurrentDate.setDisbursalDateMM(\"2\");\n paramsCurrentDate.setDisbursalDateYYYY(\"2012\");\n LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal(\"Default Group\", \"WeeklyGroupFlatLoanWithOnetimeFee\", paramsPastDate, paramsCurrentDate, 0, true);\n loanAccountPage.verifyStatus(\"Active in Good Standing\");\n loanAccountPage.verifyPerformanceHistory(\"51\", \"0\");\n // Testing multiple reverse payments\n String payAmount = \"63\";\n String reverseNote = \"Reversed \";\n int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);\n for (int i = 0; i < 3; i++) {\n ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();\n applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));\n }\n verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);\n }" ]
[ "0.6839437", "0.6680613", "0.6635975", "0.6499321", "0.6490457", "0.6458926", "0.6402365", "0.63139385", "0.6293622", "0.62899035", "0.6281748", "0.62771493", "0.62715375", "0.6268417", "0.62216836", "0.61813486", "0.61708945", "0.61694634", "0.6164383", "0.61377704", "0.61103094", "0.61031145", "0.609213", "0.60063714", "0.59991556", "0.5988771", "0.59807664", "0.59465134", "0.5931437", "0.5900396", "0.58982795", "0.58896095", "0.5869117", "0.58028674", "0.576247", "0.57359356", "0.5725726", "0.5694037", "0.5634923", "0.56233376", "0.5620061", "0.5596893", "0.55963147", "0.5593871", "0.55328155", "0.5519335", "0.5459802", "0.5426127", "0.5405249", "0.5378597", "0.5369603", "0.53564173", "0.53299564", "0.5321421", "0.5299131", "0.5282377", "0.5275254", "0.52432394", "0.52383363", "0.5233235", "0.52299875", "0.5217916", "0.52113557", "0.5192442", "0.51205564", "0.508358", "0.506602", "0.50424784", "0.5007859", "0.49986988", "0.4997976", "0.497639", "0.49282253", "0.49257588", "0.49248254", "0.49246997", "0.48979342", "0.48907825", "0.4883142", "0.48660448", "0.48620477", "0.48459655", "0.48436323", "0.4825813", "0.4795157", "0.47787637", "0.47775146", "0.47583207", "0.47550797", "0.4740997", "0.4738704", "0.4726203", "0.47261393", "0.47093827", "0.47056523", "0.47047403", "0.4669512", "0.46636617", "0.46514887", "0.46316347" ]
0.5476796
46
Humanreadable message for the merchant optional string memo = 4;
@java.lang.Override public boolean hasMemo() { return ((bitField0_ & 0x00000002) != 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getMemo();", "java.lang.String getMemo();", "java.lang.String getMemo();", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "private String getMessage() {\n\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\r\n\t\t\r\n\t\tboolean addSign = prefs.getBoolean(\"addsign\", true);\r\n\t\t\r\n\t\ttry {\r\n\t\t\r\n\t\tdefMessage = \"I am busy right now and will call you latter.\";\r\n\t\t\r\n\t\tfinalMessage = prefs.getString(\"message\", defMessage);\r\n\t\tif(finalMessage.equals(\"\"))\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t} catch (RuntimeException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t}\r\n\t\t\r\n\t\tif(addSign)\r\n\t\t\tfinalMessage += \"\\nSent using Calls and SMS Blocker for android.\\nDownload from: https://play.google.com/store/apps/details?id=com.atiffarrukh.callandsmsblocker\";\r\n\t\treturn finalMessage;\r\n\t}", "@Override\n public String getPayMemo() {\n return String.format(\"Employee ID: %d, Pay Date: %s\", this.getEmpID(),\n HRUtility.dateToStr(new Date()));\n }", "public void setMemo(String memo) {\n\t\tMEMO = memo;\n\t}", "public java.lang.String getMemo() {\r\n return memo;\r\n }", "public void setMemo(java.lang.String memo) {\r\n this.memo = memo;\r\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public void setMemo (java.lang.String memo) {\r\n\t\tthis.memo = memo;\r\n\t}", "@Override\n public String getMessage() {\n String chuoi=\"\";\n if (maCD.length()!=5)\n chuoi=\"MaCD bao gom 5 ki tu\";\n else if (soBaiHat<10)\n chuoi=\"So bai hat phai lon hon 10 bai\";\n return\n chuoi;\n }", "public void setMemo(String memo) {\n this.memo = memo == null ? null : memo.trim();\n }", "public java.lang.String getMemo () {\r\n\t\treturn memo;\r\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo == null ? null : memo.trim();\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public String getSMemo() {\n return sMemo;\n }", "private String createOrderSummary(String userName, int price, boolean addWhippedCream, boolean addChocolate, boolean addCinnamon, boolean addMarshmallows){\n String priceMessage = \"Name: \" + userName;\n priceMessage = priceMessage + \"\\nAdd Marshmallows? \" + addMarshmallows;\n priceMessage = priceMessage + \"\\nAdd Cinnamon? \" + addCinnamon;\n priceMessage = priceMessage + \"\\nAdd Whipped Cream? \" + addWhippedCream;\n priceMessage = priceMessage + \"\\nAdd Chocolate? \" + addChocolate;\n priceMessage = priceMessage + \"\\nQuantity: \" + quantity;\n priceMessage = priceMessage + \"\\nTotal: $\" + price;\n priceMessage = priceMessage + \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String getPayMemo() throws ParseException {\n return \"Employee ID: \" + getEmpID() + \", Pay Date: \" + HRDateUtils.strToDate(\"2019-10-01\");\n }", "public String showInfoMedi(){\n\t\tString msg = \"\";\n\n\t\tmsg += \"NOMBRE DE LA MEDICINA: \"+name+\"\\n\";\n\t\tmsg += \"LA DOSIS: \"+dose+\"\\n\";\n\t\tmsg += \"COSTO POR DOSIS: \"+doseCost+\"\\n\";\n\t\tmsg += \"FRECUENCIA QUE ESTA DEBE SER APLICADA: \"+frecuency+\"\\n\";\n\n\t\treturn msg;\n\t}", "private String createOrderSummary(int price,boolean addWhippedCream,boolean addChocolate,String name){\n String priceMessage=\"Name :\"+name;\n priceMessage+=\"\\nadd whipped cream ? \"+addWhippedCream;\n priceMessage+=\"\\nadd chocolate ? \"+addChocolate;\n priceMessage+=\"\\nQuantity \"+quantity;\n priceMessage+=\"\\nTotal :$ \"+price;\n priceMessage+=\"\\nThank you!\";\n return priceMessage;\n }", "@Override\r\n public String receita() {\n return \"Misturar os ingredientes; bater no liquidificador; colocar na máquina de waffle por 10m\";\r\n }", "private String createOrderSummary (String name, int price, boolean addWhippedCream, boolean addChocolate) {\n String priceMessage = getString(R.string.order_summary_name, name);\n priceMessage += \"\\n\" + getString(R.string.order_summary_whipped_cream, addWhippedCream);\n priceMessage += \"\\n\" + getString(R.string.order_summary_chocolate, addChocolate);\n priceMessage += \"\\n\" + getString(R.string.order_summary_quantity, quantity);\n priceMessage += \"\\nTotal: \" + price;\n priceMessage += \"\\n\" + getString(R.string.thank_you);\n return priceMessage;\n }", "public void setSMemo(String sMemo) {\n this.sMemo = sMemo;\n }", "public String getDescription()\r\n\t{\r\n\t\tStringBuilder msgreturn = new StringBuilder().append(m_name).append(\" \").append(m_taxBaseAmt.toString());\r\n\t\treturn msgreturn.toString();\r\n\t}", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@Override\n public String getDescription() {\n return \"Arbitrary message\";\n }", "public String getMessage()\n {\n return String.format(\"MessageType=%s,TransactionId=%s,TerminalId=%s,MerchantId=%s,FingerData=%s,CustomerId=%s,IdData=%s, CustomerData=%s\", this.messageType, this.transactionId, this.terminalId, this.merchantId, this.fingerData, this.customerId, this.idData, this.customerData);\n }", "private String buildMessage(String message) {\n\t\tif(message != null && message.contains(\"@record\")) {\n\t\t\tmessage = message.replaceAll(\"@record\", answerUser);\n\t\t\trecorded.put(owner.id(), answerUser);\n\t\t}\n\t\t//o sistema substitui o texto !id pelo id do usuário da conversa\n\t\tif(message != null && message.contains(\"!id\")) {\n\t\t\tmessage = message.replaceAll(\"!id\", owner.id() + \"\");\n\t\t}\n\t\t//o sistema verifica se tem alguma gravacao para o código recebido\n\t\tif(message != null && message.contains(\"#find\")) {\n\t\t\tString gravacao = recorded.get(Integer.parseInt(userLatestAnswer.get(owner.id())));\n\t\t\t//se houver gravacao, o sistema informa qual o desejo do amigo secreto\n\t\t\tif(gravacao != null)\n\t\t\t\tmessage = message.replaceAll(\"#find\", gravacao);\n\t\t\t//caso nao haja gravacao, o sistema notifica o usuário da situacao\n\t\t\telse\n\t\t\t\tmessage = \"O código informado não corresponde ao desejo de um amigo secreto... por favor tente novamente\";\n\t\t}\n\n\t\treturn message;\n\t}", "@Override\n\tpublic String getText() {\n\t\treturn \"MMS: \" + text;\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "private String getOrderDetails(Order order) {\n String message = getString(R.string.total) + \"\\n\" + getString(R.string.name) + \": \" + order.getCustomerName() +\n \"\\n\" + getString(R.string.add_cream) + \"? \" + String.valueOf(order.isHasWhippedCream()) +\n \"\\n\" + getString(R.string.add_chocolate) + \"? \" + String.valueOf(order.isHasChocolate()) +\n \"\\n\" + getString(R.string.quantity) + \": \" + order.getCupsNumber() + \"\\n\" + getString(R.string.resut) +\n \": $\" + MainActivity.calculatePrice(order) + \"\\n\" + getString(R.string.thanks) + \"!\";\n return message;\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "public String getMessage()\n {\n return super.getMessage()+promo_error+\"not found\";\n }", "private static String build3PidErrorMessage(Context context, @StringRes int errorMessageRes, @Nullable String additionalInfo) {\n StringBuilder builder = new StringBuilder();\n builder.append(context.getString(errorMessageRes));\n\n if (additionalInfo != null) {\n builder.append(' ');\n builder.append(context.getString(R.string.account_additional_info, additionalInfo));\n }\n\n return builder.toString();\n }", "@Override\n public String getDescription() {\n return \"Mint currency\";\n }", "@Override\n public String getDescription() {\n return \"Digital goods purchase\";\n }", "private String createOrderSummary(int price, boolean addWhippedCream, boolean addChocolate ,String name)\n {\n if (addWhippedCream==true) price+= (numOfCufee) ;\n if (addChocolate == true ) price+=(2*numOfCufee) ;\n String priceMessage = \"Name: \"+name;\n priceMessage += \"\\nAdd whipped cream? \" + addWhippedCream;\n priceMessage += \"\\nAdd chocolate? \" + addChocolate;\n priceMessage += \"\\nQuantity: \" + numOfCufee;\n priceMessage += \"\\nTotal: $\" + price;\n priceMessage += \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String descripcion() {\n return \"Viaje incentivo que te envia la empresa \" + empresa;\n }", "public String getMoneyRemark() {\n return moneyRemark;\n }", "private String getMessageSummary() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(MAIL_FROM).append(\":\").append(props.getProperty(MAIL_FROM, \"\"));\n\n\t\tif (props.containsKey(MAIL_REPLY_TO)) {\n\t\t\tsb.append(\",\").append(MAIL_REPLY_TO).append(\":\").append(props.getProperty(MAIL_REPLY_TO));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_TO).append(\":\").append(props.getProperty(MAIL_TO));\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_CC).append(\":\").append(props.getProperty(MAIL_CC));\n\t\t}\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_BCC).append(\":\").append(props.getProperty(MAIL_BCC));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_SUBJECT).append(\":\").append(props.getProperty(MAIL_SUBJECT, \"\"));\n\n\t\treturn sb.toString();\n\t}", "private String geraMensagem(Mensagem msg) {\n\t\treturn new StringBuilder()\n\t\t\t.append(msg.remetente.nome)\n\t\t\t.append(\" enviou para \")\n\t\t\t.append(msg.destinatario.nome)\n\t\t\t.append(\" uma mensagem suspeita.\")\n\t\t\t.toString();\n\t}", "private String buildResultMessage() {\n String result;\n byte[] digest = new byte[20];\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-1\");\n digest = md.digest(phonepartBytes);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n\n byte[] checksumBytes = new byte[4];\n System.arraycopy(digest, 0, checksumBytes, 0, 4);\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n try {\n outputStream.write(checksumBytes);\n outputStream.write(phonepartBytes);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n byte[] completeOutputBytes = outputStream.toByteArray();\n result = Util.insertPeriodically(new Base32().encodeAsString(completeOutputBytes), 4);\n result = result.replaceAll(\"=\", \"\");\n return result;\n }", "public String getSupMemo() {\n return supMemo;\n }", "public void writeMassege() {\n m = ChatClient.message;\n jtaChatHistory.setText(\"You : \" + m);\n //writeMassageServer();\n }", "private String createOrderSummary(int price, boolean cream, boolean chocolate, String name){\n String orderSummary = \"Name: \"+name+\"\\n\" +\n \"Add whipped cream? \" + cream +\"\\n\"+\n \"Add chocolate? \" + chocolate + \"\\n\" +\n \"Quantity: \"+\n quantity +\n \"\\nTotal: $\" + price +\n \"\\n\" + getString(R.string.thankyou) + \"!\";\n return orderSummary;\n }", "@Override\n public String getDescription() {\n return \"Digital goods feedback\";\n }", "public String getRemark()\n/* */ {\n/* 255 */ return this.remark;\n/* */ }", "@Override\n public String getMessage() {\n String result =\"Audio Message {\\n\";\n result +=\"\\tID: \"+ID+\"\\n\";\n result +=\"\\tBuffer Size: \"+bufferSize+\"\\n\";\n result +=\"}\";\n \n return result;\n }", "public String creerMessage(){\n return profile.getMessage();\n }", "BigInteger getMessage();", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private String m50433y() {\n if (TextUtils.isEmpty(this.f30738i0.getText().toString().trim())) {\n return this.f30720S.getString(C10232R.string.payment_error_blank_field);\n }\n return !CardPaymentParams.m53961m(this.f30738i0.getText().toString().trim()) ? this.f30720S.getString(C10232R.string.checkout_error_card_holder_invalid) : \"\";\n }", "private String getOrderSummary() {\n final int numberOfCoffees = getNumberOfCoffees();\n if (numberOfCoffees == 0) {\n return Constants.FREE_MESSAGE;\n }\n\n final String name = ((EditText) findViewById(R.id.name_edit_text))\n .getText().toString();\n\n return Constants.NAME + \": \" +\n (name.isEmpty() ? Constants.DEFAULT_NAME : name) + \"\\n\" +\n getToppingsSummary() + \"\\n\" +\n Constants.QUANTITY + \": \" + numberOfCoffees + \"\\n\" +\n Constants.TOTAL + \": \" +\n NumberFormat.getCurrencyInstance().format(getTotalPrice()) + \"\\n\" +\n Constants.BYE_GREETING;\n }", "String getMessage();", "String getMessage();", "String getMessage();", "public String getMerchantNo();", "@Override\n public String getDescription() {\n return \"Digital goods delivery\";\n }", "private String createOrderSummary(int price, String name, boolean hasWhippedCream,\n boolean hasChocolate){\n return getString(R.string.order_summary_name, name) +\n \"\\n\" + getString(R.string.add_whipped_cream, hasWhippedCream) +\n \"\\n\" + getString(R.string.add_chocolate, hasChocolate) +\n \"\\n\" + getString(R.string.order_quantity, quantity) +\n \"\\n\" + getString(R.string.order_total, price) +\n \"\\n\" + getString(R.string.thank_you);\n }", "@Override\r\n\tpublic String getMessage() {\n\t\treturn \"홀수입력 !!\";\r\n\t}", "private String generateOrderSummary(String name, int quantity, boolean whippedCreamChecked, boolean chocolateChecked) {\n int price = calculatePrice(quantity, whippedCreamChecked, chocolateChecked);\n\n String priceMessage = \"Name: \"+ name + \"\\n\" +\n \"Add whipped cream? \"+ whippedCreamChecked + \"\\n\" +\n \"Chocolate? \"+ chocolateChecked + \"\\n\" +\n \"Quantity: \" + quantity + \"\\n\" +\n \"Total: $ \" + price + \"\\n\" +\n \"Thank you!\";\n\n return priceMessage;\n }", "@Override\n public String getMailetInfo() {\n return \"Sieve Mailbox Mailet\";\n }", "public String returnMessage () {\n String msg = getString(R.string.result, score);\n if (score > 7) {\n msg += \"\\n\" + getString(R.string.fabulous);\n }\n else if (score >= 5 && score <= 7) {\n msg += \"\\n\" + getString(R.string.good_job);\n }\n else {\n msg += \"\\n\" + getString(R.string.try_again);\n }\n return msg;\n }", "public String getMessage(){\n return(message);\n }", "private String m50388c(PaymentError paymentError) {\n try {\n return new JSONObject(paymentError.mo40763b()).getString(\"description\");\n } catch (Exception unused) {\n return paymentError.mo40764c();\n }\n }", "java.lang.String getBuyDescribe();", "public abstract void msgPayment(Customer customer, Cash cash);", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();" ]
[ "0.6528686", "0.6528686", "0.6528686", "0.64215565", "0.63572776", "0.63572776", "0.63572776", "0.63572776", "0.6230878", "0.6226878", "0.61937135", "0.6192103", "0.61602914", "0.615164", "0.615164", "0.615164", "0.6146373", "0.6146373", "0.6146373", "0.61349267", "0.6120991", "0.6120991", "0.6120991", "0.61019516", "0.6093255", "0.60826933", "0.6072336", "0.6058279", "0.60461986", "0.60461986", "0.59808815", "0.59198743", "0.5909179", "0.5868135", "0.58613884", "0.5735315", "0.5698737", "0.5665372", "0.562132", "0.5588627", "0.5588627", "0.5588627", "0.5581732", "0.55789053", "0.5565189", "0.5550607", "0.552437", "0.552437", "0.552437", "0.55241656", "0.54899883", "0.5438751", "0.5399326", "0.5397901", "0.5391264", "0.5390979", "0.5386106", "0.53759724", "0.5374274", "0.5371592", "0.5360501", "0.5352885", "0.5349294", "0.5349294", "0.53355414", "0.5310743", "0.5305369", "0.5303087", "0.5302099", "0.52958566", "0.5294715", "0.5292624", "0.5287689", "0.5287689", "0.5287689", "0.5281478", "0.5266776", "0.5266263", "0.5261392", "0.5255795", "0.52441424", "0.52365196", "0.522935", "0.5223733", "0.5207632", "0.52022713", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134" ]
0.0
-1
Humanreadable message for the merchant optional string memo = 4;
@java.lang.Override public java.lang.String getMemo() { return memo_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getMemo();", "java.lang.String getMemo();", "java.lang.String getMemo();", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "private String getMessage() {\n\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\r\n\t\t\r\n\t\tboolean addSign = prefs.getBoolean(\"addsign\", true);\r\n\t\t\r\n\t\ttry {\r\n\t\t\r\n\t\tdefMessage = \"I am busy right now and will call you latter.\";\r\n\t\t\r\n\t\tfinalMessage = prefs.getString(\"message\", defMessage);\r\n\t\tif(finalMessage.equals(\"\"))\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t} catch (RuntimeException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t}\r\n\t\t\r\n\t\tif(addSign)\r\n\t\t\tfinalMessage += \"\\nSent using Calls and SMS Blocker for android.\\nDownload from: https://play.google.com/store/apps/details?id=com.atiffarrukh.callandsmsblocker\";\r\n\t\treturn finalMessage;\r\n\t}", "@Override\n public String getPayMemo() {\n return String.format(\"Employee ID: %d, Pay Date: %s\", this.getEmpID(),\n HRUtility.dateToStr(new Date()));\n }", "public void setMemo(String memo) {\n\t\tMEMO = memo;\n\t}", "public java.lang.String getMemo() {\r\n return memo;\r\n }", "public void setMemo(java.lang.String memo) {\r\n this.memo = memo;\r\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public void setMemo (java.lang.String memo) {\r\n\t\tthis.memo = memo;\r\n\t}", "@Override\n public String getMessage() {\n String chuoi=\"\";\n if (maCD.length()!=5)\n chuoi=\"MaCD bao gom 5 ki tu\";\n else if (soBaiHat<10)\n chuoi=\"So bai hat phai lon hon 10 bai\";\n return\n chuoi;\n }", "public void setMemo(String memo) {\n this.memo = memo == null ? null : memo.trim();\n }", "public java.lang.String getMemo () {\r\n\t\treturn memo;\r\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo == null ? null : memo.trim();\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public String getSMemo() {\n return sMemo;\n }", "private String createOrderSummary(String userName, int price, boolean addWhippedCream, boolean addChocolate, boolean addCinnamon, boolean addMarshmallows){\n String priceMessage = \"Name: \" + userName;\n priceMessage = priceMessage + \"\\nAdd Marshmallows? \" + addMarshmallows;\n priceMessage = priceMessage + \"\\nAdd Cinnamon? \" + addCinnamon;\n priceMessage = priceMessage + \"\\nAdd Whipped Cream? \" + addWhippedCream;\n priceMessage = priceMessage + \"\\nAdd Chocolate? \" + addChocolate;\n priceMessage = priceMessage + \"\\nQuantity: \" + quantity;\n priceMessage = priceMessage + \"\\nTotal: $\" + price;\n priceMessage = priceMessage + \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String getPayMemo() throws ParseException {\n return \"Employee ID: \" + getEmpID() + \", Pay Date: \" + HRDateUtils.strToDate(\"2019-10-01\");\n }", "public String showInfoMedi(){\n\t\tString msg = \"\";\n\n\t\tmsg += \"NOMBRE DE LA MEDICINA: \"+name+\"\\n\";\n\t\tmsg += \"LA DOSIS: \"+dose+\"\\n\";\n\t\tmsg += \"COSTO POR DOSIS: \"+doseCost+\"\\n\";\n\t\tmsg += \"FRECUENCIA QUE ESTA DEBE SER APLICADA: \"+frecuency+\"\\n\";\n\n\t\treturn msg;\n\t}", "private String createOrderSummary(int price,boolean addWhippedCream,boolean addChocolate,String name){\n String priceMessage=\"Name :\"+name;\n priceMessage+=\"\\nadd whipped cream ? \"+addWhippedCream;\n priceMessage+=\"\\nadd chocolate ? \"+addChocolate;\n priceMessage+=\"\\nQuantity \"+quantity;\n priceMessage+=\"\\nTotal :$ \"+price;\n priceMessage+=\"\\nThank you!\";\n return priceMessage;\n }", "@Override\r\n public String receita() {\n return \"Misturar os ingredientes; bater no liquidificador; colocar na máquina de waffle por 10m\";\r\n }", "private String createOrderSummary (String name, int price, boolean addWhippedCream, boolean addChocolate) {\n String priceMessage = getString(R.string.order_summary_name, name);\n priceMessage += \"\\n\" + getString(R.string.order_summary_whipped_cream, addWhippedCream);\n priceMessage += \"\\n\" + getString(R.string.order_summary_chocolate, addChocolate);\n priceMessage += \"\\n\" + getString(R.string.order_summary_quantity, quantity);\n priceMessage += \"\\nTotal: \" + price;\n priceMessage += \"\\n\" + getString(R.string.thank_you);\n return priceMessage;\n }", "public void setSMemo(String sMemo) {\n this.sMemo = sMemo;\n }", "public String getDescription()\r\n\t{\r\n\t\tStringBuilder msgreturn = new StringBuilder().append(m_name).append(\" \").append(m_taxBaseAmt.toString());\r\n\t\treturn msgreturn.toString();\r\n\t}", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@Override\n public String getDescription() {\n return \"Arbitrary message\";\n }", "public String getMessage()\n {\n return String.format(\"MessageType=%s,TransactionId=%s,TerminalId=%s,MerchantId=%s,FingerData=%s,CustomerId=%s,IdData=%s, CustomerData=%s\", this.messageType, this.transactionId, this.terminalId, this.merchantId, this.fingerData, this.customerId, this.idData, this.customerData);\n }", "private String buildMessage(String message) {\n\t\tif(message != null && message.contains(\"@record\")) {\n\t\t\tmessage = message.replaceAll(\"@record\", answerUser);\n\t\t\trecorded.put(owner.id(), answerUser);\n\t\t}\n\t\t//o sistema substitui o texto !id pelo id do usuário da conversa\n\t\tif(message != null && message.contains(\"!id\")) {\n\t\t\tmessage = message.replaceAll(\"!id\", owner.id() + \"\");\n\t\t}\n\t\t//o sistema verifica se tem alguma gravacao para o código recebido\n\t\tif(message != null && message.contains(\"#find\")) {\n\t\t\tString gravacao = recorded.get(Integer.parseInt(userLatestAnswer.get(owner.id())));\n\t\t\t//se houver gravacao, o sistema informa qual o desejo do amigo secreto\n\t\t\tif(gravacao != null)\n\t\t\t\tmessage = message.replaceAll(\"#find\", gravacao);\n\t\t\t//caso nao haja gravacao, o sistema notifica o usuário da situacao\n\t\t\telse\n\t\t\t\tmessage = \"O código informado não corresponde ao desejo de um amigo secreto... por favor tente novamente\";\n\t\t}\n\n\t\treturn message;\n\t}", "@Override\n\tpublic String getText() {\n\t\treturn \"MMS: \" + text;\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "private String getOrderDetails(Order order) {\n String message = getString(R.string.total) + \"\\n\" + getString(R.string.name) + \": \" + order.getCustomerName() +\n \"\\n\" + getString(R.string.add_cream) + \"? \" + String.valueOf(order.isHasWhippedCream()) +\n \"\\n\" + getString(R.string.add_chocolate) + \"? \" + String.valueOf(order.isHasChocolate()) +\n \"\\n\" + getString(R.string.quantity) + \": \" + order.getCupsNumber() + \"\\n\" + getString(R.string.resut) +\n \": $\" + MainActivity.calculatePrice(order) + \"\\n\" + getString(R.string.thanks) + \"!\";\n return message;\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "public String getMessage()\n {\n return super.getMessage()+promo_error+\"not found\";\n }", "private static String build3PidErrorMessage(Context context, @StringRes int errorMessageRes, @Nullable String additionalInfo) {\n StringBuilder builder = new StringBuilder();\n builder.append(context.getString(errorMessageRes));\n\n if (additionalInfo != null) {\n builder.append(' ');\n builder.append(context.getString(R.string.account_additional_info, additionalInfo));\n }\n\n return builder.toString();\n }", "@Override\n public String getDescription() {\n return \"Mint currency\";\n }", "@Override\n public String getDescription() {\n return \"Digital goods purchase\";\n }", "private String createOrderSummary(int price, boolean addWhippedCream, boolean addChocolate ,String name)\n {\n if (addWhippedCream==true) price+= (numOfCufee) ;\n if (addChocolate == true ) price+=(2*numOfCufee) ;\n String priceMessage = \"Name: \"+name;\n priceMessage += \"\\nAdd whipped cream? \" + addWhippedCream;\n priceMessage += \"\\nAdd chocolate? \" + addChocolate;\n priceMessage += \"\\nQuantity: \" + numOfCufee;\n priceMessage += \"\\nTotal: $\" + price;\n priceMessage += \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String descripcion() {\n return \"Viaje incentivo que te envia la empresa \" + empresa;\n }", "public String getMoneyRemark() {\n return moneyRemark;\n }", "private String getMessageSummary() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(MAIL_FROM).append(\":\").append(props.getProperty(MAIL_FROM, \"\"));\n\n\t\tif (props.containsKey(MAIL_REPLY_TO)) {\n\t\t\tsb.append(\",\").append(MAIL_REPLY_TO).append(\":\").append(props.getProperty(MAIL_REPLY_TO));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_TO).append(\":\").append(props.getProperty(MAIL_TO));\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_CC).append(\":\").append(props.getProperty(MAIL_CC));\n\t\t}\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_BCC).append(\":\").append(props.getProperty(MAIL_BCC));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_SUBJECT).append(\":\").append(props.getProperty(MAIL_SUBJECT, \"\"));\n\n\t\treturn sb.toString();\n\t}", "private String geraMensagem(Mensagem msg) {\n\t\treturn new StringBuilder()\n\t\t\t.append(msg.remetente.nome)\n\t\t\t.append(\" enviou para \")\n\t\t\t.append(msg.destinatario.nome)\n\t\t\t.append(\" uma mensagem suspeita.\")\n\t\t\t.toString();\n\t}", "private String buildResultMessage() {\n String result;\n byte[] digest = new byte[20];\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-1\");\n digest = md.digest(phonepartBytes);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n\n byte[] checksumBytes = new byte[4];\n System.arraycopy(digest, 0, checksumBytes, 0, 4);\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n try {\n outputStream.write(checksumBytes);\n outputStream.write(phonepartBytes);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n byte[] completeOutputBytes = outputStream.toByteArray();\n result = Util.insertPeriodically(new Base32().encodeAsString(completeOutputBytes), 4);\n result = result.replaceAll(\"=\", \"\");\n return result;\n }", "public String getSupMemo() {\n return supMemo;\n }", "public void writeMassege() {\n m = ChatClient.message;\n jtaChatHistory.setText(\"You : \" + m);\n //writeMassageServer();\n }", "private String createOrderSummary(int price, boolean cream, boolean chocolate, String name){\n String orderSummary = \"Name: \"+name+\"\\n\" +\n \"Add whipped cream? \" + cream +\"\\n\"+\n \"Add chocolate? \" + chocolate + \"\\n\" +\n \"Quantity: \"+\n quantity +\n \"\\nTotal: $\" + price +\n \"\\n\" + getString(R.string.thankyou) + \"!\";\n return orderSummary;\n }", "@Override\n public String getDescription() {\n return \"Digital goods feedback\";\n }", "public String getRemark()\n/* */ {\n/* 255 */ return this.remark;\n/* */ }", "@Override\n public String getMessage() {\n String result =\"Audio Message {\\n\";\n result +=\"\\tID: \"+ID+\"\\n\";\n result +=\"\\tBuffer Size: \"+bufferSize+\"\\n\";\n result +=\"}\";\n \n return result;\n }", "public String creerMessage(){\n return profile.getMessage();\n }", "BigInteger getMessage();", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private String m50433y() {\n if (TextUtils.isEmpty(this.f30738i0.getText().toString().trim())) {\n return this.f30720S.getString(C10232R.string.payment_error_blank_field);\n }\n return !CardPaymentParams.m53961m(this.f30738i0.getText().toString().trim()) ? this.f30720S.getString(C10232R.string.checkout_error_card_holder_invalid) : \"\";\n }", "private String getOrderSummary() {\n final int numberOfCoffees = getNumberOfCoffees();\n if (numberOfCoffees == 0) {\n return Constants.FREE_MESSAGE;\n }\n\n final String name = ((EditText) findViewById(R.id.name_edit_text))\n .getText().toString();\n\n return Constants.NAME + \": \" +\n (name.isEmpty() ? Constants.DEFAULT_NAME : name) + \"\\n\" +\n getToppingsSummary() + \"\\n\" +\n Constants.QUANTITY + \": \" + numberOfCoffees + \"\\n\" +\n Constants.TOTAL + \": \" +\n NumberFormat.getCurrencyInstance().format(getTotalPrice()) + \"\\n\" +\n Constants.BYE_GREETING;\n }", "String getMessage();", "String getMessage();", "String getMessage();", "public String getMerchantNo();", "@Override\n public String getDescription() {\n return \"Digital goods delivery\";\n }", "private String createOrderSummary(int price, String name, boolean hasWhippedCream,\n boolean hasChocolate){\n return getString(R.string.order_summary_name, name) +\n \"\\n\" + getString(R.string.add_whipped_cream, hasWhippedCream) +\n \"\\n\" + getString(R.string.add_chocolate, hasChocolate) +\n \"\\n\" + getString(R.string.order_quantity, quantity) +\n \"\\n\" + getString(R.string.order_total, price) +\n \"\\n\" + getString(R.string.thank_you);\n }", "@Override\r\n\tpublic String getMessage() {\n\t\treturn \"홀수입력 !!\";\r\n\t}", "private String generateOrderSummary(String name, int quantity, boolean whippedCreamChecked, boolean chocolateChecked) {\n int price = calculatePrice(quantity, whippedCreamChecked, chocolateChecked);\n\n String priceMessage = \"Name: \"+ name + \"\\n\" +\n \"Add whipped cream? \"+ whippedCreamChecked + \"\\n\" +\n \"Chocolate? \"+ chocolateChecked + \"\\n\" +\n \"Quantity: \" + quantity + \"\\n\" +\n \"Total: $ \" + price + \"\\n\" +\n \"Thank you!\";\n\n return priceMessage;\n }", "@Override\n public String getMailetInfo() {\n return \"Sieve Mailbox Mailet\";\n }", "public String returnMessage () {\n String msg = getString(R.string.result, score);\n if (score > 7) {\n msg += \"\\n\" + getString(R.string.fabulous);\n }\n else if (score >= 5 && score <= 7) {\n msg += \"\\n\" + getString(R.string.good_job);\n }\n else {\n msg += \"\\n\" + getString(R.string.try_again);\n }\n return msg;\n }", "public String getMessage(){\n return(message);\n }", "private String m50388c(PaymentError paymentError) {\n try {\n return new JSONObject(paymentError.mo40763b()).getString(\"description\");\n } catch (Exception unused) {\n return paymentError.mo40764c();\n }\n }", "java.lang.String getBuyDescribe();", "public abstract void msgPayment(Customer customer, Cash cash);", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();" ]
[ "0.6528686", "0.6528686", "0.6528686", "0.64215565", "0.63572776", "0.63572776", "0.63572776", "0.63572776", "0.6230878", "0.6226878", "0.61937135", "0.6192103", "0.61602914", "0.6146373", "0.6146373", "0.6146373", "0.61349267", "0.6120991", "0.6120991", "0.6120991", "0.61019516", "0.6093255", "0.60826933", "0.6072336", "0.6058279", "0.60461986", "0.60461986", "0.59808815", "0.59198743", "0.5909179", "0.5868135", "0.58613884", "0.5735315", "0.5698737", "0.5665372", "0.562132", "0.5588627", "0.5588627", "0.5588627", "0.5581732", "0.55789053", "0.5565189", "0.5550607", "0.552437", "0.552437", "0.552437", "0.55241656", "0.54899883", "0.5438751", "0.5399326", "0.5397901", "0.5391264", "0.5390979", "0.5386106", "0.53759724", "0.5374274", "0.5371592", "0.5360501", "0.5352885", "0.5349294", "0.5349294", "0.53355414", "0.5310743", "0.5305369", "0.5303087", "0.5302099", "0.52958566", "0.5294715", "0.5292624", "0.5287689", "0.5287689", "0.5287689", "0.5281478", "0.5266776", "0.5266263", "0.5261392", "0.5255795", "0.52441424", "0.52365196", "0.522935", "0.5223733", "0.5207632", "0.52022713", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134" ]
0.615164
14
Humanreadable message for the merchant optional string memo = 4;
@java.lang.Override public com.google.protobuf.ByteString getMemoBytes() { return com.google.protobuf.ByteString.copyFromUtf8(memo_); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getMemo();", "java.lang.String getMemo();", "java.lang.String getMemo();", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "private String getMessage() {\n\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\r\n\t\t\r\n\t\tboolean addSign = prefs.getBoolean(\"addsign\", true);\r\n\t\t\r\n\t\ttry {\r\n\t\t\r\n\t\tdefMessage = \"I am busy right now and will call you latter.\";\r\n\t\t\r\n\t\tfinalMessage = prefs.getString(\"message\", defMessage);\r\n\t\tif(finalMessage.equals(\"\"))\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t} catch (RuntimeException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t}\r\n\t\t\r\n\t\tif(addSign)\r\n\t\t\tfinalMessage += \"\\nSent using Calls and SMS Blocker for android.\\nDownload from: https://play.google.com/store/apps/details?id=com.atiffarrukh.callandsmsblocker\";\r\n\t\treturn finalMessage;\r\n\t}", "@Override\n public String getPayMemo() {\n return String.format(\"Employee ID: %d, Pay Date: %s\", this.getEmpID(),\n HRUtility.dateToStr(new Date()));\n }", "public void setMemo(String memo) {\n\t\tMEMO = memo;\n\t}", "public java.lang.String getMemo() {\r\n return memo;\r\n }", "public void setMemo(java.lang.String memo) {\r\n this.memo = memo;\r\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public void setMemo (java.lang.String memo) {\r\n\t\tthis.memo = memo;\r\n\t}", "@Override\n public String getMessage() {\n String chuoi=\"\";\n if (maCD.length()!=5)\n chuoi=\"MaCD bao gom 5 ki tu\";\n else if (soBaiHat<10)\n chuoi=\"So bai hat phai lon hon 10 bai\";\n return\n chuoi;\n }", "public void setMemo(String memo) {\n this.memo = memo == null ? null : memo.trim();\n }", "public java.lang.String getMemo () {\r\n\t\treturn memo;\r\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo == null ? null : memo.trim();\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public String getSMemo() {\n return sMemo;\n }", "private String createOrderSummary(String userName, int price, boolean addWhippedCream, boolean addChocolate, boolean addCinnamon, boolean addMarshmallows){\n String priceMessage = \"Name: \" + userName;\n priceMessage = priceMessage + \"\\nAdd Marshmallows? \" + addMarshmallows;\n priceMessage = priceMessage + \"\\nAdd Cinnamon? \" + addCinnamon;\n priceMessage = priceMessage + \"\\nAdd Whipped Cream? \" + addWhippedCream;\n priceMessage = priceMessage + \"\\nAdd Chocolate? \" + addChocolate;\n priceMessage = priceMessage + \"\\nQuantity: \" + quantity;\n priceMessage = priceMessage + \"\\nTotal: $\" + price;\n priceMessage = priceMessage + \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String getPayMemo() throws ParseException {\n return \"Employee ID: \" + getEmpID() + \", Pay Date: \" + HRDateUtils.strToDate(\"2019-10-01\");\n }", "public String showInfoMedi(){\n\t\tString msg = \"\";\n\n\t\tmsg += \"NOMBRE DE LA MEDICINA: \"+name+\"\\n\";\n\t\tmsg += \"LA DOSIS: \"+dose+\"\\n\";\n\t\tmsg += \"COSTO POR DOSIS: \"+doseCost+\"\\n\";\n\t\tmsg += \"FRECUENCIA QUE ESTA DEBE SER APLICADA: \"+frecuency+\"\\n\";\n\n\t\treturn msg;\n\t}", "private String createOrderSummary(int price,boolean addWhippedCream,boolean addChocolate,String name){\n String priceMessage=\"Name :\"+name;\n priceMessage+=\"\\nadd whipped cream ? \"+addWhippedCream;\n priceMessage+=\"\\nadd chocolate ? \"+addChocolate;\n priceMessage+=\"\\nQuantity \"+quantity;\n priceMessage+=\"\\nTotal :$ \"+price;\n priceMessage+=\"\\nThank you!\";\n return priceMessage;\n }", "@Override\r\n public String receita() {\n return \"Misturar os ingredientes; bater no liquidificador; colocar na máquina de waffle por 10m\";\r\n }", "private String createOrderSummary (String name, int price, boolean addWhippedCream, boolean addChocolate) {\n String priceMessage = getString(R.string.order_summary_name, name);\n priceMessage += \"\\n\" + getString(R.string.order_summary_whipped_cream, addWhippedCream);\n priceMessage += \"\\n\" + getString(R.string.order_summary_chocolate, addChocolate);\n priceMessage += \"\\n\" + getString(R.string.order_summary_quantity, quantity);\n priceMessage += \"\\nTotal: \" + price;\n priceMessage += \"\\n\" + getString(R.string.thank_you);\n return priceMessage;\n }", "public void setSMemo(String sMemo) {\n this.sMemo = sMemo;\n }", "public String getDescription()\r\n\t{\r\n\t\tStringBuilder msgreturn = new StringBuilder().append(m_name).append(\" \").append(m_taxBaseAmt.toString());\r\n\t\treturn msgreturn.toString();\r\n\t}", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@Override\n public String getDescription() {\n return \"Arbitrary message\";\n }", "public String getMessage()\n {\n return String.format(\"MessageType=%s,TransactionId=%s,TerminalId=%s,MerchantId=%s,FingerData=%s,CustomerId=%s,IdData=%s, CustomerData=%s\", this.messageType, this.transactionId, this.terminalId, this.merchantId, this.fingerData, this.customerId, this.idData, this.customerData);\n }", "private String buildMessage(String message) {\n\t\tif(message != null && message.contains(\"@record\")) {\n\t\t\tmessage = message.replaceAll(\"@record\", answerUser);\n\t\t\trecorded.put(owner.id(), answerUser);\n\t\t}\n\t\t//o sistema substitui o texto !id pelo id do usuário da conversa\n\t\tif(message != null && message.contains(\"!id\")) {\n\t\t\tmessage = message.replaceAll(\"!id\", owner.id() + \"\");\n\t\t}\n\t\t//o sistema verifica se tem alguma gravacao para o código recebido\n\t\tif(message != null && message.contains(\"#find\")) {\n\t\t\tString gravacao = recorded.get(Integer.parseInt(userLatestAnswer.get(owner.id())));\n\t\t\t//se houver gravacao, o sistema informa qual o desejo do amigo secreto\n\t\t\tif(gravacao != null)\n\t\t\t\tmessage = message.replaceAll(\"#find\", gravacao);\n\t\t\t//caso nao haja gravacao, o sistema notifica o usuário da situacao\n\t\t\telse\n\t\t\t\tmessage = \"O código informado não corresponde ao desejo de um amigo secreto... por favor tente novamente\";\n\t\t}\n\n\t\treturn message;\n\t}", "@Override\n\tpublic String getText() {\n\t\treturn \"MMS: \" + text;\n\t}", "private String getOrderDetails(Order order) {\n String message = getString(R.string.total) + \"\\n\" + getString(R.string.name) + \": \" + order.getCustomerName() +\n \"\\n\" + getString(R.string.add_cream) + \"? \" + String.valueOf(order.isHasWhippedCream()) +\n \"\\n\" + getString(R.string.add_chocolate) + \"? \" + String.valueOf(order.isHasChocolate()) +\n \"\\n\" + getString(R.string.quantity) + \": \" + order.getCupsNumber() + \"\\n\" + getString(R.string.resut) +\n \": $\" + MainActivity.calculatePrice(order) + \"\\n\" + getString(R.string.thanks) + \"!\";\n return message;\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "public String getMessage()\n {\n return super.getMessage()+promo_error+\"not found\";\n }", "private static String build3PidErrorMessage(Context context, @StringRes int errorMessageRes, @Nullable String additionalInfo) {\n StringBuilder builder = new StringBuilder();\n builder.append(context.getString(errorMessageRes));\n\n if (additionalInfo != null) {\n builder.append(' ');\n builder.append(context.getString(R.string.account_additional_info, additionalInfo));\n }\n\n return builder.toString();\n }", "@Override\n public String getDescription() {\n return \"Mint currency\";\n }", "@Override\n public String getDescription() {\n return \"Digital goods purchase\";\n }", "private String createOrderSummary(int price, boolean addWhippedCream, boolean addChocolate ,String name)\n {\n if (addWhippedCream==true) price+= (numOfCufee) ;\n if (addChocolate == true ) price+=(2*numOfCufee) ;\n String priceMessage = \"Name: \"+name;\n priceMessage += \"\\nAdd whipped cream? \" + addWhippedCream;\n priceMessage += \"\\nAdd chocolate? \" + addChocolate;\n priceMessage += \"\\nQuantity: \" + numOfCufee;\n priceMessage += \"\\nTotal: $\" + price;\n priceMessage += \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String descripcion() {\n return \"Viaje incentivo que te envia la empresa \" + empresa;\n }", "public String getMoneyRemark() {\n return moneyRemark;\n }", "private String getMessageSummary() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(MAIL_FROM).append(\":\").append(props.getProperty(MAIL_FROM, \"\"));\n\n\t\tif (props.containsKey(MAIL_REPLY_TO)) {\n\t\t\tsb.append(\",\").append(MAIL_REPLY_TO).append(\":\").append(props.getProperty(MAIL_REPLY_TO));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_TO).append(\":\").append(props.getProperty(MAIL_TO));\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_CC).append(\":\").append(props.getProperty(MAIL_CC));\n\t\t}\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_BCC).append(\":\").append(props.getProperty(MAIL_BCC));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_SUBJECT).append(\":\").append(props.getProperty(MAIL_SUBJECT, \"\"));\n\n\t\treturn sb.toString();\n\t}", "private String geraMensagem(Mensagem msg) {\n\t\treturn new StringBuilder()\n\t\t\t.append(msg.remetente.nome)\n\t\t\t.append(\" enviou para \")\n\t\t\t.append(msg.destinatario.nome)\n\t\t\t.append(\" uma mensagem suspeita.\")\n\t\t\t.toString();\n\t}", "private String buildResultMessage() {\n String result;\n byte[] digest = new byte[20];\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-1\");\n digest = md.digest(phonepartBytes);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n\n byte[] checksumBytes = new byte[4];\n System.arraycopy(digest, 0, checksumBytes, 0, 4);\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n try {\n outputStream.write(checksumBytes);\n outputStream.write(phonepartBytes);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n byte[] completeOutputBytes = outputStream.toByteArray();\n result = Util.insertPeriodically(new Base32().encodeAsString(completeOutputBytes), 4);\n result = result.replaceAll(\"=\", \"\");\n return result;\n }", "public String getSupMemo() {\n return supMemo;\n }", "public void writeMassege() {\n m = ChatClient.message;\n jtaChatHistory.setText(\"You : \" + m);\n //writeMassageServer();\n }", "private String createOrderSummary(int price, boolean cream, boolean chocolate, String name){\n String orderSummary = \"Name: \"+name+\"\\n\" +\n \"Add whipped cream? \" + cream +\"\\n\"+\n \"Add chocolate? \" + chocolate + \"\\n\" +\n \"Quantity: \"+\n quantity +\n \"\\nTotal: $\" + price +\n \"\\n\" + getString(R.string.thankyou) + \"!\";\n return orderSummary;\n }", "@Override\n public String getDescription() {\n return \"Digital goods feedback\";\n }", "public String getRemark()\n/* */ {\n/* 255 */ return this.remark;\n/* */ }", "@Override\n public String getMessage() {\n String result =\"Audio Message {\\n\";\n result +=\"\\tID: \"+ID+\"\\n\";\n result +=\"\\tBuffer Size: \"+bufferSize+\"\\n\";\n result +=\"}\";\n \n return result;\n }", "public String creerMessage(){\n return profile.getMessage();\n }", "BigInteger getMessage();", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private String m50433y() {\n if (TextUtils.isEmpty(this.f30738i0.getText().toString().trim())) {\n return this.f30720S.getString(C10232R.string.payment_error_blank_field);\n }\n return !CardPaymentParams.m53961m(this.f30738i0.getText().toString().trim()) ? this.f30720S.getString(C10232R.string.checkout_error_card_holder_invalid) : \"\";\n }", "private String getOrderSummary() {\n final int numberOfCoffees = getNumberOfCoffees();\n if (numberOfCoffees == 0) {\n return Constants.FREE_MESSAGE;\n }\n\n final String name = ((EditText) findViewById(R.id.name_edit_text))\n .getText().toString();\n\n return Constants.NAME + \": \" +\n (name.isEmpty() ? Constants.DEFAULT_NAME : name) + \"\\n\" +\n getToppingsSummary() + \"\\n\" +\n Constants.QUANTITY + \": \" + numberOfCoffees + \"\\n\" +\n Constants.TOTAL + \": \" +\n NumberFormat.getCurrencyInstance().format(getTotalPrice()) + \"\\n\" +\n Constants.BYE_GREETING;\n }", "String getMessage();", "String getMessage();", "String getMessage();", "public String getMerchantNo();", "@Override\n public String getDescription() {\n return \"Digital goods delivery\";\n }", "private String createOrderSummary(int price, String name, boolean hasWhippedCream,\n boolean hasChocolate){\n return getString(R.string.order_summary_name, name) +\n \"\\n\" + getString(R.string.add_whipped_cream, hasWhippedCream) +\n \"\\n\" + getString(R.string.add_chocolate, hasChocolate) +\n \"\\n\" + getString(R.string.order_quantity, quantity) +\n \"\\n\" + getString(R.string.order_total, price) +\n \"\\n\" + getString(R.string.thank_you);\n }", "@Override\r\n\tpublic String getMessage() {\n\t\treturn \"홀수입력 !!\";\r\n\t}", "private String generateOrderSummary(String name, int quantity, boolean whippedCreamChecked, boolean chocolateChecked) {\n int price = calculatePrice(quantity, whippedCreamChecked, chocolateChecked);\n\n String priceMessage = \"Name: \"+ name + \"\\n\" +\n \"Add whipped cream? \"+ whippedCreamChecked + \"\\n\" +\n \"Chocolate? \"+ chocolateChecked + \"\\n\" +\n \"Quantity: \" + quantity + \"\\n\" +\n \"Total: $ \" + price + \"\\n\" +\n \"Thank you!\";\n\n return priceMessage;\n }", "@Override\n public String getMailetInfo() {\n return \"Sieve Mailbox Mailet\";\n }", "public String returnMessage () {\n String msg = getString(R.string.result, score);\n if (score > 7) {\n msg += \"\\n\" + getString(R.string.fabulous);\n }\n else if (score >= 5 && score <= 7) {\n msg += \"\\n\" + getString(R.string.good_job);\n }\n else {\n msg += \"\\n\" + getString(R.string.try_again);\n }\n return msg;\n }", "public String getMessage(){\n return(message);\n }", "private String m50388c(PaymentError paymentError) {\n try {\n return new JSONObject(paymentError.mo40763b()).getString(\"description\");\n } catch (Exception unused) {\n return paymentError.mo40764c();\n }\n }", "java.lang.String getBuyDescribe();", "public abstract void msgPayment(Customer customer, Cash cash);", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();" ]
[ "0.6528391", "0.6528391", "0.6528391", "0.64205086", "0.6356297", "0.6356297", "0.6356297", "0.6356297", "0.62305707", "0.62265897", "0.61916566", "0.6191089", "0.61583596", "0.6150537", "0.6150537", "0.6150537", "0.6144644", "0.6144644", "0.6144644", "0.61332273", "0.61198497", "0.61198497", "0.61198497", "0.60998833", "0.6093024", "0.60809714", "0.6071289", "0.6056427", "0.60442406", "0.60442406", "0.59801567", "0.5920163", "0.59090143", "0.58681726", "0.58613783", "0.5735512", "0.56981426", "0.5663736", "0.5621511", "0.5588088", "0.5588088", "0.5588088", "0.55817044", "0.55779564", "0.5565084", "0.55500114", "0.5524078", "0.54908895", "0.543851", "0.5400001", "0.53975874", "0.5392325", "0.53910166", "0.53860414", "0.537608", "0.5373929", "0.5370945", "0.5360824", "0.5353028", "0.53495955", "0.53491366", "0.53363794", "0.531117", "0.53043985", "0.5302917", "0.53013855", "0.5297363", "0.5295898", "0.52929306", "0.5287295", "0.5287295", "0.5287295", "0.5283562", "0.52677065", "0.5266089", "0.5260809", "0.52558666", "0.5245105", "0.5236001", "0.5228618", "0.52242607", "0.5208407", "0.52036434", "0.51833576", "0.51833576", "0.51833576", "0.51833576", "0.51833576", "0.51833576", "0.51833576", "0.51833576", "0.51833576", "0.51833576", "0.51833576", "0.51833576", "0.51833576", "0.51833576", "0.51833576" ]
0.55228555
49
Humanreadable message for the merchant optional string memo = 4;
private void setMemo( java.lang.String value) { java.lang.Class<?> valueClass = value.getClass(); bitField0_ |= 0x00000002; memo_ = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getMemo();", "java.lang.String getMemo();", "java.lang.String getMemo();", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "private String getMessage() {\n\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\r\n\t\t\r\n\t\tboolean addSign = prefs.getBoolean(\"addsign\", true);\r\n\t\t\r\n\t\ttry {\r\n\t\t\r\n\t\tdefMessage = \"I am busy right now and will call you latter.\";\r\n\t\t\r\n\t\tfinalMessage = prefs.getString(\"message\", defMessage);\r\n\t\tif(finalMessage.equals(\"\"))\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t} catch (RuntimeException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t}\r\n\t\t\r\n\t\tif(addSign)\r\n\t\t\tfinalMessage += \"\\nSent using Calls and SMS Blocker for android.\\nDownload from: https://play.google.com/store/apps/details?id=com.atiffarrukh.callandsmsblocker\";\r\n\t\treturn finalMessage;\r\n\t}", "@Override\n public String getPayMemo() {\n return String.format(\"Employee ID: %d, Pay Date: %s\", this.getEmpID(),\n HRUtility.dateToStr(new Date()));\n }", "public java.lang.String getMemo() {\r\n return memo;\r\n }", "public void setMemo(String memo) {\n\t\tMEMO = memo;\n\t}", "public void setMemo(java.lang.String memo) {\r\n this.memo = memo;\r\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public void setMemo (java.lang.String memo) {\r\n\t\tthis.memo = memo;\r\n\t}", "@Override\n public String getMessage() {\n String chuoi=\"\";\n if (maCD.length()!=5)\n chuoi=\"MaCD bao gom 5 ki tu\";\n else if (soBaiHat<10)\n chuoi=\"So bai hat phai lon hon 10 bai\";\n return\n chuoi;\n }", "public void setMemo(String memo) {\n this.memo = memo == null ? null : memo.trim();\n }", "public java.lang.String getMemo () {\r\n\t\treturn memo;\r\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo == null ? null : memo.trim();\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public String getSMemo() {\n return sMemo;\n }", "private String createOrderSummary(String userName, int price, boolean addWhippedCream, boolean addChocolate, boolean addCinnamon, boolean addMarshmallows){\n String priceMessage = \"Name: \" + userName;\n priceMessage = priceMessage + \"\\nAdd Marshmallows? \" + addMarshmallows;\n priceMessage = priceMessage + \"\\nAdd Cinnamon? \" + addCinnamon;\n priceMessage = priceMessage + \"\\nAdd Whipped Cream? \" + addWhippedCream;\n priceMessage = priceMessage + \"\\nAdd Chocolate? \" + addChocolate;\n priceMessage = priceMessage + \"\\nQuantity: \" + quantity;\n priceMessage = priceMessage + \"\\nTotal: $\" + price;\n priceMessage = priceMessage + \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String getPayMemo() throws ParseException {\n return \"Employee ID: \" + getEmpID() + \", Pay Date: \" + HRDateUtils.strToDate(\"2019-10-01\");\n }", "public String showInfoMedi(){\n\t\tString msg = \"\";\n\n\t\tmsg += \"NOMBRE DE LA MEDICINA: \"+name+\"\\n\";\n\t\tmsg += \"LA DOSIS: \"+dose+\"\\n\";\n\t\tmsg += \"COSTO POR DOSIS: \"+doseCost+\"\\n\";\n\t\tmsg += \"FRECUENCIA QUE ESTA DEBE SER APLICADA: \"+frecuency+\"\\n\";\n\n\t\treturn msg;\n\t}", "private String createOrderSummary(int price,boolean addWhippedCream,boolean addChocolate,String name){\n String priceMessage=\"Name :\"+name;\n priceMessage+=\"\\nadd whipped cream ? \"+addWhippedCream;\n priceMessage+=\"\\nadd chocolate ? \"+addChocolate;\n priceMessage+=\"\\nQuantity \"+quantity;\n priceMessage+=\"\\nTotal :$ \"+price;\n priceMessage+=\"\\nThank you!\";\n return priceMessage;\n }", "@Override\r\n public String receita() {\n return \"Misturar os ingredientes; bater no liquidificador; colocar na máquina de waffle por 10m\";\r\n }", "private String createOrderSummary (String name, int price, boolean addWhippedCream, boolean addChocolate) {\n String priceMessage = getString(R.string.order_summary_name, name);\n priceMessage += \"\\n\" + getString(R.string.order_summary_whipped_cream, addWhippedCream);\n priceMessage += \"\\n\" + getString(R.string.order_summary_chocolate, addChocolate);\n priceMessage += \"\\n\" + getString(R.string.order_summary_quantity, quantity);\n priceMessage += \"\\nTotal: \" + price;\n priceMessage += \"\\n\" + getString(R.string.thank_you);\n return priceMessage;\n }", "public void setSMemo(String sMemo) {\n this.sMemo = sMemo;\n }", "public String getDescription()\r\n\t{\r\n\t\tStringBuilder msgreturn = new StringBuilder().append(m_name).append(\" \").append(m_taxBaseAmt.toString());\r\n\t\treturn msgreturn.toString();\r\n\t}", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@Override\n public String getDescription() {\n return \"Arbitrary message\";\n }", "public String getMessage()\n {\n return String.format(\"MessageType=%s,TransactionId=%s,TerminalId=%s,MerchantId=%s,FingerData=%s,CustomerId=%s,IdData=%s, CustomerData=%s\", this.messageType, this.transactionId, this.terminalId, this.merchantId, this.fingerData, this.customerId, this.idData, this.customerData);\n }", "private String buildMessage(String message) {\n\t\tif(message != null && message.contains(\"@record\")) {\n\t\t\tmessage = message.replaceAll(\"@record\", answerUser);\n\t\t\trecorded.put(owner.id(), answerUser);\n\t\t}\n\t\t//o sistema substitui o texto !id pelo id do usuário da conversa\n\t\tif(message != null && message.contains(\"!id\")) {\n\t\t\tmessage = message.replaceAll(\"!id\", owner.id() + \"\");\n\t\t}\n\t\t//o sistema verifica se tem alguma gravacao para o código recebido\n\t\tif(message != null && message.contains(\"#find\")) {\n\t\t\tString gravacao = recorded.get(Integer.parseInt(userLatestAnswer.get(owner.id())));\n\t\t\t//se houver gravacao, o sistema informa qual o desejo do amigo secreto\n\t\t\tif(gravacao != null)\n\t\t\t\tmessage = message.replaceAll(\"#find\", gravacao);\n\t\t\t//caso nao haja gravacao, o sistema notifica o usuário da situacao\n\t\t\telse\n\t\t\t\tmessage = \"O código informado não corresponde ao desejo de um amigo secreto... por favor tente novamente\";\n\t\t}\n\n\t\treturn message;\n\t}", "@Override\n\tpublic String getText() {\n\t\treturn \"MMS: \" + text;\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "private String getOrderDetails(Order order) {\n String message = getString(R.string.total) + \"\\n\" + getString(R.string.name) + \": \" + order.getCustomerName() +\n \"\\n\" + getString(R.string.add_cream) + \"? \" + String.valueOf(order.isHasWhippedCream()) +\n \"\\n\" + getString(R.string.add_chocolate) + \"? \" + String.valueOf(order.isHasChocolate()) +\n \"\\n\" + getString(R.string.quantity) + \": \" + order.getCupsNumber() + \"\\n\" + getString(R.string.resut) +\n \": $\" + MainActivity.calculatePrice(order) + \"\\n\" + getString(R.string.thanks) + \"!\";\n return message;\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "public String getMessage()\n {\n return super.getMessage()+promo_error+\"not found\";\n }", "private static String build3PidErrorMessage(Context context, @StringRes int errorMessageRes, @Nullable String additionalInfo) {\n StringBuilder builder = new StringBuilder();\n builder.append(context.getString(errorMessageRes));\n\n if (additionalInfo != null) {\n builder.append(' ');\n builder.append(context.getString(R.string.account_additional_info, additionalInfo));\n }\n\n return builder.toString();\n }", "@Override\n public String getDescription() {\n return \"Mint currency\";\n }", "@Override\n public String getDescription() {\n return \"Digital goods purchase\";\n }", "private String createOrderSummary(int price, boolean addWhippedCream, boolean addChocolate ,String name)\n {\n if (addWhippedCream==true) price+= (numOfCufee) ;\n if (addChocolate == true ) price+=(2*numOfCufee) ;\n String priceMessage = \"Name: \"+name;\n priceMessage += \"\\nAdd whipped cream? \" + addWhippedCream;\n priceMessage += \"\\nAdd chocolate? \" + addChocolate;\n priceMessage += \"\\nQuantity: \" + numOfCufee;\n priceMessage += \"\\nTotal: $\" + price;\n priceMessage += \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String descripcion() {\n return \"Viaje incentivo que te envia la empresa \" + empresa;\n }", "public String getMoneyRemark() {\n return moneyRemark;\n }", "private String getMessageSummary() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(MAIL_FROM).append(\":\").append(props.getProperty(MAIL_FROM, \"\"));\n\n\t\tif (props.containsKey(MAIL_REPLY_TO)) {\n\t\t\tsb.append(\",\").append(MAIL_REPLY_TO).append(\":\").append(props.getProperty(MAIL_REPLY_TO));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_TO).append(\":\").append(props.getProperty(MAIL_TO));\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_CC).append(\":\").append(props.getProperty(MAIL_CC));\n\t\t}\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_BCC).append(\":\").append(props.getProperty(MAIL_BCC));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_SUBJECT).append(\":\").append(props.getProperty(MAIL_SUBJECT, \"\"));\n\n\t\treturn sb.toString();\n\t}", "private String geraMensagem(Mensagem msg) {\n\t\treturn new StringBuilder()\n\t\t\t.append(msg.remetente.nome)\n\t\t\t.append(\" enviou para \")\n\t\t\t.append(msg.destinatario.nome)\n\t\t\t.append(\" uma mensagem suspeita.\")\n\t\t\t.toString();\n\t}", "private String buildResultMessage() {\n String result;\n byte[] digest = new byte[20];\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-1\");\n digest = md.digest(phonepartBytes);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n\n byte[] checksumBytes = new byte[4];\n System.arraycopy(digest, 0, checksumBytes, 0, 4);\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n try {\n outputStream.write(checksumBytes);\n outputStream.write(phonepartBytes);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n byte[] completeOutputBytes = outputStream.toByteArray();\n result = Util.insertPeriodically(new Base32().encodeAsString(completeOutputBytes), 4);\n result = result.replaceAll(\"=\", \"\");\n return result;\n }", "public String getSupMemo() {\n return supMemo;\n }", "public void writeMassege() {\n m = ChatClient.message;\n jtaChatHistory.setText(\"You : \" + m);\n //writeMassageServer();\n }", "private String createOrderSummary(int price, boolean cream, boolean chocolate, String name){\n String orderSummary = \"Name: \"+name+\"\\n\" +\n \"Add whipped cream? \" + cream +\"\\n\"+\n \"Add chocolate? \" + chocolate + \"\\n\" +\n \"Quantity: \"+\n quantity +\n \"\\nTotal: $\" + price +\n \"\\n\" + getString(R.string.thankyou) + \"!\";\n return orderSummary;\n }", "@Override\n public String getDescription() {\n return \"Digital goods feedback\";\n }", "public String getRemark()\n/* */ {\n/* 255 */ return this.remark;\n/* */ }", "@Override\n public String getMessage() {\n String result =\"Audio Message {\\n\";\n result +=\"\\tID: \"+ID+\"\\n\";\n result +=\"\\tBuffer Size: \"+bufferSize+\"\\n\";\n result +=\"}\";\n \n return result;\n }", "public String creerMessage(){\n return profile.getMessage();\n }", "BigInteger getMessage();", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private String m50433y() {\n if (TextUtils.isEmpty(this.f30738i0.getText().toString().trim())) {\n return this.f30720S.getString(C10232R.string.payment_error_blank_field);\n }\n return !CardPaymentParams.m53961m(this.f30738i0.getText().toString().trim()) ? this.f30720S.getString(C10232R.string.checkout_error_card_holder_invalid) : \"\";\n }", "private String getOrderSummary() {\n final int numberOfCoffees = getNumberOfCoffees();\n if (numberOfCoffees == 0) {\n return Constants.FREE_MESSAGE;\n }\n\n final String name = ((EditText) findViewById(R.id.name_edit_text))\n .getText().toString();\n\n return Constants.NAME + \": \" +\n (name.isEmpty() ? Constants.DEFAULT_NAME : name) + \"\\n\" +\n getToppingsSummary() + \"\\n\" +\n Constants.QUANTITY + \": \" + numberOfCoffees + \"\\n\" +\n Constants.TOTAL + \": \" +\n NumberFormat.getCurrencyInstance().format(getTotalPrice()) + \"\\n\" +\n Constants.BYE_GREETING;\n }", "String getMessage();", "String getMessage();", "String getMessage();", "public String getMerchantNo();", "@Override\n public String getDescription() {\n return \"Digital goods delivery\";\n }", "private String createOrderSummary(int price, String name, boolean hasWhippedCream,\n boolean hasChocolate){\n return getString(R.string.order_summary_name, name) +\n \"\\n\" + getString(R.string.add_whipped_cream, hasWhippedCream) +\n \"\\n\" + getString(R.string.add_chocolate, hasChocolate) +\n \"\\n\" + getString(R.string.order_quantity, quantity) +\n \"\\n\" + getString(R.string.order_total, price) +\n \"\\n\" + getString(R.string.thank_you);\n }", "@Override\r\n\tpublic String getMessage() {\n\t\treturn \"홀수입력 !!\";\r\n\t}", "private String generateOrderSummary(String name, int quantity, boolean whippedCreamChecked, boolean chocolateChecked) {\n int price = calculatePrice(quantity, whippedCreamChecked, chocolateChecked);\n\n String priceMessage = \"Name: \"+ name + \"\\n\" +\n \"Add whipped cream? \"+ whippedCreamChecked + \"\\n\" +\n \"Chocolate? \"+ chocolateChecked + \"\\n\" +\n \"Quantity: \" + quantity + \"\\n\" +\n \"Total: $ \" + price + \"\\n\" +\n \"Thank you!\";\n\n return priceMessage;\n }", "@Override\n public String getMailetInfo() {\n return \"Sieve Mailbox Mailet\";\n }", "public String returnMessage () {\n String msg = getString(R.string.result, score);\n if (score > 7) {\n msg += \"\\n\" + getString(R.string.fabulous);\n }\n else if (score >= 5 && score <= 7) {\n msg += \"\\n\" + getString(R.string.good_job);\n }\n else {\n msg += \"\\n\" + getString(R.string.try_again);\n }\n return msg;\n }", "public String getMessage(){\n return(message);\n }", "private String m50388c(PaymentError paymentError) {\n try {\n return new JSONObject(paymentError.mo40763b()).getString(\"description\");\n } catch (Exception unused) {\n return paymentError.mo40764c();\n }\n }", "java.lang.String getBuyDescribe();", "public abstract void msgPayment(Customer customer, Cash cash);", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();" ]
[ "0.6530689", "0.6530689", "0.6530689", "0.64228755", "0.63587", "0.63587", "0.63587", "0.63587", "0.62296426", "0.62271774", "0.61935705", "0.61930877", "0.6159983", "0.6152955", "0.6152955", "0.6152955", "0.6146322", "0.6146322", "0.6146322", "0.6134969", "0.6122359", "0.6122359", "0.6122359", "0.6101424", "0.60919434", "0.6082051", "0.6073869", "0.6057527", "0.6045923", "0.6045923", "0.5982354", "0.59194446", "0.5909853", "0.5868013", "0.58608526", "0.5734803", "0.569782", "0.5665116", "0.5621606", "0.5590498", "0.5590498", "0.5590498", "0.55802053", "0.55775243", "0.5564015", "0.55494684", "0.5524799", "0.5524799", "0.5524799", "0.5524594", "0.54906577", "0.5437719", "0.5397792", "0.53976196", "0.53916323", "0.53908175", "0.53849983", "0.5376101", "0.5373217", "0.5370599", "0.5361155", "0.5353887", "0.5349328", "0.5348964", "0.5335186", "0.5311137", "0.5303364", "0.53020096", "0.53015757", "0.5298194", "0.52960545", "0.52935654", "0.5286505", "0.5286505", "0.5286505", "0.5284396", "0.5266947", "0.52659756", "0.5259939", "0.5255565", "0.5244451", "0.52355653", "0.5228516", "0.52243024", "0.5207915", "0.5204521", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433", "0.5182433" ]
0.0
-1
Humanreadable message for the merchant optional string memo = 4;
private void clearMemo() { bitField0_ = (bitField0_ & ~0x00000002); memo_ = getDefaultInstance().getMemo(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getMemo();", "java.lang.String getMemo();", "java.lang.String getMemo();", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "private String getMessage() {\n\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\r\n\t\t\r\n\t\tboolean addSign = prefs.getBoolean(\"addsign\", true);\r\n\t\t\r\n\t\ttry {\r\n\t\t\r\n\t\tdefMessage = \"I am busy right now and will call you latter.\";\r\n\t\t\r\n\t\tfinalMessage = prefs.getString(\"message\", defMessage);\r\n\t\tif(finalMessage.equals(\"\"))\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t} catch (RuntimeException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t}\r\n\t\t\r\n\t\tif(addSign)\r\n\t\t\tfinalMessage += \"\\nSent using Calls and SMS Blocker for android.\\nDownload from: https://play.google.com/store/apps/details?id=com.atiffarrukh.callandsmsblocker\";\r\n\t\treturn finalMessage;\r\n\t}", "@Override\n public String getPayMemo() {\n return String.format(\"Employee ID: %d, Pay Date: %s\", this.getEmpID(),\n HRUtility.dateToStr(new Date()));\n }", "public void setMemo(String memo) {\n\t\tMEMO = memo;\n\t}", "public java.lang.String getMemo() {\r\n return memo;\r\n }", "public void setMemo(java.lang.String memo) {\r\n this.memo = memo;\r\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public void setMemo (java.lang.String memo) {\r\n\t\tthis.memo = memo;\r\n\t}", "@Override\n public String getMessage() {\n String chuoi=\"\";\n if (maCD.length()!=5)\n chuoi=\"MaCD bao gom 5 ki tu\";\n else if (soBaiHat<10)\n chuoi=\"So bai hat phai lon hon 10 bai\";\n return\n chuoi;\n }", "public void setMemo(String memo) {\n this.memo = memo == null ? null : memo.trim();\n }", "public java.lang.String getMemo () {\r\n\t\treturn memo;\r\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo == null ? null : memo.trim();\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public String getSMemo() {\n return sMemo;\n }", "private String createOrderSummary(String userName, int price, boolean addWhippedCream, boolean addChocolate, boolean addCinnamon, boolean addMarshmallows){\n String priceMessage = \"Name: \" + userName;\n priceMessage = priceMessage + \"\\nAdd Marshmallows? \" + addMarshmallows;\n priceMessage = priceMessage + \"\\nAdd Cinnamon? \" + addCinnamon;\n priceMessage = priceMessage + \"\\nAdd Whipped Cream? \" + addWhippedCream;\n priceMessage = priceMessage + \"\\nAdd Chocolate? \" + addChocolate;\n priceMessage = priceMessage + \"\\nQuantity: \" + quantity;\n priceMessage = priceMessage + \"\\nTotal: $\" + price;\n priceMessage = priceMessage + \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String getPayMemo() throws ParseException {\n return \"Employee ID: \" + getEmpID() + \", Pay Date: \" + HRDateUtils.strToDate(\"2019-10-01\");\n }", "public String showInfoMedi(){\n\t\tString msg = \"\";\n\n\t\tmsg += \"NOMBRE DE LA MEDICINA: \"+name+\"\\n\";\n\t\tmsg += \"LA DOSIS: \"+dose+\"\\n\";\n\t\tmsg += \"COSTO POR DOSIS: \"+doseCost+\"\\n\";\n\t\tmsg += \"FRECUENCIA QUE ESTA DEBE SER APLICADA: \"+frecuency+\"\\n\";\n\n\t\treturn msg;\n\t}", "private String createOrderSummary(int price,boolean addWhippedCream,boolean addChocolate,String name){\n String priceMessage=\"Name :\"+name;\n priceMessage+=\"\\nadd whipped cream ? \"+addWhippedCream;\n priceMessage+=\"\\nadd chocolate ? \"+addChocolate;\n priceMessage+=\"\\nQuantity \"+quantity;\n priceMessage+=\"\\nTotal :$ \"+price;\n priceMessage+=\"\\nThank you!\";\n return priceMessage;\n }", "@Override\r\n public String receita() {\n return \"Misturar os ingredientes; bater no liquidificador; colocar na máquina de waffle por 10m\";\r\n }", "private String createOrderSummary (String name, int price, boolean addWhippedCream, boolean addChocolate) {\n String priceMessage = getString(R.string.order_summary_name, name);\n priceMessage += \"\\n\" + getString(R.string.order_summary_whipped_cream, addWhippedCream);\n priceMessage += \"\\n\" + getString(R.string.order_summary_chocolate, addChocolate);\n priceMessage += \"\\n\" + getString(R.string.order_summary_quantity, quantity);\n priceMessage += \"\\nTotal: \" + price;\n priceMessage += \"\\n\" + getString(R.string.thank_you);\n return priceMessage;\n }", "public void setSMemo(String sMemo) {\n this.sMemo = sMemo;\n }", "public String getDescription()\r\n\t{\r\n\t\tStringBuilder msgreturn = new StringBuilder().append(m_name).append(\" \").append(m_taxBaseAmt.toString());\r\n\t\treturn msgreturn.toString();\r\n\t}", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@Override\n public String getDescription() {\n return \"Arbitrary message\";\n }", "public String getMessage()\n {\n return String.format(\"MessageType=%s,TransactionId=%s,TerminalId=%s,MerchantId=%s,FingerData=%s,CustomerId=%s,IdData=%s, CustomerData=%s\", this.messageType, this.transactionId, this.terminalId, this.merchantId, this.fingerData, this.customerId, this.idData, this.customerData);\n }", "private String buildMessage(String message) {\n\t\tif(message != null && message.contains(\"@record\")) {\n\t\t\tmessage = message.replaceAll(\"@record\", answerUser);\n\t\t\trecorded.put(owner.id(), answerUser);\n\t\t}\n\t\t//o sistema substitui o texto !id pelo id do usuário da conversa\n\t\tif(message != null && message.contains(\"!id\")) {\n\t\t\tmessage = message.replaceAll(\"!id\", owner.id() + \"\");\n\t\t}\n\t\t//o sistema verifica se tem alguma gravacao para o código recebido\n\t\tif(message != null && message.contains(\"#find\")) {\n\t\t\tString gravacao = recorded.get(Integer.parseInt(userLatestAnswer.get(owner.id())));\n\t\t\t//se houver gravacao, o sistema informa qual o desejo do amigo secreto\n\t\t\tif(gravacao != null)\n\t\t\t\tmessage = message.replaceAll(\"#find\", gravacao);\n\t\t\t//caso nao haja gravacao, o sistema notifica o usuário da situacao\n\t\t\telse\n\t\t\t\tmessage = \"O código informado não corresponde ao desejo de um amigo secreto... por favor tente novamente\";\n\t\t}\n\n\t\treturn message;\n\t}", "@Override\n\tpublic String getText() {\n\t\treturn \"MMS: \" + text;\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "private String getOrderDetails(Order order) {\n String message = getString(R.string.total) + \"\\n\" + getString(R.string.name) + \": \" + order.getCustomerName() +\n \"\\n\" + getString(R.string.add_cream) + \"? \" + String.valueOf(order.isHasWhippedCream()) +\n \"\\n\" + getString(R.string.add_chocolate) + \"? \" + String.valueOf(order.isHasChocolate()) +\n \"\\n\" + getString(R.string.quantity) + \": \" + order.getCupsNumber() + \"\\n\" + getString(R.string.resut) +\n \": $\" + MainActivity.calculatePrice(order) + \"\\n\" + getString(R.string.thanks) + \"!\";\n return message;\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "public String getMessage()\n {\n return super.getMessage()+promo_error+\"not found\";\n }", "private static String build3PidErrorMessage(Context context, @StringRes int errorMessageRes, @Nullable String additionalInfo) {\n StringBuilder builder = new StringBuilder();\n builder.append(context.getString(errorMessageRes));\n\n if (additionalInfo != null) {\n builder.append(' ');\n builder.append(context.getString(R.string.account_additional_info, additionalInfo));\n }\n\n return builder.toString();\n }", "@Override\n public String getDescription() {\n return \"Mint currency\";\n }", "@Override\n public String getDescription() {\n return \"Digital goods purchase\";\n }", "private String createOrderSummary(int price, boolean addWhippedCream, boolean addChocolate ,String name)\n {\n if (addWhippedCream==true) price+= (numOfCufee) ;\n if (addChocolate == true ) price+=(2*numOfCufee) ;\n String priceMessage = \"Name: \"+name;\n priceMessage += \"\\nAdd whipped cream? \" + addWhippedCream;\n priceMessage += \"\\nAdd chocolate? \" + addChocolate;\n priceMessage += \"\\nQuantity: \" + numOfCufee;\n priceMessage += \"\\nTotal: $\" + price;\n priceMessage += \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String descripcion() {\n return \"Viaje incentivo que te envia la empresa \" + empresa;\n }", "public String getMoneyRemark() {\n return moneyRemark;\n }", "private String getMessageSummary() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(MAIL_FROM).append(\":\").append(props.getProperty(MAIL_FROM, \"\"));\n\n\t\tif (props.containsKey(MAIL_REPLY_TO)) {\n\t\t\tsb.append(\",\").append(MAIL_REPLY_TO).append(\":\").append(props.getProperty(MAIL_REPLY_TO));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_TO).append(\":\").append(props.getProperty(MAIL_TO));\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_CC).append(\":\").append(props.getProperty(MAIL_CC));\n\t\t}\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_BCC).append(\":\").append(props.getProperty(MAIL_BCC));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_SUBJECT).append(\":\").append(props.getProperty(MAIL_SUBJECT, \"\"));\n\n\t\treturn sb.toString();\n\t}", "private String geraMensagem(Mensagem msg) {\n\t\treturn new StringBuilder()\n\t\t\t.append(msg.remetente.nome)\n\t\t\t.append(\" enviou para \")\n\t\t\t.append(msg.destinatario.nome)\n\t\t\t.append(\" uma mensagem suspeita.\")\n\t\t\t.toString();\n\t}", "private String buildResultMessage() {\n String result;\n byte[] digest = new byte[20];\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-1\");\n digest = md.digest(phonepartBytes);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n\n byte[] checksumBytes = new byte[4];\n System.arraycopy(digest, 0, checksumBytes, 0, 4);\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n try {\n outputStream.write(checksumBytes);\n outputStream.write(phonepartBytes);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n byte[] completeOutputBytes = outputStream.toByteArray();\n result = Util.insertPeriodically(new Base32().encodeAsString(completeOutputBytes), 4);\n result = result.replaceAll(\"=\", \"\");\n return result;\n }", "public String getSupMemo() {\n return supMemo;\n }", "public void writeMassege() {\n m = ChatClient.message;\n jtaChatHistory.setText(\"You : \" + m);\n //writeMassageServer();\n }", "private String createOrderSummary(int price, boolean cream, boolean chocolate, String name){\n String orderSummary = \"Name: \"+name+\"\\n\" +\n \"Add whipped cream? \" + cream +\"\\n\"+\n \"Add chocolate? \" + chocolate + \"\\n\" +\n \"Quantity: \"+\n quantity +\n \"\\nTotal: $\" + price +\n \"\\n\" + getString(R.string.thankyou) + \"!\";\n return orderSummary;\n }", "@Override\n public String getDescription() {\n return \"Digital goods feedback\";\n }", "public String getRemark()\n/* */ {\n/* 255 */ return this.remark;\n/* */ }", "@Override\n public String getMessage() {\n String result =\"Audio Message {\\n\";\n result +=\"\\tID: \"+ID+\"\\n\";\n result +=\"\\tBuffer Size: \"+bufferSize+\"\\n\";\n result +=\"}\";\n \n return result;\n }", "public String creerMessage(){\n return profile.getMessage();\n }", "BigInteger getMessage();", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private String m50433y() {\n if (TextUtils.isEmpty(this.f30738i0.getText().toString().trim())) {\n return this.f30720S.getString(C10232R.string.payment_error_blank_field);\n }\n return !CardPaymentParams.m53961m(this.f30738i0.getText().toString().trim()) ? this.f30720S.getString(C10232R.string.checkout_error_card_holder_invalid) : \"\";\n }", "private String getOrderSummary() {\n final int numberOfCoffees = getNumberOfCoffees();\n if (numberOfCoffees == 0) {\n return Constants.FREE_MESSAGE;\n }\n\n final String name = ((EditText) findViewById(R.id.name_edit_text))\n .getText().toString();\n\n return Constants.NAME + \": \" +\n (name.isEmpty() ? Constants.DEFAULT_NAME : name) + \"\\n\" +\n getToppingsSummary() + \"\\n\" +\n Constants.QUANTITY + \": \" + numberOfCoffees + \"\\n\" +\n Constants.TOTAL + \": \" +\n NumberFormat.getCurrencyInstance().format(getTotalPrice()) + \"\\n\" +\n Constants.BYE_GREETING;\n }", "String getMessage();", "String getMessage();", "String getMessage();", "public String getMerchantNo();", "@Override\n public String getDescription() {\n return \"Digital goods delivery\";\n }", "private String createOrderSummary(int price, String name, boolean hasWhippedCream,\n boolean hasChocolate){\n return getString(R.string.order_summary_name, name) +\n \"\\n\" + getString(R.string.add_whipped_cream, hasWhippedCream) +\n \"\\n\" + getString(R.string.add_chocolate, hasChocolate) +\n \"\\n\" + getString(R.string.order_quantity, quantity) +\n \"\\n\" + getString(R.string.order_total, price) +\n \"\\n\" + getString(R.string.thank_you);\n }", "@Override\r\n\tpublic String getMessage() {\n\t\treturn \"홀수입력 !!\";\r\n\t}", "private String generateOrderSummary(String name, int quantity, boolean whippedCreamChecked, boolean chocolateChecked) {\n int price = calculatePrice(quantity, whippedCreamChecked, chocolateChecked);\n\n String priceMessage = \"Name: \"+ name + \"\\n\" +\n \"Add whipped cream? \"+ whippedCreamChecked + \"\\n\" +\n \"Chocolate? \"+ chocolateChecked + \"\\n\" +\n \"Quantity: \" + quantity + \"\\n\" +\n \"Total: $ \" + price + \"\\n\" +\n \"Thank you!\";\n\n return priceMessage;\n }", "@Override\n public String getMailetInfo() {\n return \"Sieve Mailbox Mailet\";\n }", "public String returnMessage () {\n String msg = getString(R.string.result, score);\n if (score > 7) {\n msg += \"\\n\" + getString(R.string.fabulous);\n }\n else if (score >= 5 && score <= 7) {\n msg += \"\\n\" + getString(R.string.good_job);\n }\n else {\n msg += \"\\n\" + getString(R.string.try_again);\n }\n return msg;\n }", "public String getMessage(){\n return(message);\n }", "private String m50388c(PaymentError paymentError) {\n try {\n return new JSONObject(paymentError.mo40763b()).getString(\"description\");\n } catch (Exception unused) {\n return paymentError.mo40764c();\n }\n }", "java.lang.String getBuyDescribe();", "public abstract void msgPayment(Customer customer, Cash cash);", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();" ]
[ "0.6528686", "0.6528686", "0.6528686", "0.64215565", "0.63572776", "0.63572776", "0.63572776", "0.63572776", "0.6230878", "0.6226878", "0.61937135", "0.6192103", "0.61602914", "0.615164", "0.615164", "0.615164", "0.6146373", "0.6146373", "0.6146373", "0.61349267", "0.6120991", "0.6120991", "0.6120991", "0.61019516", "0.6093255", "0.60826933", "0.6072336", "0.6058279", "0.60461986", "0.60461986", "0.59808815", "0.59198743", "0.5909179", "0.5868135", "0.58613884", "0.5735315", "0.5698737", "0.5665372", "0.562132", "0.5588627", "0.5588627", "0.5588627", "0.5581732", "0.55789053", "0.5565189", "0.5550607", "0.552437", "0.552437", "0.552437", "0.55241656", "0.54899883", "0.5438751", "0.5399326", "0.5397901", "0.5391264", "0.5390979", "0.5386106", "0.53759724", "0.5374274", "0.5371592", "0.5360501", "0.5352885", "0.5349294", "0.5349294", "0.53355414", "0.5310743", "0.5305369", "0.5303087", "0.5302099", "0.52958566", "0.5294715", "0.5292624", "0.5287689", "0.5287689", "0.5287689", "0.5281478", "0.5266776", "0.5266263", "0.5261392", "0.5255795", "0.52441424", "0.52365196", "0.522935", "0.5223733", "0.5207632", "0.52022713", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134" ]
0.0
-1
Humanreadable message for the merchant optional string memo = 4;
private void setMemoBytes( com.google.protobuf.ByteString value) { memo_ = value.toStringUtf8(); bitField0_ |= 0x00000002; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getMemo();", "java.lang.String getMemo();", "java.lang.String getMemo();", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "public String getMemo() {\n return memo;\n }", "private String getMessage() {\n\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\r\n\t\t\r\n\t\tboolean addSign = prefs.getBoolean(\"addsign\", true);\r\n\t\t\r\n\t\ttry {\r\n\t\t\r\n\t\tdefMessage = \"I am busy right now and will call you latter.\";\r\n\t\t\r\n\t\tfinalMessage = prefs.getString(\"message\", defMessage);\r\n\t\tif(finalMessage.equals(\"\"))\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t} catch (RuntimeException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t}\r\n\t\t\r\n\t\tif(addSign)\r\n\t\t\tfinalMessage += \"\\nSent using Calls and SMS Blocker for android.\\nDownload from: https://play.google.com/store/apps/details?id=com.atiffarrukh.callandsmsblocker\";\r\n\t\treturn finalMessage;\r\n\t}", "@Override\n public String getPayMemo() {\n return String.format(\"Employee ID: %d, Pay Date: %s\", this.getEmpID(),\n HRUtility.dateToStr(new Date()));\n }", "public void setMemo(String memo) {\n\t\tMEMO = memo;\n\t}", "public java.lang.String getMemo() {\r\n return memo;\r\n }", "public void setMemo(java.lang.String memo) {\r\n this.memo = memo;\r\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return memo_;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public void setMemo(String memo) {\n this.memo = memo;\n }", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public String getMemo() {\n\t\treturn memo;\n\t}", "public void setMemo (java.lang.String memo) {\r\n\t\tthis.memo = memo;\r\n\t}", "@Override\n public String getMessage() {\n String chuoi=\"\";\n if (maCD.length()!=5)\n chuoi=\"MaCD bao gom 5 ki tu\";\n else if (soBaiHat<10)\n chuoi=\"So bai hat phai lon hon 10 bai\";\n return\n chuoi;\n }", "public void setMemo(String memo) {\n this.memo = memo == null ? null : memo.trim();\n }", "public java.lang.String getMemo () {\r\n\t\treturn memo;\r\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo == null ? null : memo.trim();\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public void setMemo(String memo) {\n\t\tthis.memo = memo;\n\t}", "public String getSMemo() {\n return sMemo;\n }", "private String createOrderSummary(String userName, int price, boolean addWhippedCream, boolean addChocolate, boolean addCinnamon, boolean addMarshmallows){\n String priceMessage = \"Name: \" + userName;\n priceMessage = priceMessage + \"\\nAdd Marshmallows? \" + addMarshmallows;\n priceMessage = priceMessage + \"\\nAdd Cinnamon? \" + addCinnamon;\n priceMessage = priceMessage + \"\\nAdd Whipped Cream? \" + addWhippedCream;\n priceMessage = priceMessage + \"\\nAdd Chocolate? \" + addChocolate;\n priceMessage = priceMessage + \"\\nQuantity: \" + quantity;\n priceMessage = priceMessage + \"\\nTotal: $\" + price;\n priceMessage = priceMessage + \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String getPayMemo() throws ParseException {\n return \"Employee ID: \" + getEmpID() + \", Pay Date: \" + HRDateUtils.strToDate(\"2019-10-01\");\n }", "public String showInfoMedi(){\n\t\tString msg = \"\";\n\n\t\tmsg += \"NOMBRE DE LA MEDICINA: \"+name+\"\\n\";\n\t\tmsg += \"LA DOSIS: \"+dose+\"\\n\";\n\t\tmsg += \"COSTO POR DOSIS: \"+doseCost+\"\\n\";\n\t\tmsg += \"FRECUENCIA QUE ESTA DEBE SER APLICADA: \"+frecuency+\"\\n\";\n\n\t\treturn msg;\n\t}", "private String createOrderSummary(int price,boolean addWhippedCream,boolean addChocolate,String name){\n String priceMessage=\"Name :\"+name;\n priceMessage+=\"\\nadd whipped cream ? \"+addWhippedCream;\n priceMessage+=\"\\nadd chocolate ? \"+addChocolate;\n priceMessage+=\"\\nQuantity \"+quantity;\n priceMessage+=\"\\nTotal :$ \"+price;\n priceMessage+=\"\\nThank you!\";\n return priceMessage;\n }", "@Override\r\n public String receita() {\n return \"Misturar os ingredientes; bater no liquidificador; colocar na máquina de waffle por 10m\";\r\n }", "private String createOrderSummary (String name, int price, boolean addWhippedCream, boolean addChocolate) {\n String priceMessage = getString(R.string.order_summary_name, name);\n priceMessage += \"\\n\" + getString(R.string.order_summary_whipped_cream, addWhippedCream);\n priceMessage += \"\\n\" + getString(R.string.order_summary_chocolate, addChocolate);\n priceMessage += \"\\n\" + getString(R.string.order_summary_quantity, quantity);\n priceMessage += \"\\nTotal: \" + price;\n priceMessage += \"\\n\" + getString(R.string.thank_you);\n return priceMessage;\n }", "public void setSMemo(String sMemo) {\n this.sMemo = sMemo;\n }", "public String getDescription()\r\n\t{\r\n\t\tStringBuilder msgreturn = new StringBuilder().append(m_name).append(\" \").append(m_taxBaseAmt.toString());\r\n\t\treturn msgreturn.toString();\r\n\t}", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@java.lang.Override\n public java.lang.String getMemo() {\n return instance.getMemo();\n }", "@Override\n public String getDescription() {\n return \"Arbitrary message\";\n }", "public String getMessage()\n {\n return String.format(\"MessageType=%s,TransactionId=%s,TerminalId=%s,MerchantId=%s,FingerData=%s,CustomerId=%s,IdData=%s, CustomerData=%s\", this.messageType, this.transactionId, this.terminalId, this.merchantId, this.fingerData, this.customerId, this.idData, this.customerData);\n }", "private String buildMessage(String message) {\n\t\tif(message != null && message.contains(\"@record\")) {\n\t\t\tmessage = message.replaceAll(\"@record\", answerUser);\n\t\t\trecorded.put(owner.id(), answerUser);\n\t\t}\n\t\t//o sistema substitui o texto !id pelo id do usuário da conversa\n\t\tif(message != null && message.contains(\"!id\")) {\n\t\t\tmessage = message.replaceAll(\"!id\", owner.id() + \"\");\n\t\t}\n\t\t//o sistema verifica se tem alguma gravacao para o código recebido\n\t\tif(message != null && message.contains(\"#find\")) {\n\t\t\tString gravacao = recorded.get(Integer.parseInt(userLatestAnswer.get(owner.id())));\n\t\t\t//se houver gravacao, o sistema informa qual o desejo do amigo secreto\n\t\t\tif(gravacao != null)\n\t\t\t\tmessage = message.replaceAll(\"#find\", gravacao);\n\t\t\t//caso nao haja gravacao, o sistema notifica o usuário da situacao\n\t\t\telse\n\t\t\t\tmessage = \"O código informado não corresponde ao desejo de um amigo secreto... por favor tente novamente\";\n\t\t}\n\n\t\treturn message;\n\t}", "@Override\n\tpublic String getText() {\n\t\treturn \"MMS: \" + text;\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getMemoBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(memo_);\n }", "private String getOrderDetails(Order order) {\n String message = getString(R.string.total) + \"\\n\" + getString(R.string.name) + \": \" + order.getCustomerName() +\n \"\\n\" + getString(R.string.add_cream) + \"? \" + String.valueOf(order.isHasWhippedCream()) +\n \"\\n\" + getString(R.string.add_chocolate) + \"? \" + String.valueOf(order.isHasChocolate()) +\n \"\\n\" + getString(R.string.quantity) + \": \" + order.getCupsNumber() + \"\\n\" + getString(R.string.resut) +\n \": $\" + MainActivity.calculatePrice(order) + \"\\n\" + getString(R.string.thanks) + \"!\";\n return message;\n }", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "public String getMessage()\n {\n return super.getMessage()+promo_error+\"not found\";\n }", "private static String build3PidErrorMessage(Context context, @StringRes int errorMessageRes, @Nullable String additionalInfo) {\n StringBuilder builder = new StringBuilder();\n builder.append(context.getString(errorMessageRes));\n\n if (additionalInfo != null) {\n builder.append(' ');\n builder.append(context.getString(R.string.account_additional_info, additionalInfo));\n }\n\n return builder.toString();\n }", "@Override\n public String getDescription() {\n return \"Mint currency\";\n }", "@Override\n public String getDescription() {\n return \"Digital goods purchase\";\n }", "private String createOrderSummary(int price, boolean addWhippedCream, boolean addChocolate ,String name)\n {\n if (addWhippedCream==true) price+= (numOfCufee) ;\n if (addChocolate == true ) price+=(2*numOfCufee) ;\n String priceMessage = \"Name: \"+name;\n priceMessage += \"\\nAdd whipped cream? \" + addWhippedCream;\n priceMessage += \"\\nAdd chocolate? \" + addChocolate;\n priceMessage += \"\\nQuantity: \" + numOfCufee;\n priceMessage += \"\\nTotal: $\" + price;\n priceMessage += \"\\nThank you!\";\n return priceMessage;\n }", "@Override\n public String descripcion() {\n return \"Viaje incentivo que te envia la empresa \" + empresa;\n }", "public String getMoneyRemark() {\n return moneyRemark;\n }", "private String getMessageSummary() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(MAIL_FROM).append(\":\").append(props.getProperty(MAIL_FROM, \"\"));\n\n\t\tif (props.containsKey(MAIL_REPLY_TO)) {\n\t\t\tsb.append(\",\").append(MAIL_REPLY_TO).append(\":\").append(props.getProperty(MAIL_REPLY_TO));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_TO).append(\":\").append(props.getProperty(MAIL_TO));\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_CC).append(\":\").append(props.getProperty(MAIL_CC));\n\t\t}\n\n\t\tif (props.containsKey(MAIL_CC)) {\n\t\t\tsb.append(\",\").append(MAIL_BCC).append(\":\").append(props.getProperty(MAIL_BCC));\n\t\t}\n\n\t\tsb.append(\",\").append(MAIL_SUBJECT).append(\":\").append(props.getProperty(MAIL_SUBJECT, \"\"));\n\n\t\treturn sb.toString();\n\t}", "private String geraMensagem(Mensagem msg) {\n\t\treturn new StringBuilder()\n\t\t\t.append(msg.remetente.nome)\n\t\t\t.append(\" enviou para \")\n\t\t\t.append(msg.destinatario.nome)\n\t\t\t.append(\" uma mensagem suspeita.\")\n\t\t\t.toString();\n\t}", "private String buildResultMessage() {\n String result;\n byte[] digest = new byte[20];\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-1\");\n digest = md.digest(phonepartBytes);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n\n byte[] checksumBytes = new byte[4];\n System.arraycopy(digest, 0, checksumBytes, 0, 4);\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n try {\n outputStream.write(checksumBytes);\n outputStream.write(phonepartBytes);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n byte[] completeOutputBytes = outputStream.toByteArray();\n result = Util.insertPeriodically(new Base32().encodeAsString(completeOutputBytes), 4);\n result = result.replaceAll(\"=\", \"\");\n return result;\n }", "public String getSupMemo() {\n return supMemo;\n }", "public void writeMassege() {\n m = ChatClient.message;\n jtaChatHistory.setText(\"You : \" + m);\n //writeMassageServer();\n }", "private String createOrderSummary(int price, boolean cream, boolean chocolate, String name){\n String orderSummary = \"Name: \"+name+\"\\n\" +\n \"Add whipped cream? \" + cream +\"\\n\"+\n \"Add chocolate? \" + chocolate + \"\\n\" +\n \"Quantity: \"+\n quantity +\n \"\\nTotal: $\" + price +\n \"\\n\" + getString(R.string.thankyou) + \"!\";\n return orderSummary;\n }", "@Override\n public String getDescription() {\n return \"Digital goods feedback\";\n }", "public String getRemark()\n/* */ {\n/* 255 */ return this.remark;\n/* */ }", "@Override\n public String getMessage() {\n String result =\"Audio Message {\\n\";\n result +=\"\\tID: \"+ID+\"\\n\";\n result +=\"\\tBuffer Size: \"+bufferSize+\"\\n\";\n result +=\"}\";\n \n return result;\n }", "public String creerMessage(){\n return profile.getMessage();\n }", "BigInteger getMessage();", "public String retrieveMerchant() {\n // Check if there's a valid merchant name.\n String merchant = _merchantET.getText().toString();\n if (merchant == null || merchant.equals(\"\")) {\n Toast.makeText(AddActivity.this, \"Please enter a merchant.\", Toast.LENGTH_LONG).show();\n return \"\";\n }\n return merchant;\n }", "private String m50433y() {\n if (TextUtils.isEmpty(this.f30738i0.getText().toString().trim())) {\n return this.f30720S.getString(C10232R.string.payment_error_blank_field);\n }\n return !CardPaymentParams.m53961m(this.f30738i0.getText().toString().trim()) ? this.f30720S.getString(C10232R.string.checkout_error_card_holder_invalid) : \"\";\n }", "private String getOrderSummary() {\n final int numberOfCoffees = getNumberOfCoffees();\n if (numberOfCoffees == 0) {\n return Constants.FREE_MESSAGE;\n }\n\n final String name = ((EditText) findViewById(R.id.name_edit_text))\n .getText().toString();\n\n return Constants.NAME + \": \" +\n (name.isEmpty() ? Constants.DEFAULT_NAME : name) + \"\\n\" +\n getToppingsSummary() + \"\\n\" +\n Constants.QUANTITY + \": \" + numberOfCoffees + \"\\n\" +\n Constants.TOTAL + \": \" +\n NumberFormat.getCurrencyInstance().format(getTotalPrice()) + \"\\n\" +\n Constants.BYE_GREETING;\n }", "String getMessage();", "String getMessage();", "String getMessage();", "public String getMerchantNo();", "@Override\n public String getDescription() {\n return \"Digital goods delivery\";\n }", "private String createOrderSummary(int price, String name, boolean hasWhippedCream,\n boolean hasChocolate){\n return getString(R.string.order_summary_name, name) +\n \"\\n\" + getString(R.string.add_whipped_cream, hasWhippedCream) +\n \"\\n\" + getString(R.string.add_chocolate, hasChocolate) +\n \"\\n\" + getString(R.string.order_quantity, quantity) +\n \"\\n\" + getString(R.string.order_total, price) +\n \"\\n\" + getString(R.string.thank_you);\n }", "@Override\r\n\tpublic String getMessage() {\n\t\treturn \"홀수입력 !!\";\r\n\t}", "private String generateOrderSummary(String name, int quantity, boolean whippedCreamChecked, boolean chocolateChecked) {\n int price = calculatePrice(quantity, whippedCreamChecked, chocolateChecked);\n\n String priceMessage = \"Name: \"+ name + \"\\n\" +\n \"Add whipped cream? \"+ whippedCreamChecked + \"\\n\" +\n \"Chocolate? \"+ chocolateChecked + \"\\n\" +\n \"Quantity: \" + quantity + \"\\n\" +\n \"Total: $ \" + price + \"\\n\" +\n \"Thank you!\";\n\n return priceMessage;\n }", "@Override\n public String getMailetInfo() {\n return \"Sieve Mailbox Mailet\";\n }", "public String returnMessage () {\n String msg = getString(R.string.result, score);\n if (score > 7) {\n msg += \"\\n\" + getString(R.string.fabulous);\n }\n else if (score >= 5 && score <= 7) {\n msg += \"\\n\" + getString(R.string.good_job);\n }\n else {\n msg += \"\\n\" + getString(R.string.try_again);\n }\n return msg;\n }", "public String getMessage(){\n return(message);\n }", "private String m50388c(PaymentError paymentError) {\n try {\n return new JSONObject(paymentError.mo40763b()).getString(\"description\");\n } catch (Exception unused) {\n return paymentError.mo40764c();\n }\n }", "java.lang.String getBuyDescribe();", "public abstract void msgPayment(Customer customer, Cash cash);", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();" ]
[ "0.6528686", "0.6528686", "0.6528686", "0.64215565", "0.63572776", "0.63572776", "0.63572776", "0.63572776", "0.6230878", "0.6226878", "0.61937135", "0.6192103", "0.61602914", "0.615164", "0.615164", "0.615164", "0.6146373", "0.6146373", "0.6146373", "0.61349267", "0.6120991", "0.6120991", "0.6120991", "0.61019516", "0.6093255", "0.60826933", "0.6072336", "0.6058279", "0.60461986", "0.60461986", "0.59808815", "0.59198743", "0.5909179", "0.5868135", "0.58613884", "0.5735315", "0.5698737", "0.5665372", "0.562132", "0.5588627", "0.5588627", "0.5588627", "0.5581732", "0.55789053", "0.5565189", "0.5550607", "0.552437", "0.552437", "0.552437", "0.55241656", "0.54899883", "0.5438751", "0.5399326", "0.5397901", "0.5391264", "0.5390979", "0.5386106", "0.53759724", "0.5374274", "0.5371592", "0.5360501", "0.5352885", "0.5349294", "0.5349294", "0.53355414", "0.5310743", "0.5305369", "0.5303087", "0.5302099", "0.52958566", "0.5294715", "0.5292624", "0.5287689", "0.5287689", "0.5287689", "0.5281478", "0.5266776", "0.5266263", "0.5261392", "0.5255795", "0.52441424", "0.52365196", "0.522935", "0.5223733", "0.5207632", "0.52022713", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134", "0.51841134" ]
0.0
-1