mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-12 10:15:52 +00:00
Extract getDisplayNameFromCertificate() into new X509Utils class. Also joins PkiVerificationData.name and .orgName into one .displayName. Adds tests using client/smime certificates of mine.
This commit is contained in:
parent
e640d1eec3
commit
e7eec49671
@ -394,9 +394,7 @@ public class PaymentSession {
|
|||||||
*/
|
*/
|
||||||
public static class PkiVerificationData {
|
public static class PkiVerificationData {
|
||||||
/** Display name of the payment requestor, could be a domain name, email address, legal name, etc */
|
/** Display name of the payment requestor, could be a domain name, email address, legal name, etc */
|
||||||
public final String name;
|
public final String displayName;
|
||||||
/** The "org" part of the payment requestors ID. */
|
|
||||||
public final String orgName;
|
|
||||||
/** SSL public key that was used to sign. */
|
/** SSL public key that was used to sign. */
|
||||||
public final PublicKey merchantSigningKey;
|
public final PublicKey merchantSigningKey;
|
||||||
/** Object representing the CA that verified the merchant's ID */
|
/** Object representing the CA that verified the merchant's ID */
|
||||||
@ -404,34 +402,15 @@ public class PaymentSession {
|
|||||||
/** String representing the display name of the CA that verified the merchant's ID */
|
/** String representing the display name of the CA that verified the merchant's ID */
|
||||||
public final String rootAuthorityName;
|
public final String rootAuthorityName;
|
||||||
|
|
||||||
private PkiVerificationData(@Nullable String name, @Nullable String orgName, PublicKey merchantSigningKey,
|
private PkiVerificationData(@Nullable String displayName, PublicKey merchantSigningKey,
|
||||||
TrustAnchor rootAuthority) throws PaymentRequestException.PkiVerificationException {
|
TrustAnchor rootAuthority) throws PaymentRequestException.PkiVerificationException {
|
||||||
this.name = name;
|
try {
|
||||||
this.orgName = orgName;
|
this.displayName = displayName;
|
||||||
this.merchantSigningKey = merchantSigningKey;
|
this.merchantSigningKey = merchantSigningKey;
|
||||||
this.rootAuthority = rootAuthority;
|
this.rootAuthority = rootAuthority;
|
||||||
this.rootAuthorityName = getNameFromCert(rootAuthority);
|
this.rootAuthorityName = X509Utils.getDisplayNameFromCertificate(rootAuthority.getTrustedCert());
|
||||||
}
|
} catch (CertificateParsingException x) {
|
||||||
|
throw new PaymentRequestException.PkiVerificationException(x);
|
||||||
private @Nullable String getNameFromCert(TrustAnchor rootAuthority) throws PaymentRequestException.PkiVerificationException {
|
|
||||||
org.spongycastle.asn1.x500.X500Name name = new X500Name(rootAuthority.getTrustedCert().getSubjectX500Principal().getName());
|
|
||||||
String commonName = null, org = null, location = null, country = null;
|
|
||||||
for (RDN rdn : name.getRDNs()) {
|
|
||||||
AttributeTypeAndValue pair = rdn.getFirst();
|
|
||||||
String val = ((ASN1String)pair.getValue()).getString();
|
|
||||||
if (pair.getType().equals(RFC4519Style.cn))
|
|
||||||
commonName = val;
|
|
||||||
else if (pair.getType().equals(RFC4519Style.o))
|
|
||||||
org = val;
|
|
||||||
else if (pair.getType().equals(RFC4519Style.l))
|
|
||||||
location = val;
|
|
||||||
else if (pair.getType().equals(RFC4519Style.c))
|
|
||||||
country = val;
|
|
||||||
}
|
|
||||||
if (org != null) {
|
|
||||||
return Joiner.on(", ").skipNulls().join(org, location, country);
|
|
||||||
} else {
|
|
||||||
return commonName;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -493,33 +472,11 @@ public class PaymentSession {
|
|||||||
|
|
||||||
// Signature verifies, get the names from the identity we just verified for presentation to the user.
|
// Signature verifies, get the names from the identity we just verified for presentation to the user.
|
||||||
final X509Certificate cert = certs.get(0);
|
final X509Certificate cert = certs.get(0);
|
||||||
X500Principal principal = cert.getSubjectX500Principal();
|
String displayName = X509Utils.getDisplayNameFromCertificate(cert);
|
||||||
// At this point the Java crypto API falls flat on its face and dies - there's no clean way to get the
|
if (displayName == null)
|
||||||
// different parts of the certificate name except for parsing the string. That's hard because of various
|
throw new PaymentRequestException.PkiVerificationException("Could not extract name from certificate");
|
||||||
// custom escaping rules and the usual crap. So, use Bouncy Castle to re-parse the string into binary form
|
|
||||||
// again and then look for the names we want. Fail!
|
|
||||||
org.spongycastle.asn1.x500.X500Name name = new X500Name(principal.getName());
|
|
||||||
String entityName = null, orgName = null;
|
|
||||||
for (RDN rdn : name.getRDNs()) {
|
|
||||||
AttributeTypeAndValue pair = rdn.getFirst();
|
|
||||||
if (pair.getType().equals(RFC4519Style.cn))
|
|
||||||
entityName = ((ASN1String)pair.getValue()).getString();
|
|
||||||
else if (pair.getType().equals(RFC4519Style.o))
|
|
||||||
orgName = ((ASN1String)pair.getValue()).getString();
|
|
||||||
}
|
|
||||||
if (entityName == null && orgName == null) {
|
|
||||||
// This cert might not be an SSL cert. Just grab the first "subject alt name" if present, e.g. for
|
|
||||||
// S/MIME certs.
|
|
||||||
final Iterator<List<?>> it = cert.getSubjectAlternativeNames().iterator();
|
|
||||||
List<?> list;
|
|
||||||
// email addresses have a type code of one.
|
|
||||||
if (it.hasNext() && (list = it.next()) != null && (Integer) list.get(0) == 1)
|
|
||||||
entityName = (String) list.get(1);
|
|
||||||
if (entityName == null)
|
|
||||||
throw new PaymentRequestException.PkiVerificationException("Could not extract name from certificate");
|
|
||||||
}
|
|
||||||
// Everything is peachy. Return some useful data to the caller.
|
// Everything is peachy. Return some useful data to the caller.
|
||||||
PkiVerificationData data = new PkiVerificationData(entityName, orgName, publicKey, result.getTrustAnchor());
|
PkiVerificationData data = new PkiVerificationData(displayName, publicKey, result.getTrustAnchor());
|
||||||
// Cache the result so we don't have to re-verify if this method is called again.
|
// Cache the result so we don't have to re-verify if this method is called again.
|
||||||
pkiVerificationData = data;
|
pkiVerificationData = data;
|
||||||
return data;
|
return data;
|
||||||
|
@ -0,0 +1,67 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 2014 Andreas Schildbach
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.google.bitcoin.protocols.payments;
|
||||||
|
|
||||||
|
import java.security.cert.CertificateParsingException;
|
||||||
|
import java.security.cert.X509Certificate;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import org.spongycastle.asn1.ASN1ObjectIdentifier;
|
||||||
|
import org.spongycastle.asn1.ASN1String;
|
||||||
|
import org.spongycastle.asn1.x500.AttributeTypeAndValue;
|
||||||
|
import org.spongycastle.asn1.x500.RDN;
|
||||||
|
import org.spongycastle.asn1.x500.X500Name;
|
||||||
|
import org.spongycastle.asn1.x500.style.RFC4519Style;
|
||||||
|
|
||||||
|
public class X509Utils {
|
||||||
|
|
||||||
|
public static @Nullable String getDisplayNameFromCertificate(@Nonnull X509Certificate certificate) throws CertificateParsingException {
|
||||||
|
X500Name name = new X500Name(certificate.getSubjectX500Principal().getName());
|
||||||
|
String commonName = null, org = null, location = null, country = null;
|
||||||
|
for (RDN rdn : name.getRDNs()) {
|
||||||
|
AttributeTypeAndValue pair = rdn.getFirst();
|
||||||
|
String val = ((ASN1String) pair.getValue()).getString();
|
||||||
|
ASN1ObjectIdentifier type = pair.getType();
|
||||||
|
if (type.equals(RFC4519Style.cn))
|
||||||
|
commonName = val;
|
||||||
|
else if (type.equals(RFC4519Style.o))
|
||||||
|
org = val;
|
||||||
|
else if (type.equals(RFC4519Style.l))
|
||||||
|
location = val;
|
||||||
|
else if (type.equals(RFC4519Style.c))
|
||||||
|
country = val;
|
||||||
|
}
|
||||||
|
final Collection<List<?>> subjectAlternativeNames = certificate.getSubjectAlternativeNames();
|
||||||
|
String altName = null;
|
||||||
|
if (subjectAlternativeNames != null)
|
||||||
|
for (final List<?> subjectAlternativeName : subjectAlternativeNames)
|
||||||
|
if ((Integer) subjectAlternativeName.get(0) == 1) // rfc822name
|
||||||
|
altName = (String) subjectAlternativeName.get(1);
|
||||||
|
|
||||||
|
if (org != null) {
|
||||||
|
return org;
|
||||||
|
} else if (commonName != null) {
|
||||||
|
return commonName;
|
||||||
|
} else {
|
||||||
|
return altName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -125,8 +125,8 @@ public class PaymentSessionTest {
|
|||||||
Protos.PaymentRequest paymentRequest = Protos.PaymentRequest.newBuilder().mergeFrom(in).build();
|
Protos.PaymentRequest paymentRequest = Protos.PaymentRequest.newBuilder().mergeFrom(in).build();
|
||||||
MockPaymentSession paymentSession = new MockPaymentSession(paymentRequest);
|
MockPaymentSession paymentSession = new MockPaymentSession(paymentRequest);
|
||||||
PaymentSession.PkiVerificationData pkiData = paymentSession.verifyPki();
|
PaymentSession.PkiVerificationData pkiData = paymentSession.verifyPki();
|
||||||
assertEquals("www.bitcoincore.org", pkiData.name);
|
assertEquals("www.bitcoincore.org", pkiData.displayName);
|
||||||
assertEquals("The USERTRUST Network, Salt Lake City, US", pkiData.rootAuthorityName);
|
assertEquals("The USERTRUST Network", pkiData.rootAuthorityName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Protos.PaymentRequest newSimplePaymentRequest() {
|
private Protos.PaymentRequest newSimplePaymentRequest() {
|
||||||
|
@ -0,0 +1,40 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 2014 Andreas Schildbach
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.google.bitcoin.protocols.payments;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
import java.security.cert.CertificateFactory;
|
||||||
|
import java.security.cert.X509Certificate;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class X509UtilsTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDisplayName() throws Exception {
|
||||||
|
CertificateFactory cf = CertificateFactory.getInstance("X.509");
|
||||||
|
|
||||||
|
X509Certificate clientCert = (X509Certificate) cf.generateCertificate(getClass().getResourceAsStream(
|
||||||
|
"startssl-client.crt"));
|
||||||
|
assertEquals("Andreas Schildbach", X509Utils.getDisplayNameFromCertificate(clientCert));
|
||||||
|
|
||||||
|
X509Certificate comodoCert = (X509Certificate) cf.generateCertificate(getClass().getResourceAsStream(
|
||||||
|
"comodo-smime.crt"));
|
||||||
|
assertEquals("comodo.com@schildbach.de", X509Utils.getDisplayNameFromCertificate(comodoCert));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIFMTCCBBmgAwIBAgIQV2O4gJQ5NHgn/PPvDsU1djANBgkqhkiG9w0BAQUFADCB
|
||||||
|
kzELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
|
||||||
|
A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxOTA3BgNV
|
||||||
|
BAMTMENPTU9ETyBDbGllbnQgQXV0aGVudGljYXRpb24gYW5kIFNlY3VyZSBFbWFp
|
||||||
|
bCBDQTAeFw0xNDAzMjkwMDAwMDBaFw0xNTAzMjkyMzU5NTlaMCkxJzAlBgkqhkiG
|
||||||
|
9w0BCQE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09NT0RPQ2xpZW50QXV0aGVudGljYXRp
|
||||||
|
b25hbmRTZWN1cmVFbWFpbENBLmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3Au
|
||||||
|
Y29tb2RvY2EuY29tMCMGA1UdEQQcMBqBGGNvbW9kby5jb21Ac2NoaWxkYmFjaC5k
|
||||||
|
ZTANBgkqhkiG9w0BAQUFAAOCAQEAMFhmP1Zy16m5L9gaGCDy847tJI3btBFFZMu/
|
||||||
|
MMqamC5515QayLfwf9K2nmu1W63nehEAKqNw+PR1xTYnhPT4fopw5zFndiNg0L5u
|
||||||
|
blEbRgSdQYBh1I2dkzzPRDRJig4LfxVzRzL66FbllLEiJ6oR/XgdsH+JFgyjhk3Y
|
||||||
|
uJt+29sXoZ+ZR29d7l07OikQGI0HWCmp/UiwBcQ4dcTrDB72JYLHyli+OTAkcu9I
|
||||||
|
rBpsIbWJq+7NjaQ/8CJjvQ2neTgDS1Dq5DzMqqRlhxQwRl4dhfCSCcF81Vf0as4S
|
||||||
|
vVDNR8vJ9puGlYyGVJHhQ6mEoFEIvpetS7E9ELHnybSC9ev8CA==
|
||||||
|
-----END CERTIFICATE-----
|
@ -0,0 +1,41 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIHPjCCBiagAwIBAgICH8wwDQYJKoZIhvcNAQEFBQAwgYwxCzAJBgNVBAYTAklM
|
||||||
|
MRYwFAYDVQQKEw1TdGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRh
|
||||||
|
bCBDZXJ0aWZpY2F0ZSBTaWduaW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAx
|
||||||
|
IFByaW1hcnkgSW50ZXJtZWRpYXRlIENsaWVudCBDQTAeFw0wODA2MjIyMzA4MTJa
|
||||||
|
Fw0wOTA2MjIyMzA4MTJaMIHEMQswCQYDVQQGEwJERTEPMA0GA1UECBMGQmF5ZXJu
|
||||||
|
MREwDwYDVQQHEwhNdWVuY2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WtFF2nrgFaoUmq2KxMnCD1gkQPQu01TqrDDwi
|
||||||
|
+dKFkh4tSGyj++BRCX4jpYgY7pDzh0Dtb261ovpzYB3e36mMO4AiLHby10VHir+k
|
||||||
|
AUI87JVffsgsKCEEEkywA//KcXqyVfgW3FgicNczCiwXdWCLJcnBAq8aundebdIH
|
||||||
|
hTFoWB/5BuRRCY2Je9XFR8vb1EUC5SuTL+wT0mGdx2T+qNskNtbZKyHLQSp9fCoD
|
||||||
|
yupR1THhr7iqF4zRI6r5r8tRuu8jr55NgN5ZA+LCisEJ7A==
|
||||||
|
-----END CERTIFICATE-----
|
@ -0,0 +1,40 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIHFDCCBfygAwIBAgIDAILwMA0GCSqGSIb3DQEBBQUAMIGMMQswCQYDVQQGEwJJ
|
||||||
|
TDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0
|
||||||
|
YWwgQ2VydGlmaWNhdGUgU2lnbmluZzE4MDYGA1UEAxMvU3RhcnRDb20gQ2xhc3Mg
|
||||||
|
MSBQcmltYXJ5IEludGVybWVkaWF0ZSBDbGllbnQgQ0EwHhcNMDkwNjA5MDAwMDAx
|
||||||
|
WhcNMTAwNjA5MjM1OTU5WjB2MR4wHAYDVQQKExVQZXJzb25hIE5vdCBWYWxpZGF0
|
||||||
|
ZWQxKTAnBgNVBAMTIFN0YXJ0Q29tIEZyZWUgQ2VydGlmaWNhdGUgTWVtYmVyMSkw
|
||||||
|
JwYJKoZIhvcNAQkBFhpzdGFydHNzbC5jb21Ac2NoaWxkYmFjaC5kZTCCASIwDQYJ
|
||||||
|
KoZIhvcNAQEBBQADggEPADCCAQoCggEBALA4dtu1FlTbhZQ+M9pyTFte40zotk3J
|
||||||
|
fqvEkDpWLBz3orN4SkMAUDOgTWdvNm+PakX2tEsZGD+nnWzkO3NI8x5ZhrOF3HwW
|
||||||
|
zeCaYzaDjhhRw4G1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,7 @@ public class PaymentProtocol {
|
|||||||
format("Bitcoin payment request, version %d%nDate: %s%n", version, session.getDate()));
|
format("Bitcoin payment request, version %d%nDate: %s%n", version, session.getDate()));
|
||||||
PaymentSession.PkiVerificationData pki = session.verifyPki();
|
PaymentSession.PkiVerificationData pki = session.verifyPki();
|
||||||
if (pki != null) {
|
if (pki != null) {
|
||||||
output.append(format("Signed by: %s%nIdentity verified by: %s%n", pki.name, pki.rootAuthorityName));
|
output.append(format("Signed by: %s%nIdentity verified by: %s%n", pki.displayName, pki.rootAuthorityName));
|
||||||
}
|
}
|
||||||
if (session.getPaymentDetails().hasExpires()) {
|
if (session.getPaymentDetails().hasExpires()) {
|
||||||
output.append(format("Expires: %s%n", new Date(session.getPaymentDetails().getExpires() * 1000)));
|
output.append(format("Expires: %s%n", new Date(session.getPaymentDetails().getExpires() * 1000)));
|
||||||
|
@ -536,9 +536,7 @@ public class WalletTool {
|
|||||||
System.out.println("Date: " + session.getDate());
|
System.out.println("Date: " + session.getDate());
|
||||||
System.out.println("Memo: " + session.getMemo());
|
System.out.println("Memo: " + session.getMemo());
|
||||||
if (session.pkiVerificationData != null) {
|
if (session.pkiVerificationData != null) {
|
||||||
System.out.println("Pki-Verified Name: " + session.pkiVerificationData.name);
|
System.out.println("Pki-Verified Name: " + session.pkiVerificationData.displayName);
|
||||||
if (session.pkiVerificationData.orgName != null)
|
|
||||||
System.out.println("Pki-Verified Org: " + session.pkiVerificationData.orgName);
|
|
||||||
System.out.println("PKI data verified by: " + session.pkiVerificationData.rootAuthorityName);
|
System.out.println("PKI data verified by: " + session.pkiVerificationData.rootAuthorityName);
|
||||||
}
|
}
|
||||||
final Wallet.SendRequest req = session.getSendRequest();
|
final Wallet.SendRequest req = session.getSendRequest();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user