├── HEAD ├── .gitignore ├── bank ├── web │ ├── index.jsp │ └── saturn.png ├── empty.lib │ └── .gitignore ├── README.md ├── conf │ ├── extensions-payeebank.json │ └── extensions-payerbank.json ├── context.xml ├── TODO.txt ├── .classpath ├── src │ └── org │ │ └── webpki │ │ └── saturn │ │ └── bank │ │ ├── NormalException.java │ │ ├── RiskBasedAuthentication.java │ │ ├── ProviderAuthorityServlet.java │ │ └── PayeeAuthorityServlet.java └── .project ├── resources ├── credentials │ ├── merchants-payerbank.json │ └── merchants-acquirer.json ├── .gitignore ├── card-images │ ├── coolcard.png │ ├── bankdirect.png │ ├── supercard.png │ └── unusualcard.png ├── keys │ ├── acquirer-eecert.p12 │ ├── hosting-key-ec.p12 │ ├── kg2-km-key-ec.p12 │ ├── payeebank-eecert.p12 │ ├── payerbank-eecert.p12 │ ├── acquirer-enc-key-ec.p12 │ ├── acquirer-enc-key-rsa.p12 │ ├── bank-network-rootca.cer │ ├── bank-network-rootca.p12 │ ├── bank-network-subca.p12 │ ├── client-key-ec-super.p12 │ ├── client-key-ec-unsual.p12 │ ├── payeebank-enc-key-ec.cer │ ├── payeebank-enc-key-ec.p12 │ ├── payerbank-enc-key-ec.cer │ ├── payerbank-enc-key-ec.p12 │ ├── acquirer-network-subca.p12 │ ├── client-key-ec-bankdir.p12 │ ├── inhouse-kg2-km-key-ec.p12 │ ├── payeebank-enc-key-rsa.cer │ ├── payeebank-enc-key-rsa.p12 │ ├── payerbank-enc-key-rsa.cer │ ├── payerbank-enc-key-rsa.p12 │ ├── acquirer-network-rootca.cer │ ├── acquirer-network-rootca.p12 │ ├── client-key-ec-bankdir.jwk │ ├── client-key-ec-super.jwk │ ├── client-key-ec-unsual.jwk │ ├── planetgas.com-banknet.jwk │ ├── planetgas.com-cardnet.jwk │ ├── spaceshop.com-banknet.jwk │ ├── spaceshop.com-cardnet.jwk │ ├── client-key-ec-super.certpath │ ├── client-key-ec-unsual.certpath │ └── client-key-ec-bankdir.certpath ├── originals │ ├── coolcard.pptx │ ├── supercard.pptx │ ├── bankdirect.pptx │ └── unusualcard.pptx ├── android.properties ├── logotype │ ├── saturn-small.png │ └── saturnlogo.svg ├── w3c.properties ├── common.lib │ └── proxy-support.jar ├── qr.lib │ ├── zxing-core-3.4.1.jar │ └── zxing-javase-3.4.1.jar ├── docs │ └── namespace │ │ └── to-be-supplied.pdf ├── README.md ├── accounts.properties ├── src │ └── org │ │ └── webpki │ │ ├── saturn │ │ ├── resources │ │ │ ├── bobkey.jwk │ │ │ ├── alicekey.jwk │ │ │ └── rsakey.jwk │ │ └── svg │ │ │ └── diagrams │ │ │ ├── ORGGlyphs.java │ │ │ ├── WebPKIGlyphs.java │ │ │ ├── SupercardGlyphs.java │ │ │ └── org-glyphs.xml │ │ └── tools │ │ └── svg │ │ ├── SVGGlyphContainer.java │ │ ├── SVGVerticalLine.java │ │ ├── SVGShaderTemplate.java │ │ ├── SVGSubDocument.java │ │ ├── glypher.xsd │ │ ├── SVGEndGlobal.java │ │ ├── SVGBeginGlobal.java │ │ ├── SVGNegate.java │ │ ├── SVGStringValue.java │ │ ├── SVGAddOffset.java │ │ ├── SVGDivConstant.java │ │ ├── SVGTransform.java │ │ ├── SVGValue.java │ │ ├── SVGAddDouble.java │ │ ├── SVGSubtractDouble.java │ │ ├── SVGDoubleValue.java │ │ ├── SVGCenter.java │ │ ├── SVGAttributes.java │ │ └── SVGDocument.java ├── svg-filters │ ├── test-filters.xml │ └── wallet-filters.xml ├── svg-gen │ ├── saturnlogo.svg │ ├── play │ │ └── Spinner.svg │ └── bank.svg ├── .classpath ├── common │ └── org │ │ └── webpki │ │ └── saturn │ │ └── common │ │ ├── Version.java │ │ ├── UserAuthorizationMethods.java │ │ ├── ReservationSubTypes.java │ │ ├── TransactionTypes.java │ │ ├── KnownExtensions.java │ │ ├── ServerX509Signer.java │ │ ├── ClientPlatform.java │ │ ├── ReceiptShippingRecord.java │ │ ├── ReceiptTaxRecord.java │ │ ├── SaturnException.java │ │ ├── ReceiptBarcode.java │ │ ├── WalletAlertMessage.java │ │ ├── Software.java │ │ ├── SignatureProfiles.java │ │ ├── UserResponseItem.java │ │ ├── BalanceResponseEncoder.java │ │ ├── RecurringPaymentIntervals.java │ │ ├── ServerAsymKeySigner.java │ │ ├── UrlHolder.java │ │ ├── BalanceRequestEncoder.java │ │ ├── PayeeAuthorityEncoder.java │ │ ├── BalanceResponseDecoder.java │ │ ├── MobileProxyParameters.java │ │ ├── RefundResponseEncoder.java │ │ ├── HostingProvider.java │ │ └── NonDirectPaymentTypes.java ├── .project └── common.properties ├── acquirer ├── web │ ├── index.jsp │ └── saturn.png ├── empty.lib │ └── .gitignore ├── README.md ├── conf │ └── extensions-acquirer.json ├── .classpath ├── .project └── src │ └── org │ └── webpki │ └── saturn │ └── acquirer │ ├── ProviderAuthorityServlet.java │ └── PayeeAuthorityServlet.java ├── hosting ├── web │ ├── index.jsp │ └── saturn.png ├── empty.lib │ └── .gitignore ├── README.md ├── .classpath ├── .project └── src │ └── org │ └── webpki │ └── saturn │ └── hosting │ └── PayeeAuthorityServlet.java ├── .gitattributes ├── w3cpay ├── .gitattributes ├── web │ ├── index.jsp │ └── webpkiorg.png ├── empty.lib │ └── .gitignore ├── signer-certificate.cer ├── .classpath ├── .project ├── src │ └── org │ │ └── webpki │ │ └── saturn │ │ └── w3c │ │ └── manifest │ │ ├── PaymentAppMethodServlet.java │ │ └── PaymentManifestServlet.java └── web.xml ├── desktop-client ├── manifest.json ├── README.md ├── images │ ├── error.png │ ├── warning.png │ ├── working.gif │ ├── dummycard.png │ └── information.png ├── .classpath ├── .project └── w2nb │ └── org │ └── webpki │ └── saturn │ └── w2nb │ └── support │ └── W2NB.java ├── merchant ├── web │ ├── index.jsp │ ├── saturn.png │ └── images │ │ ├── waiting.gif │ │ ├── qr_launcher.png │ │ ├── planetgas-logo.png │ │ ├── t-shirt-nasa-grey.png │ │ ├── spacex-starship-heavy.png │ │ ├── loading-gears-animation-3.gif │ │ ├── saturn-pay.svg │ │ └── gaspump.svg ├── empty.lib │ └── .gitignore ├── .settings │ └── org.eclipse.core.resources.prefs ├── README.md ├── TODO.txt ├── debug-samples │ └── sampleauthorizationkey.jwk ├── context.xml ├── .classpath ├── src │ └── org │ │ └── webpki │ │ └── saturn │ │ └── merchant │ │ ├── NFCLauncherServlet.java │ │ ├── TransactionOperation.java │ │ ├── ShoppingCart.java │ │ ├── ResultData.java │ │ ├── ProductEntry.java │ │ ├── AndroidServlet.java │ │ ├── MerchantSessionProperties.java │ │ ├── MerchantDescriptor.java │ │ ├── Synchronizer.java │ │ └── PaymentMethodDescriptor.java └── .project ├── keyprovider ├── web │ ├── index.jsp │ ├── saturn.png │ ├── waiting.gif │ └── google-play-badge.png ├── empty.lib │ └── .gitignore ├── README.md ├── docs │ └── webpay-keyprovider.properties ├── context.xml ├── card-images │ ├── unusualcard.svg │ └── reference-card-for-checking-rendering.svg ├── .classpath └── .project ├── nodejs-acquirer ├── config │ ├── tlskeys │ │ ├── for-the-test-system-only │ │ ├── localhost.cert.pem │ │ └── localhost.key.pem │ ├── ownkeys │ │ ├── acquirer.ec-enc-key.pem │ │ └── acquirer.rsa-enc-key.pem │ ├── config.js │ └── trustanchors │ │ └── paymentnetworks.pem ├── runserver.bat ├── runserver.sh ├── .project └── README.md ├── tls-certificates ├── README.md ├── server │ └── .gitignore ├── root │ ├── tlsroot.cer │ ├── tlsroot.p12 │ └── tlsroot.pem └── .project ├── nodejs-common ├── README.md ├── .project ├── ServerAsymKeySigner.js ├── ReservationSubTypes.js ├── ServerCertificateSigner.js ├── Software.js ├── RequestHash.js ├── NonDirectPayments.js └── TransactionResponse.js ├── account-types ├── README.md ├── .classpath ├── .project └── src │ ├── se │ └── bankgirot │ │ ├── BGAccountDataEncoder.java │ │ └── BGAccountDataDecoder.java │ ├── org │ └── payments │ │ └── sepa │ │ ├── SEPAAccountDataEncoder.java │ │ └── SEPAAccountDataDecoder.java │ └── com │ └── supercard │ └── SupercardAccountDataEncoder.java ├── config ├── interbanking ├── README.md ├── .classpath ├── .project └── src │ └── io │ └── interbanking │ └── IBCommon.java ├── LICENSE └── README.md /HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | .tmp 3 | dist 4 | .DS_store 5 | -------------------------------------------------------------------------------- /bank/web/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /resources/credentials/merchants-payerbank.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /acquirer/web/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hosting/web/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Disable LF normalization for all files 2 | * -text -------------------------------------------------------------------------------- /resources/.gitignore: -------------------------------------------------------------------------------- 1 | /credentials/sks.serialized 2 | /nodejscryptotest/ 3 | -------------------------------------------------------------------------------- /w3cpay/.gitattributes: -------------------------------------------------------------------------------- 1 | # Disable LF normalization for all files 2 | * -text -------------------------------------------------------------------------------- /desktop-client/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "callableFrom": ["*://*/*", "file:///*"] 3 | } 4 | -------------------------------------------------------------------------------- /merchant/web/index.jsp: -------------------------------------------------------------------------------- 1 | <%@page session="false"%><%response.sendRedirect ("home");%> 2 | -------------------------------------------------------------------------------- /w3cpay/web/index.jsp: -------------------------------------------------------------------------------- 1 | <%@page session="false"%><%response.sendRedirect ("method");%> 2 | -------------------------------------------------------------------------------- /bank/web/saturn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/bank/web/saturn.png -------------------------------------------------------------------------------- /keyprovider/web/index.jsp: -------------------------------------------------------------------------------- 1 | <%@page session="false"%><%response.sendRedirect ("init");%> 2 | -------------------------------------------------------------------------------- /acquirer/web/saturn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/acquirer/web/saturn.png -------------------------------------------------------------------------------- /hosting/web/saturn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/hosting/web/saturn.png -------------------------------------------------------------------------------- /merchant/web/saturn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/merchant/web/saturn.png -------------------------------------------------------------------------------- /w3cpay/web/webpkiorg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/w3cpay/web/webpkiorg.png -------------------------------------------------------------------------------- /bank/empty.lib/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /keyprovider/web/saturn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/keyprovider/web/saturn.png -------------------------------------------------------------------------------- /acquirer/empty.lib/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /hosting/empty.lib/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /keyprovider/web/waiting.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/keyprovider/web/waiting.gif -------------------------------------------------------------------------------- /merchant/empty.lib/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /nodejs-acquirer/config/tlskeys/for-the-test-system-only: -------------------------------------------------------------------------------- 1 | These keys have little use for anybody else I guess... -------------------------------------------------------------------------------- /tls-certificates/README.md: -------------------------------------------------------------------------------- 1 | ### TLS Certificates 2 | 3 | This is just for local installations and testing... 4 | -------------------------------------------------------------------------------- /w3cpay/empty.lib/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /w3cpay/signer-certificate.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/w3cpay/signer-certificate.cer -------------------------------------------------------------------------------- /desktop-client/README.md: -------------------------------------------------------------------------------- 1 | ### Saturn Payment Authorization System 2 | This project holds the code for the Wallet 3 | -------------------------------------------------------------------------------- /desktop-client/images/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/desktop-client/images/error.png -------------------------------------------------------------------------------- /keyprovider/empty.lib/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /merchant/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /merchant/web/images/waiting.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/merchant/web/images/waiting.gif -------------------------------------------------------------------------------- /tls-certificates/server/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /bank/README.md: -------------------------------------------------------------------------------- 1 | ### Saturn Payment Authorization System 2 | This project holds the code for a Payment Provider (Bank) 3 | -------------------------------------------------------------------------------- /desktop-client/images/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/desktop-client/images/warning.png -------------------------------------------------------------------------------- /desktop-client/images/working.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/desktop-client/images/working.gif -------------------------------------------------------------------------------- /merchant/README.md: -------------------------------------------------------------------------------- 1 | ### Saturn Payment Authorization System 2 | This project holds the code for a demo Payee (Merchant) 3 | -------------------------------------------------------------------------------- /resources/card-images/coolcard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/card-images/coolcard.png -------------------------------------------------------------------------------- /resources/keys/acquirer-eecert.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/acquirer-eecert.p12 -------------------------------------------------------------------------------- /resources/keys/hosting-key-ec.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/hosting-key-ec.p12 -------------------------------------------------------------------------------- /resources/keys/kg2-km-key-ec.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/kg2-km-key-ec.p12 -------------------------------------------------------------------------------- /resources/originals/coolcard.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/originals/coolcard.pptx -------------------------------------------------------------------------------- /resources/originals/supercard.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/originals/supercard.pptx -------------------------------------------------------------------------------- /tls-certificates/root/tlsroot.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/tls-certificates/root/tlsroot.cer -------------------------------------------------------------------------------- /tls-certificates/root/tlsroot.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/tls-certificates/root/tlsroot.p12 -------------------------------------------------------------------------------- /acquirer/README.md: -------------------------------------------------------------------------------- 1 | ### Saturn Payment Authorization System 2 | This project holds the code for an Acquirer (Card Processor) 3 | -------------------------------------------------------------------------------- /desktop-client/images/dummycard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/desktop-client/images/dummycard.png -------------------------------------------------------------------------------- /merchant/web/images/qr_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/merchant/web/images/qr_launcher.png -------------------------------------------------------------------------------- /nodejs-common/README.md: -------------------------------------------------------------------------------- 1 | ### Saturn Payment Authorization System 2 | This project contains Node.js specific Saturn objects 3 | -------------------------------------------------------------------------------- /resources/android.properties: -------------------------------------------------------------------------------- 1 | # Android specifics 2 | @android.webpki.versions=1.41-1.46 3 | @android.chrome.version=120 4 | 5 | -------------------------------------------------------------------------------- /resources/card-images/bankdirect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/card-images/bankdirect.png -------------------------------------------------------------------------------- /resources/card-images/supercard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/card-images/supercard.png -------------------------------------------------------------------------------- /resources/keys/payeebank-eecert.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/payeebank-eecert.p12 -------------------------------------------------------------------------------- /resources/keys/payerbank-eecert.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/payerbank-eecert.p12 -------------------------------------------------------------------------------- /resources/logotype/saturn-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/logotype/saturn-small.png -------------------------------------------------------------------------------- /resources/originals/bankdirect.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/originals/bankdirect.pptx -------------------------------------------------------------------------------- /resources/originals/unusualcard.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/originals/unusualcard.pptx -------------------------------------------------------------------------------- /resources/w3c.properties: -------------------------------------------------------------------------------- 1 | @w3c.paymentrequest=true 2 | @w3c.manifesturl=https://test.webpki.org/w3cpay/payment-manifest.json 3 | -------------------------------------------------------------------------------- /account-types/README.md: -------------------------------------------------------------------------------- 1 | ### Saturn Payment Authorization System 2 | This project holds the code for payment method specific data 3 | -------------------------------------------------------------------------------- /bank/conf/extensions-payeebank.json: -------------------------------------------------------------------------------- 1 | { 2 | "https://webpki.github.io/saturn/v3/extensions#refund": "${host}/refund" 3 | } 4 | 5 | -------------------------------------------------------------------------------- /desktop-client/images/information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/desktop-client/images/information.png -------------------------------------------------------------------------------- /keyprovider/README.md: -------------------------------------------------------------------------------- 1 | ### Saturn Payment Authorization System 2 | This project holds the code for a demo key provider (Issuer) 3 | -------------------------------------------------------------------------------- /keyprovider/web/google-play-badge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/keyprovider/web/google-play-badge.png -------------------------------------------------------------------------------- /merchant/web/images/planetgas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/merchant/web/images/planetgas-logo.png -------------------------------------------------------------------------------- /nodejs-acquirer/runserver.bat: -------------------------------------------------------------------------------- 1 | set NODE_PATH=c:\github.repositories\node-webpki.org\node_modules 2 | node "%~dp0acquirer.js" 3 | -------------------------------------------------------------------------------- /resources/card-images/unusualcard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/card-images/unusualcard.png -------------------------------------------------------------------------------- /resources/common.lib/proxy-support.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/common.lib/proxy-support.jar -------------------------------------------------------------------------------- /resources/keys/acquirer-enc-key-ec.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/acquirer-enc-key-ec.p12 -------------------------------------------------------------------------------- /resources/keys/acquirer-enc-key-rsa.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/acquirer-enc-key-rsa.p12 -------------------------------------------------------------------------------- /resources/keys/bank-network-rootca.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/bank-network-rootca.cer -------------------------------------------------------------------------------- /resources/keys/bank-network-rootca.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/bank-network-rootca.p12 -------------------------------------------------------------------------------- /resources/keys/bank-network-subca.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/bank-network-subca.p12 -------------------------------------------------------------------------------- /resources/keys/client-key-ec-super.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/client-key-ec-super.p12 -------------------------------------------------------------------------------- /resources/keys/client-key-ec-unsual.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/client-key-ec-unsual.p12 -------------------------------------------------------------------------------- /resources/keys/payeebank-enc-key-ec.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/payeebank-enc-key-ec.cer -------------------------------------------------------------------------------- /resources/keys/payeebank-enc-key-ec.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/payeebank-enc-key-ec.p12 -------------------------------------------------------------------------------- /resources/keys/payerbank-enc-key-ec.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/payerbank-enc-key-ec.cer -------------------------------------------------------------------------------- /resources/keys/payerbank-enc-key-ec.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/payerbank-enc-key-ec.p12 -------------------------------------------------------------------------------- /resources/qr.lib/zxing-core-3.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/qr.lib/zxing-core-3.4.1.jar -------------------------------------------------------------------------------- /resources/qr.lib/zxing-javase-3.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/qr.lib/zxing-javase-3.4.1.jar -------------------------------------------------------------------------------- /acquirer/conf/extensions-acquirer.json: -------------------------------------------------------------------------------- 1 | { 2 | "https://webpki.github.io/saturn/v3/extensions#refund": "${host}/refund" 3 | } 4 | 5 | -------------------------------------------------------------------------------- /merchant/web/images/t-shirt-nasa-grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/merchant/web/images/t-shirt-nasa-grey.png -------------------------------------------------------------------------------- /resources/keys/acquirer-network-subca.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/acquirer-network-subca.p12 -------------------------------------------------------------------------------- /resources/keys/client-key-ec-bankdir.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/client-key-ec-bankdir.p12 -------------------------------------------------------------------------------- /resources/keys/inhouse-kg2-km-key-ec.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/inhouse-kg2-km-key-ec.p12 -------------------------------------------------------------------------------- /resources/keys/payeebank-enc-key-rsa.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/payeebank-enc-key-rsa.cer -------------------------------------------------------------------------------- /resources/keys/payeebank-enc-key-rsa.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/payeebank-enc-key-rsa.p12 -------------------------------------------------------------------------------- /resources/keys/payerbank-enc-key-rsa.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/payerbank-enc-key-rsa.cer -------------------------------------------------------------------------------- /resources/keys/payerbank-enc-key-rsa.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/payerbank-enc-key-rsa.p12 -------------------------------------------------------------------------------- /config: -------------------------------------------------------------------------------- 1 | [core] 2 | symlinks = false 3 | repositoryformatversion = 0 4 | filemode = false 5 | bare = true 6 | logallrefupdates = false 7 | -------------------------------------------------------------------------------- /resources/docs/namespace/to-be-supplied.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/docs/namespace/to-be-supplied.pdf -------------------------------------------------------------------------------- /resources/keys/acquirer-network-rootca.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/acquirer-network-rootca.cer -------------------------------------------------------------------------------- /resources/keys/acquirer-network-rootca.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/resources/keys/acquirer-network-rootca.p12 -------------------------------------------------------------------------------- /merchant/web/images/spacex-starship-heavy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/merchant/web/images/spacex-starship-heavy.png -------------------------------------------------------------------------------- /merchant/web/images/loading-gears-animation-3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyberphone/saturn/master/merchant/web/images/loading-gears-animation-3.gif -------------------------------------------------------------------------------- /resources/README.md: -------------------------------------------------------------------------------- 1 | ### Saturn Payment Authorization System 2 | This project contains miscellaneous resources as well as a library of common objects. 3 | -------------------------------------------------------------------------------- /merchant/TODO.txt: -------------------------------------------------------------------------------- 1 | encryptedAuthorization should be in CBOR. 2 | No hashing of PaymentRequest, verbatim is OK since it is small. 3 | "expires" in PaymentRequest should be moved out. 4 | -------------------------------------------------------------------------------- /resources/accounts.properties: -------------------------------------------------------------------------------- 1 | # Key database for the desktop (test) client 2 | @clientkey_bankdir=client-key-ec-bankdir 3 | @clientkey_super=client-key-ec-super 4 | @clientkey_unusual=client-key-ec-unsual 5 | -------------------------------------------------------------------------------- /bank/conf/extensions-payerbank.json: -------------------------------------------------------------------------------- 1 | { 2 | "https://webpki.github.io/saturn/v3/extensions#hybrid": "${host}/hybridpay", 3 | "https://webpki.github.io/saturn/v3/extensions#balance": "${host}/balancereq" 4 | } 5 | -------------------------------------------------------------------------------- /resources/keys/client-key-ec-bankdir.jwk: -------------------------------------------------------------------------------- 1 | { 2 | "kty": "EC", 3 | "crv": "P-256", 4 | "x": "rQ4WXMB6_wQKHSiY_mbJ4QkGpfWLssF7hvIiiFpDEx8", 5 | "y": "Fh2rl0LGTtvaomOuhuRNo9Drz9o0--WXV2ITvdVQFRY", 6 | "d": "rylnl8Z_CBYDmkLAfRrlhI_EbJzSwxQwE8cNDTHBWdQ" 7 | } 8 | -------------------------------------------------------------------------------- /resources/keys/client-key-ec-super.jwk: -------------------------------------------------------------------------------- 1 | { 2 | "kty": "EC", 3 | "crv": "P-256", 4 | "x": "MNGpxRCX3nbLR2IsLIVUpNDkbGJs4FaSCPW0odyIXMY", 5 | "y": "8gsEOvO5Y5HL-s092cmKp1MQXWUmytp4jBEvnw67weM", 6 | "d": "ulFWRUMVwkwAYIWv3PAzYsUcHLUc4H2lm2DAjz-XMxA" 7 | } 8 | -------------------------------------------------------------------------------- /resources/keys/client-key-ec-unsual.jwk: -------------------------------------------------------------------------------- 1 | { 2 | "kty": "EC", 3 | "crv": "P-256", 4 | "x": "S17oNEkw--n87PmnUP2Tt483aMsL0IyLgA1ho6Dh2kA", 5 | "y": "smTPia5kBL_GBoLWVnKIrtWBfhQTI4STeau_A83fP_w", 6 | "d": "Lucd-3NgxeC352mIC29ABLBRE_lXd1z8KcueAe348EA" 7 | } 8 | -------------------------------------------------------------------------------- /resources/keys/planetgas.com-banknet.jwk: -------------------------------------------------------------------------------- 1 | { 2 | "kty": "EC", 3 | "crv": "P-256", 4 | "x": "yxkJV3w2WH5g_4IBSrdZ1EFmLojQIiYhhiwOd3YjooU", 5 | "y": "-8mDbeY6oEFpwktEPOQPlMo5BNW1AJoeTmQ4gmsADy4", 6 | "d": "r6nSCfno2jV-rtyFotyT_sG1TRqBkRjxjIDliN1VTTI" 7 | } 8 | -------------------------------------------------------------------------------- /resources/keys/planetgas.com-cardnet.jwk: -------------------------------------------------------------------------------- 1 | { 2 | "kty": "EC", 3 | "crv": "P-256", 4 | "x": "_6soiu94ku4oBHe9O4yS7kIaVIgSiL_RLabSPOAcYPI", 5 | "y": "N5lB1JwdVw32WVaW-AriD2ajuWYuHFoCvRX2RxpVlHw", 6 | "d": "by9eq4bP78QuymERv6V2N4gJKCzwcB3eSJBMOoPeds4" 7 | } 8 | -------------------------------------------------------------------------------- /resources/keys/spaceshop.com-banknet.jwk: -------------------------------------------------------------------------------- 1 | { 2 | "kty": "EC", 3 | "crv": "P-256", 4 | "x": "8VY09NWUy-aVGNHZZQDIyy-H3RxLfXbiPR2SVlEubjE", 5 | "y": "OuHehTNjMbphW0s3nBBVdAALLdzE9x-hup4CnJ1gM-o", 6 | "d": "2Sm9G2mWLur-dPtD8h9g93OHWyofbKaIw-l03PKAfoA" 7 | } 8 | -------------------------------------------------------------------------------- /resources/keys/spaceshop.com-cardnet.jwk: -------------------------------------------------------------------------------- 1 | { 2 | "kty": "EC", 3 | "crv": "P-256", 4 | "x": "t4DjDTgLk6PIAX9bn46JybFgWOv0npE2iEQs0P2kzjs", 5 | "y": "YcrZeO3SQZgxAyRI8myWlapaNHOBqGL5Pqi5xDXiNt8", 6 | "d": "e6DKxKYoSK0J7rhgqvpEbhwaF8eFlRFhCe8E34S1xwk" 7 | } 8 | -------------------------------------------------------------------------------- /nodejs-acquirer/runserver.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | DIR="$( cd "$( dirname "$0" )" && pwd )" 6 | 7 | # adjust the line below to your installation 8 | NODE_PATH=/home/server/node-webpki.org-master/node_modules 9 | 10 | node $DIR/acquirer.js 11 | 12 | -------------------------------------------------------------------------------- /merchant/debug-samples/sampleauthorizationkey.jwk: -------------------------------------------------------------------------------- 1 | { 2 | "kty": "EC", 3 | "crv": "P-256", 4 | "x": "censDzcMEkgiePz6DXB7cDuwFemshAFR90UNVQFCg8Q", 5 | "y": "xq8rze6ewG0-eVcSF72J77gKiD0IHnzpwHaU7t6nVeY", 6 | "d": "nEsftLbi5u9pI8B0-drEjIuJzQgZie3yeqUR3BwWDl4" 7 | } 8 | -------------------------------------------------------------------------------- /resources/src/org/webpki/saturn/resources/bobkey.jwk: -------------------------------------------------------------------------------- 1 | { 2 | "kty":"EC", 3 | "crv":"P-256", 4 | "x":"mPUKT_bAWGHIhg0TpjjqVsP1rXWQu_vwVOHHtNkdYoA", 5 | "y":"8BQAsImGeAS46fyWw5MhYfGTT0IjBpFw2SS34Dv4Irs", 6 | "d":"AtH35vJsQ9SGjYfOsjUxYXQKrPH3FjZHmEtSKoSN8cM" 7 | } 8 | -------------------------------------------------------------------------------- /interbanking/README.md: -------------------------------------------------------------------------------- 1 | ### Saturn Payment Authorization System 2 | This project holds code for a hypothetical payment backend network 3 | which was created to make the demo functionally complete. Credit-card and 4 | refund operations depend on (existing) non-Saturn channels. 5 | -------------------------------------------------------------------------------- /resources/src/org/webpki/saturn/resources/alicekey.jwk: -------------------------------------------------------------------------------- 1 | { 2 | "kty":"EC", 3 | "crv":"P-256", 4 | "x":"Ze2loSV3wrroKUN_4zhwGhCqo3Xhu1td4QjeQ5wIVR0", 5 | "y":"HlLtdXARY_f55A3fnzQbPcm6hgr34Mp8p-nuzQCE0Zw", 6 | "d":"r_kHyZ-a06rmxM3yESK84r1otSg-aQcVStkRhA-iCM8" 7 | } 8 | -------------------------------------------------------------------------------- /nodejs-common/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | nodejs-common 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /nodejs-acquirer/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | nodejs-acquirer 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tls-certificates/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | tls-certificates 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /nodejs-acquirer/config/ownkeys/acquirer.ec-enc-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgIADtC0xu72sMTUIxgIpF7HVR3WpA 3 | 77vMgyTWeRbKiyOgCgYIKoZIzj0DAQehRANCAAQ2cdIyjVeLNIEBtrekswvCOkQdMX0TW1UB1ZKg 4 | 4UwjUtRnUBGcEVJBcuptrmgn3w8LAFip3xD/y6nAvTjXIwWx 5 | -----END PRIVATE KEY----- 6 | 7 | -------------------------------------------------------------------------------- /resources/svg-filters/test-filters.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /resources/svg-filters/wallet-filters.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /hosting/README.md: -------------------------------------------------------------------------------- 1 | ### Saturn Payment Authorization System 2 | This project holds the code for a Hosting service 3 | 4 | It requires configuration in **merchant** and **payeebank** through the `-Dhostingoption=true` flag. 5 | 6 | ```code 7 | ant -f saturn/bank tomcat -Dpayeebank=true -Dhostingoption=true 8 | ant -f saturn/merchant tomcat -Dhostingoption=true 9 | ``` 10 | -------------------------------------------------------------------------------- /nodejs-acquirer/README.md: -------------------------------------------------------------------------------- 1 | ### Saturn Payment Authorization System 2 | This project holds the code for an Acquirer (Card Processor) using the Node.js platform 3 | 4 | To configure the Merchant sample application to use the Node.js, compile like this: 5 | 6 | ```code 7 | ant -f github.repositories/saturn/merchant tomcat -Dpayee_acquirer.url=https://localhost:8888/payees/ 8 | ``` 9 | -------------------------------------------------------------------------------- /keyprovider/docs/webpay-keyprovider.properties: -------------------------------------------------------------------------------- 1 | # Mandatory: Path to the ANT build file 2 | plugin.ejbca.ant.file /downloads/webpay-keyprovider/build.xml 3 | 4 | # Mandatory: Source directory. Adapt to your installation. 5 | plugin.ejbca.ant.custom.enrollment_plugin_directory /mobile-phone-ra/enrollment-plugin 6 | 7 | # Mandatory: Keep! 8 | plugin.ejbca.ant.target mobilepki-ejbca 9 | # or use this 10 | # plugin.ejbca.ant.target localhost-ejbca 11 | 12 | -------------------------------------------------------------------------------- /bank/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /keyprovider/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /merchant/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /keyprovider/card-images/unusualcard.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | UnusualCard 4 | PIN for this card: 5 | 143455 6 | 7 | -------------------------------------------------------------------------------- /resources/keys/client-key-ec-super.certpath: -------------------------------------------------------------------------------- 1 | [ 2 | "MIIBrDCCAVGgAwIBAgIGAVP3WL78MAwGCCqGSM49BAMCBQAwLDERMA8GA1UEBRMIOTU2NzM1MjIxFzAVBgNVBAMTDkx1a2UgU2t5d2Fsa2VyMB4XDTEyMDcxMDEwMDAwMFoXDTI1MDcxMDA5NTk1OVowLDERMA8GA1UEBRMIOTU2NzM1MjIxFzAVBgNVBAMTDkx1a2UgU2t5d2Fsa2VyMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEMNGpxRCX3nbLR2IsLIVUpNDkbGJs4FaSCPW0odyIXMbyCwQ687ljkcv6zT3ZyYqnUxBdZSbK2niMES-fDrvB46NdMFswCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYEFAUpcIBPVZHQzE_069uakoX7_qMIMB8GA1UdIwQYMBaAFAUpcIBPVZHQzE_069uakoX7_qMIMAwGCCqGSM49BAMCBQADRwAwRAIgVfHV4WsqcdCe72QC_Z9U2LNvJWnPIeyqLw6_RRU38t0CID3NQv8HT0CkKOK67P3mQAiY1uV8bN0z2zdPzHkyWRcQ" 3 | ] 4 | -------------------------------------------------------------------------------- /resources/keys/client-key-ec-unsual.certpath: -------------------------------------------------------------------------------- 1 | [ 2 | "MIIBrTCCAVGgAwIBAgIGAVP3WMJ4MAwGCCqGSM49BAMCBQAwLDERMA8GA1UEBRMIOTU2NzM1MjIxFzAVBgNVBAMTDkx1a2UgU2t5d2Fsa2VyMB4XDTEyMDcxMDEwMDAwMFoXDTI1MDcxMDA5NTk1OVowLDERMA8GA1UEBRMIOTU2NzM1MjIxFzAVBgNVBAMTDkx1a2UgU2t5d2Fsa2VyMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAES17oNEkw--n87PmnUP2Tt483aMsL0IyLgA1ho6Dh2kCyZM-JrmQEv8YGgtZWcoiu1YF-FBMjhJN5q78Dzd8__KNdMFswCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYEFH07UljUmyUds8hMQIbmtBu0gfMcMB8GA1UdIwQYMBaAFH07UljUmyUds8hMQIbmtBu0gfMcMAwGCCqGSM49BAMCBQADSAAwRQIgfm9xujTrGc1eggq2ZybZS3Ql8FJwohW2TXKN_p7t8nUCIQDPNe1OpU3fZQsFAIyYfl-TIAt-jIOWLnoIg_N_EmdrdA" 3 | ] 4 | -------------------------------------------------------------------------------- /resources/keys/client-key-ec-bankdir.certpath: -------------------------------------------------------------------------------- 1 | [ 2 | "MIIBrTCCAVGgAwIBAgIGAVP3WLuZMAwGCCqGSM49BAMCBQAwLDERMA8GA1UEBRMIOTU2NzM1MjIxFzAVBgNVBAMTDkx1a2UgU2t5d2Fsa2VyMB4XDTEyMDcxMDEwMDAwMFoXDTI1MDcxMDA5NTk1OVowLDERMA8GA1UEBRMIOTU2NzM1MjIxFzAVBgNVBAMTDkx1a2UgU2t5d2Fsa2VyMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAErQ4WXMB6_wQKHSiY_mbJ4QkGpfWLssF7hvIiiFpDEx8WHauXQsZO29qiY66G5E2j0OvP2jT75ZdXYhO91VAVFqNdMFswCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYEFIyPjMLh1as4IQKpPeYSUP2ATLf1MB8GA1UdIwQYMBaAFIyPjMLh1as4IQKpPeYSUP2ATLf1MAwGCCqGSM49BAMCBQADSAAwRQIhAP6KwQ0pQIFM2b7Ao8Aev0Ooqf3DcXn9S1O5peu_J9FzAiASC0cUp4Xe02PixFcDn7CzrleAWZwxbqyxCYTA7QOtFw" 3 | ] 4 | -------------------------------------------------------------------------------- /keyprovider/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /account-types/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /bank/TODO.txt: -------------------------------------------------------------------------------- 1 | CACHING 2 | ======= 3 | There should be a cache holding *successfully* processed messages in order to support 4 | fully idempotent retransmissions. The expiration time for the cache should be: 5 | Receival Time + Message Max Age + Max Clock Sync Deviation + Retransmission Window 6 | That is, each message decoder MUST reject messages received outside of their 7 | (potentially specific) time limit. For user authorizations timeout-related rejections 8 | are already made in a user friendly way through private messaging, while server-only 9 | operations should simply return HTTP 400 (bad request) and a textual description. 10 | -------------------------------------------------------------------------------- /interbanking/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /w3cpay/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2018-2020 Anders Rundgren 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /hosting/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /resources/logotype/saturnlogo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | S 9 | aturn 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /resources/svg-gen/saturnlogo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | S 9 | aturn 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /bank/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /acquirer/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /desktop-client/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /resources/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/Version.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | public class Version { 20 | public final static String PROTOCOL = "0.68"; 21 | public final static String DATE = "2020-09-07"; 22 | } 23 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/UserAuthorizationMethods.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | public enum UserAuthorizationMethods { 20 | 21 | PIN, 22 | FINGER_PRINT, 23 | FACE_SCAN, 24 | IRIS_SCAN, 25 | OTHER; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /resources/svg-gen/play/Spinner.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/ReservationSubTypes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | public enum ReservationSubTypes { 20 | 21 | GAS_STATION, 22 | CONSUMABLE, // Same as GAS_STATION but unspecified 23 | BOOKING, 24 | DEPOSIT; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /merchant/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /merchant/src/org/webpki/saturn/merchant/NFCLauncherServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.merchant; 18 | 19 | public class NFCLauncherServlet extends HomeServlet { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | @Override 24 | boolean isTapConnect() { 25 | return true; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/TransactionTypes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | public enum TransactionTypes { 20 | 21 | INSTANT, // Direct payment 22 | RESERVE, // Reserve fund 23 | TRANSACT, // Resolving reservation 24 | REFUND; // Refunding 25 | 26 | } 27 | -------------------------------------------------------------------------------- /resources/src/org/webpki/saturn/svg/diagrams/ORGGlyphs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.svg.diagrams; 18 | 19 | import org.webpki.tools.svg.SVGGlyphContainer; 20 | 21 | public class ORGGlyphs extends SVGGlyphContainer { 22 | 23 | @Override 24 | protected String getResourceName() { 25 | return "org-glyphs.xml"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /resources/src/org/webpki/saturn/svg/diagrams/WebPKIGlyphs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.svg.diagrams; 18 | 19 | import org.webpki.tools.svg.SVGGlyphContainer; 20 | 21 | public class WebPKIGlyphs extends SVGGlyphContainer { 22 | 23 | @Override 24 | protected String getResourceName() { 25 | return "webpki-glyphs.xml"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /resources/src/org/webpki/saturn/svg/diagrams/SupercardGlyphs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.svg.diagrams; 18 | 19 | import org.webpki.tools.svg.SVGGlyphContainer; 20 | 21 | public class SupercardGlyphs extends SVGGlyphContainer { 22 | 23 | @Override 24 | protected String getResourceName() { 25 | return "supercardglyphs.xml"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGGlyphContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | import java.io.InputStream; 20 | 21 | public abstract class SVGGlyphContainer { 22 | 23 | abstract protected String getResourceName(); 24 | 25 | InputStream init() { 26 | return getClass().getResourceAsStream(getResourceName()); 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /merchant/src/org/webpki/saturn/merchant/TransactionOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.merchant; 18 | 19 | import org.webpki.json.JSONX509Verifier; 20 | 21 | import org.webpki.saturn.common.AuthorizationResponseDecoder; 22 | 23 | public class TransactionOperation { 24 | String urlToCall; 25 | JSONX509Verifier verifier; 26 | AuthorizationResponseDecoder authorizationResponse; 27 | } 28 | -------------------------------------------------------------------------------- /bank/src/org/webpki/saturn/bank/NormalException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.bank; 18 | 19 | 20 | // Exception that should be dealt with differently with respect to external/internal // 21 | 22 | public class NormalException extends Exception { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | NormalException(String message) { 27 | super(message); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /keyprovider/card-images/reference-card-for-checking-rendering.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Your Name 12 | ACCOUNT NUMBER 13 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/KnownExtensions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | // Holds Saturn pre-defined extensions 20 | 21 | public interface KnownExtensions { 22 | 23 | String HYBRID_PAYMENT = "https://webpki.github.io/saturn/v3/extensions#hybrid"; 24 | 25 | String REFUND_REQUEST = "https://webpki.github.io/saturn/v3/extensions#refund"; 26 | 27 | String BALANCE_REQUEST = "https://webpki.github.io/saturn/v3/extensions#balance"; 28 | } 29 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGVerticalLine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public class SVGVerticalLine extends SVGLine { 20 | 21 | public SVGVerticalLine(SVGValue x, 22 | SVGValue y, 23 | SVGValue length, 24 | double strokeWidth, 25 | String strokeColor) { 26 | super(x, y, x, new SVGAddDouble(y, length), strokeWidth, strokeColor); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /resources/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | org.eclipse.jdt.ls.unmanagedFolderNature 17 | 18 | 19 | 20 | w2nb 21 | 2 22 | copy_PARENT/desktop-client/w2nb 23 | 24 | 25 | 26 | 27 | 1713510837620 28 | 29 | 30 30 | 31 | org.eclipse.core.resources.regexFilterMatcher 32 | node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 33 | 34 | 35 | 36 | 37 | 38 | copy_PARENT 39 | ${PROJECT_LOC}/.. 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /w3cpay/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | w3cpay 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | org.eclipse.jdt.ls.unmanagedFolderNature 17 | 18 | 19 | 20 | common 21 | 2 22 | copy_PARENT/resources/common 23 | 24 | 25 | 26 | 27 | 1713510837621 28 | 29 | 30 30 | 31 | org.eclipse.core.resources.regexFilterMatcher 32 | node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 33 | 34 | 35 | 36 | 37 | 38 | copy_PARENT 39 | ${PROJECT_LOC}/.. 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGShaderTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public class SVGShaderTemplate { 20 | 21 | String filter; 22 | String fillColor; 23 | double xOffset; 24 | double yOffset; 25 | 26 | public SVGShaderTemplate(String filter, String fillColor, double xOffset, double yOffset) { 27 | this.filter = filter; 28 | this.fillColor = fillColor; 29 | this.xOffset = xOffset; 30 | this.yOffset = yOffset; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGSubDocument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public abstract class SVGSubDocument { 20 | 21 | SVGDocument _svgDocument; 22 | 23 | public void generate(SVGDocument svgDocument) { 24 | _svgDocument = svgDocument; 25 | generate(); 26 | } 27 | 28 | public abstract void generate(); 29 | 30 | public SVGObject add(SVGObject svgObject) { 31 | _svgDocument.add(svgObject); 32 | return svgObject; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /interbanking/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | interbanking 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | org.eclipse.jdt.ls.unmanagedFolderNature 17 | 18 | 19 | 20 | common 21 | 2 22 | copy_PARENT/resources/common 23 | 24 | 25 | 26 | 27 | 1713510837617 28 | 29 | 30 30 | 31 | org.eclipse.core.resources.regexFilterMatcher 32 | node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 33 | 34 | 35 | 36 | 37 | 38 | copy_PARENT 39 | ${PROJECT_LOC}/.. 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /merchant/web/images/saturn-pay.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Saturn payment symbol 4 | 5 | 6 | 7 | 8 | S 9 | aturn 10 | 11 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /desktop-client/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | desktop-client 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | org.eclipse.jdt.ls.unmanagedFolderNature 17 | 18 | 19 | 20 | common 21 | 2 22 | copy_PARENT/resources/common 23 | 24 | 25 | 26 | 27 | 1713510837615 28 | 29 | 30 30 | 31 | org.eclipse.core.resources.regexFilterMatcher 32 | node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 33 | 34 | 35 | 36 | 37 | 38 | copy_PARENT 39 | ${PROJECT_LOC}/.. 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/ServerX509Signer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import java.io.IOException; 20 | 21 | import java.security.GeneralSecurityException; 22 | 23 | import org.webpki.json.JSONX509Signer; 24 | 25 | public class ServerX509Signer extends JSONX509Signer { 26 | 27 | public ServerX509Signer(final KeyStoreEnumerator key) 28 | throws IOException, GeneralSecurityException { 29 | super(key.getPrivateKey(), key.getCertificatePath()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/glypher.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /keyprovider/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | keyprovider 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | org.eclipse.jdt.ls.unmanagedFolderNature 17 | 18 | 19 | 20 | common 21 | 2 22 | copy_PARENT/resources/common 23 | 24 | 25 | 26 | 27 | 1713510837618 28 | 29 | 30 30 | 31 | org.eclipse.core.resources.regexFilterMatcher 32 | node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 33 | 34 | 35 | 36 | 37 | 38 | copy_PARENT 39 | ${PROJECT_LOC}/.. 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGEndGlobal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public class SVGEndGlobal extends SVGObject { 20 | 21 | public SVGEndGlobal() { 22 | } 23 | 24 | @Override 25 | String getTag() { 26 | return "g"; 27 | } 28 | 29 | @Override 30 | boolean hasBody() { 31 | return false; 32 | } 33 | 34 | @Override 35 | double getMaxX() { 36 | return 0; 37 | } 38 | 39 | @Override 40 | double getMaxY() { 41 | return 0; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /account-types/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | account-types 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | org.eclipse.jdt.ls.unmanagedFolderNature 17 | 18 | 19 | 20 | common 21 | 2 22 | copy_PARENT/resources/common 23 | 24 | 25 | 26 | 27 | 1713510837613 28 | 29 | 30 30 | 31 | org.eclipse.core.resources.regexFilterMatcher 32 | node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 33 | 34 | 35 | 36 | 37 | 38 | copy_PARENT 39 | ${PROJECT_LOC}/.. 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGBeginGlobal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public class SVGBeginGlobal extends SVGObject { 20 | 21 | public SVGBeginGlobal() { 22 | } 23 | 24 | @Override 25 | String getTag() { 26 | return "g"; 27 | } 28 | 29 | @Override 30 | boolean hasBody() { 31 | return false; 32 | } 33 | 34 | @Override 35 | double getMaxX() { 36 | return 0; 37 | } 38 | 39 | @Override 40 | double getMaxY() { 41 | return 0; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /merchant/web/images/gaspump.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGNegate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public class SVGNegate extends SVGValue { 20 | 21 | SVGValue value; 22 | 23 | public SVGNegate(SVGValue value) { 24 | this.value = value; 25 | } 26 | 27 | private double getValue() { 28 | return -value.getDouble(); 29 | } 30 | 31 | @Override 32 | public String getStringRepresentation() { 33 | return niceDouble(getValue()); 34 | } 35 | 36 | @Override 37 | public double getDouble() { 38 | return getValue(); 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /merchant/src/org/webpki/saturn/merchant/ShoppingCart.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.merchant; 18 | 19 | import java.io.Serializable; 20 | 21 | import java.math.BigDecimal; 22 | 23 | import java.util.LinkedHashMap; 24 | 25 | public class ShoppingCart implements Serializable { 26 | 27 | static final int TAX = 20; 28 | 29 | private static final long serialVersionUID = 1L; 30 | 31 | LinkedHashMap products; 32 | long subtotal; 33 | long tax; 34 | long roundedPaymentAmount; 35 | LinkedHashMap items = new LinkedHashMap<>(); 36 | } 37 | 38 | -------------------------------------------------------------------------------- /nodejs-common/ServerAsymKeySigner.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | 'use strict'; 19 | 20 | // Holder for server signature keys 21 | 22 | const Jsf = require('webpki.org').Jsf; 23 | 24 | function ServerAsymKeySigner(privateKey) { 25 | this.privateKey = privateKey; 26 | } 27 | 28 | ServerAsymKeySigner.prototype.sign = function(jsonObject, optionalSignatureLabel) { 29 | let signer = new Jsf.Signer(this.privateKey); 30 | if (optionalSignatureLabel !== undefined) { 31 | signer.setSignatureLabel(optionalSignatureLabel); 32 | } 33 | return signer.sign(jsonObject); 34 | }; 35 | 36 | module.exports = ServerAsymKeySigner; 37 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGStringValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public class SVGStringValue extends SVGValue { 20 | 21 | private String value; 22 | 23 | public SVGStringValue(String value) { 24 | this.value = value; 25 | } 26 | 27 | @Override 28 | public String getString() { 29 | return value; 30 | } 31 | 32 | @Override 33 | public String getStringRepresentation() { 34 | return value; 35 | } 36 | 37 | public static SVGStringValue parse(String value) { 38 | return value == null ? null : new SVGStringValue(value); 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /merchant/src/org/webpki/saturn/merchant/ResultData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.merchant; 18 | 19 | import java.io.Serializable; 20 | 21 | import org.webpki.saturn.common.ProviderResponseDecoder; 22 | import org.webpki.saturn.common.TransactionResponseDecoder; 23 | 24 | public class ResultData implements Serializable { 25 | 26 | private static final long serialVersionUID = 1L; 27 | 28 | ProviderResponseDecoder authorization; 29 | 30 | String providerAuthorityUrl; 31 | 32 | TransactionResponseDecoder.ERROR transactionError; 33 | 34 | String providerCommonName; 35 | 36 | WalletRequest walletRequest; 37 | } 38 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/ClientPlatform.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | public class ClientPlatform { 20 | 21 | String name; 22 | String version; 23 | String vendor; 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public String getVersion() { 30 | return version; 31 | } 32 | 33 | public String getVendor() { 34 | return vendor; 35 | } 36 | 37 | public ClientPlatform(String name, String version, String vendor) { 38 | this.name = name; 39 | this.version = version; 40 | this.vendor = vendor; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGAddOffset.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public class SVGAddOffset extends SVGValue { 20 | 21 | SVGValue value; 22 | double offset; 23 | 24 | public SVGAddOffset(SVGValue value, double offset) { 25 | this.value = value; 26 | this.offset = offset; 27 | } 28 | 29 | private double getValue() { 30 | return value.getDouble() + offset; 31 | } 32 | 33 | @Override 34 | public String getStringRepresentation() { 35 | return niceDouble(getValue()); 36 | } 37 | 38 | @Override 39 | public double getDouble() { 40 | return getValue(); 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/ReceiptShippingRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import java.math.BigDecimal; 20 | 21 | // Holds a shipping record for the Saturn receipt system 22 | 23 | public class ReceiptShippingRecord { 24 | 25 | String[] description; 26 | BigDecimal amount; 27 | 28 | public ReceiptShippingRecord(String[] description, BigDecimal amount) { 29 | this.description = description; 30 | this.amount = amount; 31 | } 32 | 33 | public String[] getDescription() { 34 | return description; 35 | } 36 | 37 | public BigDecimal getAmount() { 38 | return amount; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGDivConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public class SVGDivConstant extends SVGValue { 20 | 21 | SVGValue value; 22 | double offset; 23 | 24 | public SVGDivConstant(SVGValue value, double offset) { 25 | this.value = value; 26 | this.offset = offset; 27 | } 28 | 29 | private double getValue() { 30 | return value.getDouble() / offset; 31 | } 32 | 33 | @Override 34 | public String getStringRepresentation() { 35 | return niceDouble(getValue()); 36 | } 37 | 38 | @Override 39 | public double getDouble() { 40 | return getValue(); 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /hosting/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | hosting 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | org.eclipse.jdt.ls.unmanagedFolderNature 17 | 18 | 19 | 20 | account-types 21 | 2 22 | copy_PARENT/account-types/src 23 | 24 | 25 | common 26 | 2 27 | copy_PARENT/resources/common 28 | 29 | 30 | 31 | 32 | 1713510837617 33 | 34 | 30 35 | 36 | org.eclipse.core.resources.regexFilterMatcher 37 | node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 38 | 39 | 40 | 41 | 42 | 43 | copy_PARENT 44 | ${PROJECT_LOC}/.. 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /nodejs-common/ReservationSubTypes.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | 'use strict'; 19 | 20 | //Saturn "ReverationSubTypes" object 21 | 22 | const BaseProperties = require('./BaseProperties'); 23 | 24 | const SUB_TYPES = ['GAS_STATION', 25 | 'CONSUMABLE', // Same as GAS_STATION but unspecified 26 | 'BOOKING', 27 | 'DEPOSIT']; 28 | 29 | let ReservationSubTypes = { 30 | 31 | from: function(subTypeName) { 32 | for (let q = 0; q < SUB_TYPES.length; q++) { 33 | if (subTypeName == SUB_TYPES[q]) { 34 | return subTypeName; 35 | } 36 | } 37 | throw new TypeError('No such sub type: ' + subTypeName); 38 | } 39 | 40 | }; 41 | 42 | module.exports = ReservationSubTypes; 43 | -------------------------------------------------------------------------------- /account-types/src/se/bankgirot/BGAccountDataEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package se.bankgirot; 18 | 19 | import java.io.IOException; 20 | 21 | import org.webpki.saturn.common.AccountDataEncoder; 22 | 23 | public final class BGAccountDataEncoder extends AccountDataEncoder { 24 | 25 | BGAccountDataEncoder() { 26 | } 27 | 28 | public BGAccountDataEncoder(String bgNumber) throws IOException { 29 | setInternal(BGAccountDataDecoder.CONTEXT) 30 | .setString(BGAccountDataDecoder.BG_NUMBER_JSON, bgNumber); 31 | } 32 | 33 | @Override 34 | public String getPartialAccountIdentifier(String bgNumber) { 35 | return bgNumber.substring(0, 2) + '*' + bgNumber.substring(bgNumber.length() - 4); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /nodejs-common/ServerCertificateSigner.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | 'use strict'; 19 | 20 | // Holder for server signature keys 21 | 22 | const Jsf = require('webpki.org').Jsf; 23 | 24 | function ServerCertificateSigner(privateKey, certificatePath) { 25 | this.privateKey = privateKey; 26 | this.certificatePath = certificatePath; 27 | } 28 | 29 | ServerCertificateSigner.prototype.sign = function(jsonObject, optionalSignatureLabel) { 30 | let signer = new Jsf.Signer(this.privateKey); 31 | signer.setCertificatePath(this.certificatePath); 32 | if (optionalSignatureLabel !== undefined) { 33 | signer.setSignatureLabel(optionalSignatureLabel); 34 | } 35 | return signer.sign(jsonObject); 36 | }; 37 | 38 | module.exports = ServerCertificateSigner; 39 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGTransform.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public class SVGTransform extends SVGObject { 20 | 21 | public SVGTransform(String specification) { 22 | addString(SVGAttributes.TRANSFORM, new SVGStringValue(specification)); 23 | } 24 | 25 | @Override 26 | String getTag() { 27 | return "g"; 28 | } 29 | 30 | @Override 31 | boolean hasBody() { 32 | return true; 33 | } 34 | 35 | @Override 36 | double getMaxX() { 37 | return 0; 38 | } 39 | 40 | @Override 41 | double getMaxY() { 42 | return 0; 43 | } 44 | 45 | @Override 46 | String getBody() { 47 | return null; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/ReceiptTaxRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import java.math.BigDecimal; 20 | 21 | // Holds a Tax record for the Saturn receipt system 22 | // Note that this may be featured at the top level as well as per line 23 | 24 | public class ReceiptTaxRecord { 25 | 26 | BigDecimal amount; 27 | 28 | BigDecimal percentage; 29 | 30 | public ReceiptTaxRecord(BigDecimal amount, BigDecimal percentage) { 31 | this.amount = amount; 32 | this.percentage = percentage; 33 | } 34 | 35 | public BigDecimal getAmount() { 36 | return amount; 37 | } 38 | 39 | public BigDecimal getPercentage() { 40 | return percentage; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /account-types/src/org/payments/sepa/SEPAAccountDataEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.payments.sepa; 18 | 19 | import java.io.IOException; 20 | 21 | import org.webpki.saturn.common.AccountDataEncoder; 22 | 23 | public final class SEPAAccountDataEncoder extends AccountDataEncoder { 24 | 25 | SEPAAccountDataEncoder() { 26 | } 27 | 28 | public SEPAAccountDataEncoder(String iban) throws IOException { 29 | setInternal(SEPAAccountDataDecoder.CONTEXT) 30 | .setString(SEPAAccountDataDecoder.IBAN_JSON, iban); 31 | } 32 | 33 | @Override 34 | public String getPartialAccountIdentifier(String accountId) { 35 | int q = accountId.length(); 36 | return accountId.substring(0, 2) + '*' + accountId.substring(q - 6, q - 2); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/SaturnException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2021 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | /** 20 | * Wrapper for making the WebPKI CBOR library only throw unchecked exceptions. 21 | */ 22 | public class SaturnException extends RuntimeException { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | /** 27 | * Constructor for rethrowing checked exceptions. 28 | * 29 | * @param sourceException 30 | */ 31 | public SaturnException(Exception sourceException) { 32 | super(sourceException); 33 | } 34 | 35 | /** 36 | * Constructor for original exceptions. 37 | * 38 | * @param message 39 | */ 40 | public SaturnException(String message) { 41 | super(message); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /bank/src/org/webpki/saturn/bank/RiskBasedAuthentication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.bank; 18 | 19 | import java.math.BigDecimal; 20 | 21 | import java.security.PublicKey; 22 | 23 | import java.util.GregorianCalendar; 24 | 25 | public class RiskBasedAuthentication { 26 | String lastIpAddress; 27 | int consecutiveChallenge; 28 | String expectedResponse; 29 | PublicKey payeePublicKey; 30 | String payeeId; 31 | BigDecimal amount; 32 | GregorianCalendar when; 33 | 34 | public RiskBasedAuthentication() { 35 | } 36 | 37 | public String getPayeeId() { 38 | return payeeId; 39 | } 40 | 41 | public PublicKey getPayeePublicKey() { 42 | return payeePublicKey; 43 | } 44 | 45 | public void clear() { 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public abstract class SVGValue { 20 | 21 | public abstract String getStringRepresentation(); 22 | 23 | public double getDouble() { 24 | throw new RuntimeException("getDouble() invalid for this type " + this.getClass().getCanonicalName()); 25 | } 26 | 27 | public String getString() { 28 | throw new RuntimeException("getString() invalid for this type " + this.getClass().getCanonicalName()); 29 | } 30 | 31 | String niceDouble(double value) { 32 | long lval = (long)(value * 100); 33 | value = ((double)lval) / 100; 34 | if (value == (long)value) { 35 | return Long.toString((long)value); 36 | } 37 | return Double.toString(value); 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/ReceiptBarcode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | // Holds a barcode for the Saturn receipt system 20 | 21 | public class ReceiptBarcode { 22 | 23 | public enum BarcodeTypes {UPC_A, UPC_E, EAN_8, EAN_13, UPC_EAN_EXTENSION, 24 | CODE_39, CODE_93, CODE_128, CODABAR, ITF, QR_CODE}; 25 | 26 | BarcodeTypes barcodeType; 27 | 28 | String barcodeValue; 29 | 30 | public ReceiptBarcode(String barcodeValue, BarcodeTypes barcodeType) { 31 | this.barcodeType = barcodeType; 32 | this.barcodeValue = barcodeValue; 33 | } 34 | 35 | public BarcodeTypes getBarcodeType() { 36 | return barcodeType; 37 | } 38 | 39 | public String getBarcodeValue() { 40 | return barcodeValue; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGAddDouble.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public class SVGAddDouble extends SVGValue { 20 | 21 | SVGValue a; 22 | SVGValue b; 23 | double offset; 24 | 25 | public SVGAddDouble(SVGValue a, SVGValue b) { 26 | this(a, b, 0); 27 | } 28 | 29 | public SVGAddDouble(SVGValue a, SVGValue b, double offset) { 30 | this.a = a; 31 | this.b = b; 32 | this.offset = offset; 33 | } 34 | 35 | private double getValue() { 36 | return a.getDouble() + b.getDouble() + offset; 37 | } 38 | 39 | @Override 40 | public String getStringRepresentation() { 41 | return niceDouble(getValue()); 42 | } 43 | 44 | @Override 45 | public double getDouble() { 46 | return getValue(); 47 | } 48 | } 49 | 50 | -------------------------------------------------------------------------------- /bank/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | bank 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | org.eclipse.jdt.ls.unmanagedFolderNature 17 | 18 | 19 | 20 | account-types 21 | 2 22 | copy_PARENT/account-types/src 23 | 24 | 25 | common 26 | 2 27 | copy_PARENT/resources/common 28 | 29 | 30 | interbanking 31 | 2 32 | copy_PARENT/interbanking/src 33 | 34 | 35 | 36 | 37 | 1713510807477 38 | 39 | 30 40 | 41 | org.eclipse.core.resources.regexFilterMatcher 42 | node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 43 | 44 | 45 | 46 | 47 | 48 | copy_PARENT 49 | ${PROJECT_LOC}/.. 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /merchant/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | merchant 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | org.eclipse.jdt.ls.unmanagedFolderNature 17 | 18 | 19 | 20 | account-types 21 | 2 22 | copy_PARENT/account-types/src 23 | 24 | 25 | common 26 | 2 27 | copy_PARENT/resources/common 28 | 29 | 30 | w2nb 31 | 2 32 | copy_PARENT/desktop-client/w2nb 33 | 34 | 35 | 36 | 37 | 1713510837618 38 | 39 | 30 40 | 41 | org.eclipse.core.resources.regexFilterMatcher 42 | node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 43 | 44 | 45 | 46 | 47 | 48 | copy_PARENT 49 | ${PROJECT_LOC}/.. 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /nodejs-common/Software.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | 'use strict'; 19 | 20 | // Software object 21 | 22 | const JsonUtil = require('webpki.org').JsonUtil; 23 | 24 | const BaseProperties = require('./BaseProperties'); 25 | 26 | function Software(rd) { 27 | rd = rd.getObject(BaseProperties.SOFTWARE_JSON); 28 | this.name = rd.getString(BaseProperties.NAME_JSON); 29 | this.version = rd.getString(BaseProperties.VERSION_JSON); 30 | } 31 | 32 | Software.prototype.getName = function() { 33 | return this.name; 34 | }; 35 | 36 | Software.prototype.getVersion = function() { 37 | return this.version; 38 | }; 39 | 40 | Software.encode = function(name, version) { 41 | return new JsonUtil.ObjectWriter() 42 | .setString(BaseProperties.NAME_JSON, name) 43 | .setString(BaseProperties.VERSION_JSON, version); 44 | }; 45 | 46 | 47 | module.exports = Software; 48 | -------------------------------------------------------------------------------- /acquirer/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | acquirer 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | org.eclipse.jdt.ls.unmanagedFolderNature 17 | 18 | 19 | 20 | account-types 21 | 2 22 | copy_PARENT/account-types/src 23 | 24 | 25 | common 26 | 2 27 | copy_PARENT/resources/common 28 | 29 | 30 | interbanking 31 | 2 32 | copy_PARENT/interbanking/src 33 | 34 | 35 | 36 | 37 | 1713510837614 38 | 39 | 30 40 | 41 | org.eclipse.core.resources.regexFilterMatcher 42 | node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 43 | 44 | 45 | 46 | 47 | 48 | copy_PARENT 49 | ${PROJECT_LOC}/.. 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGSubtractDouble.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public class SVGSubtractDouble extends SVGValue { 20 | 21 | SVGValue a; 22 | SVGValue b; 23 | double offset; 24 | 25 | public SVGSubtractDouble(SVGValue a, SVGValue b) { 26 | this(a, b, 0); 27 | } 28 | 29 | public SVGSubtractDouble(SVGValue a, SVGValue b, double offset) { 30 | this.a = a; 31 | this.b = b; 32 | this.offset = offset; 33 | } 34 | 35 | private double getValue() { 36 | return a.getDouble() - b.getDouble() + offset; 37 | } 38 | 39 | @Override 40 | public String getStringRepresentation() { 41 | return niceDouble(getValue()); 42 | } 43 | 44 | @Override 45 | public double getDouble() { 46 | return getValue(); 47 | } 48 | } 49 | 50 | -------------------------------------------------------------------------------- /merchant/src/org/webpki/saturn/merchant/ProductEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.merchant; 18 | 19 | import java.io.IOException; 20 | import java.math.BigDecimal; 21 | 22 | import org.webpki.saturn.common.Currencies; 23 | 24 | public interface ProductEntry { 25 | 26 | String[] getDescription(); 27 | 28 | String getOptionalUnit(); 29 | 30 | long getPriceX100(); 31 | 32 | BigDecimal getOptionalSubtotal(BigDecimal quantity); 33 | 34 | BigDecimal getOptionalPrice(); 35 | 36 | default String renderPrice(long priceX100) throws IOException { 37 | return Currencies.EUR.amountToDisplayString( 38 | new BigDecimal(priceX100).divide(new BigDecimal(100)), false); 39 | } 40 | 41 | default String displayPrice() throws IOException { 42 | return renderPrice(getPriceX100()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGDoubleValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public class SVGDoubleValue extends SVGValue { 20 | 21 | private double value; 22 | 23 | public SVGDoubleValue(double value) { 24 | this.value = value; 25 | } 26 | 27 | @Override 28 | public String getStringRepresentation() { 29 | return niceDouble(value); 30 | } 31 | 32 | @Override 33 | public String getString() { 34 | return getStringRepresentation(); 35 | } 36 | 37 | @Override 38 | public double getDouble() { 39 | return value; 40 | } 41 | 42 | public void setDouble(double value) { 43 | this.value = value; 44 | } 45 | 46 | public static SVGDoubleValue parse(Double value) { 47 | return value == null ? null : new SVGDoubleValue(value); 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /merchant/src/org/webpki/saturn/merchant/AndroidServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.merchant; 18 | 19 | import java.io.IOException; 20 | 21 | import javax.servlet.ServletException; 22 | 23 | import javax.servlet.http.HttpServlet; 24 | import javax.servlet.http.HttpServletRequest; 25 | import javax.servlet.http.HttpServletResponse; 26 | 27 | //======================================================================// 28 | // This servlet shows data about the Android version and enrollment // 29 | //======================================================================// 30 | 31 | public class AndroidServlet extends HttpServlet { 32 | 33 | private static final long serialVersionUID = 1L; 34 | 35 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { 36 | HTML.androidPage(response); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/WalletAlertMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import org.webpki.json.JSONObjectReader; 20 | import org.webpki.json.JSONObjectWriter; 21 | 22 | public class WalletAlertMessage implements BaseProperties { 23 | 24 | public WalletAlertMessage(JSONObjectReader rd) { 25 | root = Messages.PAYMENT_CLIENT_ALERT.parseBaseMessage(rd); 26 | text = rd.getString(TEXT_JSON); 27 | rd.checkForUnread(); 28 | } 29 | 30 | JSONObjectReader root; 31 | public JSONObjectReader getRoot() { 32 | return root; 33 | } 34 | 35 | String text; 36 | public String getText() { 37 | return text; 38 | } 39 | 40 | public static JSONObjectWriter encode(String text) { 41 | return Messages.PAYMENT_CLIENT_ALERT.createBaseMessage() 42 | .setString(TEXT_JSON, text); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /nodejs-acquirer/config/config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | 'use strict'; 19 | 20 | // Configuration parameters fo the "Acquirer" server 21 | 22 | const Url = require('url'); 23 | 24 | let config = {}; 25 | 26 | config.logging = false; 27 | 28 | config.host = 'https://localhost:8888'; 29 | 30 | config.tlsKeys = { 31 | keyFile: __dirname + '/tlskeys/' + Url.parse(config.host).hostname + '.key.pem', 32 | certFile: __dirname + '/tlskeys/' + Url.parse(config.host).hostname + '.cert.pem' 33 | }; 34 | 35 | config.ownKeys = { 36 | certAndKey : __dirname + '/ownkeys/acquirer.cert-and-key.pem', 37 | rsaEncryptionKey: __dirname + '/ownkeys/acquirer.rsa-enc-key.pem', 38 | ecEncryptionKey : __dirname + '/ownkeys/acquirer.ec-enc-key.pem' 39 | }; 40 | 41 | config.trustAnchors = __dirname + '/trustanchors/paymentnetworks.pem'; 42 | 43 | config.payeeDb = __dirname + '/../../resources/credentials/merchants.webpay-acquirer.json'; 44 | 45 | module.exports = config; 46 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/Software.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import org.webpki.json.JSONObjectReader; 20 | import org.webpki.json.JSONObjectWriter; 21 | 22 | public class Software implements BaseProperties { 23 | 24 | String name; 25 | String version; 26 | 27 | public Software(JSONObjectReader rd) { 28 | rd = rd.getObject(SOFTWARE_JSON); 29 | name = rd.getString(NAME_JSON); 30 | version = rd.getString(VERSION_JSON); 31 | } 32 | 33 | public String getName() { 34 | return name; 35 | } 36 | 37 | public String getVersion() { 38 | return version; 39 | } 40 | 41 | public static JSONObjectWriter encode(JSONObjectWriter wr, String name, String version) { 42 | return wr.setObject(SOFTWARE_JSON, new JSONObjectWriter() 43 | .setString(NAME_JSON, name) 44 | .setString(VERSION_JSON, version)); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /nodejs-common/RequestHash.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | 'use strict'; 19 | 20 | // RequestHash object 21 | 22 | const Jsf = require('webpki.org').Jsf; 23 | const Hash = require('webpki.org').Hash; 24 | 25 | const BaseProperties = require('./BaseProperties'); 26 | 27 | const RequestHash = { 28 | 29 | JOSE_SHA_256_ALG_ID : 'S256', // Well, not really JOSE but "similar" :-) 30 | 31 | getRequestHash : function(input) { 32 | if (input instanceof Uint8Array) { 33 | return Hash.hashBinary('SHA256', input); 34 | } 35 | return RequestHash.getRequestHash(input.getNormalizedData()); 36 | }, 37 | 38 | parse : function(rd) { 39 | rd = rd.getObject(BaseProperties.REQUEST_HASH_JSON); 40 | if (rd.getString(Jsf.ALGORITHM_JSON) != RequestHash.SHA_256_ALG_ID) { 41 | throw new TypeError('Expected algorithm: ' + RequestHash.SHA_256_ALG_ID); 42 | } 43 | return rd.getBinary(Jsf.VALUE_JSON); 44 | } 45 | 46 | }; 47 | 48 | 49 | module.exports = RequestHash; 50 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/SignatureProfiles.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | // Holds Saturn pre-defined signatures profiles 20 | 21 | public enum SignatureProfiles { 22 | 23 | ES256_P256 ("https://webpki.github.io/saturn/v3/signatures#ES256.P-256"), 24 | RS256_2048 ("https://webpki.github.io/saturn/v3/signatures#RS256.2048"); 25 | 26 | String id; 27 | 28 | SignatureProfiles(String id) { 29 | this.id = id; 30 | } 31 | 32 | public String getId() { 33 | return id; 34 | } 35 | 36 | public static SignatureProfiles getProfileFromString(String id) { 37 | for (SignatureProfiles signatureProfile : SignatureProfiles.values()) { 38 | if (signatureProfile.id.equals(id)) { 39 | return signatureProfile; 40 | } 41 | } 42 | // All signature profiles DO NOT need to be known by everybody 43 | return null; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/UserResponseItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import org.webpki.json.JSONObjectReader; 20 | import org.webpki.json.JSONObjectWriter; 21 | 22 | public class UserResponseItem implements BaseProperties { 23 | 24 | public UserResponseItem(String name, String value) { 25 | this.name = name; 26 | this.value = value; 27 | } 28 | 29 | public JSONObjectWriter writeObject() { 30 | return new JSONObjectWriter() 31 | .setString(NAME_JSON, name) 32 | .setString(VALUE_JSON, value); 33 | } 34 | 35 | String name; 36 | public String getName() { 37 | return name; 38 | } 39 | 40 | String value; 41 | public String getValue() { 42 | return value; 43 | } 44 | 45 | public UserResponseItem(JSONObjectReader rd) { 46 | name = rd.getString(NAME_JSON); 47 | value = rd.getStringConditional(VALUE_JSON); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/BalanceResponseEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import java.math.BigDecimal; 20 | 21 | import java.util.GregorianCalendar; 22 | 23 | import org.webpki.json.JSONObjectWriter; 24 | 25 | import org.webpki.util.ISODateTime; 26 | 27 | public class BalanceResponseEncoder implements BaseProperties { 28 | 29 | public static JSONObjectWriter encode(String accountId, 30 | BigDecimal amount, 31 | Currencies currency) { 32 | return Messages.BALANCE_RESPONSE.createBaseMessage() 33 | .setString(ACCOUNT_ID_JSON, accountId) 34 | .setMoney(AMOUNT_JSON, amount, currency.getDecimals()) 35 | .setString(CURRENCY_JSON, currency.toString()) 36 | .setDateTime(TIME_STAMP_JSON, 37 | new GregorianCalendar(), 38 | ISODateTime.LOCAL_NO_SUBSECONDS); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /merchant/src/org/webpki/saturn/merchant/MerchantSessionProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.merchant; 18 | 19 | public interface MerchantSessionProperties { 20 | 21 | public String MERCHANT_COMMON_NAME_ATTR = "MERCHCN"; // Merchant database ID in this setup 22 | public String WALLET_REQUEST_SESSION_ATTR = "WALLREQ"; 23 | public String DEBUG_DATA_SESSION_ATTR = "DBGDATA"; 24 | public String SHOPPING_CART_SESSION_ATTR = "SHOPCART"; 25 | public String RESULT_DATA_SESSION_ATTR = "RESDAT"; 26 | public String QR_SESSION_ID_ATTR = "QRSESS"; 27 | public String GAS_STATION_SESSION_ATTR = "GASSTAT"; 28 | public String GAS_STATION_RES_SESSION_ATTR = "GASRESV"; 29 | 30 | public String DEBUG_MODE_SESSION_ATTR = "debug"; 31 | public String REFUND_MODE_SESSION_ATTR = "refund"; 32 | public String TAP_CONNECT_MODE_SESSION_ATTR = "tapcon"; 33 | 34 | public String SHOPPING_CART_FORM_ATTR = "shopcart"; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nodejs-acquirer/config/tlskeys/localhost.cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEajCCAlKgAwIBAgIGAXNdQ49PMA0GCSqGSIb3DQEBDQUAMCExHzAdBgNVBAMTFldlYlBLSS5v 3 | cmcgVExTIFJvb3QgQ0EwHhcNMTQwMTAxMDAwMDAwWhcNMjQwNzEwMDk1OTU5WjA5MTcwNQYDVQQD 4 | Ey5UTFMgY2VydGlmaWNhdGUgZm9yIGxvY2FsaG9zdC1hbmQtMTkyLjE2OC4xLjc5MIIBIjANBgkq 5 | hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8uJWUCS4Zzwcy129xOtm8p8TWKkslC28+g/lztymznko 6 | EMfOG04DGvLTryCttgG9tZtcK56jdpJf5/grzqXn2yUfzo+nEMRJ5D2QPeUNSvEy+i7NDuA5ib94 7 | NDErKMTcAAb/WopmlO06mXVqiIOFLwAghPZsRWzuUooDM/gWnrxAPPAnXjFEpRxVrC3R2OCIsHaL 8 | Q8XRRq6rxpsZ21H+Y6qLQknbtiPX1fhlv2NUDKX8BRHavOIphq2CkXG2Xm1OVVgdITLJ+HE1vgUu 9 | 2x/2WlAfqe9mBc2vaQwzes9HSy/5kYYvfU8SBLVAfNEUvB/Q1tfTt82RDMXffjZ2KOx/MQIDAQAB 10 | o4GPMIGMMAkGA1UdEwQCMAAwDgYDVR0PAQH/BAQDAgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMBMB0G 11 | A1UdDgQWBBQGnu58uUXHp3udossrpr2Yd7umjTAfBgNVHSMEGDAWgBRyeLB/n31LNKl0v4J2kSnh 12 | 1rmFozAaBgNVHREEEzARgglsb2NhbGhvc3SHBMCoAU8wDQYJKoZIhvcNAQENBQADggIBALaOA0W4 13 | Tj9I0rjToBBoHlJLo7SLes0siuCkMlfhYMeWS/CB4hYozW1ByKkjE1p3Bhi6HdabSmI5FktxVgzh 14 | fepALAVjNcW8IRf0jhDk/7H2lK/i02wMCbTwPLAEzFARDZNtGxCrCdApYYexwU1R5FIMPjAl2kL1 15 | Ru/YLlZojupTktqOmBTW3azSiKnRqQ7ZBNiBRrnpv2SRGZLo+tfU4W61btKiID5yEG0BbOfaca+k 16 | U8gVScEEP5BZbEC8+hGh/V0uhSXn0oAkAvbNoYkNdaVYhsxGB8ZRrXNsncvS/TNCz2wiA9/YGDN7 17 | RzT6OeX8ls87c+RPsW+6O4FJYwbOtisXZx/JdFUcvMfFG5E1lyrnMG/EarrT+ZNvBjcwIspr1nD4 18 | l8LoIrIqWUieS5ZJD9Qrmplsa9kovSsMTDNbDFVcqToQMD6K3z6kOvwdTPlLlFlBn66gL04ASq93 19 | LeMH0IS6TuqWrL9M1gfElbn7aCG0z5jjhsN74srSmHXffD6vdVPHuouzgv+BKD4WWHYE/b5Pfe4t 20 | EYot9BVV9rUoZrIjimiwjYchgKN5bvwrrtRvhFFOwuhf5tbtLyCVzKnyX9dfrKOlphanpaNuku41 21 | CDKfCZW/JnCPbmSvCY9QVL+Fl3++VD6hp50Iv1P4v6v4MA3PAIp6opP8czUrynaYAjb+ 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /resources/src/org/webpki/saturn/resources/rsakey.jwk: -------------------------------------------------------------------------------- 1 | { 2 | "kty":"RSA", 3 | "n":"y__yOXXaisKqCW2UCcOxpZRCCIdz04074KrnQXMOjSulnaB-kBUUV49Gc8jBI1k7IP0gLdtIPjv2WVFaewt3bm2P2tymRYNw6trisoVtSswWhPDNR12ZEhUNh4vIyJsyYsZRg2y11_ghmK5PeRRxSqVwdga-HOuhXhN_KyD-CL7VxHQwpeAmwWXDvPweTpLWzlVoRzOSkCbsluzCW9Sh0rBHPe4pBScaY2oXQsiWt8nm3p6rgfBALsP_8pEdt5W-dHMihTYfsuLNroJRngocnvPhv44F1ODafUwfuLPe-LpG8zIzMGHnaD4GECOatrzOqPjUCnyiHchNFap1HU8khQ", 4 | "e":"AQAB", 5 | "d":"licHtT-H4kayPUpIgn9mDIf5qql4magFALMKkGQNu976gfEV9xts453zr1l-v3P4T6nAu8ABhr0_8DIvNQ4VlFRUZDWwtM2wmU0PO3N2JG3fzW4oynScLHEOikxbNzz0czuh1-h2WEatA-KZYHepg9YN1vHTkRnmpoYXPjmEgg4UBCPZWBYqiSOYTlmyMh3OJrHlhkaqMQZID1acU1WPf5rtl9-s3DLYjaV9sgk-4dlmUShWoa4ruK1tL4hZV77tgHzG0D4jmnjc7aHnH20aCGoGz0SkIDH5Y-UzotG-vKvVW_9LaXSrEcfuqs2YtaXeixB1Xp_EI3yntt1z-vPC6Q", 6 | "p":"8VLnM8VF1pW1M31jQfec0h4NUO3WuLTR8xJJA1Qn572zYC1jd5myLOYIdZ1KpSDeTtydEiR63OMeht4Ph5GgBd8d8Mfq5ANpyhmMO8eqegzx51AuKFRrRyLVtjgwdt3Y-xzsagR1ovHg7C0nvMoBGBC6R4HqRmX7Yeq_Me4Kb2M", 7 | "q":"2Gf00-LjLNyHjcPZGA4mEQ_Zo-5cj9t6X2-m8Vyu40Id1OOdzhbE1jifls0piTdD2_dxGcYLhtDxJtvRr58YsArJSKOdDAZxETfh4f3K_QEoWiVFKd2Ig2P67k4D1sEPoFjM8ri3vFstAawQv06nwgKtNWhfkOishKjpfEPJZPc", 8 | "dp":"oykgNLqOa3Uw3C1MrM9TciTrb-o-oQdwY93bC6sch-yUmNRXSgfalcy5r3u3eknsxHkYoamUgD_25czBxzFIdm_R-HfScnN0VTZMwCZRNtAFxhVJ_-6D0cbVo6v96IA6Mh3uIgf92TucjVJCabxSXQkCSVKnKQ3Olvd2abW9zG0", 9 | "dq":"Uv5baL-E_Hl_CyFnKtCSTMzVXQdXPFyh6-P4FGzFLab3peO9a4JT7ww8OCtqmJM3VS7qk0Xeuc98DLkVC9NqNmmMlG0bF7eIuV_DI1af-LPu89ODWPD7H9jCLY6B7mSQR6CGyTeKT5RwCEojChtyPvej0e27aOmy8BWPpfahUDU", 10 | "qi":"kyWCUFH8mC4evXRP0flATYdrAPIWwuLO9945Q5FXRT41jFWzAY8NO-pzPWIfo8uOWbgAxG83RzKlDqNyDfU3LPIoYuBC8sGwGhU12E4A0L7IoLWi6I3eXasiX1sd3ngjRuHDiBWD5DHdQySfsTJI5v0Tb4Kuop0KDvf9wNdlr60" 11 | } 12 | -------------------------------------------------------------------------------- /w3cpay/src/org/webpki/saturn/w3c/manifest/PaymentAppMethodServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.w3c.manifest; 18 | 19 | import java.io.IOException; 20 | 21 | import javax.servlet.ServletException; 22 | 23 | import javax.servlet.http.HttpServlet; 24 | import javax.servlet.http.HttpServletRequest; 25 | import javax.servlet.http.HttpServletResponse; 26 | 27 | import org.webpki.json.JSONOutputFormats; 28 | import org.webpki.json.JSONParser; 29 | 30 | public class PaymentAppMethodServlet extends HttpServlet { 31 | 32 | private static final long serialVersionUID = 1L; 33 | 34 | @Override 35 | public void doGet(HttpServletRequest request, HttpServletResponse response) 36 | throws IOException, ServletException { 37 | response.setContentType("text/plain"); 38 | response.getOutputStream().write( 39 | JSONParser.parse( 40 | PaymentAppMethodService.paymentManifest) 41 | .serializeToBytes(JSONOutputFormats.PRETTY_PRINT)); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /nodejs-common/NonDirectPayments.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | 'use strict'; 19 | 20 | //Saturn "NonDirectPayments" object 21 | 22 | const JsonUtil = require('webpki.org').JsonUtil; 23 | 24 | const ReservationSubTypes = require('./ReservationSubTypes'); 25 | const BaseProperties = require('./BaseProperties'); 26 | 27 | let NonDirectPayments = { 28 | 29 | from: function(rd, timeStamp) { 30 | switch (this.type = rd.getString(BaseProperties.TYPE_JSON)) { 31 | case 'RESERVATION': 32 | this.subType = ReservationSubTypes.from(rd.getString(BaseProperties.SUB_TYPE_JSON)); 33 | this.expires = rd.getDateTime(BaseProperties.EXPIRES_JSON); 34 | break; 35 | 36 | case 'RECURRING': 37 | throw new TypeError('Not yet implemented: ' + this.type); 38 | break; 39 | 40 | default: 41 | throw new TypeError('No such type: ' + this.type); 42 | } 43 | this.fixed = rd.getBoolean(BaseProperties.FIXED_JSON); 44 | } 45 | 46 | }; 47 | 48 | module.exports = NonDirectPayments; 49 | -------------------------------------------------------------------------------- /bank/src/org/webpki/saturn/bank/ProviderAuthorityServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.bank; 18 | 19 | import java.io.IOException; 20 | 21 | import javax.servlet.ServletException; 22 | 23 | import javax.servlet.http.HttpServletRequest; 24 | import javax.servlet.http.HttpServletResponse; 25 | 26 | import org.webpki.saturn.common.AuthorityBaseServlet; 27 | 28 | // This servlet publishes the Payment Provider (Bank) "ProviderAuthority" object. 29 | 30 | public class ProviderAuthorityServlet extends AuthorityBaseServlet { 31 | 32 | private static final long serialVersionUID = 1L; 33 | 34 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { 35 | processAuthorityRequest(request, 36 | response, 37 | BankService.authorityObjectManager.getProviderAuthorityBlob()); 38 | } 39 | 40 | @Override 41 | protected boolean isProvider() { 42 | return true; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /merchant/src/org/webpki/saturn/merchant/MerchantDescriptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.merchant; 18 | 19 | import java.util.LinkedHashMap; 20 | 21 | public class MerchantDescriptor { 22 | 23 | String commonName; 24 | String[] optionalPhysicalAddress; 25 | String optionalPhoneNumber; 26 | String optionalEmailAddress; 27 | LinkedHashMap paymentMethods; 28 | 29 | MerchantDescriptor(String commonName, 30 | String[] optionalPhysicalAddress, 31 | String optionalPhoneNumber, 32 | String optionalEmailAddress, 33 | LinkedHashMap paymentMethods) { 34 | this.commonName = commonName; 35 | this.optionalPhysicalAddress = optionalPhysicalAddress; 36 | this.optionalPhoneNumber = optionalPhoneNumber; 37 | this.optionalEmailAddress = optionalEmailAddress; 38 | this.paymentMethods = paymentMethods; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /merchant/src/org/webpki/saturn/merchant/Synchronizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.merchant; 18 | 19 | class Synchronizer { 20 | private boolean touched; 21 | private boolean inProgress; 22 | 23 | synchronized boolean perform(long cometWait) { 24 | boolean timeoutFlag = false; 25 | while (!touched && !timeoutFlag) { 26 | try { 27 | wait(cometWait); 28 | } catch (InterruptedException e) { 29 | return false; 30 | } 31 | timeoutFlag = true; 32 | } 33 | return touched; 34 | } 35 | 36 | synchronized void haveData4You() { 37 | touched = true; 38 | notify(); 39 | } 40 | 41 | synchronized void setInProgress() { 42 | inProgress = true; 43 | notify(); 44 | } 45 | 46 | synchronized boolean isInProgress() { 47 | if (inProgress) { 48 | inProgress = false; 49 | return true; 50 | } 51 | return false; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/RecurringPaymentIntervals.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import java.util.GregorianCalendar; 20 | 21 | public enum RecurringPaymentIntervals { 22 | 23 | WEEKLY (GregorianCalendar.HOUR, 7 * 24), 24 | BI_WEEKLY (GregorianCalendar.HOUR, 14 * 24), // Every two weeks 25 | MONTHLY (GregorianCalendar.MONTH, 1), 26 | BI_MONTHLY (GregorianCalendar.MONTH, 2), // Every two months 27 | QUARTERLY (GregorianCalendar.MONTH, 3), // Every three months 28 | TRI_ANNUAL (GregorianCalendar.MONTH, 4), // Every four months 29 | SEMI_ANNUAL (GregorianCalendar.MONTH, 6), // Every six months 30 | ANNUALY (GregorianCalendar.YEAR, 1), // Once a year 31 | 32 | UNSPECIFIED (-1, 0); 33 | 34 | int field; 35 | int quantity; 36 | 37 | RecurringPaymentIntervals(int field, int quantity) { 38 | this.field = field; 39 | this.quantity = quantity; 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /acquirer/src/org/webpki/saturn/acquirer/ProviderAuthorityServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.acquirer; 18 | 19 | import java.io.IOException; 20 | 21 | import javax.servlet.ServletException; 22 | 23 | import javax.servlet.http.HttpServletRequest; 24 | import javax.servlet.http.HttpServletResponse; 25 | 26 | import org.webpki.saturn.common.AuthorityBaseServlet; 27 | 28 | // This servlet publishes the Acquirer (Card-Processor) "ProviderAuthority" object. 29 | 30 | public class ProviderAuthorityServlet extends AuthorityBaseServlet { 31 | 32 | private static final long serialVersionUID = 1L; 33 | 34 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { 35 | processAuthorityRequest(request, 36 | response, 37 | AcquirerService.authorityObjectManager.getProviderAuthorityBlob()); 38 | } 39 | 40 | @Override 41 | protected boolean isProvider() { 42 | return true; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/ServerAsymKeySigner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import java.io.IOException; 20 | 21 | import java.security.GeneralSecurityException; 22 | import java.security.KeyPair; 23 | import java.security.PrivateKey; 24 | import java.security.PublicKey; 25 | 26 | import org.webpki.json.JSONAsymKeySigner; 27 | 28 | public class ServerAsymKeySigner extends JSONAsymKeySigner { 29 | 30 | ServerAsymKeySigner(PrivateKey privateKey, PublicKey publicKey) 31 | throws IOException, GeneralSecurityException { 32 | super(privateKey); 33 | setPublicKey(publicKey); 34 | } 35 | 36 | public ServerAsymKeySigner(KeyPair keyPair) 37 | throws IOException, GeneralSecurityException { 38 | this(keyPair.getPrivate(), keyPair.getPublic()); 39 | } 40 | 41 | public ServerAsymKeySigner(KeyStoreEnumerator kse) 42 | throws IOException, GeneralSecurityException { 43 | this(kse.getPrivateKey(), kse.getPublicKey()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /account-types/src/se/bankgirot/BGAccountDataDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package se.bankgirot; 18 | 19 | import org.webpki.json.JSONObjectReader; 20 | import org.webpki.json.JSONOutputFormats; 21 | 22 | import org.webpki.saturn.common.AccountDataDecoder; 23 | 24 | public final class BGAccountDataDecoder extends AccountDataDecoder { 25 | 26 | static final String CONTEXT = "https://bankgirot.se/saturn/v3#account"; 27 | 28 | static final String BG_NUMBER_JSON = "bgNumber"; 29 | 30 | @Override 31 | protected void readJSONData(JSONObjectReader rd) { 32 | readOptionalNonce(rd); 33 | accountId = rd.getString(BG_NUMBER_JSON); 34 | } 35 | 36 | @Override 37 | protected byte[] getAccountObject() { 38 | return getWriter().serializeToBytes(JSONOutputFormats.CANONICALIZED); 39 | } 40 | 41 | @Override 42 | public String getContext() { 43 | return CONTEXT; 44 | } 45 | 46 | @Override 47 | protected BGAccountDataEncoder createEncoder() { 48 | return new BGAccountDataEncoder(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /account-types/src/org/payments/sepa/SEPAAccountDataDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.payments.sepa; 18 | 19 | import org.webpki.json.JSONObjectReader; 20 | import org.webpki.json.JSONOutputFormats; 21 | 22 | import org.webpki.saturn.common.AccountDataDecoder; 23 | 24 | public final class SEPAAccountDataDecoder extends AccountDataDecoder { 25 | 26 | static final String CONTEXT = "https://sepa.payments.org/saturn/v3#account"; 27 | 28 | static final String IBAN_JSON = "iban"; 29 | 30 | @Override 31 | protected void readJSONData(JSONObjectReader rd) { 32 | readOptionalNonce(rd); 33 | accountId = rd.getString(IBAN_JSON); 34 | } 35 | 36 | @Override 37 | protected SEPAAccountDataEncoder createEncoder() { 38 | return new SEPAAccountDataEncoder(); 39 | } 40 | 41 | @Override 42 | protected byte[] getAccountObject() { 43 | return getWriter().serializeToBytes(JSONOutputFormats.CANONICALIZED); 44 | } 45 | 46 | @Override 47 | public String getContext() { 48 | return CONTEXT; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGCenter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain lowVal copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public class SVGCenter extends SVGValue { 20 | 21 | SVGValue lowVal; 22 | SVGValue highVal; 23 | SVGValue width; 24 | 25 | public SVGCenter(SVGValue lowVal, SVGValue highVal, double width) { 26 | this(lowVal, highVal, new SVGDoubleValue(width)); 27 | } 28 | 29 | public SVGCenter(SVGValue lowVal, SVGValue highVal, SVGValue width) { 30 | this.lowVal = lowVal; 31 | this.highVal = highVal; 32 | this.width = width; 33 | } 34 | 35 | public SVGCenter(SVGValue lowVal, SVGValue highVal) { 36 | this(lowVal, highVal, 0); 37 | } 38 | 39 | private double getValue() { 40 | return (highVal.getDouble() + lowVal.getDouble() - width.getDouble()) / 2; 41 | } 42 | 43 | @Override 44 | public String getStringRepresentation() { 45 | return niceDouble(getValue()); 46 | } 47 | 48 | @Override 49 | public double getDouble() { 50 | return getValue(); 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /bank/src/org/webpki/saturn/bank/PayeeAuthorityServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.bank; 18 | 19 | import java.io.IOException; 20 | 21 | import javax.servlet.ServletException; 22 | 23 | import javax.servlet.http.HttpServletRequest; 24 | import javax.servlet.http.HttpServletResponse; 25 | 26 | import org.webpki.saturn.common.AuthorityBaseServlet; 27 | 28 | // This servlet publishes Payee (Merchant) "PayeeAuthority" objects. 29 | 30 | public class PayeeAuthorityServlet extends AuthorityBaseServlet { 31 | 32 | private static final long serialVersionUID = 1L; 33 | 34 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { 35 | String id = request.getPathInfo(); 36 | processAuthorityRequest(request, 37 | response, 38 | id == null ? null : BankService.authorityObjectManager.getPayeeAuthorityBlob(id.substring(1))); 39 | } 40 | 41 | @Override 42 | protected boolean isProvider() { 43 | return false; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /desktop-client/w2nb/org/webpki/saturn/w2nb/support/W2NB.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.w2nb.support; 18 | 19 | import java.io.IOException; 20 | 21 | import org.webpki.json.JSONDecoderCache; 22 | import org.webpki.json.JSONObjectWriter; 23 | 24 | import org.webpki.saturn.common.BaseProperties; 25 | 26 | // For the Web2Native Bridge wallet 27 | 28 | public class W2NB { 29 | 30 | private W2NB() {}; 31 | 32 | public static final String WINDOW_JSON = "window"; 33 | public static final String HEIGHT_JSON = "height"; 34 | public static final String WIDTH_JSON = "width"; 35 | 36 | public static final String PAYMENT_CLIENT_IS_READY = "PaymentClientIsReady"; // PaymentClient to payee Web page message 37 | 38 | public static JSONObjectWriter createReadyMessage() throws IOException { 39 | return new JSONObjectWriter() 40 | .setString(JSONDecoderCache.CONTEXT_JSON, BaseProperties.SATURN_WEB_PAY_CONTEXT_URI) 41 | .setString(JSONDecoderCache.QUALIFIER_JSON, PAYMENT_CLIENT_IS_READY); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /acquirer/src/org/webpki/saturn/acquirer/PayeeAuthorityServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.acquirer; 18 | 19 | import java.io.IOException; 20 | 21 | import javax.servlet.ServletException; 22 | 23 | import javax.servlet.http.HttpServletRequest; 24 | import javax.servlet.http.HttpServletResponse; 25 | 26 | import org.webpki.saturn.common.AuthorityBaseServlet; 27 | 28 | // This servlet publishes Payee (Merchant) "PayeeAuthority" objects. 29 | 30 | public class PayeeAuthorityServlet extends AuthorityBaseServlet { 31 | 32 | private static final long serialVersionUID = 1L; 33 | 34 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { 35 | String id = request.getPathInfo(); 36 | processAuthorityRequest(request, 37 | response, 38 | id == null ? null : AcquirerService.authorityObjectManager.getPayeeAuthorityBlob(id.substring(1))); 39 | } 40 | 41 | @Override 42 | protected boolean isProvider() { 43 | return false; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/UrlHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import javax.servlet.http.HttpServletRequest; 20 | 21 | 22 | // The purpose of this class is to enable URL information in exceptions 23 | 24 | public class UrlHolder { 25 | String callerAddress; 26 | boolean nonCached; 27 | 28 | public UrlHolder(HttpServletRequest request) { 29 | callerAddress = " [Origin=" + request.getRemoteAddr() + ", Context=" + request.getContextPath() + "] "; 30 | } 31 | 32 | private String url; 33 | 34 | public String getUrl() { 35 | return url; 36 | } 37 | 38 | public void setNonCachedMode(boolean nonCached) { 39 | this.nonCached = nonCached; 40 | } 41 | 42 | public boolean nonCachedMode() { 43 | boolean temp = nonCached; 44 | nonCached = false; 45 | return temp; 46 | } 47 | 48 | public UrlHolder setUrl(String url) { 49 | this.url = url; 50 | return this; 51 | } 52 | 53 | public String getCallerAddress() { 54 | return callerAddress; 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /resources/svg-gen/bank.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /nodejs-acquirer/config/tlskeys/localhost.key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDy4lZQJLhnPBzLXb3E62bynxNY 3 | qSyULbz6D+XO3KbOeSgQx84bTgMa8tOvIK22Ab21m1wrnqN2kl/n+CvOpefbJR/Oj6cQxEnkPZA9 4 | 5Q1K8TL6Ls0O4DmJv3g0MSsoxNwABv9aimaU7TqZdWqIg4UvACCE9mxFbO5SigMz+BaevEA88Cde 5 | MUSlHFWsLdHY4IiwdotDxdFGrqvGmxnbUf5jqotCSdu2I9fV+GW/Y1QMpfwFEdq84imGrYKRcbZe 6 | bU5VWB0hMsn4cTW+BS7bH/ZaUB+p72YFza9pDDN6z0dLL/mRhi99TxIEtUB80RS8H9DW19O3zZEM 7 | xd9+NnYo7H8xAgMBAAECggEBANp0Ko/Axz7K+VcMhD+WPqzf2OW4m0jXbo43OEn7eehhXmDhZQZ3 8 | /yEA4NY1/Sejnz61cowlDf76nlokgzpFTCl11YrS97+D3LX1jUOuPWt3T5Nn/rVvhTDYzsOaqafs 9 | j7dSk9+adbNjP36A9gW8zVA9vAH7Jdy3og8I5OKcM7Ql+s2Zy6PL9EA4EseXTF6Xq524LnKm5p3E 10 | 9WbwfgdMNOMoxFOfuf+LWjIgFNcigvu4HsWOlqXBxqhtdzS6yaNA71WeUWFo1TA9SpdGz5NMPOA6 11 | 7SCFx6Ln6RRrMpAzKXLGE1cRdR4uTfObz2K2rJgLHJ+NXZmEMpON1gimf5rOKAECgYEA+ns9slMu 12 | SPGt+Rx7tZKRghlkcjEHhR1ZWq7HFMQdgybRkrj5P9GU3KSm3aXBItzlNLvwODYnNzf2rP4kBtWF 13 | Mea2SpZYjHDZDBNDaEgZufzVwCRr/Twvrs+0ugGBYhIzC0eybAt+Ns8J4kjRMdwJwDVhLSe4/0pT 14 | ODS24/iYp7ECgYEA+Dw/BLQeN9jHnpt00l6n0ozbVOLcIybSDELEqb6cSIxvYqKMM4qm4urY5Tj0 15 | N+0I8cm4/1BMFaDjXouK4J1+mDTGmEpdwf3nuTb7pbA7aCLzwmJlXi3MxKaT+1DUEywS60lnB89Q 16 | rOwHrdxZJbCUPF7v3S5pKZxDG5UrQ1S+r4ECgYEA5IoV3OLwVDXO2oAWj7DPerjYYShDCD2jDY5y 17 | rovRsZx1kz2ajZQYEslYRtu5wKlzqA3iPCeM2GEDfQvUqzeec81hfeR3noxIPTBGTJucfYonLU0O 18 | CtwjVYjGCQDeoDCiyiP8s4A5BKEbD5AI70kozGrn419e9+9Exv+x74cfIcECgYBtkDnIW6+Suq2w 19 | xbCUQY8VEXKlTtQW98Vx/+5JdYYJR2LKSDBVd3cdZMaCtdak8IwoG/75QXmzeiWgzzpm1VzQ1Upq 20 | YThsrSKfzzLW+Kff2L16KG/RV6mvik56eDyCkctv6h/9hHV5PVxOUplOV1e2Jbj9CMUFxqCgBgDo 21 | YPkhAQKBgQDFPMwwFsCHOQ7rBlEigk5gU4M2dVcoVwtndHR5ifH47z9glTDlNtVTmbuaKwCdWdeh 22 | FUv1nhac55Hv7cVSpfhqUH8ZEZuZhaGR6MHRo3/MKkAD+ZWoy1dDyBJ8W7iHB+UmWYOw7G1tqVI1 23 | 7CI6XbnLJyzVlWv45+zKIji1Ro9kXw== 24 | -----END PRIVATE KEY----- 25 | -------------------------------------------------------------------------------- /resources/src/org/webpki/saturn/svg/diagrams/org-glyphs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /merchant/src/org/webpki/saturn/merchant/PaymentMethodDescriptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.merchant; 18 | 19 | import java.util.LinkedHashMap; 20 | 21 | import org.webpki.saturn.common.AccountDataEncoder; 22 | import org.webpki.saturn.common.ServerAsymKeySigner; 23 | 24 | public class PaymentMethodDescriptor { 25 | 26 | String authorityUrl; // Merchant authorityUrl 27 | ServerAsymKeySigner signer; // Holding merchant/method specific key 28 | LinkedHashMap receiverAccounts; // Where to receive money 29 | LinkedHashMap sourceAccounts; // For refunds 30 | 31 | PaymentMethodDescriptor(String authorityUrl, 32 | ServerAsymKeySigner signer, 33 | LinkedHashMap receiverAccounts, 34 | LinkedHashMap sourceAccounts) { 35 | this.authorityUrl = authorityUrl; 36 | this.signer = signer; 37 | this.receiverAccounts = receiverAccounts; 38 | this.sourceAccounts = sourceAccounts; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /nodejs-acquirer/config/ownkeys/acquirer.rsa-enc-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCDeSMfQx7FIwIKmAUuGG+tktaO 3 | eh2EUUhzy/pFfTtASW5tFrNeLc/2csfAbQtA/HUz6kNux9dZAdLW8WCqy4wadZkFt0sc7npO2gHJ 4 | UsK1lCDyeRXCqP1wkqELYbPTW8trqGa7PsGev7zkm2Wn/jnQammY1OlW+pRU2AOl2EbtMTKK6+q+ 5 | HNeK3H0HnGNANytW9iDl9jOzLp49U79H2rHuqnsxiEjAyDZssXwO6FYh6qrdYjEFUh/uG4HqRHQ/ 6 | bfEqURUql/ttNySn34xou5QRJnaugglEUPPEx5n4xlfLarY502q0sw/uyMM+tkfz2QOhzZRFkZpZ 7 | MTJq1vbudWw/AgMBAAECggEAFf+xBsweW/Itp0Qkqb/g//Qv/oskYT2Ql/+rkvEPdwRSe+JuhPW5 8 | dI1kKyiT133mxpcOTX0W5YfOlbSx7iI9AThoMHKpGOA2ivcjkWJNvkBY+vmT0IyiS7HdTKA+jMEx 9 | WoRFHFO15jBDFSWDbwa0+dC0dqQ5nxoys7epdJip1YpGetaAUmwlVGOanAwZ1nb4O7juh0vBFXF9 10 | J90atFeXX+Oic9MSqLDAnwtCt+wszL+Z9/Ya5+66tANKmvZtC+kwR8HTh9iQ4QH/CJQ5CaxshBm0 11 | vUHEnk1CXf05Ju0aZHflGa8AltoJlQ0MXAJwwD+KO+EmvN4BbVwq9I36Zew3MQKBgQC5KJR/MqOV 12 | ghJm6w+5I4aMsLRHPNvaZYPOU2+bgDVBxJdqqla7fh/BEe1eOQOhvo57/SAupk0Rb7aoTzeu9rqZ 13 | BrBUO1GniVEmzdgCB9E8tFt96UOoCE1Ia8Q0e1VYjkd0hh5D0VAh3yvWPeoZh0JBiaOTHpoQqvfM 14 | 14WOKtJyhQKBgQC1xlP8EySpcI8YCLCSVXIh7Mc8ryp+oJMsU+rlgjYu24TK+RS7oPwwcflBSsig 15 | kfJ18rLWk0Ysi2um/O8rSxOFUBL5NBfavX+9c/ukwr43Cnk+vGhPZbYOKSpy+tgam+lHLK2s2DaE 16 | kDqEfJmlL9a2P62P1fFeLjXXS3zDBJFY8wKBgQCu/kZSbRaj77naoSBMFuJMR5kqlr8mirjmoH6j 17 | 1aj/zoBYpEKykwIJ5BqV6YagMEvTrSjkTfIan51fNvdmmfNDO0odYa7Li4EyDmuvh5neKIsr1fFG 18 | dworfwaBn2rK9jVcUIF8EPAOAzEYG44LsIUTEbWSDuMHC76FT8/+zEP3TQKBgBWhp2btBEThrzWl 19 | +xU+89kTq1YOZlkxVLJGvkJXr4j9+JyK7auyabB+L7JUavGozJi6rAua9RPh94qkuPWG9qi7sbZU 20 | O659NJFgFwcxYZ99MJaFp0gji3m97l5GeacY/LbKm1RhWoOGAmC3zzT4L236v/XI+PNDPocDZbJz 21 | fbR/AoGAFEf4uOdjPyWnumTj74HFhGTgdUxgodgATTTf8rB9NLZxY8EXMKZAaSR1QEEcihomvHsF 22 | qlqvjNEADtBwYsTkSmZ6t9rOgJsvS66ksGGVyjmTzRDIqrRzuI5yBAMbqhZvu++cDaaQTI6TeOQ6 23 | zPbpPLRLU75XZ/zCHwmf3Gs4xgc= 24 | -----END PRIVATE KEY----- 25 | 26 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/BalanceRequestEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import java.util.GregorianCalendar; 20 | 21 | import org.webpki.json.JSONAsymKeySigner; 22 | import org.webpki.json.JSONObjectWriter; 23 | 24 | import org.webpki.util.ISODateTime; 25 | 26 | public class BalanceRequestEncoder implements BaseProperties { 27 | 28 | public static JSONObjectWriter encode(String recipientUrl, 29 | Currencies currency, 30 | String accountId, 31 | String credentialId, 32 | JSONAsymKeySigner signer) { 33 | return Messages.BALANCE_REQUEST.createBaseMessage() 34 | .setString(RECIPIENT_URL_JSON, recipientUrl) 35 | .setString(ACCOUNT_ID_JSON, accountId) 36 | .setString(CREDENTIAL_ID_JSON, credentialId) 37 | .setString(CURRENCY_JSON, currency.toString()) 38 | .setDateTime(TIME_STAMP_JSON, new GregorianCalendar(), ISODateTime.LOCAL_NO_SUBSECONDS) 39 | .setSignature(REQUEST_SIGNATURE_JSON, signer); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /hosting/src/org/webpki/saturn/hosting/PayeeAuthorityServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.hosting; 18 | 19 | import java.io.IOException; 20 | 21 | import javax.servlet.ServletException; 22 | 23 | import javax.servlet.http.HttpServletRequest; 24 | import javax.servlet.http.HttpServletResponse; 25 | 26 | import org.webpki.saturn.common.AuthorityBaseServlet; 27 | 28 | // This servlet publishes Payee (Merchant) "PayeeAuthority" objects. 29 | 30 | public class PayeeAuthorityServlet extends AuthorityBaseServlet { 31 | 32 | private static final long serialVersionUID = 1L; 33 | 34 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { 35 | String id = request.getPathInfo(); 36 | processAuthorityRequest(request, 37 | response, 38 | id == null ? null : HostingService.authorityObjectManager.getPayeeAuthorityBlob(id.substring(1))); 39 | } 40 | 41 | @Override 42 | protected boolean isPayeeHosted() { 43 | return true; 44 | } 45 | 46 | @Override 47 | protected boolean isProvider() { 48 | return false; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /tls-certificates/root/tlsroot.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIFIDCCAwigAwIBAgIBATANBgkqhkiG9w0BAQ0FADAhMR8wHQYDVQQDExZXZWJQS0kub3JnIFRM 3 | UyBSb290IENBMB4XDTEwMDcxMDEwMDAwMFoXDTMwMDcxMDA5NTk1OVowITEfMB0GA1UEAxMWV2Vi 4 | UEtJLm9yZyBUTFMgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMiVaKDY 5 | xVpko0v9yk+OHRjeiMfupovRXnNal3tF1pYWENnrktFgWJCKGQJ3waMFPxwc06lvKJtOfgmmdMJJ 6 | vFPvJdUew3ggG10IUgaEeMk/1LMtEZyzsWbicRDsyNLdqZrWnuzkDYJDD228KppPTrmGst65HZqY 7 | kd4zrOmyfqxtBNdcUccpdP8+RZ6YWbXnbGwz8fWjo2ntTYtTgVLemKWCyRQnGMb73QbRY8fn9Aax 8 | tFYgQzb+qV/mihbXiDX21tEEIsqSURdpOL3o8BNL54GMDJXmqrS/R4xKGFwm6J98XhkcvOpOD+Kh 9 | k6jQgaF4njHUnaJQEUda1eaTofCvoADZvnfQgV/IpphBYSoWfzimghbuW74fsvhim77eZRamBM9e 10 | smBSD10GlqYBUmMy0u6nMSqaVg15Wwc3/37z51q3DhJUm2mcz/Tuby7g+dqLOzOQTc/RTRGgx3up 11 | xePQKTXiA2fLd/UacTTAPkfGMzg1J9GSS+UpwwXwu1w3HOvFUMEPMcyRHc0toTK7iC2+suMhyMlj 12 | 71XHeA66OBB0J+eFuc4vi7NKtbkE5xBttF9uBC0PpUQt77+MAPOkLWiurk516qkrcHkoA3+SPfJd 13 | D0QB/3o3Kapqieqp7El4UdwLiA0u86I8+IMhmEZyO7xWVX3n0wA+iWsa0rFdT/BJFJWdAgMBAAGj 14 | YzBhMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRyeLB/n31LNKl0 15 | v4J2kSnh1rmFozAfBgNVHSMEGDAWgBRyeLB/n31LNKl0v4J2kSnh1rmFozANBgkqhkiG9w0BAQ0F 16 | AAOCAgEAUF8SScOjyW8u9gFhhmGP2gXLJlCnBdoZDlrkB1gUoJWa6je1//rea2WPAgeRbvEpsKMB 17 | Ql1e0padTE9behScn490hBvCxVbNOmhnVBTqCvWeYq7BstHjxtiaLTO0aN0NC98ZrGfW0yKaX/EV 18 | Qk+zlJlBbc7JCG34Mq+bb4RD5aVLt/v1LLhn3wvAlmwakRYWIae1/A86eCKlKUcoz1DXrzJXb21T 19 | T2rp+47No7E6s2VzVx/ty2k9CpGGopCJz6NFRLQK/mxp+9LzO4WkqUu8terdGdBiv6lruNPDhRjp 20 | 00Bq9QZR2ryM4WlEia6Q0GWMUBeJbaxOoUVPnROq7b/ZSGhnvMy/G8WBJk6K3nvvETDXhG1/uPxR 21 | SOmtVHU18kDb3dqzLqMEAoyCgtha8Kd2PeDBiLD+a/Nc8sIZXbHbs55Q6THW+fJGeQ0Kc4wHLj8/ 22 | WgpQfTd6AmNPbpsp5T0iUbqeWIN6uAldun+OK0BAIZPld7Ww1RX6a1Shln0Js7H0u4qAxhckTdLK 23 | j/n5UvA1N9kwvsiDrx6GpCjCXbWy6qS5a+iflK0h4RNZYWWga7i0G/EgHYq7H7uUrIhgRXA9k9H0 24 | PxC9+GVONQbRxJ6MGSh8fMPr2kyplIxUXyw1sDAh01wh0oMU5iJ32cMM6EiISF+O2+wv0CvL0STx 25 | JIjM4qE= 26 | -----END CERTIFICATE----- 27 | 28 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/PayeeAuthorityEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import java.util.GregorianCalendar; 20 | 21 | import org.webpki.json.JSONObjectWriter; 22 | 23 | import org.webpki.util.ISODateTime; 24 | 25 | public class PayeeAuthorityEncoder implements BaseProperties { 26 | 27 | public static JSONObjectWriter encode(String payeeAuthorityUrl, 28 | String providerAuthorityUrl, 29 | PayeeCoreProperties payeeCoreProperties, 30 | GregorianCalendar expires, 31 | ServerAsymKeySigner issuerSigner) { 32 | return payeeCoreProperties.writeObject(Messages.PAYEE_AUTHORITY.createBaseMessage() 33 | .setString(PAYEE_AUTHORITY_URL_JSON, payeeAuthorityUrl) 34 | .setString(PROVIDER_AUTHORITY_URL_JSON, providerAuthorityUrl)) 35 | .setDateTime(TIME_STAMP_JSON, new GregorianCalendar(), ISODateTime.UTC_NO_SUBSECONDS) 36 | .setDateTime(BaseProperties.EXPIRES_JSON, expires, ISODateTime.UTC_NO_SUBSECONDS) 37 | .setSignature(ISSUER_SIGNATURE_JSON, issuerSigner); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/BalanceResponseDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import java.math.BigDecimal; 20 | 21 | import java.util.GregorianCalendar; 22 | 23 | import org.webpki.json.JSONObjectReader; 24 | 25 | import org.webpki.util.ISODateTime; 26 | 27 | 28 | public class BalanceResponseDecoder implements BaseProperties { 29 | 30 | public BalanceResponseDecoder(JSONObjectReader rd) { 31 | Messages.BALANCE_RESPONSE.parseBaseMessage(rd); 32 | accountId = rd.getString(ACCOUNT_ID_JSON); 33 | currency = Currencies.valueOf(rd.getString(CURRENCY_JSON)); 34 | amount = rd.getMoney(AMOUNT_JSON, currency.getDecimals()); 35 | timeStamp = rd.getDateTime(TIME_STAMP_JSON, ISODateTime.COMPLETE); 36 | rd.checkForUnread(); 37 | } 38 | 39 | String accountId; 40 | public String getAccountId() { 41 | return accountId; 42 | } 43 | 44 | BigDecimal amount; 45 | public BigDecimal getAmount() { 46 | return amount; 47 | } 48 | 49 | Currencies currency; 50 | public Currencies getCurrency() { 51 | return currency; 52 | } 53 | 54 | GregorianCalendar timeStamp; 55 | public GregorianCalendar getTimeStamp() { 56 | return timeStamp; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /nodejs-acquirer/config/trustanchors/paymentnetworks.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIFPjCCAyagAwIBAgIBATANBgkqhkiG9w0BAQ0FADAwMQswCQYDVQQGEwJVUzEhMB8GA1UEAxMY 3 | UGF5bWVudCBOZXR3b3JrIFJvb3QgQ0ExMB4XDTEwMDcxMDEwMDAwMFoXDTMwMDcxMDA5NTk1OVow 4 | MDELMAkGA1UEBhMCVVMxITAfBgNVBAMTGFBheW1lbnQgTmV0d29yayBSb290IENBMTCCAiIwDQYJ 5 | KoZIhvcNAQEBBQADggIPADCCAgoCggIBAKjhd3W4NyzVFDgsb5LaAXe35e7m04kCbFciL1CNskhC 6 | aUxQxNap1/k7dYck/8TyEU9LwqVYTNv4blCemJ/03gKR+pA/zKKYKfFtkemJxckP3/+zj3LD8jDN 7 | GDS4yoTDwhVSRQg6TnDqd1aLtQwsUe6IsDtVuLKTSWmd3nUzDpO2lvgHtUObU6bygBebCzVonjUs 8 | V/ZwDMoWkId+iD8nUjIzIo8lFZ58jcLPd03Zk4xBRAC6IPtYQKgMi4GCwuWO6zZ5YE5miISEdMCS 9 | 0D+Qy190gh7RQ3cs8hdp56FuansFdRGlO2SyzRC/s67QmzHWhZrlcIpibJtmONogmp0lILEwXH7M 10 | 5vXfh+AtGBLMPHjzvVKrrH55watIA/Wicar5iusMML+o0vIzb+WdTjKsvodSPVPOmZlTLLqkEwRo 11 | NBzLKMpzyycYBvhFerZJWXixGovasvW6AYAp2OlbmDuyEDlwHzhoGISyPcewfgfede8f1yeaYp1Z 12 | xPSzAeM+K4hSGbHyBjwMcP466Y2s3gYwoG98AyEXEyiQ4tNYOx1oNqQDHJMhdVhehI/6jd5AIhxB 13 | OcoDJZ+fcQYWA6STbOdIRcfX4RyOHesfQS2AdERl44IlINCqwWsSmfdVVJV2ciKZjsp3xWVYipCp 14 | K53YdewxtztRwQUSxguv05/bJTCTSisZAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0P 15 | AQH/BAQDAgEGMB0GA1UdDgQWBBQfAltR1CIQ1HHN72IWAJ0xl5zOTDAfBgNVHSMEGDAWgBQfAltR 16 | 1CIQ1HHN72IWAJ0xl5zOTDANBgkqhkiG9w0BAQ0FAAOCAgEATQssVqytC1n1N4j4MGOBUXaxx3V2 17 | +uqtfWF2kyXmdENgc834UYWxtvU9deCnfgN2S12NfwIoet53rh5gFGKtDqieDNTQ0cGp0pB23soC 18 | wEL6CaKaTMOW1TtZGaPymSzNOAPHHlIbgUcHGpSNbmYSgWbmvkuVC1P3hSawc5NbsevQZWtVGOwD 19 | q+5XHtlOTgpuvZ7/ceXHEy42waUpaHknyQ1vDKXP9mkutU6pJI1EapdbGyScRoorF9/DwjH5BDR4 20 | fhyR1APqyqpIkSoUYp1Bn97PE+Foq3YWpBPTRbFtR+3I59Qtl4MI7oDuA50+Q+IJ2ICzvi8hixpu 21 | yw/WeMS6MOC3mXg/zpYaqJWrPy38baYQZZ7yRotSOJqEJ/N15TGZvhpt1yVolGUzrnuu7ChcRcl3 22 | jdCNX1/tYJfh0chGPibO0CI/rKC5XmuJld2K6TXaHfUWnozjPdnz+IcJRdN7UKhSW8IgtiXNBZ/M 23 | oUrmxYHt8roC3Lbh+cGOonFpL/d2/RNu8lidW263f+VCbcIhCxJv1VXRetXqKfcQZqGgKVnCt66b 24 | 8yOC87/ys//7qDE5qGDkhe0gRjgitJIBdLdHxdDMsjCqQe5h6AW1lESv6cvrUYiO/xwUFTirMXz4 25 | xi2Pmt0jiiPhIkIu278su87DhSs0O5lTLRbbkVJihQcxTmc= 26 | -----END CERTIFICATE----- 27 | 28 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/MobileProxyParameters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2018 WebPKI.org (httpwebpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * httpswww.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | public interface MobileProxyParameters { 20 | 21 | // A proxy URI looks like: SCHEME + '://' + HOST + data 22 | 23 | String HOST_SATURN = "saturn"; 24 | String HOST_KEYGEN2 = "keygen2"; 25 | String HOST_MOBILEID = "mobileid"; 26 | 27 | String SCHEME_QRCODE = "qrcode"; 28 | String SCHEME_W3CPAY = "w3cpay"; 29 | String SCHEME_URLHANDLER = "intent"; 30 | 31 | String ANDROID_PACKAGE_NAME = "org.webpki.mobile.android"; 32 | 33 | String W3CPAY_GOTO_URL = "goto"; // Object.details.W3CPAY_GOTO_URL 34 | 35 | // Proxy URL Parameters 36 | String PUP_COOKIE = "cookie"; // Optional 37 | String PUP_INIT_URL = "init"; 38 | String PUP_MAIN_URL = "url"; 39 | String PUP_CANCEL_URL = "cncl"; 40 | String PUP_VERSIONS = "ver"; // Required "App" versions x.yy-x.yy 41 | 42 | // QR code invocations may present a local result screen or 43 | // may also start a browser at a normal URL. It is up to 44 | // each service to decide how to deal with this. 45 | String QRCODE_LOCAL_SUCCESS_URL = SCHEME_QRCODE + "://success"; 46 | String QRCODE_LOCAL_CANCEL_URL = SCHEME_QRCODE + "://cancel"; 47 | } 48 | -------------------------------------------------------------------------------- /resources/credentials/merchants-acquirer.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "localPayeeId": "1077342", 3 | "commonName": "Space Shop", 4 | "homePage": "https://spaceshop.com", 5 | "logotypeUrl": "https://spaceshop.com/images/spaceshop-logo.svg", 6 | "payeeAccounts": [{ 7 | "@context": "https://sepa.payments.org/saturn/v3#account", 8 | "iban": "FR7630004003200001019471656", 9 | "nonce": "nZFwxLP0TvFXD2xPKzRTIGevgLjpiMw2BP86hszj5x4" 10 | }], 11 | "signatureParameters": [{ 12 | "algorithm": "ES256", 13 | "publicKey": { 14 | "kty": "EC", 15 | "crv": "P-256", 16 | "x": "t4DjDTgLk6PIAX9bn46JybFgWOv0npE2iEQs0P2kzjs", 17 | "y": "YcrZeO3SQZgxAyRI8myWlapaNHOBqGL5Pqi5xDXiNt8" 18 | } 19 | }] 20 | },{ 21 | "localPayeeId": "8888", 22 | "commonName": "Planet Gas", 23 | "homePage": "https://planetgas.com", 24 | "logotypeUrl": "https://planetgas.com/images/planetgas-logo.png", 25 | "payeeAccounts": [{ 26 | "@context": "https://sepa.payments.org/saturn/v3#account", 27 | "iban": "FR7630002111110020050047168", 28 | "nonce": "Fh2rl0LGTtvaomOuhuRNo9Drz9o0--WXV2ITvdVQFRY" 29 | }], 30 | "signatureParameters": [{ 31 | "algorithm": "ES256", 32 | "publicKey": { 33 | "kty": "EC", 34 | "crv": "P-256", 35 | "x": "_6soiu94ku4oBHe9O4yS7kIaVIgSiL_RLabSPOAcYPI", 36 | "y": "N5lB1JwdVw32WVaW-AriD2ajuWYuHFoCvRX2RxpVlHw" 37 | } 38 | }] 39 | },{ 40 | "localPayeeId": "100000", 41 | "commonName": "Buyerzone", 42 | "homePage": "https://buyerzone.com", 43 | "logotypeUrl": "https://buyerzone.com/images/buyerzone-logo.svg", 44 | "payeeAccounts": [{ 45 | "@context": "https://sepa.payments.org/saturn/v3#account", 46 | "iban": "FR7630004003200001019100000" 47 | }], 48 | "signatureParameters": [{ 49 | "algorithm": "ES256", 50 | "publicKey": { 51 | "kty": "EC", 52 | "crv": "P-256", 53 | "x": "0BRaPoeMzqwSIl3pI00o6e4v-GG7XHzi7FsScITnnTM", 54 | "y": "Dn2OjoWV7KkivxbNp_ABrslnhxUH-9fl38JgE7_Q9Q8" 55 | } 56 | }] 57 | }] 58 | -------------------------------------------------------------------------------- /w3cpay/src/org/webpki/saturn/w3c/manifest/PaymentManifestServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.w3c.manifest; 18 | 19 | import java.io.IOException; 20 | 21 | import java.util.logging.Logger; 22 | 23 | import javax.servlet.ServletException; 24 | 25 | import javax.servlet.http.HttpServlet; 26 | import javax.servlet.http.HttpServletRequest; 27 | import javax.servlet.http.HttpServletResponse; 28 | 29 | public class PaymentManifestServlet extends HttpServlet { 30 | 31 | private static final long serialVersionUID = 1L; 32 | 33 | static Logger logger = Logger.getLogger(PaymentManifestServlet.class.getCanonicalName()); 34 | 35 | @Override 36 | public void doGet(HttpServletRequest request, HttpServletResponse response) 37 | throws IOException, ServletException { 38 | if (PaymentAppMethodService.logging) logger.info("GET"); 39 | response.setContentType("application/json"); 40 | response.getOutputStream().write(PaymentAppMethodService.paymentManifest); 41 | } 42 | 43 | @Override 44 | public void doHead(HttpServletRequest request, HttpServletResponse response) 45 | throws IOException, ServletException { 46 | if (PaymentAppMethodService.logging) logger.info("HEAD"); 47 | response.setHeader("Link", PaymentAppMethodService.linkArgument); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /interbanking/src/io/interbanking/IBCommon.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package io.interbanking; 18 | 19 | import java.io.IOException; 20 | 21 | import org.webpki.json.JSONDecoderCache; 22 | import org.webpki.json.JSONObjectReader; 23 | 24 | // Note that this class is deliberately not aligned with Saturn because 25 | // it should be possible using existing payment rails. 26 | 27 | class IBCommon { 28 | 29 | static final String TIME_STAMP_JSON = "timeStamp"; // Everywhere 30 | 31 | static final String TEST_MODE_JSON = "testMode"; // Test mode = no real money involved 32 | 33 | static final String INTERBANKING_CONTEXT_URI = "https://webpki.github.io/interbanking.io"; 34 | 35 | void check(JSONObjectReader rd, String expectedQualifier) throws IOException { 36 | String context = rd.getString(JSONDecoderCache.CONTEXT_JSON); 37 | if (!context.equals(INTERBANKING_CONTEXT_URI)) { 38 | throw new IOException("Wrong '" + JSONDecoderCache.CONTEXT_JSON + "' :" + context); 39 | } 40 | String qualifier = rd.getString(JSONDecoderCache.QUALIFIER_JSON); 41 | if (!qualifier.equals(expectedQualifier)) { 42 | throw new IOException("Wrong '" + JSONDecoderCache.QUALIFIER_JSON + "' :" + qualifier); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Saturn is great](https://cyberphone.github.io/doc/saturn/github-saturnlogo.svg) 2 | 3 | ## A (potentially) Universal Payment Authorization System 4 | 5 | https://cyberphone.github.io/doc/saturn 6 | 7 | ## Testing Saturn locally using Tomcat 8.5 8 | 9 | Prerequisites: JDK 8 and ANT 10 | 11 | Download/unzip the Saturn ZIP or clone the GIT repository to any free directory. 12 | 13 | Define an environment variable CATALINA_HOME = TOMCAT-INSTALL-DIRECTORY 14 | 15 | In TOMCAT-INSTALL-DIRECTORY/conf/server.xml define: 16 | ```xml 17 | 18 | 20 | 21 | 24 | 25 | 26 | ``` 27 | Perform the following ANT commands: 28 | 29 | ``` 30 | $ ant -f SATURN-INSTALL-DIRECTORY/merchant/build.xml tomcat 31 | $ ant -f SATURN-INSTALL-DIRECTORY/acquirer/build.xml tomcat 32 | $ ant -f SATURN-INSTALL-DIRECTORY/keyprovider/build.xml tomcat 33 | $ ant -f SATURN-INSTALL-DIRECTORY/bank/build.xml both 34 | ``` 35 | Update the cacerts file used by the JDK installation: 36 | 37 | ``` 38 | $ keytool -importcert -keystore JDK-INSTALL-DIRECTORY/jre/lib/security/cacerts -storepass changeit -file SATURN-INSTALL-DIRECTORY/tls-certificates/root/tlsroot.cer -alias webpkitestroot 39 | ``` 40 | Now Tomcat can be started. There should be no errors in the log. 41 | 42 | A browser can be used to invoke the "mechant" application at: http://localhost:8080/webpay-merchant 43 | 44 | Using HTTPS requires installation of SATURN-INSTALL-DIRECTORY/tls-certificates/root/tlsroot.cer in the browser's trust store. Then you would browse to the address: https://localhost:8442/webpay-merchant 45 | -------------------------------------------------------------------------------- /resources/common.properties: -------------------------------------------------------------------------------- 1 | @webpki-libext.jar=webpki.org-libext-1.0.0.jar 2 | @webpki-webutil.jar=webpki.org-webutil-1.0.0.jar 3 | 4 | @w2nb.webwallet=org.webpki.webpay.wallet3 5 | 6 | @logotype.dir=../resources/logotype 7 | @webpki-logotype.file=webpki-logo.svg 8 | @saturn-logotype.file=saturnlogo.svg 9 | 10 | @common.src.dir=../resources/common 11 | @account-types.src.dir=../account-types/src 12 | @interbanking.src.dir=../interbanking/src 13 | @reference.lib.dir=../../openkeystore/resources/third-party-jars 14 | @common.lib.dir=../resources/common.lib 15 | @webpki.lib.dir=../../openkeystore/library/dist 16 | @cardimage.dir=../resources/card-images 17 | @credentials.dir=../resources/credentials 18 | @credentials_store=sks.serialized 19 | 20 | @qr.lib.dir=../resources/qr.lib 21 | 22 | @keypassword=foo123 23 | @keyfilext=.p12 24 | 25 | @key.dir=../resources/keys 26 | 27 | @banknetworkroot=bank-network-rootca 28 | @banknetworksubca=bank-network-subca 29 | 30 | @hostingattestationkey=hosting-key-ec 31 | @acquirersignaturekey=acquirer-eecert 32 | @acquirerencryptionkey_rsa=acquirer-enc-key-rsa 33 | @acquirerencryptionkey_ec=acquirer-enc-key-ec 34 | @acquirernetworkroot=acquirer-network-rootca 35 | @acquirernetworksubca=acquirer-network-subca 36 | 37 | # local web app path 38 | @hostingpath=saturn-hosting 39 | @acquirerpath=saturn-acquirer 40 | @payerbankpath=saturn-payerbank 41 | @payeebankpath=saturn-payeebank 42 | @keyprovpath=saturn-keyprovider 43 | @merchantpath=saturn 44 | 45 | @inhouse-host=https://192.168.1.124:8442 46 | 47 | @hostinghost=${@inhouse-host} 48 | @acquirerhost=${@inhouse-host} 49 | @payerbankhost=${@inhouse-host} 50 | @payeebankhost=${@inhouse-host} 51 | @keyprovhost=${@inhouse-host} 52 | @merchanthost=${@inhouse-host} 53 | 54 | @wellknownurl=saturn-authority 55 | 56 | @kg2kmkey_ec=kg2-km-key-ec 57 | @kg2_tls_cert_file=c:/github.repositories/saturn/tls-certificates/server/localhost-and-192.168.1.124.cert.pem 58 | 59 | # uncomment the next line if you want to deploy self-contained WAR files 60 | #@include.webpki.in.war= 61 | 62 | -------------------------------------------------------------------------------- /w3cpay/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | For payment manifest creation 9 | host_path 10 | @host-path@ 11 | 12 | 13 | 14 | Logging 15 | logging 16 | @logging@ 17 | 18 | 19 | 20 | org.webpki.saturn.w3c.manifest.PaymentAppMethodService 21 | 22 | 23 | 24 | PaymentAppMethodServlet 25 | org.webpki.saturn.w3c.manifest.PaymentAppMethodServlet 26 | 27 | 28 | 29 | PaymentManifestServlet 30 | org.webpki.saturn.w3c.manifest.PaymentManifestServlet 31 | 32 | 33 | 34 | PaymentAppMethodServlet 35 | /method 36 | 37 | 38 | 39 | PaymentManifestServlet 40 | /payment-manifest.json 41 | 42 | 43 | 44 | 45 | The app 46 | /* 47 | 48 | 49 | CONFIDENTIAL 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/RefundResponseEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import java.util.GregorianCalendar; 20 | 21 | import org.webpki.json.JSONObjectWriter; 22 | 23 | import org.webpki.util.ISODateTime; 24 | 25 | public class RefundResponseEncoder implements BaseProperties { 26 | 27 | public static JSONObjectWriter encode(RefundRequestDecoder refundRequest, 28 | String referenceId, 29 | String optionalLogData, 30 | ServerX509Signer signer) { 31 | return Messages.REFUND_RESPONSE.createBaseMessage() 32 | .setDynamic((wr) -> optionalLogData == null ? 33 | wr : wr.setString(LOG_DATA_JSON, optionalLogData)) 34 | .setString(REFERENCE_ID_JSON, referenceId) 35 | .setDateTime(TIME_STAMP_JSON, new GregorianCalendar(), ISODateTime.UTC_NO_SUBSECONDS) 36 | .setDynamic((wr) -> Software.encode(wr, 37 | TransactionResponseEncoder.SOFTWARE_NAME, 38 | TransactionResponseEncoder.SOFTWARE_VERSION)) 39 | .setObject(Messages.REFUND_REQUEST.lowerCamelCase(), refundRequest.root) 40 | .setSignature(AUTHORIZATION_SIGNATURE_JSON, signer); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /nodejs-common/TransactionResponse.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | 'use strict'; 19 | 20 | // Saturn "TransactionResponse" object 21 | 22 | const JsonUtil = require('webpki.org').JsonUtil; 23 | 24 | const BaseProperties = require('./BaseProperties'); 25 | const Messages = require('./Messages'); 26 | const Software = require('./Software'); 27 | 28 | const SOFTWARE_NAME = "WebPKI.org - Acquirer(js)"; 29 | const SOFTWARE_VERSION = "1.00"; 30 | 31 | function TransactionResponse() { 32 | } 33 | 34 | TransactionResponse.encode = function(transactionRequest, 35 | referenceId, 36 | optionalLogData, 37 | signer) { 38 | return Messages.createBaseMessage(Messages.TRANSACTION_RESPONSE) 39 | .setString(BaseProperties.REFERENCE_ID_JSON, referenceId) 40 | .setDynamic((wr) => { 41 | return optionalLogData == null ? wr : wr.setString(BaseProperties.LOG_DATA_JSON, optionalLogData) 42 | }) 43 | .setDateTime(BaseProperties.TIME_STAMP_JSON, new Date()) 44 | .setObject(BaseProperties.SOFTWARE_JSON, Software.encode(SOFTWARE_NAME, SOFTWARE_VERSION)) 45 | .setObject(Messages.getLowerCamelCase(Messages.TRANSACTION_REQUEST), transactionRequest.root) 46 | .setSignature(signer, BaseProperties.AUTHORIZATION_SIGNATURE_JSON); 47 | }; 48 | 49 | module.exports = TransactionResponse; 50 | 51 | -------------------------------------------------------------------------------- /account-types/src/com/supercard/SupercardAccountDataEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package com.supercard; 18 | 19 | import java.io.IOException; 20 | 21 | import java.util.GregorianCalendar; 22 | 23 | import org.webpki.saturn.common.AccountDataEncoder; 24 | import org.webpki.saturn.common.BaseProperties; 25 | 26 | import org.webpki.util.ISODateTime; 27 | 28 | public final class SupercardAccountDataEncoder extends AccountDataEncoder { 29 | 30 | SupercardAccountDataEncoder() { 31 | } 32 | 33 | public SupercardAccountDataEncoder(String cardNumber, 34 | String cardHolder, 35 | GregorianCalendar expirationDate) throws IOException { 36 | setInternal(SupercardAccountDataDecoder.CONTEXT) 37 | .setString(SupercardAccountDataDecoder.CARD_NUMBER_JSON, cardNumber) 38 | .setString(SupercardAccountDataDecoder.CARD_HOLDER_JSON, cardHolder) 39 | .setDateTime(BaseProperties.EXPIRES_JSON, expirationDate, ISODateTime.UTC_NO_SUBSECONDS); 40 | } 41 | 42 | @Override 43 | public String getPartialAccountIdentifier(String cardNumber) { 44 | StringBuilder accountReference = new StringBuilder(); 45 | int q = cardNumber.length() - 4; 46 | for (char c : cardNumber.toCharArray()) { 47 | accountReference.append((--q < 0) ? c : '*'); 48 | } 49 | return accountReference.toString(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGAttributes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | public enum SVGAttributes { 20 | X ("x"), 21 | Y ("y"), 22 | X1 ("x1"), 23 | X2 ("x2"), 24 | Y1 ("y1"), 25 | Y2 ("y2"), 26 | RX ("rx"), 27 | RY ("ry"), 28 | DY ("dy"), 29 | CX ("cx"), 30 | CY ("cy"), 31 | R ("r"), 32 | D ("d"), 33 | STROKE_LINECAP ("stroke-linecap"), 34 | STROKE_WIDTH ("stroke-width"), 35 | STROKE_DASHES ("stroke-dasharray"), 36 | STROKE_OPACITY ("stroke-opacity"), 37 | WIDTH ("width"), 38 | HEIGHT ("height"), 39 | POINTS ("points"), 40 | FILTER ("filter"), 41 | FILL_COLOR ("fill"), 42 | FILL_OPACITY ("fill-opacity"), 43 | STROKE_COLOR ("stroke"), 44 | FONT_FAMILY ("font-family"), 45 | FONT_SIZE ("font-size"), 46 | FONT_WEIGHT ("font-weight"), 47 | LETTER_SPACING ("letter-spacing"), 48 | TRANSFORM ("transform"), 49 | TEXT_ANCHOR ("text-anchor"); 50 | 51 | String svgNotation; 52 | 53 | SVGAttributes(String svgNotation) { 54 | this.svgNotation = svgNotation; 55 | } 56 | 57 | @Override 58 | public String toString() { 59 | return svgNotation; 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/HostingProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | import java.security.PublicKey; 20 | 21 | import org.webpki.json.JSONObjectReader; 22 | import org.webpki.json.JSONObjectWriter; 23 | 24 | public class HostingProvider implements BaseProperties { 25 | 26 | public HostingProvider(JSONObjectReader rd) { 27 | homePage = rd.getString(HOME_PAGE_JSON); 28 | hostingUrl = rd.getString(HOSTING_URL_JSON); 29 | publicKey = rd.getPublicKey(); 30 | } 31 | 32 | public HostingProvider(String homePage, 33 | String hostingUrl, 34 | PublicKey publicKey) { 35 | this.homePage = homePage; 36 | this.hostingUrl = hostingUrl; 37 | this.publicKey = publicKey; 38 | } 39 | 40 | PublicKey publicKey; 41 | public PublicKey getPublicKey() { 42 | return publicKey; 43 | } 44 | 45 | String homePage; 46 | public String getHomePage() { 47 | return homePage; 48 | } 49 | 50 | String hostingUrl; 51 | public String getHostingUrl() { 52 | return hostingUrl; 53 | } 54 | 55 | public JSONObjectWriter writeObject() { 56 | return new JSONObjectWriter() 57 | .setString(HOME_PAGE_JSON, homePage) 58 | .setString(HOSTING_URL_JSON, hostingUrl) 59 | .setPublicKey(publicKey); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /resources/common/org/webpki/saturn/common/NonDirectPaymentTypes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.saturn.common; 18 | 19 | /* This is a complex issue and the solutions here are preliminary 20 | * but there are basically two kinds of non-direct payments: 21 | * 22 | * 1. Single payment where the specified amount is reserved and thus secured. 23 | * In the case the amount to pay is above the one specified, like when a 24 | * hotel guest puts additional items on the bill, the underlying payment 25 | * scheme must support that. 26 | * 27 | * 2. Recurring payments that are not guaranteed to succeed since the payer may 28 | * not have enough money to fulfill a request. What will happen in the case 29 | * of failure depends on the service the payment is associated with. For 30 | * e-commerce it would simply be that the order is rejected while electricity 31 | * providers may (presumably after a warning), turn off the supply. 32 | * 33 | * Recurring payments is an optional feature requiring support from the 34 | * underlying payment scheme to function. 35 | * 36 | * Note: Saturn is not a payment scheme, it only authorizes payment operations! 37 | * 38 | */ 39 | public enum NonDirectPaymentTypes { 40 | 41 | RESERVATION, // Single shot payment to be activated later 42 | 43 | RECURRING; // Auto transactions, terminated by a zero-amount request 44 | // or end of engagement period 45 | } 46 | -------------------------------------------------------------------------------- /resources/src/org/webpki/tools/svg/SVGDocument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 WebPKI.org (http://webpki.org). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.webpki.tools.svg; 18 | 19 | import java.util.ArrayList; 20 | 21 | public abstract class SVGDocument { 22 | 23 | static ArrayList svgObjects = new ArrayList<>(); 24 | 25 | double currentMaxX; 26 | double currentMaxY; 27 | 28 | static double marginX; 29 | static double marginY; 30 | 31 | static boolean linksUsed; 32 | 33 | protected SVGDocument(double marginX, double marginY) { 34 | SVGDocument.marginX = marginX; 35 | SVGDocument.marginY = marginY; 36 | } 37 | 38 | public abstract void generate(); 39 | 40 | public SVGObject add(SVGObject svgObject) { 41 | svgObjects.add(svgObject); 42 | return svgObject; 43 | } 44 | 45 | public SVGAnchor createDocumentAnchor(double x,double y, SVGAnchor.ALIGNMENT alignment) { 46 | return new SVGAnchor(new SVGDoubleValue(x), new SVGDoubleValue(y), alignment); 47 | } 48 | 49 | void findLargestSize(SVGObject svgObject) { 50 | double maxX = svgObject.getMaxX(); 51 | if (maxX > currentMaxX) { 52 | currentMaxX = maxX; 53 | } 54 | double maxY = svgObject.getMaxY(); 55 | if (maxY > currentMaxY) { 56 | currentMaxY = maxY; 57 | } 58 | } 59 | 60 | public String getFilters() { 61 | return ""; 62 | } 63 | 64 | public boolean useViewBox() { 65 | return false; 66 | } 67 | } 68 | --------------------------------------------------------------------------------