Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symmetric keygen: JavaThemis #565

Merged
merged 1 commit into from
Dec 11, 2019

Commits on Dec 11, 2019

  1. Symmetric keygen: JavaThemis

    More or less straightforward, if involved implementation. The main class
    is SymmetricKey which manages input validation and delegates actual key
    generation to JNI code.
    
    JNI returns "null" on errors, just like other methods, because it's
    easier to deal with Java exceptions from Java.
    
    Note the cast from jbyte* to uint8_t*. It is necessary because Java
    bytes are always signed, but uint8_t is unsigned. Later we cast them
    back so this does not cause any problems.
    
    We add more constructors to KeyGenerationException because now we need
    to have some messages there as there are two places where keys are
    generated.
    
    Do not export new constructors for KeyGenerationException. There is no
    reason for the users to construct instances of these exceptions.
    
    Historically we had constructors for other exceptions, but that's
    a mistake. We can't hide them without breaking compatibility, but we
    can avoid making the same mistake again.
    ilammy committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    e112192 View commit details
    Browse the repository at this point in the history