eclipse-ee4j / eclipse-ee4j/metro-wsit
Replace usage of X509Certificate.getIssuerDN() with getIssuerX500Principal()
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 6
- Forks
- 21
- Avg merge
- 10h 2m
- Merged PRs (30d)
- 1
Description
X509Certificate.getIssuerDN() should not be used any more, X509Certificate.getIssuerX500Principal() should be used instead, see:
[http://docs.oracle.com/javase/7/docs/api/java/security/cert/X509Certificate.html#getIssuerDN%28%29](http://docs.oracle.com/javase/7/docs/api/java/security/cert/X509Certificate.html#getIssuerDN%28%29)
Some JCE provider like Bouncy Castle return a wrongly formated String there, because it is not specified.
The return value of "xCert.getIssuerDN().getName()" on a X509Certificate is not specified, but metro assumes that it is a string formated accordingly to RFC 4514 section 2.1, because [http://www.ws-i.org/Profiles/BasicSecurityProfile-1.1.html](http://www.ws-i.org/Profiles/BasicSecurityProfile-1.1.html) says so.
When replacing this call with getIssuerX500Principal() Bouncy Castle returns the correctly formated string.
The main Problem I see is in ws-sx/wssx-impl/src/main/java/com/sun/xml/ws/security/opt/impl/keyinfo/X509TokenBuilder.java
metro returns the following part in the Soap Webservice when using a certificate from Bouncy castle:
CN=bos CA eID Communication Certs,O=bremen online services,C=DE
904391263803916562
The X509IssuerName element should be ordered the other way around.
#### Affected Versions
[2.2.7]
Source: [https://github.com/javaee/metro-jax-ws/issues/1148](https://github.com/javaee/metro-jax-ws/issues/1148)
Author: glassfishrobot
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in ws-sx/wssx-impl/src/main/java/com/sun/xml/ws/security/opt/impl/keyinfo/X509TokenBuilder.java and search the repository for uses of X509Certificate.getIssuerDN(). Review how the issuer name is placed in X509IssuerName, then replace the deprecated lookup with getIssuerX500Principal() and verify that the emitted name follows the expected RFC 4514 ordering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100