Files
canvas-lms/script/generate_rsa_keypair.rb
Mysti Lilla 51077360bf Add RSA keypair that matches with quizzes in vault_contents
Also adds a script to create new RSA keypairs

flag=none

Test plan
- Use the script and make sure if you use the keypair
  in vault_contents in the InstAccess session, Canvas
  can still start

Change-Id: I4b04acbdef385ba151e0b274ea22acd6d1708645
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/362290
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob DeWar <jacob.dewar@instructure.com>
QA-Review: Jacob DeWar <jacob.dewar@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2024-11-13 01:44:38 +00:00

27 lines
929 B
Ruby

# frozen_string_literal: true
#
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require "openssl"
require "base64"
key = OpenSSL::PKey::RSA.generate(2048)
puts "Public key:\n#{Base64.encode64(key.public_key.to_s).delete("\n")}", ""
puts "Private key:\n#{Base64.encode64(key.to_s).delete("\n")}"