errorfile
if you are interested)
I did not want to "pollute" the GIT-Issue with opinions and discussion, so I moved here and perhaps, we could discuss some things, so I can finalize an early usable Version of the PS-Core module:
1) Regarding the Interface-Driven Approach - I agree with that, but I would not Interface the JwsTool, but an Wrapper around the algorithm itself. Besides beeing used for JWS RSA and ECDSA both are needed to create certificates as well. To make this possible it's feasable to use multiple algorithms wrapped by an Adapter, which translates the calls like sign() to the actual sign() call of the Algorithm. The JWSTool can use that Adapter to handle everything neccessary. I have a repostiory, where I implemented
that. It uses an Abstract base class, which is more or less equivalent to an interface. There's no strong reason for it to be a base class, so using an interface would be possible, too.
2) I think the Crypto-Bits should be an own Project, which can be included in the original one - thus allowing me to Import less Methods, which I do not Need in the PS-Module (the Client itself for example).
3) The base-Type I introduced works as static factory for the algorithm. To accomplish that I introduced types, to export the keys and a method which chooses the correct algorithm-type based on the key-export-type.
I'd like to hear your opinion.