def add_key_arguments(parser):
    """
     Adds the arguments required to create a new key to the parser given as a parameter

     Args:
            - parser: Parser where to add the key parameters
                + Type: argparse.ArgumentParser

     Return:
            - group: Argument group containing all the key arguments
                + Type: argparse._ArgumentGroup
    """
    group = parser.add_argument_group("Key management")
    group.add_argument(
        "-ks", "--key_size",
        help='Length of the new key',
        type=int,
        default=4096
    )
    group.add_argument(
        "-kt", "--key_type",
        help="Method used for generating the new key",
        choices=["dsa", "rsa"],
        default="rsa"
    )
    return group